| 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..f55788508834d44c4e284dc15b4136be1df4def8
|
| --- /dev/null
|
| +++ b/LayoutTests/fast/css/css-imagevalue-url.html
|
| @@ -0,0 +1,39 @@
|
| +<!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() {
|
| + var styles = document.getElementsByTagName("style"),
|
| + cssText = styles[styles.length-1].textContent.trim();
|
| + assert_equals(cssRulesToText(rulesForCssText(cssText)), cssText);
|
| + }, 'Testing URLs in CSS');
|
| + }, false);
|
| +</script>
|
|
|