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

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

Issue 21006006: Add forEach() to CSSVariablesMap (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase and review changes Created 7 years, 2 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
OLDNEW
1 <!doctype html> 1 <!doctype html>
2 <head><script src="../../js/resources/js-test-pre.js"></script></head>
2 3
3 <style> 4 <div id="test-target" style="var-a: fail; var-b: fail;"></div>
4 div {
5 background-color: var(color);
6 border-style: var(border);
7 }
8 </style>
9
10 <div id="outer" style="var-color: darkred; var-border: dashed">
11 This div should be green with a solid border.
12 <div>This div should also be green with a solid border.</div>
13 </div>
14 5
15 <script> 6 <script>
16 var outer = document.querySelector("#outer"); 7 description('This tests Javascript modification of CSS variables in inline style s.');
17 8
18 outer.style.var.set("color", "green"); 9 var div = document.querySelector('#test-target');
19 outer.style.var.set("border", "solid");
20 10
11 div.style.var.set('a', 'pass');
12 div.style.var.set('b', 'pass');
13 div.style.var.set('c', 'pass');
14
15 shouldBeEqualToString('div.style.cssText', 'var-a: pass; var-b: pass; var-c: pas s;');
16 shouldBe('div.style.var.size', '3');
17 shouldBeEqualToString('div.style.var.get("a")', 'pass');
18 shouldBeEqualToString('div.style.var.get("b")', 'pass');
19 shouldBeEqualToString('div.style.var.get("c")', 'pass');
20
21 var forEachIterations = [];
22 div.style.var.forEach(function(value, name, map) {
23 forEachIterations.push([value, name, map.toString()]);
24 });
25
26 shouldBe('forEachIterations[0]', '["pass", "a", "[object CSSVariablesMap]"]');
27 shouldBe('forEachIterations[1]', '["pass", "b", "[object CSSVariablesMap]"]');
28 shouldBe('forEachIterations[2]', '["pass", "c", "[object CSSVariablesMap]"]');
29 shouldBe('forEachIterations.length', '3');
21 </script> 30 </script>
31 <script src="../../js/resources/js-test-post.js"></script>
OLDNEW
« no previous file with comments | « LayoutTests/fast/css/variables/cssom-read-expected.txt ('k') | LayoutTests/fast/css/variables/cssom-update-expected.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698