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> |