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

Unified Diff: LayoutTests/fast/css/invalidation/webkit-any-universal.html

Issue 383833002: All selectors in :-webkit-any must have an invalidation set feature. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Avoid eventSender Created 6 years, 4 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 | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: LayoutTests/fast/css/invalidation/webkit-any-universal.html
diff --git a/LayoutTests/fast/css/invalidation/webkit-any-universal.html b/LayoutTests/fast/css/invalidation/webkit-any-universal.html
new file mode 100644
index 0000000000000000000000000000000000000000..51150a10c2f161d7e918810ac32d18a476c88aaa
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/webkit-any-universal.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<script src="../../../resources/testharness.js"></script>
+<script src="../../../resources/testharnessreport.js"></script>
+<style>
+.t1 :-webkit-any(*, .dummy),
+.t2 :-webkit-any(:-webkit-any(.dummy, *), .dummy),
+.t3 :-webkit-any(:focus, dummy) { background-color: rgb(0, 128, 0); }
+
+#r3 { width: 10px; height: 10px }
+</style>
+<div id="t1">
+ <div id="r1"></div>
+</div>
+<div id="t2">
+ <div id="r2"></div>
+</div>
+<div id="t3">
+ <div id="r3" tabIndex="1"></div>
+</div>
+<script>
+document.body.offsetTop;
+
+test(function() {
+ assert_true(!!window.internals, "This test only works with internals exposed present");
+ assert_equals(getComputedStyle(r1).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
+
+ t1.className = "t1";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subtree style recalc");
+ assert_equals(getComputedStyle(r1).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
+}, ":-webkit-any() with universal selector");
+
+test(function() {
+ assert_true(!!window.internals, "This test only works with internals exposed present");
+ assert_equals(getComputedStyle(r2).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
+
+ t2.className = "t2";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subtree style recalc");
+ assert_equals(getComputedStyle(r2).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
+}, "Nested :-webkit-any() with universal selector");
+
+test(function() {
+ assert_true(!!window.internals, "This test only works with internals exposed present");
+
+ r3.focus();
+ assert_equals(getComputedStyle(r3).backgroundColor, "rgba(0, 0, 0, 0)", "Background color should initially be transparent");
+
+ t3.className = "t3";
+ assert_equals(internals.updateStyleAndReturnAffectedElementCount(), 2, "Subtree style recalc");
+ assert_equals(getComputedStyle(r3).backgroundColor, "rgb(0, 128, 0)", "Background color is green after class change");
+}, ":-webkit-any() with universal :focus selector");
+</script>
« no previous file with comments | « no previous file | Source/core/css/RuleFeature.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698