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

Unified Diff: LayoutTests/fast/css/css-imagevalue-url.html

Issue 1306283006: BackgroundImage incorrectly returns empty url() when created on-the-fly (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 3 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 | Source/core/css/CSSImageValue.cpp » ('j') | Source/core/css/CSSImageValue.cpp » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/css-imagevalue-url.html
diff --git a/LayoutTests/fast/css/css-imagevalue-url.html b/LayoutTests/fast/css/css-imagevalue-url.html
new file mode 100644
index 0000000000000000000000000000000000000000..3b7fc77f599ace37401680005d1fd8b1168667da
--- /dev/null
+++ b/LayoutTests/fast/css/css-imagevalue-url.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<script src="../../resources/testharness.js"></script>
+<script src="../../resources/testharnessreport.js"></script>
+
+<style>
+div { background-image: url(images.jpg); }
+</style>
+
+<body>
+</body>
+
+<script>
+ var rulesForCssText = function (styleContent) {
+ var doc = document.implementation.createHTMLDocument(""),
+ styleElement = document.createElement("style");
+
+ styleElement.textContent = styleContent;
+ // the style will only parsed once it is added to a document
+ doc.body.appendChild(styleElement);
+
+ return styleElement.sheet.cssRules;
+ };
+
+ var cssRulesToText = function (cssRules) {
+ var cssText = "";
+
+ Array.prototype.slice.call(cssRules).forEach(function (rule) {
+ cssText += rule.cssText;
+ });
+ return cssText;
+ };
+
+ addEventListener("load", function() {
+ test(function() {
rune 2015/09/08 23:57:28 Indentation looks inconsistent. Sometimes 8, most
nainar 2015/09/09 00:30:30 Done. On 2015/09/08 at 23:57:28, rune wrote:
+ var styles = document.getElementsByTagName("style"),
+ cssText = styles[styles.length-1].textContent.trim();
+ assert_equals(cssRulesToText(rulesForCssText(cssText)), cssText);
+ }, 'Testing URLs in CSS');
+ }, false);
+</script>
« no previous file with comments | « no previous file | Source/core/css/CSSImageValue.cpp » ('j') | Source/core/css/CSSImageValue.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698