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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/variables/computed-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-image-url.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/variables/computed-image-url.html b/third_party/WebKit/LayoutTests/fast/css/variables/computed-image-url.html
new file mode 100644
index 0000000000000000000000000000000000000000..bd2257653cb19bb2e8ca67cb8fe26c765ba5facd
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/variables/computed-image-url.html
@@ -0,0 +1,26 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+
+<div id="target"></div>
+
+<script>
+function testImageVar(property, value) {
+ test(() => {
+ target.style.setProperty('--test', value);
+ target.style[property] = 'var(--test)';
+ var actual = getComputedStyle(target)[property];
+
+ target.style[property] = value;
+ assert_not_equals(target.style[property], '', value + ' must be valid for ' + property);
+ var expected = getComputedStyle(target)[property];
+
+ assert_equals(actual, expected);
+ }, property + ' should resolve ' + value + ' the same whether via var() or not.');
+}
+
+testImageVar('background-image', 'url("image.png")');
+testImageVar('background-image', '-webkit-image-set(url("image.png") 1x)');
+testImageVar('background', 'url("image.png")');
+testImageVar('background', '-webkit-image-set(url("image.png") 1x)');
+</script>

Powered by Google App Engine
This is Rietveld 408576698