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

Side by Side 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 unified diff | Download patch
OLDNEW
(Empty)
1 <!DOCTYPE html>
2
3 <script src="../../../resources/testharness.js"></script>
4 <script src="../../../resources/testharnessreport.js"></script>
5
6 <!-- The linked stylesheet must not be in the same directory as this test file. -->
7 <!-- This is intended to test that relative URLs in stylesheets remain relative -->
8 <!-- to the stylesheet's directory rather than the page that uses it. -->
9 <link href="../resources/image-url-var.css" rel="stylesheet">
10
11 <div id="target"></div>
12
13 <script>
14 for (var property of ['background', 'background-image']) {
15 for (var value of ['image-set', 'url']) {
16 test(() => {
17 target.classList.remove(...target.classList);
18 assert_equals(target.classList.length, 0);
19 var initial = getComputedStyle(target)[property];
20
21 target.classList.add(property);
22 target.classList.add(value);
23 target.classList.add('var');
24 var actual = getComputedStyle(target)[property];
25
26 target.classList.remove('var');
27 target.classList.add('inline');
28 var expected = getComputedStyle(target)[property];
29 assert_not_equals(expected, initial);
30
31 assert_equals(actual, expected);
32 }, property + ' should resolve ' + value + ' the same whether via var() or n ot.');
33 }
34 }
35 </script>
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698