[SCM] WebKit Debian packaging branch, debian/experimental, updated. upstream/1.3.3-9427-gc2be6fc

benm at google.com benm at google.com
Wed Dec 22 11:22:57 UTC 2010


The following commit has been merged in the debian/experimental branch:
commit c90e5dc663f19f2f97daa6223870322fe6701786
Author: benm at google.com <benm at google.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Jul 21 09:19:02 2010 +0000

    Touch events do not affect the :active CSS state
    https://bugs.webkit.org/show_bug.cgi?id=39493
    
    Reviewed by Steve Block.
    
    WebCore:
    
    Test: fast/events/touch/touch-active-state.html
    
    * WebCore.exp.in: Update exports for new signature of
        hitTestResultAtPoint.
    * WebCore.order: ditto.
    * page/EventHandler.cpp:
    (WebCore::EventHandler::EventHandler):
    (WebCore::EventHandler::hitTestResultAtPoint): Pass the type
        of the hit test to perform as a parameter with a default
        value rather than harcoding it in the function body.
    (WebCore::EventHandler::handleMouseMoveEvent): Do not modiify
        the active element during a mouse move if the user is
        touching the screen.
    (WebCore::EventHandler::handleTouchEvent): Set the correct
        type of hit test to perform depending on the type of the
        touch event we are handling.
    * page/EventHandler.h: Update the signature of hitTestResultAtPoint.
    
    LayoutTests:
    
    * fast/events/touch/touch-active-state-expected.txt: Added.
    * fast/events/touch/touch-active-state.html: Added.
    
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@63807 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog
index 3c491b4..38dff7e 100644
--- a/LayoutTests/ChangeLog
+++ b/LayoutTests/ChangeLog
@@ -1,3 +1,13 @@
+2010-07-20  Ben Murdoch  <benm at google.com>
+
+        Reviewed by Steve Block.
+
+        Touch events do not affect the :active CSS state
+        https://bugs.webkit.org/show_bug.cgi?id=39493
+
+        * fast/events/touch/touch-active-state-expected.txt: Added.
+        * fast/events/touch/touch-active-state.html: Added.
+
 2010-07-20  Yury Semikhatsky  <yurys at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/LayoutTests/fast/events/touch/touch-active-state-expected.txt b/LayoutTests/fast/events/touch/touch-active-state-expected.txt
new file mode 100644
index 0000000..1c9c36f
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-active-state-expected.txt
@@ -0,0 +1,9 @@
+Test touches set the active state.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
diff --git a/LayoutTests/fast/events/touch/touch-active-state.html b/LayoutTests/fast/events/touch/touch-active-state.html
new file mode 100644
index 0000000..8b1fe29
--- /dev/null
+++ b/LayoutTests/fast/events/touch/touch-active-state.html
@@ -0,0 +1,48 @@
+<html>
+<link rel="stylesheet" href="../../js/resources/js-test-style.css">
+<script src="../../js/resources/js-test-pre.js"></script>
+<script src="../../js/resources/js-test-post-function.js"></script>
+<style type="text/css">
+#box {
+    background-color:blue;
+    width:100px;
+    height:100px;
+}
+
+#box:active {
+    visibility:hidden;
+}
+
+</style>
+<body onload="runTest();">
+<div id="box" ontouchstart="testComplete();">FAIL</div>
+
+<p id="description"></p>
+<div id="console"></div>
+
+<script type="text/javascript">
+description('Test touches set the active state.');
+
+function testComplete(event)
+{
+    isSuccessfullyParsed();
+    layoutTestController.notifyDone();
+}
+
+function runTest()
+{
+    if (window.eventSender) {
+        // Touch the center of the div.
+        eventSender.addTouchPoint(50, 50);
+        eventSender.touchStart();
+    } else
+        debug('This test requires DRT.');
+}
+
+if (window.layoutTestController)
+    layoutTestController.waitUntilDone();
+
+var successfullyParsed = true;
+</script>
+</body>
+</html>
diff --git a/WebCore/ChangeLog b/WebCore/ChangeLog
index 4af7110..c2c1bda 100644
--- a/WebCore/ChangeLog
+++ b/WebCore/ChangeLog
@@ -1,3 +1,28 @@
+2010-07-20  Ben Murdoch  <benm at google.com>
+
+        Reviewed by Steve Block.
+
+        Touch events do not affect the :active CSS state
+        https://bugs.webkit.org/show_bug.cgi?id=39493
+
+        Test: fast/events/touch/touch-active-state.html
+
+        * WebCore.exp.in: Update exports for new signature of
+            hitTestResultAtPoint.
+        * WebCore.order: ditto.
+        * page/EventHandler.cpp:
+        (WebCore::EventHandler::EventHandler):
+        (WebCore::EventHandler::hitTestResultAtPoint): Pass the type
+            of the hit test to perform as a parameter with a default
+            value rather than harcoding it in the function body.
+        (WebCore::EventHandler::handleMouseMoveEvent): Do not modiify
+            the active element during a mouse move if the user is
+            touching the screen.
+        (WebCore::EventHandler::handleTouchEvent): Set the correct
+            type of hit test to perform depending on the type of the
+            touch event we are handling.
+        * page/EventHandler.h: Update the signature of hitTestResultAtPoint.
+
 2010-07-20  Yury Semikhatsky  <yurys at chromium.org>
 
         Reviewed by Pavel Feldman.
