Add regression test for :empty { display: none }
https://bugs.webkit.org/show_bug.cgi?id=26570
Patch by Noel Gordon <noel.gordon@gmail.com> on 2011-07-26
Reviewed by Alexey Proskuryakov.
* fast/css/pseudo-empty-display-none-expected.txt: Added.
* fast/css/pseudo-empty-display-none.html: Added.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@91744 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 58f0e11..e39bad8 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2011-07-26 Noel Gordon <noel.gordon@gmail.com>
+
+ Add regression test for :empty { display: none }
+ https://bugs.webkit.org/show_bug.cgi?id=26570
+
+ Reviewed by Alexey Proskuryakov.
+
+ * fast/css/pseudo-empty-display-none-expected.txt: Added.
+ * fast/css/pseudo-empty-display-none.html: Added.
+
2011-07-25 Dan Bernstein <mitz@apple.com>
Updated three more tests that relied on fonts loading synchronously.
diff --git a/LayoutTests/fast/css/pseudo-empty-display-none-expected.txt b/LayoutTests/fast/css/pseudo-empty-display-none-expected.txt
new file mode 100644
index 0000000..e4ba9bc
--- /dev/null
+++ b/LayoutTests/fast/css/pseudo-empty-display-none-expected.txt
@@ -0,0 +1,3 @@
+Test for bug 26570. There should be two green boxes on this page.
+
+PASS
diff --git a/LayoutTests/fast/css/pseudo-empty-display-none.html b/LayoutTests/fast/css/pseudo-empty-display-none.html
new file mode 100644
index 0000000..34dab1a
--- /dev/null
+++ b/LayoutTests/fast/css/pseudo-empty-display-none.html
@@ -0,0 +1,26 @@
+<style>
+ p { background-color: green; width: 100px; height: 100px }
+ p:empty { display: none }
+</style>
+
+<body>
+ Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=26570"> bug 26570</a>.
+ There should be two green boxes on this page.<br>
+ <p></p>
+ <p>	</p>
+ <p></p>
+ <p><span></span></p>
+ <p></p>
+</body>
+
+<script>
+ if (window.layoutTestController)
+ layoutTestController.dumpAsText();
+
+ var list = document.querySelectorAll("p");
+ for (var result = "", i = 0; i < list.length; ++i)
+ result += list.item(i).offsetWidth == (100 * (i & 1)) ? "PASS " : "FAIL ";
+
+ result = list.length == result.match(/PASS /g).length ? "PASS" : "FAIL";
+ document.body.appendChild(document.createTextNode(result));
+</script>