Index: LayoutTests/fast/css/invalidation/enabled-pseudo.html |
diff --git a/LayoutTests/fast/css/invalidation/enabled-pseudo.html b/LayoutTests/fast/css/invalidation/enabled-pseudo.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..3f30b132d3d97c324aa7986888c9f4ad870d2a79 |
--- /dev/null |
+++ b/LayoutTests/fast/css/invalidation/enabled-pseudo.html |
@@ -0,0 +1,31 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/js-test.js"></script> |
+<style> |
+input { background: transparent } |
+:enabled { background-color: green } |
+input + div { color: pink } |
+</style> |
+<input id="button" type="button" disabled></input> |
+<div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+</div> |
+<script> |
+description("Use descendant invalidation set for :enabled pseudo class.") |
+ |
+var transparent = "rgba(0, 0, 0, 0)"; |
+var green = "rgb(0, 128, 0)"; |
+ |
+shouldBe("getComputedStyle(button, '').backgroundColor", "transparent"); |
+ |
+button.offsetTop; // Force recalc. |
+ |
+button.disabled = false; |
+ |
+if (window.internals) |
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "1"); |
+ |
+shouldBe("getComputedStyle(button, '').backgroundColor", "green"); |
+</script> |