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

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: 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
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 b293bd0aa433e4fb420bf87e39c839e7bd70b3d3..8075cb499f811102891f271ce94694e03e27fec0 100644
--- a/LayoutTests/fast/css/variables/cssom-computed-style.html
+++ b/LayoutTests/fast/css/variables/cssom-computed-style.html
@@ -37,6 +37,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";
arv (Not doing code reviews) 2013/07/31 16:45:24 don't use innerText... I know you are just followi
alancutter (OOO until 2018) 2013/08/05 09:33:49 Thanks for the advice. I'll avoid using it in futu
+var varList = [];
+preStyle.var.forEach(function(value, name) { varList.push([name, value]); });
+varList.sort();
+for (var i in varList) {
arv (Not doing code reviews) 2013/07/31 16:45:24 do not use for-in loops to loop over arrays. Use f
alancutter (OOO until 2018) 2013/08/05 09:33:49 Done.
+ 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