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

Unified Diff: LayoutTests/fast/css/invalidation/fieldset-disabled.html

Issue 540533004: Use style invalidation for more pseudo classes. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased Created 6 years, 3 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/fieldset-disabled.html
diff --git a/LayoutTests/fast/css/invalidation/fieldset-disabled.html b/LayoutTests/fast/css/invalidation/fieldset-disabled.html
new file mode 100644
index 0000000000000000000000000000000000000000..37ea2e404635ebad7ae568b2dcea2b39ec33756c
--- /dev/null
+++ b/LayoutTests/fast/css/invalidation/fieldset-disabled.html
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+fieldset:disabled { background-color: green }
+fieldset + div { color: pink }
+</style>
+<fieldset id="fieldset">
+ <legend></legend>
+ <label for="field"></label>
+ <input type="text" name="field" id="field">
+ <div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+ </div>
+</fieldset>
+<div>
+ <div></div>
+ <div></div>
+ <div></div>
+ <div></div>
+</div>
+<script>
+description("Use descendant invalidation set for :disabled fieldset.")
+
+var transparent = "rgba(0, 0, 0, 0)";
+var green = "rgb(0, 128, 0)";
+
+shouldBe("getComputedStyle(fieldset, '').backgroundColor", "transparent");
+
+fieldset.offsetTop; // Force recalc.
+fieldset.disabled = true;
+
+if (window.internals) {
+ // There are still instances of SubtreeStyleChange left when updating
+ // disabled state. This count should become lower.
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "7");
+}
+
+shouldBe("getComputedStyle(fieldset, '').backgroundColor", "green");
+</script>

Powered by Google App Engine
This is Rietveld 408576698