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

Side by Side Diff: third_party/WebKit/LayoutTests/fast/css/variables/read-from-computed-style.html

Issue 1501313002: Expose custom property values to getComputedStyle. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../../../resources/testharness.js"></script>
3 <script src="../../../resources/testharnessreport.js"></script>
4 <style>
5 #container {
6 --a: it was the best of times;
7 --b: it was the worst of times;
8 --c: also the blurst of times;
9 }
10
11 #b {
12 --c: it was the age of wisdom;
13 }
14 </style>
15
16 <div id="container">
17 <div id="a"></div>
18 <div id="b"><div id="c"></div></div>
19 </div>
20
21 <script>
22 test(function() {
23 assert_equals(getComputedStyle(container).getPropertyValue("--a"), " it was th e best of times");
24 assert_equals(getComputedStyle(container).getPropertyValue("--b"), " it was th e worst of times");
25 assert_equals(getComputedStyle(container).getPropertyValue("--c"), " also the blurst of times");
26 }, 'Directly declared custom properties appear in computed style.');
27
28 test(function() {
29 assert_equals(getComputedStyle(a).getPropertyValue("--a"), " it was the best o f times");
30 assert_equals(getComputedStyle(a).getPropertyValue("--b"), " it was the worst of times");
31 assert_equals(getComputedStyle(a).getPropertyValue("--c"), " also the blurst o f times");
32 }, 'Inherited custom properties appear in computed style.');
33
34 test(function() {
35 assert_equals(getComputedStyle(b).getPropertyValue("--a"), " it was the best o f times");
36 assert_equals(getComputedStyle(b).getPropertyValue("--b"), " it was the worst of times");
37 assert_equals(getComputedStyle(b).getPropertyValue("--c"), " it was the age of wisdom");
38 }, 'Inherited custom properties overidden values appear correctly in computed st yle.');
39
40 test(function() {
41 assert_equals(getComputedStyle(c).getPropertyValue("--a"), " it was the best o f times");
42 assert_equals(getComputedStyle(c).getPropertyValue("--b"), " it was the worst of times");
43 assert_equals(getComputedStyle(c).getPropertyValue("--c"), " it was the age of wisdom");
44 }, 'Overidden and inherited custom properties appear in computed style.');
45 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/CSSComputedStyleDeclaration.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698