Reviewed by Geoff Garen.
authorap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 May 2010 00:03:19 +0000 (00:03 +0000)
committerap@apple.com <ap@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 7 May 2010 00:03:19 +0000 (00:03 +0000)
        https://bugs.webkit.org/show_bug.cgi?id=38697
        REGRESSION (r58299): Replying on reddit.com no longer works

        * css/CSSSelector.cpp: (WebCore::CSSSelector::extractPseudoType): Don't recognize :first,
        :left and :right. The aren't allowed in all contexts, and properly implementing them is out
        of scope for this regression fix.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@58922 268f45cc-cd09-0410-ab3c-d52691b4dbfc

LayoutTests/ChangeLog
LayoutTests/fast/css/misplaced-paged-media-pseudo-expected.txt [new file with mode: 0644]
LayoutTests/fast/css/misplaced-paged-media-pseudo.html [new file with mode: 0644]
LayoutTests/printing/page-rule-css-text-expected.txt
WebCore/ChangeLog
WebCore/css/CSSSelector.cpp

index 0e4b36f..d5f6659 100644 (file)
@@ -1,3 +1,16 @@
+2010-05-06  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=38697
+        REGRESSION (r58299): Replying on reddit.com no longer works
+
+        * fast/css/misplaced-paged-media-pseudo-expected.txt: Added.
+        * fast/css/misplaced-paged-media-pseudo.html: Added.
+
+        * printing/page-rule-css-text-expected.txt: :first, :left and :right are no longer recognized,
+        landing regressed results until they can be properly implemented.
+
 2010-05-06  Anders Carlsson  <andersca@apple.com>
 
         Reviewed by Darin Adler and Dan Bernstein..
diff --git a/LayoutTests/fast/css/misplaced-paged-media-pseudo-expected.txt b/LayoutTests/fast/css/misplaced-paged-media-pseudo-expected.txt
new file mode 100644 (file)
index 0000000..1d85585
--- /dev/null
@@ -0,0 +1,3 @@
+Test for bug 38697: Replying on reddit.com no longer works.
+
+PASS
diff --git a/LayoutTests/fast/css/misplaced-paged-media-pseudo.html b/LayoutTests/fast/css/misplaced-paged-media-pseudo.html
new file mode 100644 (file)
index 0000000..a45d954
--- /dev/null
@@ -0,0 +1,15 @@
+<body>
+<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=38697">bug 38697<a/>:
+Replying on reddit.com no longer works.</p>
+<script>
+if (window.layoutTestController)
+    layoutTestController.dumpAsText();
+
+try {
+    document.querySelectorAll(".login-popup:first");
+    document.write("FAIL");
+} catch (EX) {
+    document.write("PASS");
+}
+</script>
+</body>
index f18b1e2..71c146b 100644 (file)
@@ -1,10 +1,5 @@
 @page { margin-top: 5cm; margin-bottom: 10cm; }
-@page :left { margin-right: 3cm; }
-@page :right { margin-left: 3cm; }
-@page :first { border-top-width: 1px; border-right-width: 1px; border-bottom-width: 1px; border-left-width: 1px; }
 @page hello { color: green; }
-@page world:right { color: red; }
-@media print { @page somepage:first { margin-top: 3cm; margin-right: 3cm; margin-bottom: 3cm; margin-left: 3cm; } }
 @page auto_page { size: auto; }
 @page square_page { size: 4in; }
 @page letter_page { size: letter; }
index 028bcf0..48c99bd 100644 (file)
@@ -1,3 +1,14 @@
+2010-05-06  Alexey Proskuryakov  <ap@apple.com>
+
+        Reviewed by Geoff Garen.
+
+        https://bugs.webkit.org/show_bug.cgi?id=38697
+        REGRESSION (r58299): Replying on reddit.com no longer works
+
+        * css/CSSSelector.cpp: (WebCore::CSSSelector::extractPseudoType): Don't recognize :first,
+        :left and :right. The aren't allowed in all contexts, and properly implementing them is out
+        of scope for this regression fix.
+
 2010-05-06  Jian Li  <jianli@chromium.org>
 
         Reviewed by Adam Barth.
index 7d23d1c..ee9c846 100644 (file)
@@ -525,10 +525,13 @@ void CSSSelector::extractPseudoType() const
     case PseudoSingleButton:
     case PseudoNoButton:
     case PseudoNotParsed:
+        break;
     case PseudoFirstPage:
     case PseudoLeftPage:
     case PseudoRightPage:
-        break;
+        // FIXME: These should only be allowed in @page rules. Disabled them altogether until that's implemented correctly.
+        m_pseudoType = PseudoUnknown;
+        return;
     }
 
     if (m_match == PseudoClass && element) {