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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/background-image-url-setproperty.html

Issue 2622993003: Compare relative url if absolute urls are empty for CSSImageValue (Closed)
Patch Set: add a test case Created 3 years, 11 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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/background-image-url-setproperty-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/background-image-url-setproperty.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/background-image-url-setproperty.html b/third_party/WebKit/LayoutTests/fast/css/background-image-url-setproperty.html
new file mode 100644
index 0000000000000000000000000000000000000000..e21ddd407d47b9035879aa4b7edd8ed17beb2791
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/background-image-url-setproperty.html
@@ -0,0 +1,25 @@
+<p id="result">
rune 2017/01/11 14:13:13 Test should be strict unless specifically testing
+</p>
+<script>
+ if (window.testRunner)
+ testRunner.dumpAsText();
+
+ var rulesForCssTextFromBrowser = function (styleContent) {
+ var doc = document.implementation.createHTMLDocument(""),
+ styleElement = document.createElement("style"),
+ rules;
+
+ styleElement.textContent = styleContent;
+ // the style will only be parsed once it is added to a document
+ doc.body.appendChild(styleElement);
+ rules = styleElement.sheet.cssRules;
+
+ return Array.prototype.slice.call(rules);
+ };
+
+ var rules = rulesForCssTextFromBrowser("span { background: url('aaaaaaa'); }");
+ var rule = rules[0];
+ rule.style.setProperty('background', 'url("bbbbbbb")', '');
+ var url = rule.style.getPropertyValue('background');
+ document.getElementById("result").innerText = url == "url(\"bbbbbbb\")" ? "PASS" : "FAIL";
+</script>
rune 2017/01/11 14:13:14 We prefer using testharness.js. Then you should dr
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/fast/css/background-image-url-setproperty-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698