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

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

Issue 143873016: Implement style invalidation tree walk for targeted style recalc upon class change. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 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 | LayoutTests/fast/css/invalidation/targeted-class-style-invalidation-expected.txt » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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
new file mode 100644
index 0000000000000000000000000000000000000000..462901fba83dcde0a704de3c08e1bce943e62858
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/targeted-class-style-invalidation.html
@@ -0,0 +1,34 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+
+<style>
+ .outer .inner {}
+</style>
+
+<div id="outer">
+ <div id="inner" class="inner">
+ </div>
+ <div id="inner2">
+ </div>
+</div>
+
+<script>
+description("Test that adding and removing class names only updates the elements that are affected.");
+
+function insertStyleSheet(css)
+{
+ var styleElement = document.createElement("style");
+ styleElement.textContent = css;
+ (document.head || document.documentElement).appendChild(styleElement);
+}
+
+var outer = document.getElementById('outer');
+
+outer.offsetTop;
+outer.className = 'outer';
+
+// Style recalc should happen on "inner" and "outer", but not "inner2".
+// FIXME: change the 3 to a 2 once we have a virtual test setup.
+shouldBe("internals.updateStyleAndReturnAffectedElementCount()", '3');
+
+</script>
« no previous file with comments | « no previous file | LayoutTests/fast/css/invalidation/targeted-class-style-invalidation-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698