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

Unified Diff: LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-before-element.html

Issue 572043002: Support getComputedStyle for non-rendered pseudo elements. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 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/getComputedStyle/getComputedStyle-with-before-element.html
diff --git a/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-before-element.html b/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-before-element.html
new file mode 100644
index 0000000000000000000000000000000000000000..ec8e0a26f0160ccfc42349b8f411b98b08026505
--- /dev/null
+++ b/LayoutTests/fast/css/getComputedStyle/getComputedStyle-with-before-element.html
@@ -0,0 +1,39 @@
+<!DOCTYPE html>
+<script src="../../../resources/js-test.js"></script>
+<style>
+#t1::before { color: green }
+#t2::before { display: none; content: "X"; color: green; }
+#t3::before { display: none; color: green; }
+#t4 { display: none; }
+#t4::before { content: "X"; color: green; }
+#t5 { display: none; }
+#t5::before { color: green; }
+#t6 { color: green; }
+</style>
+<div id="t1"></div>
+<div id="t2"></div>
+<div id="t3"></div>
+<div id="t4"></div>
+<div id="t5"></div>
+<div id="t6"></div>
+<script>
+description("Check getComputedStyle for ::before with various combinations of display and content.");
+
+var expectedDisplay = [
+ "'inline'",
+ "'none'",
+ "'none'",
+ "'inline'",
+ "'inline'",
+ "'inline'"
+];
+
+for (var i=0; i<6; i++) {
+
+ var computed = getComputedStyle(document.getElementById("t"+(i+1)), "::before");
+
+ shouldBe("computed.color", "'rgb(0, 128, 0)'");
+ shouldBe("computed.display", expectedDisplay[i]);
+}
+
+</script>

Powered by Google App Engine
This is Rietveld 408576698