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

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

Issue 1581223003: Ensure that custom property declarations are treated as inherited (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 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 | third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl » ('j') | 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
new file mode 100644
index 0000000000000000000000000000000000000000..8d93fe66624ce1e763494b0a3b12ccb85628206d
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/fast/css/variables/recompute-variables-when-parent-style-updates.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<style>
+ body {
+ --a: red;
+ --b: blue;
+ }
+
+ .foo {
+ --a: green;
+ }
+
+ .container {
+ --a: var(--b);
+ }
+
+ .here {
+ background: var(--a);
+ width: 100px;
+ height: 100px;
+ }
+</style>
+<div id="outer">
+<div class="here" id='red'></div>
+
+<div class="container" id='container'>
+ <div class="here" id='blue'></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)");
+}, 'Custom properties are recomputed when parent style changes.');
+</script>
« no previous file with comments | « no previous file | third_party/WebKit/Source/build/scripts/templates/CSSPropertyMetadata.cpp.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698