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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/variables/computed-stylesheet-image-url.html

Issue 2873943002: Ensure original parser context is used when parsing resolved var() references (Closed)
Patch Set: g cl set-commit Created 3 years, 7 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/variables/computed-stylesheet-image-url.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/variables/computed-stylesheet-image-url.html b/third_party/WebKit/LayoutTests/fast/css/variables/computed-stylesheet-image-url.html
new file mode 100644
index 0000000000000000000000000000000000000000..c0008d690b391a98e91385f37378108462d1b3c1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/variables/computed-stylesheet-image-url.html
@@ -0,0 +1,35 @@
+<!DOCTYPE html>
+
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+
+<!-- The linked stylesheet must not be in the same directory as this test file. -->
+<!-- This is intended to test that relative URLs in stylesheets remain relative -->
+<!-- to the stylesheet's directory rather than the page that uses it. -->
+<link href="../resources/image-url-var.css" rel="stylesheet">
+
+<div id="target"></div>
+
+<script>
+for (var property of ['background', 'background-image']) {
+ for (var value of ['image-set', 'url']) {
+ test(() => {
+ target.classList.remove(...target.classList);
+ assert_equals(target.classList.length, 0);
+ var initial = getComputedStyle(target)[property];
+
+ target.classList.add(property);
+ target.classList.add(value);
+ target.classList.add('var');
+ var actual = getComputedStyle(target)[property];
+
+ target.classList.remove('var');
+ target.classList.add('inline');
+ var expected = getComputedStyle(target)[property];
+ assert_not_equals(expected, initial);
+
+ assert_equals(actual, expected);
+ }, property + ' should resolve ' + value + ' the same whether via var() or not.');
+ }
+}
+</script>

Powered by Google App Engine
This is Rietveld 408576698