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

Side by Side Diff: LayoutTests/fast/shapes/parsing/parsing-test-utils.js

Issue 103413006: Implement parsing of the new ellipse shape syntax. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 7 years 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 // Valid values for both shape-inside and shape-outside. Two values are specifie d when the shape property value 1 // Valid values for both shape-inside and shape-outside. Two values are specifie d when the shape property value
2 // differs from the specified value. Three values are specified when the compute d shape property value differs 2 // differs from the specified value. Three values are specified when the compute d shape property value differs
3 // from the specified value. 3 // from the specified value.
4 // eg: "specified value/CSS Text value/computed style value" 4 // eg: "specified value/CSS Text value/computed style value"
5 // or: ["specified value", "CSS Text value/computed style value"] 5 // or: ["specified value", "CSS Text value/computed style value"]
6 // or: ["specified value", "CSS Text value", "Computed style value"] 6 // or: ["specified value", "CSS Text value", "Computed style value"]
7 var validShapeValues = [ 7 var validShapeValues = [
8 "auto", 8 "auto",
9 ["rectangle(10px, 20px, 30px, 40px)", "rectangle(10px, 20px, 30px, 40px)", " rectangle(10px, 20px, 30px, 40px, 0px, 0px)"], 9 ["rectangle(10px, 20px, 30px, 40px)", "rectangle(10px, 20px, 30px, 40px)", " rectangle(10px, 20px, 30px, 40px, 0px, 0px)"],
10 ["rectangle(10px, 20px, 30px, 40px, 5px)", "rectangle(10px, 20px, 30px, 40px , 5px)", "rectangle(10px, 20px, 30px, 40px, 5px, 5px)"], 10 ["rectangle(10px, 20px, 30px, 40px, 5px)", "rectangle(10px, 20px, 30px, 40px , 5px)", "rectangle(10px, 20px, 30px, 40px, 5px, 5px)"],
11 "rectangle(10px, 20px, 30px, 40px, 5px, 10px)", 11 "rectangle(10px, 20px, 30px, 40px, 5px, 10px)",
12 12
13 ["inset-rectangle(10px, 20px, 30px, 40px)", "inset-rectangle(10px, 20px, 30p x, 40px)", "inset-rectangle(10px, 20px, 30px, 40px, 0px, 0px)"], 13 ["inset-rectangle(10px, 20px, 30px, 40px)", "inset-rectangle(10px, 20px, 30p x, 40px)", "inset-rectangle(10px, 20px, 30px, 40px, 0px, 0px)"],
14 ["inset-rectangle(10px, 20px, 30px, 40px, 5px)", "inset-rectangle(10px, 20px , 30px, 40px, 5px)", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 5px)"], 14 ["inset-rectangle(10px, 20px, 30px, 40px, 5px)", "inset-rectangle(10px, 20px , 30px, 40px, 5px)", "inset-rectangle(10px, 20px, 30px, 40px, 5px, 5px)"],
15 "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)", 15 "inset-rectangle(10px, 20px, 30px, 40px, 5px, 10px)",
16 16
17 "circle(10px, 20px, 30px)", 17 "circle(10px, 20px, 30px)", // FIXME: Remove this test once we do not suppor t the deprecated CSS Shapes syntax anymore.
18 18
19 "ellipse(10px, 20px, 30px, 40px)", 19 ["circle()", "circle()", "circle(closest-side at 50% 50%)"],
20 ["circle(10px)", "circle(10px)", "circle(10px at 50% 50%)"],
21 ["circle(10px at 10px)", "circle(10px at 10px 50%)"],
22 "circle(10px at 10px 10px)",
23 ["circle(at 10px)", "circle(at 10px 50%)", "circle(closest-side at 10px 50%) "],
24 ["circle(at 10px 10px)", "circle(at 10px 10px)", "circle(closest-side at 10p x 10px)"],
25 ["circle(at top left)", "circle(at 0% 0%)", "circle(closest-side at 0% 0%)"] ,
26 ["circle(at right bottom)", "circle(at 100% 100%)", "circle(closest-side at 100% 100%)"],
27 ["circle(10px at left top 10px)", "circle(10px at left 0% top 10px)"],
28 ["circle(10px at top 10px left 10px)", "circle(10px at left 10px top 10px)"] ,
29 ["circle(10px at right 10px bottom 10px)", "circle(10px at right 10px bottom 10px)"],
30
31 "ellipse(10px, 20px, 30px, 40px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
32
33 ["ellipse()", "ellipse()", "ellipse(closest-side closest-side at 50% 50%)"],
34 ["ellipse(10px)", "ellipse(10px)", "ellipse(10px closest-side at 50% 50%)"],
35 ["ellipse(10px 20px)", "ellipse(10px 20px)", "ellipse(10px 20px at 50% 50%)" ],
36 ["ellipse(10px at 10px)", "ellipse(10px at 10px 50%)", "ellipse(10px closest -side at 10px 50%)"],
37 ["ellipse(10px 20px at 10px)", "ellipse(10px 20px at 10px 50%)"],
38 ["ellipse(10px at 10px 10px)", "ellipse(10px at 10px 10px)", "ellipse(10px c losest-side at 10px 10px)"],
39 ["ellipse(at 10px)", "ellipse(at 10px 50%)", "ellipse(closest-side closest-s ide at 10px 50%)"],
40 ["ellipse(at 10px 10px)", "ellipse(at 10px 10px)", "ellipse(closest-side clo sest-side at 10px 10px)"],
41 ["ellipse(at top left)", "ellipse(at 0% 0%)", "ellipse(closest-side closest- side at 0% 0%)"],
42 ["ellipse(at right bottom)", "ellipse(at 100% 100%)", "ellipse(closest-side closest-side at 100% 100%)"],
43 ["ellipse(10px at left top 10px)", "ellipse(10px at left 0% top 10px)", "ell ipse(10px closest-side at left 0% top 10px)"],
44 ["ellipse(10px at top 10px left 10px)", "ellipse(10px at left 10px top 10px) ", "ellipse(10px closest-side at left 10px top 10px)"],
45 ["ellipse(10px at right 10px bottom 10px)", "ellipse(10px at right 10px bott om 10px)", "ellipse(10px closest-side at right 10px bottom 10px)"],
46 ["ellipse(10px 20px at left top 10px)", "ellipse(10px 20px at left 0% top 10 px)"],
47 ["ellipse(10px 20px at top 10px left 10px)", "ellipse(10px 20px at left 10px top 10px)"],
48 ["ellipse(10px 20px at right 10px bottom 10px)", "ellipse(10px 20px at right 10px bottom 10px)"],
20 49
21 ["polygon(10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30 px 40px, 40px 50px)"], 50 ["polygon(10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30 px 40px, 40px 50px)"],
22 ["polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)", "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)"], 51 ["polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)", "polygon(evenodd, 10px 20px, 30px 40px, 40px 50px)"],
23 ["polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"], 52 ["polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)", "polygon(nonzero, 10px 20px, 30px 40px, 40px 50px)"],
24 53
25 "content-box", 54 "content-box",
26 "padding-box", 55 "padding-box",
27 "border-box", 56 "border-box",
28 "margin-box" 57 "margin-box"
29 ]; 58 ];
(...skipping 11 matching lines...) Expand all
41 "rectangle(10px 20px 30px 40px)", 70 "rectangle(10px 20px 30px 40px)",
42 "rectangle(10px, 20px, 30px, 40px, 50px, 60px, 70px)", 71 "rectangle(10px, 20px, 30px, 40px, 50px, 60px, 70px)",
43 72
44 "inset-rectangle()", 73 "inset-rectangle()",
45 "inset-rectangle(10px)", 74 "inset-rectangle(10px)",
46 "inset-rectangle(10px, 10px)", 75 "inset-rectangle(10px, 10px)",
47 "inset-rectangle(10px, 20px, 30px)", 76 "inset-rectangle(10px, 20px, 30px)",
48 "inset-rectangle(10px 20px 30px 40px)", 77 "inset-rectangle(10px 20px 30px 40px)",
49 "inset-rectangle(10px, 20px, 30px, 40px, 50px, 60px, 70px)", 78 "inset-rectangle(10px, 20px, 30px, 40px, 50px, 60px, 70px)",
50 79
51 "circle()", 80 "circle(10px, 20px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
52 "circle(10px)", 81 "circle(10px 20px 30px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
53 "circle(10px, 20px)", 82 "circle(10px, 20px, 30px, 40px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
54 "circle(10px 20px 30px)",
55 "circle(10px, 20px, 30px, 40px)",
56 83
57 "ellipse()", 84 "circle(10px 20px)",
58 "ellipse(10px)", 85 "circle(10px at 10px 10px 10px)",
59 "ellipse(10px, 20px)", 86 "circle(10px at 10px 10px at center)",
60 "ellipse(10px, 20px, 30px)", 87 "circle(10px at center center 10px)",
61 "ellipse(10px 20px 30px 40px)", 88 "circle(at 10px 10px 10px)",
89 "circle(at 10px 10px at center)",
90 "circle(at center center 10px)",
91
92 "ellipse(10px, 20px)", // FIXME: Remove this test once we do not support the deprecated CSS Shapes syntax anymore.
93 "ellipse(10px, 20px, 30px)", // FIXME: Remove this test once we do not suppo rt the deprecated CSS Shapes syntax anymore.
94 "ellipse(10px 20px 30px 40px)", // FIXME: Remove this test once we do not su pport the deprecated CSS Shapes syntax anymore.
95
96 "ellipse(10px 20px 30px)",
97 "ellipse(10px at 10px 10px 10px)",
98 "ellipse(10px at 10px 10px at center)",
99 "ellipse(10px at center center 10px)",
100 "ellipse(10px 20px 30px at center center 10px)",
101 "ellipse(at 10px 10px 10px)",
102 "ellipse(at 10px 10px at center)",
103 "ellipse(at center center 10px)",
62 104
63 "polygon()", 105 "polygon()",
64 "polygon(evenodd 10px 20px, 30px 40px, 40px 50px)", 106 "polygon(evenodd 10px 20px, 30px 40px, 40px 50px)",
65 "polygon(nonzero 10px 20px, 30px 40px, 40px 50px)", 107 "polygon(nonzero 10px 20px, 30px 40px, 40px 50px)",
66 "polygon(nonzero)", 108 "polygon(nonzero)",
67 "polygon(evenodd)", 109 "polygon(evenodd)",
68 "polygon(10px)", 110 "polygon(10px)",
69 "polygon(nonzero,10px)", 111 "polygon(nonzero,10px)",
70 "polygon(evenodd,12px)", 112 "polygon(evenodd,12px)",
71 "polygon(10px, 20px, 30px, 40px, 40px, 50px)", 113 "polygon(10px, 20px, 30px, 40px, 40px, 50px)",
(...skipping 100 matching lines...) Expand 10 before | Expand all | Expand 10 after
172 214
173 function testNotInheritedShapeProperty(property, parentValue, childValue, expect edValue) 215 function testNotInheritedShapeProperty(property, parentValue, childValue, expect edValue)
174 { 216 {
175 shouldBeEqualToString('getParentAndChildComputedStylesString("' + property + '", "' + parentValue + '", "' + childValue + '")', expectedValue); 217 shouldBeEqualToString('getParentAndChildComputedStylesString("' + property + '", "' + parentValue + '", "' + childValue + '")', expectedValue);
176 } 218 }
177 219
178 function applyToEachArglist(testFunction, arglists) 220 function applyToEachArglist(testFunction, arglists)
179 { 221 {
180 arglists.forEach(function(arglist, i, a) {testFunction.apply(null, arglist); }); 222 arglists.forEach(function(arglist, i, a) {testFunction.apply(null, arglist); });
181 } 223 }
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698