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

Unified Diff: third_party/WebKit/LayoutTests/fast/css/variables/recompute-variables-when-parent-style-updates.html

Issue 2164603004: Cleaned up variables layout test (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/LayoutTests/fast/css/variables/recompute-variables-when-parent-style-updates.html
diff --git a/third_party/WebKit/LayoutTests/fast/css/variables/recompute-variables-when-parent-style-updates.html b/third_party/WebKit/LayoutTests/fast/css/variables/recompute-variables-when-parent-style-updates.html
index 8d93fe66624ce1e763494b0a3b12ccb85628206d..aaac88cc62dc4fea31937e789ac787e80957465f 100644
--- a/third_party/WebKit/LayoutTests/fast/css/variables/recompute-variables-when-parent-style-updates.html
+++ b/third_party/WebKit/LayoutTests/fast/css/variables/recompute-variables-when-parent-style-updates.html
@@ -2,39 +2,40 @@
<script src="../../../resources/testharness.js"></script>
<script src="../../../resources/testharnessreport.js"></script>
<style>
- body {
- --a: red;
- --b: blue;
- }
+body {
+ --a: red;
+ --b: blue;
+}
- .foo {
- --a: green;
- }
+.setAToGreen {
+ --a: green;
+}
- .container {
- --a: var(--b);
- }
+.setAToB {
+ --a: var(--b);
+}
- .here {
- background: var(--a);
- width: 100px;
- height: 100px;
- }
+.backgroundA {
+ background: var(--a);
+}
</style>
<div id="outer">
-<div class="here" id='red'></div>
+ <div class="backgroundA" id='backgroundA'></div>
-<div class="container" id='container'>
- <div class="here" id='blue'></div>
-</div>
+ <div class="setAToB">
+ <div class="backgroundA" id='backgroundB'></div>
+ </div>
</div>
<script>
test(function() {
- assert_equals(getComputedStyle(red).backgroundColor, "rgb(255, 0, 0)");
- assert_equals(getComputedStyle(blue).backgroundColor, "rgb(0, 0, 255)");
- outer.classList.add('foo');
- assert_equals(getComputedStyle(red).backgroundColor, "rgb(0, 128, 0)");
- assert_equals(getComputedStyle(blue).backgroundColor, "rgb(0, 0, 255)");
+ var red = "rgb(255, 0, 0)";
+ var blue = "rgb(0, 0, 255)";
+ var green = "rgb(0, 128, 0)";
+ assert_equals(getComputedStyle(backgroundA).backgroundColor, red);
+ assert_equals(getComputedStyle(backgroundB).backgroundColor, blue);
+ outer.classList.add('setAToGreen');
+ assert_equals(getComputedStyle(backgroundA).backgroundColor, green);
+ assert_equals(getComputedStyle(backgroundB).backgroundColor, blue);
}, 'Custom properties are recomputed when parent style changes.');
</script>
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698