Reviewed by Darin.
authorap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Mar 2006 20:46:24 +0000 (20:46 +0000)
committerap <ap@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 20 Mar 2006 20:46:24 +0000 (20:46 +0000)
commit160dafc4eb7d954e5026459b0fb158cd76e90bc5
tree6a07d726b6b69b3c5a7ed24e29325b9bc734c34b
parentff9ca98f7e6758446ed2a97a5a0b331b92548417
    Reviewed by Darin.

        - http://bugzilla.opendarwin.org/show_bug.cgi?id=3439
         mouseover effects can get stuck sometimes due to missing events
        - http://bugzilla.opendarwin.org/show_bug.cgi?id=7701
         mouseout sent to the wrong element when layout changes simultaneously

        Implemented saving the previous node under the mouse, so that we don't need to
        recalculate it, which is slow and even not really possible. This has fixed a number
        of issues with mouse event dispatching when the content changes.
        The code still needs refactoring and cleanup, see bug 3439 for comments.

        Tests (both files perform multiple checks):
        - fast/events/mouseover-mouseout.html
        - fast/events/mouseover-mouseout2.html

        * page/Frame.h: Added a Frame parameter to passSubframeEventToSubframe(),
        used for mouseMoved events.
        * bridge/mac/FrameMac.h: Ditto.
        * bridge/mac/FrameMac.mm:
        (WebCore::FrameMac::passSubframeEventToSubframe): Use the passed subframe to target
        NSMouseMoved events.
        * page/FrameView.h: Added a prepareMouseEvent() helper that does viewportToContents translation.
        * page/FrameView.cpp: Added data members for storing the previous node and subframe
        under the mouse to FrameViewPrivate. Removed the now unused prevMouseX/prevMouseY.
        (WebCore::FrameViewPrivate::reset): Reset the new data members.
        (WebCore::subframeForEvent): A temporary place for the code that extracts a subframe
        pointer from MouseEventWithHitTestResults, moved from FrameMac::passSubframeEventToSubframe().
        (WebCore::FrameView::prepareMouseEvent): The new helper.
        (WebCore::FrameView::handleMousePressEvent): Use the new helper.
        (WebCore::FrameView::handleMouseDoubleClickEvent): Ditto.
        (WebCore::FrameView::handleMouseReleaseEvent): Ditto.
        (WebCore::FrameView::updateDragAndDrop): Ditto.
        (WebCore::FrameView::hoverTimerFired): Ditto.
        (WebCore::FrameView::dispatchMouseEvent): Store and use the oldUnder node, don't store
        or use prevMouseX/Y.
        (WebCore::FrameView::handleMouseMoveEvent): Rewrote dispatching events to subframes using
        a stored oldSubframe reference. Protect "this" from being removed while in this function.

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@13402 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/fast/events/mouseover-mouseout-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/mouseover-mouseout.html [new file with mode: 0644]
LayoutTests/fast/events/mouseover-mouseout2-expected.txt [new file with mode: 0644]
LayoutTests/fast/events/mouseover-mouseout2.html [new file with mode: 0644]
WebCore/ChangeLog
WebCore/bridge/mac/FrameMac.h
WebCore/bridge/mac/FrameMac.mm
WebCore/page/Frame.h
WebCore/page/FrameView.cpp
WebCore/page/FrameView.h