Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(9)

Side by Side Diff: third_party/WebKit/Source/core/input/EventHandler.cpp

Issue 1960233002: Fix mouse pointer event clientX/Y (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed. 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011 Apple Inc. All rights reserv ed.
3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org)
4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies)
5 * 5 *
6 * Redistribution and use in source and binary forms, with or without 6 * Redistribution and use in source and binary forms, with or without
7 * modification, are permitted provided that the following conditions 7 * modification, are permitted provided that the following conditions
8 * are met: 8 * are met:
9 * 1. Redistributions of source code must retain the above copyright 9 * 1. Redistributions of source code must retain the above copyright
10 * notice, this list of conditions and the following disclaimer. 10 * notice, this list of conditions and the following disclaimer.
(...skipping 1705 matching lines...) Expand 10 before | Expand all | Expand 10 after
1716 1716
1717 return lastNodeUnderMouse; 1717 return lastNodeUnderMouse;
1718 } 1718 }
1719 1719
1720 void EventHandler::updateMouseEventTargetNodeAndSendEvents(Node* targetNode, 1720 void EventHandler::updateMouseEventTargetNodeAndSendEvents(Node* targetNode,
1721 const PlatformMouseEvent& mouseEvent, bool isFrameBoundaryTransition) 1721 const PlatformMouseEvent& mouseEvent, bool isFrameBoundaryTransition)
1722 { 1722 {
1723 Node* lastNodeUnderMouse = updateMouseEventTargetNode(targetNode, mouseEvent ); 1723 Node* lastNodeUnderMouse = updateMouseEventTargetNode(targetNode, mouseEvent );
1724 m_pointerEventManager.sendMouseAndPossiblyPointerNodeTransitionEvents( 1724 m_pointerEventManager.sendMouseAndPossiblyPointerNodeTransitionEvents(
1725 lastNodeUnderMouse, m_nodeUnderMouse, mouseEvent, 1725 lastNodeUnderMouse, m_nodeUnderMouse, mouseEvent,
1726 m_frame->document()->domWindow(), isFrameBoundaryTransition); 1726 isFrameBoundaryTransition);
1727 } 1727 }
1728 1728
1729 WebInputEventResult EventHandler::dispatchMouseEvent(const AtomicString& eventTy pe, Node* targetNode, int clickCount, const PlatformMouseEvent& mouseEvent) 1729 WebInputEventResult EventHandler::dispatchMouseEvent(const AtomicString& eventTy pe, Node* targetNode, int clickCount, const PlatformMouseEvent& mouseEvent)
1730 { 1730 {
1731 updateMouseEventTargetNodeAndSendEvents(targetNode, mouseEvent); 1731 updateMouseEventTargetNodeAndSendEvents(targetNode, mouseEvent);
1732 if (!m_nodeUnderMouse) 1732 if (!m_nodeUnderMouse)
1733 return WebInputEventResult::NotHandled; 1733 return WebInputEventResult::NotHandled;
1734 1734
1735 MouseEvent* event = MouseEvent::create(eventType, m_nodeUnderMouse->document ().domWindow(), mouseEvent, clickCount, nullptr); 1735 MouseEvent* event = MouseEvent::create(eventType, m_nodeUnderMouse->document ().domWindow(), mouseEvent, clickCount, nullptr);
1736 return toWebInputEventResult(m_nodeUnderMouse->dispatchEvent(event)); 1736 return toWebInputEventResult(m_nodeUnderMouse->dispatchEvent(event));
(...skipping 29 matching lines...) Expand all
1766 WebInputEventResult EventHandler::updatePointerTargetAndDispatchEvents(const Ato micString& mouseEventType, Node* targetNode, int clickCount, const PlatformMouse Event& mouseEvent) 1766 WebInputEventResult EventHandler::updatePointerTargetAndDispatchEvents(const Ato micString& mouseEventType, Node* targetNode, int clickCount, const PlatformMouse Event& mouseEvent)
1767 { 1767 {
1768 ASSERT(mouseEventType == EventTypeNames::mousedown 1768 ASSERT(mouseEventType == EventTypeNames::mousedown
1769 || mouseEventType == EventTypeNames::mousemove 1769 || mouseEventType == EventTypeNames::mousemove
1770 || mouseEventType == EventTypeNames::mouseup); 1770 || mouseEventType == EventTypeNames::mouseup);
1771 1771
1772 Node* lastNodeUnderMouse = updateMouseEventTargetNode(targetNode, mouseEvent ); 1772 Node* lastNodeUnderMouse = updateMouseEventTargetNode(targetNode, mouseEvent );
1773 1773
1774 return m_pointerEventManager.sendMousePointerEvent( 1774 return m_pointerEventManager.sendMousePointerEvent(
1775 m_nodeUnderMouse, mouseEventType, clickCount, mouseEvent, nullptr, 1775 m_nodeUnderMouse, mouseEventType, clickCount, mouseEvent, nullptr,
1776 m_frame->document()->domWindow(), lastNodeUnderMouse); 1776 lastNodeUnderMouse);
1777 } 1777 }
1778 1778
1779 WebInputEventResult EventHandler::handleMouseFocus(const MouseEventWithHitTestRe sults& targetedEvent, InputDeviceCapabilities* sourceCapabilities) 1779 WebInputEventResult EventHandler::handleMouseFocus(const MouseEventWithHitTestRe sults& targetedEvent, InputDeviceCapabilities* sourceCapabilities)
1780 { 1780 {
1781 // If clicking on a frame scrollbar, do not mess up with content focus. 1781 // If clicking on a frame scrollbar, do not mess up with content focus.
1782 if (targetedEvent.hitTestResult().scrollbar() && !m_frame->contentLayoutItem ().isNull()) { 1782 if (targetedEvent.hitTestResult().scrollbar() && !m_frame->contentLayoutItem ().isNull()) {
1783 if (targetedEvent.hitTestResult().scrollbar()->getScrollableArea() == m_ frame->contentLayoutItem().getScrollableArea()) 1783 if (targetedEvent.hitTestResult().scrollbar()->getScrollableArea() == m_ frame->contentLayoutItem().getScrollableArea())
1784 return WebInputEventResult::NotHandled; 1784 return WebInputEventResult::NotHandled;
1785 } 1785 }
1786 1786
(...skipping 1921 matching lines...) Expand 10 before | Expand all | Expand 10 after
3708 3708
3709 FrameHost* EventHandler::frameHost() 3709 FrameHost* EventHandler::frameHost()
3710 { 3710 {
3711 if (!m_frame->page()) 3711 if (!m_frame->page())
3712 return nullptr; 3712 return nullptr;
3713 3713
3714 return &m_frame->page()->frameHost(); 3714 return &m_frame->page()->frameHost();
3715 } 3715 }
3716 3716
3717 } // namespace blink 3717 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698