| Index: LayoutTests/fast/css/variables/cssom-update.html
|
| diff --git a/LayoutTests/fast/css/variables/cssom-update.html b/LayoutTests/fast/css/variables/cssom-update.html
|
| index eb899b08547563dc76d586bea52b570e744bb5a1..4a0d8c0f1f89ec7869469db327f6d18f1c30f86a 100644
|
| --- a/LayoutTests/fast/css/variables/cssom-update.html
|
| +++ b/LayoutTests/fast/css/variables/cssom-update.html
|
| @@ -1,21 +1,31 @@
|
| <!doctype html>
|
| +<head><script src="../../js/resources/js-test-pre.js"></script></head>
|
|
|
| -<style>
|
| - div {
|
| - background-color: var(color);
|
| - border-style: var(border);
|
| - }
|
| -</style>
|
| -
|
| -<div id="outer" style="var-color: darkred; var-border: dashed">
|
| - This div should be green with a solid border.
|
| - <div>This div should also be green with a solid border.</div>
|
| -</div>
|
| +<div id="test-target" style="var-a: fail; var-b: fail;"></div>
|
|
|
| <script>
|
| -var outer = document.querySelector("#outer");
|
| +description('This tests Javascript modification of CSS variables in inline styles.');
|
| +
|
| +var div = document.querySelector('#test-target');
|
| +
|
| +div.style.var.set('a', 'pass');
|
| +div.style.var.set('b', 'pass');
|
| +div.style.var.set('c', 'pass');
|
| +
|
| +shouldBeEqualToString('div.style.cssText', 'var-a: pass; var-b: pass; var-c: pass;');
|
| +shouldBe('div.style.var.size', '3');
|
| +shouldBeEqualToString('div.style.var.get("a")', 'pass');
|
| +shouldBeEqualToString('div.style.var.get("b")', 'pass');
|
| +shouldBeEqualToString('div.style.var.get("c")', 'pass');
|
|
|
| -outer.style.var.set("color", "green");
|
| -outer.style.var.set("border", "solid");
|
| +var forEachIterations = [];
|
| +div.style.var.forEach(function(value, name, map) {
|
| + forEachIterations.push([value, name, map.toString()]);
|
| +});
|
|
|
| +shouldBe('forEachIterations[0]', '["pass", "a", "[object CSSVariablesMap]"]');
|
| +shouldBe('forEachIterations[1]', '["pass", "b", "[object CSSVariablesMap]"]');
|
| +shouldBe('forEachIterations[2]', '["pass", "c", "[object CSSVariablesMap]"]');
|
| +shouldBe('forEachIterations.length', '3');
|
| </script>
|
| +<script src="../../js/resources/js-test-post.js"></script>
|
|
|