Index: LayoutTests/fast/css/invalidation/targeted-class-custom-pseudo.html |
diff --git a/LayoutTests/fast/css/invalidation/targeted-class-custom-pseudo.html b/LayoutTests/fast/css/invalidation/targeted-class-custom-pseudo.html |
new file mode 100644 |
index 0000000000000000000000000000000000000000..0395152473f4853e7d52957f5476d520f23262d5 |
--- /dev/null |
+++ b/LayoutTests/fast/css/invalidation/targeted-class-custom-pseudo.html |
@@ -0,0 +1,34 @@ |
+<!DOCTYPE html> |
+<script src="../../../resources/js-test.js"></script> |
+<style> |
+.theme ::-webkit-file-upload-button { background-color: green } |
+</style> |
+<div id="t"> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <div></div> |
+ <input type="file"></input> |
+</div> |
+<script> |
+description("Check that targeted class invalidation works for custom pseudo elements."); |
+ |
+shouldBeTrue("!!window.internals"); |
+ |
+if (window.internals) { |
+ var gray = "rgb(192, 192, 192)"; |
+ var green = "rgb(0, 128, 0)"; |
+ |
+ fileUploadButton = internals.shadowRoot(document.querySelector("input")).firstChild; |
+ |
+ shouldBe("getComputedStyle(fileUploadButton, null).backgroundColor", "gray"); |
+ |
+ document.body.offsetLeft; // force style recalc. |
+ |
+ document.getElementById("t").className = "theme"; |
+ |
+ shouldBe("internals.updateStyleAndReturnAffectedElementCount()", "2"); |
+ shouldBe("getComputedStyle(fileUploadButton, null).backgroundColor", "green"); |
+} |
+</script> |