Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(388)

Side by Side Diff: third_party/WebKit/LayoutTests/typedcssom/inlinestyle/properties/config-templates.js

Issue 2903413002: Restructure type tracking in StyleValues to work better with new numeric types (Closed)
Patch Set: rebase Created 3 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /** 1 /**
2 * Generates config objects that are common between multiple properties for use 2 * Generates config objects that are common between multiple properties for use
3 * in property-suite.js 3 * in property-suite.js
4 */ 4 */
5 5
6 let config_templates = {}; 6 let config_templates = {};
7 config_templates.lengthConfig_ = { 7 config_templates.lengthConfig_ = {
8 validObjects: [ 8 validObjects: [
9 new CSSUnitValue(1, 'px'), 9 new CSSUnitValue(1, 'px'),
10 new CSSUnitValue(3, 'em'), 10 new CSSUnitValue(3, 'em'),
(...skipping 30 matching lines...) Expand all
41 // // Contains neither pixels or percent 41 // // Contains neither pixels or percent
42 // new CSSCalcValue({vmin: 5, in: 10}), 42 // new CSSCalcValue({vmin: 5, in: 10}),
43 ], 43 ],
44 validStringMappings: { 44 validStringMappings: {
45 // // Contains multiplication 45 // // Contains multiplication
46 // 'calc(3 * (5px - 3em))': new CSSCalcValue({px: 15, em: -9}), 46 // 'calc(3 * (5px - 3em))': new CSSCalcValue({px: 15, em: -9}),
47 // // Contains division 47 // // Contains division
48 // 'calc((5vmin + 1mm) / 2)': new CSSCalcValue({vmin: 2.5, mm: 0.5}), 48 // 'calc((5vmin + 1mm) / 2)': new CSSCalcValue({vmin: 2.5, mm: 0.5}),
49 }, 49 },
50 supportsMultiple: false, 50 supportsMultiple: false,
51 invalidObjects: [new CSSUnitValue(1, 'number')] 51 invalidObjects: [
52 new CSSUnitValue(1, 'number'),
53 new CSSUnitValue(2, 'percent'),
54 ]
52 }; 55 };
53 56
54 config_templates.lengthPercentConfig_ = Object.assign( 57 config_templates.lengthPercentConfig_ = Object.assign(
55 {}, config_templates.lengthConfig_); 58 {}, config_templates.lengthConfig_);
56 config_templates.lengthPercentConfig_.validObjects.concat([ 59 config_templates.lengthPercentConfig_.validObjects.concat([
57 new CSSUnitValue(2, 'percent'), 60 new CSSUnitValue(2, 'percent'),
58 // Fully populated calc 61 // Fully populated calc
59 // new CSSCalcValue({ 62 // new CSSCalcValue({
60 // px: 1200, 63 // px: 1200,
61 // percent: -2.3, 64 // percent: -2.3,
62 // em: 4.5, 65 // em: 4.5,
63 // ex: -6.7, 66 // ex: -6.7,
64 // ch: 8.9, 67 // ch: 8.9,
65 // rem: -10, 68 // rem: -10,
66 // vw: 1.1, 69 // vw: 1.1,
67 // vh: -1.2, 70 // vh: -1.2,
68 // vmin: 1.3, 71 // vmin: 1.3,
69 // vmax: -1.4, 72 // vmax: -1.4,
70 // cm: 1.56, 73 // cm: 1.56,
71 // mm: -1.7, 74 // mm: -1.7,
72 // in: 1.8, 75 // in: 1.8,
73 // pc: -1.9, 76 // pc: -1.9,
74 // pt: 2.1}), 77 // pt: 2.1}),
75 // // Contains only percent 78 // // Contains only percent
76 // new CSSCalcValue({percent: 10}), 79 // new CSSCalcValue({percent: 10}),
77 // // Contains px and percent 80 // // Contains px and percent
78 // new CSSCalcValue({px: 6, percent: 10}) 81 // new CSSCalcValue({px: 6, percent: 10})
79 ]); 82 ]);
83 config_templates.lengthPercentConfig_.invalidObjects = [
84 new CSSUnitValue(1, 'number'),
85 ];
80 86
81 config_templates.borderConfig_ = { 87 config_templates.borderConfig_ = {
82 validKeywords: [ 88 validKeywords: [
83 'none', 89 'none',
84 //TODO: Implement the keywords listed below. 90 //TODO: Implement the keywords listed below.
85 // 'hidden', 91 // 'hidden',
86 // 'dotted', 92 // 'dotted',
87 // 'dashed', 93 // 'dashed',
88 // 'solid', 94 // 'solid',
89 // 'double', 95 // 'double',
(...skipping 11 matching lines...) Expand all
101 107
102 config_templates.lengthConfig = function() { 108 config_templates.lengthConfig = function() {
103 return Object.assign({}, config_templates.lengthConfig_); 109 return Object.assign({}, config_templates.lengthConfig_);
104 }; 110 };
105 config_templates.lengthPercentConfig = function() { 111 config_templates.lengthPercentConfig = function() {
106 return Object.assign({}, config_templates.lengthPercentConfig_); 112 return Object.assign({}, config_templates.lengthPercentConfig_);
107 }; 113 };
108 config_templates.borderConfig = function() { 114 config_templates.borderConfig = function() {
109 return Object.assign({}, config_templates.borderConfig_); 115 return Object.assign({}, config_templates.borderConfig_);
110 }; 116 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698