LayoutTests:
authorthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Aug 2006 04:00:57 +0000 (04:00 +0000)
committerthatcher <thatcher@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 1 Aug 2006 04:00:57 +0000 (04:00 +0000)
        Reviewed by Maciej.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=9738
        Bug 9738: Unqualified :hover selector ignored in strict parsing mode

        * fast/selectors/unqualified-hover-quirks-expected.checksum: Added.
        * fast/selectors/unqualified-hover-quirks-expected.png: Added.
        * fast/selectors/unqualified-hover-quirks-expected.txt: Added.
        * fast/selectors/unqualified-hover-quirks.html: Added.
        * fast/selectors/unqualified-hover-strict-expected.checksum: Added.
        * fast/selectors/unqualified-hover-strict-expected.png: Added.
        * fast/selectors/unqualified-hover-strict-expected.txt: Added.
        * fast/selectors/unqualified-hover-strict.html: Added.

WebCore:

        Reviewed by Maciej.

        http://bugzilla.opendarwin.org/show_bug.cgi?id=9738
        Bug 9738: Unqualified :hover selector ignored in strict parsing mode

        * css/cssstyleselector.cpp:
        (WebCore::CSSStyleSelector::checkSelector): Restrict the :hover and :active
        exclusion based on onlyHoverActive to quirks mode.

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

LayoutTests/ChangeLog
LayoutTests/fast/selectors/unqualified-hover-quirks-expected.checksum [new file with mode: 0644]
LayoutTests/fast/selectors/unqualified-hover-quirks-expected.png [new file with mode: 0644]
LayoutTests/fast/selectors/unqualified-hover-quirks-expected.txt [new file with mode: 0644]
LayoutTests/fast/selectors/unqualified-hover-quirks.html [new file with mode: 0644]
LayoutTests/fast/selectors/unqualified-hover-strict-expected.checksum [new file with mode: 0644]
LayoutTests/fast/selectors/unqualified-hover-strict-expected.png [new file with mode: 0644]
LayoutTests/fast/selectors/unqualified-hover-strict-expected.txt [new file with mode: 0644]
LayoutTests/fast/selectors/unqualified-hover-strict.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/css/cssstyleselector.cpp

index df4bf1646a97c0dae466bd9c18b522db5814a6ea..d0510a641b792b0851436e3883cf8b7a50dbe7b4 100644 (file)
@@ -1,3 +1,19 @@
+2006-07-31  Mark Rowe  <opendarwin.org@bdash.net.nz>
+
+        Reviewed by Maciej.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9738
+        Bug 9738: Unqualified :hover selector ignored in strict parsing mode
+
+        * fast/selectors/unqualified-hover-quirks-expected.checksum: Added.
+        * fast/selectors/unqualified-hover-quirks-expected.png: Added.
+        * fast/selectors/unqualified-hover-quirks-expected.txt: Added.
+        * fast/selectors/unqualified-hover-quirks.html: Added.
+        * fast/selectors/unqualified-hover-strict-expected.checksum: Added.
+        * fast/selectors/unqualified-hover-strict-expected.png: Added.
+        * fast/selectors/unqualified-hover-strict-expected.txt: Added.
+        * fast/selectors/unqualified-hover-strict.html: Added.
+
 2006-07-31  Adele Peterson  <adele@apple.com>
 
         Reviewed by John and Anders.
diff --git a/LayoutTests/fast/selectors/unqualified-hover-quirks-expected.checksum b/LayoutTests/fast/selectors/unqualified-hover-quirks-expected.checksum
new file mode 100644 (file)
index 0000000..2924a20
--- /dev/null
@@ -0,0 +1,2 @@
+8445465d29f4df0132be070ab12a6aee
+\ No newline at end of file
diff --git a/LayoutTests/fast/selectors/unqualified-hover-quirks-expected.png b/LayoutTests/fast/selectors/unqualified-hover-quirks-expected.png
new file mode 100644 (file)
index 0000000..ff0dd94
Binary files /dev/null and b/LayoutTests/fast/selectors/unqualified-hover-quirks-expected.png differ
diff --git a/LayoutTests/fast/selectors/unqualified-hover-quirks-expected.txt b/LayoutTests/fast/selectors/unqualified-hover-quirks-expected.txt
new file mode 100644 (file)
index 0000000..49fe504
--- /dev/null
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x576
+      RenderBlock {H3} at (0,0) size 784x22
+        RenderText {#text} at (0,0) size 468x22
+          text run at (0,0) width 468: "Test of unqualifed :hover selector in quirks parsing mode"
+      RenderBlock {P} at (0,40) size 784x18
+        RenderText {#text} at (0,0) size 616x18
+          text run at (0,0) width 616: "Moving the mouse anywhere over the document should result no change to the background color."
diff --git a/LayoutTests/fast/selectors/unqualified-hover-quirks.html b/LayoutTests/fast/selectors/unqualified-hover-quirks.html
new file mode 100644 (file)
index 0000000..532434a
--- /dev/null
@@ -0,0 +1,24 @@
+<html>
+  <head>
+    <style type='text/css'>
+      :hover { background-color: #666; }
+    </style>
+
+    <script type="text/javascript">
+      function test()
+      {
+          if (!window.eventSender)
+              return;
+
+          document.body.offsetTop;    // Force layout. The mouse is not tracked before first layout.
+          eventSender.mouseMoveTo(16, 16);    // Hover.
+          document.body.offsetTop;    // Update layout for hovered state.
+      }
+    </script>
+  </head>
+  <body onload="test()">
+    <h3>Test of unqualifed :hover selector in quirks parsing mode</h3>
+
+    <p>Moving the mouse anywhere over the document should result no change to the background color.</p>
+  </body>
+</html>
diff --git a/LayoutTests/fast/selectors/unqualified-hover-strict-expected.checksum b/LayoutTests/fast/selectors/unqualified-hover-strict-expected.checksum
new file mode 100644 (file)
index 0000000..8d7bece
--- /dev/null
@@ -0,0 +1,2 @@
+a6055b5382b4cfdaf22d493ea46da84a
+\ No newline at end of file
diff --git a/LayoutTests/fast/selectors/unqualified-hover-strict-expected.png b/LayoutTests/fast/selectors/unqualified-hover-strict-expected.png
new file mode 100644 (file)
index 0000000..be32aa6
Binary files /dev/null and b/LayoutTests/fast/selectors/unqualified-hover-strict-expected.png differ
diff --git a/LayoutTests/fast/selectors/unqualified-hover-strict-expected.txt b/LayoutTests/fast/selectors/unqualified-hover-strict-expected.txt
new file mode 100644 (file)
index 0000000..dce8c99
--- /dev/null
@@ -0,0 +1,11 @@
+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x92
+  RenderBlock {HTML} at (0,0) size 800x92 [bgcolor=#666666]
+    RenderBody {BODY} at (8,18) size 784x58
+      RenderBlock {H3} at (0,0) size 784x22
+        RenderText {#text} at (0,0) size 455x22
+          text run at (0,0) width 455: "Test of unqualifed :hover selector in strict parsing mode"
+      RenderBlock {P} at (0,40) size 784x18
+        RenderText {#text} at (0,0) size 691x18
+          text run at (0,0) width 691: "Moving the mouse anywhere over the document should result in the background color being changed to grey."
diff --git a/LayoutTests/fast/selectors/unqualified-hover-strict.html b/LayoutTests/fast/selectors/unqualified-hover-strict.html
new file mode 100644 (file)
index 0000000..a33d734
--- /dev/null
@@ -0,0 +1,25 @@
+<!DOCTYPE HTML>
+<html>
+  <head>
+    <style type='text/css'>
+      :hover { background-color: #666; }
+    </style>
+
+    <script type="text/javascript">
+      function test()
+      {
+          if (!window.eventSender)
+              return;
+
+          document.body.offsetTop;    // Force layout. The mouse is not tracked before first layout.
+          eventSender.mouseMoveTo(16, 16);    // Hover.
+          document.body.offsetTop;    // Update layout for hovered state.
+      }
+    </script>
+  </head>
+  <body onload="test()">
+    <h3>Test of unqualifed :hover selector in strict parsing mode</h3>
+
+    <p>Moving the mouse anywhere over the document should result in the background color being changed to grey.</p>
+  </body>
+</html>
index 3321a990c662422cea0a04b2bce206a358b18d6c..824c06bb5cb26e3950effe020451e4c0c4b4787b 100644 (file)
@@ -1,3 +1,14 @@
+2006-07-31  Mark Rowe  <opendarwin.org@bdash.net.nz>
+
+        Reviewed by Maciej.
+
+        http://bugzilla.opendarwin.org/show_bug.cgi?id=9738
+        Bug 9738: Unqualified :hover selector ignored in strict parsing mode
+
+        * css/cssstyleselector.cpp:
+        (WebCore::CSSStyleSelector::checkSelector): Restrict the :hover and :active
+        exclusion based on onlyHoverActive to quirks mode.
+
 2006-07-31  David Hyatt  <hyatt@apple.com>
 
         Fix for bug 10179, digg.com scrolls slowly.  Improve fixed positioning
index ec429c9d425627b459acbfb185eb17890298ac5e..09fe9b777850c843b62bf6f60f245f7d958d5f4c 100644 (file)
@@ -1244,7 +1244,7 @@ bool CSSStyleSelector::checkSelector(CSSSelector* sel, Element *e)
         return false;
     
     // disallow *:hover, *:active, and *:hover:active except for links
-    if (onlyHoverActive && subject) {
+    if (!strictParsing && onlyHoverActive && subject) {
         if (pseudoState == PseudoUnknown)
             checkPseudoState(e);