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

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

Issue 2867883003: [CSS Typed OM] Delete obsolete number and length classes from Typed OM (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 CSSSimpleLength(1, 'px'), 9 new CSSUnitValue(1, 'px'),
10 new CSSSimpleLength(3, 'em'), 10 new CSSUnitValue(3, 'em'),
11 new CSSSimpleLength(4, 'ex'), 11 new CSSUnitValue(4, 'ex'),
12 new CSSSimpleLength(5, 'ch'), 12 new CSSUnitValue(5, 'ch'),
13 new CSSSimpleLength(6, 'rem'), 13 new CSSUnitValue(6, 'rem'),
14 new CSSSimpleLength(7, 'vw'), 14 new CSSUnitValue(7, 'vw'),
15 new CSSSimpleLength(8, 'vh'), 15 new CSSUnitValue(8, 'vh'),
16 new CSSSimpleLength(9, 'vmin'), 16 new CSSUnitValue(9, 'vmin'),
17 new CSSSimpleLength(10, 'vmax'), 17 new CSSUnitValue(10, 'vmax'),
18 new CSSSimpleLength(11, 'cm'), 18 new CSSUnitValue(11, 'cm'),
19 new CSSSimpleLength(12, 'mm'), 19 new CSSUnitValue(12, 'mm'),
20 new CSSSimpleLength(13, 'in'), 20 new CSSUnitValue(13, 'in'),
21 new CSSSimpleLength(14, 'pc'), 21 new CSSUnitValue(14, 'pc'),
22 new CSSSimpleLength(15, 'pt'), 22 new CSSUnitValue(15, 'pt'),
23 // Fully populated calc (no percent) 23 // // Fully populated calc (no percent)
24 new CSSCalcLength({ 24 // new CSSCalcValue({
25 px: 1200, 25 // px: 1200,
26 em: 4.5, 26 // em: 4.5,
27 ex: -6.7, 27 // ex: -6.7,
28 ch: 8.9, 28 // ch: 8.9,
29 rem: -10, 29 // rem: -10,
30 vw: 1.1, 30 // vw: 1.1,
31 vh: -1.2, 31 // vh: -1.2,
32 vmin: 1.3, 32 // vmin: 1.3,
33 vmax: -1.4, 33 // vmax: -1.4,
34 cm: 1.56, 34 // cm: 1.56,
35 mm: -1.7, 35 // mm: -1.7,
36 in: 1.8, 36 // in: 1.8,
37 pc: -1.9, 37 // pc: -1.9,
38 pt: 2.1}), 38 // pt: 2.1}),
39 // Contains only px 39 // // Contains only px
40 new CSSCalcLength({px: 10}), 40 // new CSSCalcValue({px: 10}),
41 // Contains neither pixels or percent 41 // // Contains neither pixels or percent
42 new CSSCalcLength({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 CSSCalcLength({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 CSSCalcLength({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 CSSNumberValue(1)] 51 invalidObjects: [new CSSUnitValue(1, 'number')]
52 }; 52 };
53 53
54 config_templates.lengthPercentConfig_ = Object.assign( 54 config_templates.lengthPercentConfig_ = Object.assign(
55 {}, config_templates.lengthConfig_); 55 {}, config_templates.lengthConfig_);
56 config_templates.lengthPercentConfig_.validObjects.concat([ 56 config_templates.lengthPercentConfig_.validObjects.concat([
57 new CSSSimpleLength(2, 'percent'), 57 new CSSUnitValue(2, 'percent'),
58 // Fully populated calc 58 // Fully populated calc
59 new CSSCalcLength({ 59 // new CSSCalcValue({
60 px: 1200, 60 // px: 1200,
61 percent: -2.3, 61 // percent: -2.3,
62 em: 4.5, 62 // em: 4.5,
63 ex: -6.7, 63 // ex: -6.7,
64 ch: 8.9, 64 // ch: 8.9,
65 rem: -10, 65 // rem: -10,
66 vw: 1.1, 66 // vw: 1.1,
67 vh: -1.2, 67 // vh: -1.2,
68 vmin: 1.3, 68 // vmin: 1.3,
69 vmax: -1.4, 69 // vmax: -1.4,
70 cm: 1.56, 70 // cm: 1.56,
71 mm: -1.7, 71 // mm: -1.7,
72 in: 1.8, 72 // in: 1.8,
73 pc: -1.9, 73 // pc: -1.9,
74 pt: 2.1}), 74 // pt: 2.1}),
75 // Contains only percent 75 // // Contains only percent
76 new CSSCalcLength({percent: 10}), 76 // new CSSCalcValue({percent: 10}),
77 // Contains px and percent 77 // // Contains px and percent
78 new CSSCalcLength({px: 6, percent: 10}) 78 // new CSSCalcValue({px: 6, percent: 10})
79 ]); 79 ]);
80 80
81 config_templates.borderConfig_ = { 81 config_templates.borderConfig_ = {
82 validKeywords: [ 82 validKeywords: [
83 'none', 83 'none',
84 //TODO: Implement the keywords listed below. 84 //TODO: Implement the keywords listed below.
85 // 'hidden', 85 // 'hidden',
86 // 'dotted', 86 // 'dotted',
87 // 'dashed', 87 // 'dashed',
88 // 'solid', 88 // 'solid',
89 // 'double', 89 // 'double',
90 // 'groove', 90 // 'groove',
91 // 'ridge', 91 // 'ridge',
92 // 'inset', 92 // 'inset',
93 // 'outset', 93 // 'outset',
94 // 'inherit' 94 // 'inherit'
95 ], 95 ],
96 validObjects: [ 96 validObjects: [
97 ], 97 ],
98 supportsMultiple: false, 98 supportsMultiple: false,
99 invalidObjects: [new CSSSimpleLength(4, 'px')] 99 invalidObjects: [new CSSUnitValue(4, 'px')]
100 }; 100 };
101 101
102 config_templates.lengthConfig = function() { 102 config_templates.lengthConfig = function() {
103 return Object.assign({}, config_templates.lengthConfig_); 103 return Object.assign({}, config_templates.lengthConfig_);
104 }; 104 };
105 config_templates.lengthPercentConfig = function() { 105 config_templates.lengthPercentConfig = function() {
106 return Object.assign({}, config_templates.lengthPercentConfig_); 106 return Object.assign({}, config_templates.lengthPercentConfig_);
107 }; 107 };
108 config_templates.borderConfig = function() { 108 config_templates.borderConfig = function() {
109 return Object.assign({}, config_templates.borderConfig_); 109 return Object.assign({}, config_templates.borderConfig_);
110 }; 110 };
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698