Commit c46ef479 authored by mustaq@chromium.org's avatar mustaq@chromium.org

Removed a redundant mouse-state from EventHandler.

EventHandler currently have two state vars for tracking
node under mouse: m_nodeUnderMouse and m_lastNodeUnderMouse.
These two pointers are used primarily for mouse entry/exit
events, but they point to the same node until we are about
to send mouseenter/leave/over/out events. In the few cases
these pointers become unequal otherwise (happens only when
dispathMouseEvent is called with setUnder=false), it is not
clear why we didn't update the old state. My experiments
suggest that updating the old state doesn't hurt in these
cases. So it makes sense to nuke the m_lastNodeUnderMouse
state.

BUG=

Review URL: https://codereview.chromium.org/1293973004

git-svn-id: svn://svn.chromium.org/blink/trunk@201023 bbb929c8-8fbe-4397-9dbb-9b2b20218538
parent 9bb0d546
...@@ -279,14 +279,14 @@ private: ...@@ -279,14 +279,14 @@ private:
void invalidateClick(); void invalidateClick();
void updateMouseEventTargetNode(Node*, const PlatformMouseEvent&, bool); void updateMouseEventTargetNode(Node*, const PlatformMouseEvent&);
/* Dispatches mouseover, mouseout, mouseenter and mouseleave events to appropriate nodes when the mouse pointer moves from one node to another. */ /* Dispatches mouseover, mouseout, mouseenter and mouseleave events to appropriate nodes when the mouse pointer moves from one node to another. */
void sendMouseEventsForNodeTransition(Node*, Node*, const PlatformMouseEvent&); void sendMouseEventsForNodeTransition(Node*, Node*, const PlatformMouseEvent&);
MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const PlatformMouseEvent&); MouseEventWithHitTestResults prepareMouseEvent(const HitTestRequest&, const PlatformMouseEvent&);
bool dispatchMouseEvent(const AtomicString& eventType, Node* target, int clickCount, const PlatformMouseEvent&, bool setUnder); bool dispatchMouseEvent(const AtomicString& eventType, Node* target, int clickCount, const PlatformMouseEvent&);
bool dispatchDragEvent(const AtomicString& eventType, Node* target, const PlatformMouseEvent&, DataTransfer*); bool dispatchDragEvent(const AtomicString& eventType, Node* target, const PlatformMouseEvent&, DataTransfer*);
void clearDragDataTransfer(); void clearDragDataTransfer();
...@@ -372,7 +372,6 @@ private: ...@@ -372,7 +372,6 @@ private:
bool m_eventHandlerWillResetCapturingMouseEventsNode; bool m_eventHandlerWillResetCapturingMouseEventsNode;
RefPtrWillBeMember<Node> m_nodeUnderMouse; RefPtrWillBeMember<Node> m_nodeUnderMouse;
RefPtrWillBeMember<Node> m_lastNodeUnderMouse;
RefPtrWillBeMember<LocalFrame> m_lastMouseMoveEventSubframe; RefPtrWillBeMember<LocalFrame> m_lastMouseMoveEventSubframe;
RefPtrWillBeMember<Scrollbar> m_lastScrollbarUnderMouse; RefPtrWillBeMember<Scrollbar> m_lastScrollbarUnderMouse;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment