WebCore:
authoradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Jan 2008 20:50:58 +0000 (20:50 +0000)
committeradele@apple.com <adele@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Tue, 8 Jan 2008 20:50:58 +0000 (20:50 +0000)
        Reviewed by Darin.

        Fix for <rdar://problem/5674667> fast/forms/slider-mouse-events.html is broken by media control checkin 29257

        * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):
          After fixing a bug in EventHandler to make sure events always go to the capturing node, this bug was exposed.
          MouseMove and MouseUp events were going to the thumb element, but not to the slider input element.
          This change makes the input element the capturing node, and then the input element forwards the mouse events to the thumb element.
          I also added a missing call to setDefaultHandled for the mousemove event.

LayoutTests:

        Reviewed by Darin.

        Updated test for:
        <rdar://problem/5674667> fast/forms/slider-mouse-events.html is broken by media control checkin 29257

        * fast/forms/slider-mouse-events-expected.txt:
        * fast/forms/slider-mouse-events.html: Now tests mousemove events too.

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

LayoutTests/ChangeLog
LayoutTests/fast/forms/slider-mouse-events-expected.txt
LayoutTests/fast/forms/slider-mouse-events.html
WebCore/ChangeLog
WebCore/rendering/RenderSlider.cpp

index b847eed2349a368afb24cc299f9c903c1b39e685..9f5082c910f371876214a8877868593faa72ece8 100644 (file)
@@ -1,3 +1,13 @@
+2008-01-08  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        Updated test for:
+        <rdar://problem/5674667> fast/forms/slider-mouse-events.html is broken by media control checkin 29257
+
+        * fast/forms/slider-mouse-events-expected.txt:
+        * fast/forms/slider-mouse-events.html: Now tests mousemove events too.
+
 2008-01-08  Alexey Proskuryakov  <ap@webkit.org>
 
         Reviewed by Darin.
index 8cf41f93febc96836a85ce5f80cfa114eda305dd..eb2063088158f7f8454853f6dc13da23be45a645 100644 (file)
@@ -1,5 +1,8 @@
-This tests that slider controls get mouse down, input, and mouseup events.
+This tests that slider controls get mousedown, mousemove, input, and mouseup events.
 
+mousemove
 mousedown
+mousemove
 input
+mouseup
 
index cfb3c9cdac9ad9ad71bf81983e6de495ae06b276..a93e860bdd6e641017f2610e50b49edc996673ed 100644 (file)
@@ -20,8 +20,8 @@
         </script>
     </head>
     <body onload="test()">
-        This tests that slider controls get mouse down, input, and mouseup events.<br>
-        <input type="range" id="slider" onmousedown="log('mousedown')" onmouseup="log('mouseup')" oninput="log('input')" value=0>
+        This tests that slider controls get mousedown, mousemove, input, and mouseup events.<br>
+        <input type="range" id="slider" onmousedown="log('mousedown')" onmouseup="log('mouseup')" onmousemove="log('mousemove')" oninput="log('input')" value=0>
         <div id="res"></div>
     </body>
 </html>
index 66a852584d86f732c5b49960136ac1859d91056e..84f495274c62b4b2b40c7cef7487741d887ab408 100644 (file)
@@ -1,3 +1,15 @@
+2008-01-08  Adele Peterson  <adele@apple.com>
+
+        Reviewed by Darin.
+
+        Fix for <rdar://problem/5674667> fast/forms/slider-mouse-events.html is broken by media control checkin 29257
+
+        * rendering/RenderSlider.cpp: (WebCore::HTMLSliderThumbElement::defaultEventHandler):
+          After fixing a bug in EventHandler to make sure events always go to the capturing node, this bug was exposed.
+          MouseMove and MouseUp events were going to the thumb element, but not to the slider input element.  
+          This change makes the input element the capturing node, and then the input element forwards the mouse events to the thumb element.
+          I also added a missing call to setDefaultHandled for the mousemove event.
+
 2008-01-08  Adele Peterson  <adele@apple.com>
 
         Reviewed by Adam. 
index 822c1316bf5a1865db6776cff260326c5a6fe0da..af634111800eb75bb7d9d1f700ea56a9c094c357 100644 (file)
@@ -82,7 +82,7 @@ void HTMLSliderThumbElement::defaultEventHandler(Event* event)
             m_initialPosition = static_cast<RenderSlider*>(renderer()->parent())->currentPosition();
             m_inDragMode = true;
             
-            document()->frame()->eventHandler()->setCapturingMouseEventsNode(this);
+            document()->frame()->eventHandler()->setCapturingMouseEventsNode(m_shadowParent);
             
             event->setDefaultHandled();
             return;
@@ -109,6 +109,8 @@ void HTMLSliderThumbElement::defaultEventHandler(Event* event)
                 slider->setCurrentPosition(newPosition);
                 slider->valueChanged();
             }
+            event->setDefaultHandled();
+            return;
         }
     }