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

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

Issue 21006006: Add forEach() to CSSVariablesMap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebased onto callback change Created 7 years, 3 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
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
index 5a58b0f6d9f8bacdd44e99441b894df5e53fb7ec..37a8af8ee5a665de3b5d916d006e7a792c3c2201 100644
--- a/LayoutTests/fast/css/variables/cssom-computed-style.html
+++ b/LayoutTests/fast/css/variables/cssom-computed-style.html
@@ -21,6 +21,9 @@ var preStyle = getComputedStyle(pre);
var bodyStyle = getComputedStyle(document.querySelector("body"));
pre.innerText += "Computed variables declaration: " + preStyle.var + "\n";
+pre.innerText += "Equal variables declaration objects on multiple accesses: ";
+pre.innerText += ((preStyle.var === preStyle.var) ? "pass": "fail") + "\n";
esprehn 2013/09/12 01:13:42 This isn't a good test, you need to trigger a gc b
alancutter (OOO until 2018) 2013/09/13 03:06:14 This check was suggested by arv after I had been c
+
pre.innerText += "Create variable: ";
try {
preStyle.var.set("create", "test");
@@ -37,6 +40,19 @@ pre.innerText += "Read inherited variable: " + preStyle.var.get("inherited") + "
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 += "Enumerate variables:\n";
+var varList = [];
+preStyle.var.forEach(function(value, name) { varList.push([name, value]); });
+varList.sort();
+for (var i = 0; i < varList.length; i++) {
+ pre.innerText += " " + varList[i][0] + ": " + varList[i][1] + "\n";
+}
+
+pre.innerText += "Enumerate empty variables: ";
+var pass = true;
+bodyStyle.var.forEach(function(value, name) { pass = false; });
+pre.innerText += (pass ? "pass" : "fail") + "\n";
+
pre.innerText += "Update variable: ";
try {
preStyle.var.set("inline", "test");

Powered by Google App Engine
This is Rietveld 408576698