diff --git a/WebCore/WebCore.exp.in b/WebCore/WebCore.exp.in
index 4dd4ee7..d3db7b2 100644
--- a/WebCore/WebCore.exp.in
+++ b/WebCore/WebCore.exp.in
@@ -216,7 +216,7 @@ __ZN7WebCore12EventHandler14scrollOverflowENS_15ScrollDirectionENS_17ScrollGranu
 __ZN7WebCore12EventHandler15sendScrollEventEv
 __ZN7WebCore12EventHandler16handleWheelEventERNS_18PlatformWheelEventE
 __ZN7WebCore12EventHandler20handleTextInputEventERKNS_6StringEPNS_5EventEbb
-__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsE
+__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEi
 __ZN7WebCore12EventHandler21handleMousePressEventERKNS_18PlatformMouseEventE
 __ZN7WebCore12EventHandler23handleMouseReleaseEventERKNS_18PlatformMouseEventE
 __ZN7WebCore12EventHandler27capsLockStateMayHaveChangedEv
diff --git a/WebCore/WebCore.order b/WebCore/WebCore.order
index 7f916d2..8fa6586 100644
--- a/WebCore/WebCore.order
+++ b/WebCore/WebCore.order
@@ -2999,7 +2999,7 @@ __ZN7WebCore24StringWrapperCFAllocatorL22deallocateOnMainThreadEPv
 __ZNK7WebCore12RenderObject5themeEv
 __ZNK7WebCore14RenderThemeMac20supportsControlTintsEv
 __ZN7WebCore15GraphicsContext23setUpdatingControlTintsEb
-__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsE
+__ZN7WebCore12EventHandler20hitTestResultAtPointERKNS_8IntPointEbbNS_17HitTestScrollbarsEi
 __ZNK7WebCore13HitTestResult10isSelectedEv
 __ZN7WebCore19SelectionController8containsERKNS_8IntPointE
 __ZN7WebCore13InlineTextBox11nodeAtPointERKNS_14HitTestRequestERNS_13HitTestResultEiiii
diff --git a/WebCore/page/EventHandler.cpp b/WebCore/page/EventHandler.cpp
index e7f94b0..7184268 100644
--- a/WebCore/page/EventHandler.cpp
+++ b/WebCore/page/EventHandler.cpp
@@ -190,6 +190,9 @@ EventHandler::EventHandler(Frame* frame)
     , m_sendingEventToSubview(false)
     , m_activationEventNumber(0)
 #endif
+#if ENABLE(TOUCH_EVENTS)
+    , m_touchPressed(false)
+#endif
 {
 }
 
@@ -859,12 +862,11 @@ void EventHandler::allowDHTMLDrag(bool& flagDHTML, bool& flagUA) const
 }
 #endif // ENABLE(DRAG_SUPPORT)
     
-HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars)
+HitTestResult EventHandler::hitTestResultAtPoint(const IntPoint& point, bool allowShadowContent, bool ignoreClipping, HitTestScrollbars testScrollbars, int hitType)
 {
     HitTestResult result(point);
     if (!m_frame->contentRenderer())
         return result;
-    int hitType = HitTestRequest::ReadOnly | HitTestRequest::Active;
     if (ignoreClipping)
         hitType |= HitTestRequest::IgnoreClipping;
     m_frame->contentRenderer()->layer()->hitTest(HitTestRequest(hitType), result);
@@ -1441,6 +1443,12 @@ bool EventHandler::handleMouseMoveEvent(const PlatformMouseEvent& mouseEvent, Hi
         hitType |= HitTestRequest::ReadOnly;
     if (m_mousePressed)
         hitType |= HitTestRequest::Active;
+
+#if ENABLE(TOUCH_EVENTS)
+    // Treat any mouse move events as readonly if the user is currently touching the screen.
+    if (m_touchPressed)
+        hitType |= HitTestRequest::Active | HitTestRequest::ReadOnly;
+#endif
     HitTestRequest request(hitType);
     MouseEventWithHitTestResults mev = prepareMouseEvent(request, mouseEvent);
     if (hoveredNode)
@@ -2838,7 +2846,29 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
     for (unsigned i = 0; i < points.size(); ++i) {
         const PlatformTouchPoint& point = points[i];
         IntPoint pagePoint = documentPointForWindowPoint(m_frame, point.pos());
-        HitTestResult result = hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false);
+
+        int hitType = HitTestRequest::Active | HitTestRequest::ReadOnly;
+        // The HitTestRequest types used for mouse events map quite adequately
+        // to touch events. Note that in addition to meaning that the hit test
+        // should affect the active state of the current node if necessary,
+        // HitTestRequest::Active signifies that the hit test is taking place
+        // with the mouse (or finger in this case) being pressed.
+        switch (point.state()) {
+        case PlatformTouchPoint::TouchPressed:
+            hitType = HitTestRequest::Active;
+            break;
+        case PlatformTouchPoint::TouchMoved:
+            hitType = HitTestRequest::Active | HitTestRequest::MouseMove | HitTestRequest::ReadOnly;
+            break;
+        case PlatformTouchPoint::TouchReleased:
+        case PlatformTouchPoint::TouchCancelled:
+            hitType = HitTestRequest::MouseUp;
+            break;
+        default:
+            break;
+        }
+
+        HitTestResult result = hitTestResultAtPoint(pagePoint, /*allowShadowContent*/ false, false, DontHitTestScrollbars, hitType);
         Node* target = result.innerNode();
 
         // Touch events should not go to text nodes
@@ -2901,6 +2931,8 @@ bool EventHandler::handleTouchEvent(const PlatformTouchEvent& event)
             movedTouches->append(touch);
     }
 
+    m_touchPressed = touches->length() > 0;
+
     bool defaultPrevented = false;
     Touch* changedTouch = 0;
     EventTarget* touchEventTarget = 0;
diff --git a/WebCore/page/EventHandler.h b/WebCore/page/EventHandler.h
index 4cca898..ec6b772 100644
--- a/WebCore/page/EventHandler.h
+++ b/WebCore/page/EventHandler.h
@@ -28,6 +28,7 @@
 
 #include "DragActions.h"
 #include "FocusDirection.h"
+#include "HitTestRequest.h"
 #include "PlatformMouseEvent.h"
 #include "ScrollTypes.h"
 #include "Timer.h"
@@ -105,7 +106,7 @@ public:
 
     void dispatchFakeMouseMoveEventSoonInQuad(const FloatQuad&);
 
-    HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars);
+    HitTestResult hitTestResultAtPoint(const IntPoint&, bool allowShadowContent, bool ignoreClipping = false, HitTestScrollbars scrollbars = DontHitTestScrollbars, int hitType = HitTestRequest::ReadOnly | HitTestRequest::Active);
 
     bool mousePressed() const { return m_mousePressed; }
     void setMousePressed(bool pressed) { m_mousePressed = pressed; }
@@ -431,6 +432,7 @@ private:
 #if ENABLE(TOUCH_EVENTS)
     typedef HashMap<int, RefPtr<EventTarget> > TouchTargetMap;
     TouchTargetMap m_originatingTouchPointTargets;
+    bool m_touchPressed;
 #endif
 };
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list