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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/image-set-unprefixed.html

Issue 2203773002: Add support for "image-set" Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 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
(Empty)
1 <pre id="output"></pre>
2 <script>
3 function debug(msg)
4 {
5 var output = document.getElementById("output");
6 output.appendChild(document.createTextNode(msg + "\n"));
7 }
8
9 function testComputedStyle(property, fullRule)
10 {
11 var div = document.createElement("div");
12 document.body.appendChild(div);
13 div.setAttribute("style", property + ": " + fullRule);
14 var computedValue = div.style[property];
15 document.body.removeChild(div);
16 return computedValue;
17 }
18
19 function testImageSetRule(description, property, rule, expected)
20 {
21 debug("");
22 debug(`${description} : ${rule}`);
23
24 var rule = `image-set(${rule})`;
25 if (testComputedStyle(property, rule) == rule)
26 debug("Unprefixed: PASS");
27 else
28 debug("Unprefixed: FAIL");
29
30 if (testComputedStyle(property, "-webkit-" + rule) == rule)
31 debug("Prefixed: PASS");
32 else
33 debug("Prefixed: FAIL");
34 }
35
36 if (window.testRunner)
37 window.testRunner.dumpAsText();
38
39 testImageSetRule("Single value for background-image",
40 "background-image",
41 'url("http://www.webkit.org/a") 1x');
42
43 testImageSetRule("Multiple values for background-image",
44 "background-image",
45 'url("http://www.webkit.org/a") 1x, url("http://www.webkit.org/b ") 2x');
46
47 testImageSetRule("Multiple values for background-image, out of order",
48 "background-image",
49 'url("http://www.webkit.org/c") 3x, url("http://www.webkit.org/b ") 2x, url("http://www.webkit.org/a") 1x');
50
51 testImageSetRule("Duplicate values for background-image",
52 "background-image",
53 'url("http://www.webkit.org/c") 1x, url("http://www.webkit.org/b ") 2x, url("http://www.webkit.org/a") 1x');
54
55 testImageSetRule("Fractional values for background-image",
56 "background-image",
57 'url("http://www.webkit.org/c") 0.2x, url("http://www.webkit.org /b") 2.3x, url("http://www.webkit.org/a") 12.3456x');
58
59 testImageSetRule("Single value for list-style-image",
60 "list-style-image",
61 'url("http://www.webkit.org/a") 1x');
62
63 testImageSetRule("Multiple values for list-style-image",
64 "list-style-image",
65 'url("http://www.webkit.org/a") 1x, url("http://www.webkit.org/b ") 2x');
66
67 testImageSetRule("Multiple values for list-style-image, out of order",
68 "list-style-image",
69 'url("http://www.webkit.org/c") 3x, url("http://www.webkit.org/b ") 2x, url("http://www.webkit.org/a") 1x');
70
71 testImageSetRule("Duplicate values for list-style-image",
72 "list-style-image",
73 'url("http://www.webkit.org/c") 1x, url("http://www.webkit.org/b ") 2x, url("http://www.webkit.org/a") 1x');
74
75 testImageSetRule("Fractional values for list-style-image",
76 "list-style-image",
77 'url("http://www.webkit.org/c") 0.2x, url("http://www.webkit.org /b") 2.3x, url("http://www.webkit.org/a") 12.3456x');
78
79 testImageSetRule("Single value for content",
80 "content",
81 'url("http://www.webkit.org/a") 1x');
82
83 testImageSetRule("Multiple values for content",
84 "content",
85 'url("http://www.webkit.org/a") 1x, url("http://www.webkit.org/b ") 2x');
86
87 testImageSetRule("Multiple values for content, out of order",
88 "content",
89 'url("http://www.webkit.org/c") 3x, url("http://www.webkit.org/b ") 2x, url("http://www.webkit.org/a") 1x');
90
91 testImageSetRule("Duplicate values for content",
92 "content",
93 'url("http://www.webkit.org/c") 1x, url("http://www.webkit.org/b ") 2x, url("http://www.webkit.org/a") 1x');
94
95 testImageSetRule("Fractional values for content",
96 "content",
97 'url("http://www.webkit.org/c") 0.2x, url("http://www.webkit.org /b") 2.3x, url("http://www.webkit.org/a") 12.3456x');
98
99
100 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698