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

Unified 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/fast/css/image-set-unprefixed.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/image-set-unprefixed.html b/third_party/WebKit/LayoutTests/fast/css/image-set-unprefixed.html
new file mode 100644
index 0000000000000000000000000000000000000000..82c293f1be5535b462155ea98bf0fd14c78b53a3
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/image-set-unprefixed.html
@@ -0,0 +1,100 @@
+<pre id="output"></pre>
+<script>
+function debug(msg)
+{
+ var output = document.getElementById("output");
+ output.appendChild(document.createTextNode(msg + "\n"));
+}
+
+function testComputedStyle(property, fullRule)
+{
+ var div = document.createElement("div");
+ document.body.appendChild(div);
+ div.setAttribute("style", property + ": " + fullRule);
+ var computedValue = div.style[property];
+ document.body.removeChild(div);
+ return computedValue;
+}
+
+function testImageSetRule(description, property, rule, expected)
+{
+ debug("");
+ debug(`${description} : ${rule}`);
+
+ var rule = `image-set(${rule})`;
+ if (testComputedStyle(property, rule) == rule)
+ debug("Unprefixed: PASS");
+ else
+ debug("Unprefixed: FAIL");
+
+ if (testComputedStyle(property, "-webkit-" + rule) == rule)
+ debug("Prefixed: PASS");
+ else
+ debug("Prefixed: FAIL");
+}
+
+if (window.testRunner)
+ window.testRunner.dumpAsText();
+
+testImageSetRule("Single value for background-image",
+ "background-image",
+ 'url("http://www.webkit.org/a") 1x');
+
+testImageSetRule("Multiple values for background-image",
+ "background-image",
+ 'url("http://www.webkit.org/a") 1x, url("http://www.webkit.org/b") 2x');
+
+testImageSetRule("Multiple values for background-image, out of order",
+ "background-image",
+ 'url("http://www.webkit.org/c") 3x, url("http://www.webkit.org/b") 2x, url("http://www.webkit.org/a") 1x');
+
+testImageSetRule("Duplicate values for background-image",
+ "background-image",
+ 'url("http://www.webkit.org/c") 1x, url("http://www.webkit.org/b") 2x, url("http://www.webkit.org/a") 1x');
+
+testImageSetRule("Fractional values for background-image",
+ "background-image",
+ 'url("http://www.webkit.org/c") 0.2x, url("http://www.webkit.org/b") 2.3x, url("http://www.webkit.org/a") 12.3456x');
+
+testImageSetRule("Single value for list-style-image",
+ "list-style-image",
+ 'url("http://www.webkit.org/a") 1x');
+
+testImageSetRule("Multiple values for list-style-image",
+ "list-style-image",
+ 'url("http://www.webkit.org/a") 1x, url("http://www.webkit.org/b") 2x');
+
+testImageSetRule("Multiple values for list-style-image, out of order",
+ "list-style-image",
+ 'url("http://www.webkit.org/c") 3x, url("http://www.webkit.org/b") 2x, url("http://www.webkit.org/a") 1x');
+
+testImageSetRule("Duplicate values for list-style-image",
+ "list-style-image",
+ 'url("http://www.webkit.org/c") 1x, url("http://www.webkit.org/b") 2x, url("http://www.webkit.org/a") 1x');
+
+testImageSetRule("Fractional values for list-style-image",
+ "list-style-image",
+ 'url("http://www.webkit.org/c") 0.2x, url("http://www.webkit.org/b") 2.3x, url("http://www.webkit.org/a") 12.3456x');
+
+testImageSetRule("Single value for content",
+ "content",
+ 'url("http://www.webkit.org/a") 1x');
+
+testImageSetRule("Multiple values for content",
+ "content",
+ 'url("http://www.webkit.org/a") 1x, url("http://www.webkit.org/b") 2x');
+
+testImageSetRule("Multiple values for content, out of order",
+ "content",
+ 'url("http://www.webkit.org/c") 3x, url("http://www.webkit.org/b") 2x, url("http://www.webkit.org/a") 1x');
+
+testImageSetRule("Duplicate values for content",
+ "content",
+ 'url("http://www.webkit.org/c") 1x, url("http://www.webkit.org/b") 2x, url("http://www.webkit.org/a") 1x');
+
+testImageSetRule("Fractional values for content",
+ "content",
+ 'url("http://www.webkit.org/c") 0.2x, url("http://www.webkit.org/b") 2.3x, url("http://www.webkit.org/a") 12.3456x');
+
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698