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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4
5 <div id="target"></div>
6
7 <script>
8 function testImageVar(property, value) {
9 test(() => {
10 target.style.setProperty('--test', value);
11 target.style[property] = 'var(--test)';
12 var actual = getComputedStyle(target)[property];
13
14 target.style[property] = value;
15 assert_not_equals(target.style[property], '', value + ' must be valid for ' + property);
16 var expected = getComputedStyle(target)[property];
17
18 assert_equals(actual, expected);
19 }, property + ' should resolve ' + value + ' the same whether via var() or not .');
20 }
21
22 testImageVar('background-image', 'url("image.png")');
23 testImageVar('background-image', '-webkit-image-set(url("image.png") 1x)');
24 testImageVar('background', 'url("image.png")');
25 testImageVar('background', '-webkit-image-set(url("image.png") 1x)');
26 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698