Chromium Code Reviews| OLD | NEW |
|---|---|
| 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 291 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 302 { | 302 { |
| 303 if (nodeToBeRemoved.isShadowIncludingInclusiveAncestorOf(m_clickNode.get())) { | 303 if (nodeToBeRemoved.isShadowIncludingInclusiveAncestorOf(m_clickNode.get())) { |
| 304 // We don't dispatch click events if the mousedown node is removed | 304 // We don't dispatch click events if the mousedown node is removed |
| 305 // before a mouseup event. It is compatible with IE and Firefox. | 305 // before a mouseup event. It is compatible with IE and Firefox. |
| 306 m_clickNode = nullptr; | 306 m_clickNode = nullptr; |
| 307 } | 307 } |
| 308 } | 308 } |
| 309 | 309 |
| 310 void EventHandler::immediatelyProcessPendingPointerCapture(int pointerId) | 310 void EventHandler::immediatelyProcessPendingPointerCapture(int pointerId) |
| 311 { | 311 { |
| 312 m_pointerEventManager.immediatelyProcessPendingPointerCapture(pointerId); | 312 m_pointerEventManager.processPendingPointerCapture(pointerId); |
| 313 } | 313 } |
| 314 | 314 |
| 315 WebInputEventResult EventHandler::handleMousePressEvent(const MouseEventWithHitT estResults& event) | 315 WebInputEventResult EventHandler::handleMousePressEvent(const MouseEventWithHitT estResults& event) |
| 316 { | 316 { |
| 317 TRACE_EVENT0("blink", "EventHandler::handleMousePressEvent"); | 317 TRACE_EVENT0("blink", "EventHandler::handleMousePressEvent"); |
| 318 | 318 |
| 319 // Reset drag state. | 319 // Reset drag state. |
| 320 dragState().m_dragSrc = nullptr; | 320 dragState().m_dragSrc = nullptr; |
| 321 | 321 |
| 322 cancelFakeMouseMoveEvent(); | 322 cancelFakeMouseMoveEvent(); |
| (...skipping 1078 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 1401 { | 1401 { |
| 1402 ASSERT(m_frame); | 1402 ASSERT(m_frame); |
| 1403 ASSERT(m_frame->document()); | 1403 ASSERT(m_frame->document()); |
| 1404 | 1404 |
| 1405 return m_frame->document()->prepareMouseEvent(request, contentPointFromRootF rame(m_frame, mev.position()), mev); | 1405 return m_frame->document()->prepareMouseEvent(request, contentPointFromRootF rame(m_frame, mev.position()), mev); |
| 1406 } | 1406 } |
| 1407 | 1407 |
| 1408 Node* EventHandler::updateMouseEventTargetNode(Node* targetNode, | 1408 Node* EventHandler::updateMouseEventTargetNode(Node* targetNode, |
| 1409 const PlatformMouseEvent& mouseEvent) | 1409 const PlatformMouseEvent& mouseEvent) |
| 1410 { | 1410 { |
| 1411 Node* result = targetNode; | 1411 Node* result = targetNode; |
|
mustaq
2016/07/22 16:01:01
s/result/newNodeUnderMouse
Navid Zolghadr
2016/07/22 16:39:23
Done.
| |
| 1412 | 1412 |
| 1413 // If we're capturing, we always go right to that node. | 1413 // If we're capturing, we always go right to that node. |
| 1414 if (m_capturingMouseEventsNode) { | 1414 if (EventTarget* tmp = m_pointerEventManager.getMouseCapturingNode()) { |
|
dtapuska
2016/07/22 15:57:39
You are going to have to use a better name than tm
Navid Zolghadr
2016/07/22 16:39:23
Done. :)
| |
| 1415 result = tmp->toNode(); | |
| 1416 DCHECK(result); | |
| 1417 } else if (m_capturingMouseEventsNode) { | |
| 1415 result = m_capturingMouseEventsNode.get(); | 1418 result = m_capturingMouseEventsNode.get(); |
| 1416 } else { | 1419 } else { |
| 1417 // If the target node is a text node, dispatch on the parent node - rdar ://4196646 | 1420 // If the target node is a text node, dispatch on the parent node - rdar ://4196646 |
| 1418 if (result && result->isTextNode()) | 1421 if (result && result->isTextNode()) |
| 1419 result = FlatTreeTraversal::parent(*result); | 1422 result = FlatTreeTraversal::parent(*result); |
| 1420 } | 1423 } |
| 1421 Node* lastNodeUnderMouse = m_nodeUnderMouse; | 1424 Node* lastNodeUnderMouse = m_nodeUnderMouse; |
| 1422 m_nodeUnderMouse = result; | 1425 m_nodeUnderMouse = result; |
| 1423 | 1426 |
| 1424 PaintLayer* layerForLastNode = layerForNode(lastNodeUnderMouse); | 1427 PaintLayer* layerForLastNode = layerForNode(lastNodeUnderMouse); |
| (...skipping 1160 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2585 | 2588 |
| 2586 FrameHost* EventHandler::frameHost() const | 2589 FrameHost* EventHandler::frameHost() const |
| 2587 { | 2590 { |
| 2588 if (!m_frame->page()) | 2591 if (!m_frame->page()) |
| 2589 return nullptr; | 2592 return nullptr; |
| 2590 | 2593 |
| 2591 return &m_frame->page()->frameHost(); | 2594 return &m_frame->page()->frameHost(); |
| 2592 } | 2595 } |
| 2593 | 2596 |
| 2594 } // namespace blink | 2597 } // namespace blink |
| OLD | NEW |