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

Side by Side Diff: LayoutTests/fast/css/variables/cssom-computed-style.html

Issue 18311002: Partial implementation of CSSVariablesMap for CSS Variables CSSOM (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased onto ToT, cleaned up includes Created 7 years, 5 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 | Annotate | Revision Log
« no previous file with comments | « no previous file | LayoutTests/fast/css/variables/cssom-computed-style-expected.txt » ('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 <script>
2 if (window.testRunner)
3 testRunner.dumpAsText();
4 </script>
5
6 <style>
7 pre {
8 var-stylesheet: pass;
9 }
10 </style>
11
12 <body>
13
14 <pre style="var-inherited: pass"><pre id="pre" style="var-inline: pass"></pre></ pre>
15
16 </body>
17
18 <script>
19 var pre = document.querySelector("#pre");
20 var preStyle = getComputedStyle(pre);
21 var bodyStyle = getComputedStyle(document.querySelector("body"));
22 pre.innerText += "Computed variables declaration: " + preStyle.var + "\n";
23
24 pre.innerText += "Create variable: ";
25 try {
26 preStyle.var.set("create", "test");
27 pre.innerText += "No exception thrown.\n";
28 }
29 catch (exception) {
30 pre.innerText += exception + "\n";
31 }
32
33 pre.innerText += "Count variables: " + preStyle.var.size + "\n";
34 pre.innerText += "Count empty variables: " + bodyStyle.var.size + "\n";
35 pre.innerText += "Read stylesheet variable: " + preStyle.var.get("stylesheet") + "\n";
36 pre.innerText += "Read inherited variable: " + preStyle.var.get("inherited") + " \n";
37 pre.innerText += "Read inline variable: " + preStyle.var.get("inline") + "\n";
38 pre.innerText += "Read non-existent variable: " + (bodyStyle.var.get("test") ? " fail" : "pass") + "\n";
39
40 pre.innerText += "Update variable: ";
41 try {
42 preStyle.var.set("inline", "test");
43 pre.innerText += "No exception thrown (fail).\n";
44 }
45 catch (exception) {
46 pre.innerText += exception + "\n";
47 }
48
49 pre.innerText += "Delete variable: " + (preStyle.var.delete("inline") ? "Deleted " : "Not deleted") + "\n";
50
51 pre.innerText += "Clear variables: ";
52 try {
53 preStyle.var.clear();
54 pre.innerText += "No exception thrown (fail).\n";
55 }
56 catch (exception) {
57 pre.innerText += exception + "\n";
58 }
59
60 pre.innerText += "Read deleted variable: " + preStyle.var.get("inline") + "\n";
61 </script>
OLDNEW
« no previous file with comments | « no previous file | LayoutTests/fast/css/variables/cssom-computed-style-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698