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

Unified 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | LayoutTests/fast/css/variables/cssom-computed-style-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/variables/cssom-computed-style.html
diff --git a/LayoutTests/fast/css/variables/cssom-computed-style.html b/LayoutTests/fast/css/variables/cssom-computed-style.html
new file mode 100644
index 0000000000000000000000000000000000000000..b293bd0aa433e4fb420bf87e39c839e7bd70b3d3
--- /dev/null
+++ b/LayoutTests/fast/css/variables/cssom-computed-style.html
@@ -0,0 +1,61 @@
+<script>
+if (window.testRunner)
+ testRunner.dumpAsText();
+</script>
+
+<style>
+pre {
+ var-stylesheet: pass;
+}
+</style>
+
+<body>
+
+<pre style="var-inherited: pass"><pre id="pre" style="var-inline: pass"></pre></pre>
+
+</body>
+
+<script>
+var pre = document.querySelector("#pre");
+var preStyle = getComputedStyle(pre);
+var bodyStyle = getComputedStyle(document.querySelector("body"));
+pre.innerText += "Computed variables declaration: " + preStyle.var + "\n";
+
+pre.innerText += "Create variable: ";
+try {
+ preStyle.var.set("create", "test");
+ pre.innerText += "No exception thrown.\n";
+}
+catch (exception) {
+ pre.innerText += exception + "\n";
+}
+
+pre.innerText += "Count variables: " + preStyle.var.size + "\n";
+pre.innerText += "Count empty variables: " + bodyStyle.var.size + "\n";
+pre.innerText += "Read stylesheet variable: " + preStyle.var.get("stylesheet") + "\n";
+pre.innerText += "Read inherited variable: " + preStyle.var.get("inherited") + "\n";
+pre.innerText += "Read inline variable: " + preStyle.var.get("inline") + "\n";
+pre.innerText += "Read non-existent variable: " + (bodyStyle.var.get("test") ? "fail" : "pass") + "\n";
+
+pre.innerText += "Update variable: ";
+try {
+ preStyle.var.set("inline", "test");
+ pre.innerText += "No exception thrown (fail).\n";
+}
+catch (exception) {
+ pre.innerText += exception + "\n";
+}
+
+pre.innerText += "Delete variable: " + (preStyle.var.delete("inline") ? "Deleted" : "Not deleted") + "\n";
+
+pre.innerText += "Clear variables: ";
+try {
+ preStyle.var.clear();
+ pre.innerText += "No exception thrown (fail).\n";
+}
+catch (exception) {
+ pre.innerText += exception + "\n";
+}
+
+pre.innerText += "Read deleted variable: " + preStyle.var.get("inline") + "\n";
+</script>
« 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