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

Unified Diff: LayoutTests/fast/css/invalidation/targeted-class-style-invalidation.html

Issue 171513006: Support invalidation sets for simple class selectors. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 10 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
Index: LayoutTests/fast/css/invalidation/targeted-class-style-invalidation.html
diff --git a/LayoutTests/fast/css/invalidation/targeted-class-style-invalidation.html b/LayoutTests/fast/css/invalidation/targeted-class-style-invalidation.html
index cbf58d1b56417a4431fcd0a17f03bf5ec53d1eac..df733d145188eb14a9e3ec1ea41382ea602211af 100644
--- a/LayoutTests/fast/css/invalidation/targeted-class-style-invalidation.html
+++ b/LayoutTests/fast/css/invalidation/targeted-class-style-invalidation.html
@@ -4,6 +4,7 @@
<style>
div { width: 100px }
.outer .inner { width: 200px }
+ .outer2 { width: 150px }
</style>
<div id="outer">
@@ -14,6 +15,9 @@
<div id="inner2">
</div>
</div>
+<div id="outer2">
+ <div id="inner3"></div>
+</div>
<script>
description("Test that adding and removing class names only updates the elements that are affected.");
@@ -27,6 +31,7 @@ function insertStyleSheet(css)
var outer = document.getElementById('outer');
var inner = document.getElementById('inner');
+var outer2 = document.getElementById('outer2');
var count;
if (internals.runtimeFlags.targetedStyleRecalcEnabled)
@@ -51,4 +56,14 @@ inner.className = '';
shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '' + count);
shouldBe("getComputedStyle(inner).width", '"100px"');
+if (internals.runtimeFlags.targetedStyleRecalcEnabled)
+ count = 1;
+else
+ count = 2;
+
+// Style recalc should happen on "outer2", but not "inner3".
+outer2.offsetTop;
+outer2.className = 'outer2';
+shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '' + count);
+shouldBe("getComputedStyle(outer2).width", '"150px"');
</script>

Powered by Google App Engine
This is Rietveld 408576698