| 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 17 matching lines...) Expand all Loading... |
| 28 #include "core/input/EventHandler.h" | 28 #include "core/input/EventHandler.h" |
| 29 | 29 |
| 30 #include "bindings/core/v8/ExceptionStatePlaceholder.h" | 30 #include "bindings/core/v8/ExceptionStatePlaceholder.h" |
| 31 #include "core/HTMLNames.h" | 31 #include "core/HTMLNames.h" |
| 32 #include "core/InputTypeNames.h" | 32 #include "core/InputTypeNames.h" |
| 33 #include "core/clipboard/DataObject.h" | 33 #include "core/clipboard/DataObject.h" |
| 34 #include "core/clipboard/DataTransfer.h" | 34 #include "core/clipboard/DataTransfer.h" |
| 35 #include "core/dom/DOMNodeIds.h" | 35 #include "core/dom/DOMNodeIds.h" |
| 36 #include "core/dom/Document.h" | 36 #include "core/dom/Document.h" |
| 37 #include "core/dom/TouchList.h" | 37 #include "core/dom/TouchList.h" |
| 38 #include "core/dom/shadow/ComposedTreeTraversal.h" | 38 #include "core/dom/shadow/FlatTreeTraversal.h" |
| 39 #include "core/dom/shadow/ShadowRoot.h" | 39 #include "core/dom/shadow/ShadowRoot.h" |
| 40 #include "core/editing/Editor.h" | 40 #include "core/editing/Editor.h" |
| 41 #include "core/editing/FrameSelection.h" | 41 #include "core/editing/FrameSelection.h" |
| 42 #include "core/editing/SelectionController.h" | 42 #include "core/editing/SelectionController.h" |
| 43 #include "core/events/DragEvent.h" | 43 #include "core/events/DragEvent.h" |
| 44 #include "core/events/EventPath.h" | 44 #include "core/events/EventPath.h" |
| 45 #include "core/events/GestureEvent.h" | 45 #include "core/events/GestureEvent.h" |
| 46 #include "core/events/KeyboardEvent.h" | 46 #include "core/events/KeyboardEvent.h" |
| 47 #include "core/events/MouseEvent.h" | 47 #include "core/events/MouseEvent.h" |
| 48 #include "core/events/PointerEvent.h" | 48 #include "core/events/PointerEvent.h" |
| (...skipping 471 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 520 | 520 |
| 521 if (handleDrag(event, DragInitiator::Mouse)) | 521 if (handleDrag(event, DragInitiator::Mouse)) |
| 522 return WebInputEventResult::HandledSystem; | 522 return WebInputEventResult::HandledSystem; |
| 523 | 523 |
| 524 Node* targetNode = event.innerNode(); | 524 Node* targetNode = event.innerNode(); |
| 525 if (!targetNode) | 525 if (!targetNode) |
| 526 return WebInputEventResult::NotHandled; | 526 return WebInputEventResult::NotHandled; |
| 527 | 527 |
| 528 LayoutObject* layoutObject = targetNode->layoutObject(); | 528 LayoutObject* layoutObject = targetNode->layoutObject(); |
| 529 if (!layoutObject) { | 529 if (!layoutObject) { |
| 530 Node* parent = ComposedTreeTraversal::parent(*targetNode); | 530 Node* parent = FlatTreeTraversal::parent(*targetNode); |
| 531 if (!parent) | 531 if (!parent) |
| 532 return WebInputEventResult::NotHandled; | 532 return WebInputEventResult::NotHandled; |
| 533 | 533 |
| 534 layoutObject = parent->layoutObject(); | 534 layoutObject = parent->layoutObject(); |
| 535 if (!layoutObject || !layoutObject->isListBox()) | 535 if (!layoutObject || !layoutObject->isListBox()) |
| 536 return WebInputEventResult::NotHandled; | 536 return WebInputEventResult::NotHandled; |
| 537 } | 537 } |
| 538 | 538 |
| 539 m_mouseDownMayStartDrag = false; | 539 m_mouseDownMayStartDrag = false; |
| 540 | 540 |
| (...skipping 506 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1047 stopAutoscroll(); | 1047 stopAutoscroll(); |
| 1048 if (isPanScrollInProgress) { | 1048 if (isPanScrollInProgress) { |
| 1049 // We invalidate the click when exiting pan scrolling so that we don't i
nadvertently navigate | 1049 // We invalidate the click when exiting pan scrolling so that we don't i
nadvertently navigate |
| 1050 // away from the current page (e.g. the click was on a hyperlink). See <
rdar://problem/6095023>. | 1050 // away from the current page (e.g. the click was on a hyperlink). See <
rdar://problem/6095023>. |
| 1051 invalidateClick(); | 1051 invalidateClick(); |
| 1052 return WebInputEventResult::HandledSuppressed; | 1052 return WebInputEventResult::HandledSuppressed; |
| 1053 } | 1053 } |
| 1054 #endif | 1054 #endif |
| 1055 | 1055 |
| 1056 m_clickCount = mouseEvent.clickCount(); | 1056 m_clickCount = mouseEvent.clickCount(); |
| 1057 m_clickNode = mev.innerNode()->isTextNode() ? ComposedTreeTraversal::parent
(*mev.innerNode()) : mev.innerNode(); | 1057 m_clickNode = mev.innerNode()->isTextNode() ? FlatTreeTraversal::parent(*me
v.innerNode()) : mev.innerNode(); |
| 1058 | 1058 |
| 1059 m_frame->selection().setCaretBlinkingSuspended(true); | 1059 m_frame->selection().setCaretBlinkingSuspended(true); |
| 1060 | 1060 |
| 1061 WebInputEventResult eventResult = updatePointerTargetAndDispatchEvents(Event
TypeNames::mousedown, mev.innerNode(), m_clickCount, mouseEvent); | 1061 WebInputEventResult eventResult = updatePointerTargetAndDispatchEvents(Event
TypeNames::mousedown, mev.innerNode(), m_clickCount, mouseEvent); |
| 1062 | 1062 |
| 1063 if (eventResult == WebInputEventResult::NotHandled && m_frame->view()) { | 1063 if (eventResult == WebInputEventResult::NotHandled && m_frame->view()) { |
| 1064 FrameView* view = m_frame->view(); | 1064 FrameView* view = m_frame->view(); |
| 1065 PaintLayer* layer = mev.innerNode()->layoutObject() ? mev.innerNode()->l
ayoutObject()->enclosingLayer() : nullptr; | 1065 PaintLayer* layer = mev.innerNode()->layoutObject() ? mev.innerNode()->l
ayoutObject()->enclosingLayer() : nullptr; |
| 1066 IntPoint p = view->rootFrameToContents(mouseEvent.position()); | 1066 IntPoint p = view->rootFrameToContents(mouseEvent.position()); |
| 1067 if (layer && layer->scrollableArea() && layer->scrollableArea()->isPoint
InResizeControl(p, ResizerForPointer)) { | 1067 if (layer && layer->scrollableArea() && layer->scrollableArea()->isPoint
InResizeControl(p, ResizerForPointer)) { |
| (...skipping 232 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1300 m_clickNode = nullptr; | 1300 m_clickNode = nullptr; |
| 1301 } | 1301 } |
| 1302 | 1302 |
| 1303 static ContainerNode* parentForClickEvent(const Node& node) | 1303 static ContainerNode* parentForClickEvent(const Node& node) |
| 1304 { | 1304 { |
| 1305 // IE doesn't dispatch click events for mousedown/mouseup events across form | 1305 // IE doesn't dispatch click events for mousedown/mouseup events across form |
| 1306 // controls. | 1306 // controls. |
| 1307 if (node.isHTMLElement() && toHTMLElement(node).isInteractiveContent()) | 1307 if (node.isHTMLElement() && toHTMLElement(node).isInteractiveContent()) |
| 1308 return nullptr; | 1308 return nullptr; |
| 1309 | 1309 |
| 1310 return ComposedTreeTraversal::parent(node); | 1310 return FlatTreeTraversal::parent(node); |
| 1311 } | 1311 } |
| 1312 | 1312 |
| 1313 WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve
nt& mouseEvent) | 1313 WebInputEventResult EventHandler::handleMouseReleaseEvent(const PlatformMouseEve
nt& mouseEvent) |
| 1314 { | 1314 { |
| 1315 TRACE_EVENT0("blink", "EventHandler::handleMouseReleaseEvent"); | 1315 TRACE_EVENT0("blink", "EventHandler::handleMouseReleaseEvent"); |
| 1316 | 1316 |
| 1317 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view()); | 1317 RefPtrWillBeRawPtr<FrameView> protector(m_frame->view()); |
| 1318 | 1318 |
| 1319 m_frame->selection().setCaretBlinkingSuspended(false); | 1319 m_frame->selection().setCaretBlinkingSuspended(false); |
| 1320 | 1320 |
| (...skipping 45 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1366 m_preventMouseEventForPointerTypeMouse = false; | 1366 m_preventMouseEventForPointerTypeMouse = false; |
| 1367 | 1367 |
| 1368 bool contextMenuEvent = mouseEvent.button() == RightButton; | 1368 bool contextMenuEvent = mouseEvent.button() == RightButton; |
| 1369 #if OS(MACOSX) | 1369 #if OS(MACOSX) |
| 1370 // FIXME: The Mac port achieves the same behavior by checking whether the co
ntext menu is currently open in WebPage::mouseEvent(). Consider merging the impl
ementations. | 1370 // FIXME: The Mac port achieves the same behavior by checking whether the co
ntext menu is currently open in WebPage::mouseEvent(). Consider merging the impl
ementations. |
| 1371 if (mouseEvent.button() == LeftButton && mouseEvent.modifiers() & PlatformEv
ent::CtrlKey) | 1371 if (mouseEvent.button() == LeftButton && mouseEvent.modifiers() & PlatformEv
ent::CtrlKey) |
| 1372 contextMenuEvent = true; | 1372 contextMenuEvent = true; |
| 1373 #endif | 1373 #endif |
| 1374 | 1374 |
| 1375 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled; | 1375 WebInputEventResult clickEventResult = WebInputEventResult::NotHandled; |
| 1376 if (m_clickCount > 0 && !contextMenuEvent && mev.innerNode() && m_clickNode
&& mev.innerNode()->canParticipateInComposedTree() && m_clickNode->canParticipat
eInComposedTree()) { | 1376 if (m_clickCount > 0 && !contextMenuEvent && mev.innerNode() && m_clickNode
&& mev.innerNode()->canParticipateInFlatTree() && m_clickNode->canParticipateInF
latTree()) { |
| 1377 // Updates distribution because a 'mouseup' event listener can make the | 1377 // Updates distribution because a 'mouseup' event listener can make the |
| 1378 // tree dirty at dispatchMouseEvent() invocation above. | 1378 // tree dirty at dispatchMouseEvent() invocation above. |
| 1379 // Unless distribution is updated, commonAncestor would hit ASSERT. | 1379 // Unless distribution is updated, commonAncestor would hit ASSERT. |
| 1380 // Both m_clickNode and mev.innerNode() don't need to be updated | 1380 // Both m_clickNode and mev.innerNode() don't need to be updated |
| 1381 // because commonAncestor() will exit early if their documents are diffe
rent. | 1381 // because commonAncestor() will exit early if their documents are diffe
rent. |
| 1382 m_clickNode->updateDistribution(); | 1382 m_clickNode->updateDistribution(); |
| 1383 if (Node* clickTargetNode = mev.innerNode()->commonAncestor( | 1383 if (Node* clickTargetNode = mev.innerNode()->commonAncestor( |
| 1384 *m_clickNode, parentForClickEvent)) { | 1384 *m_clickNode, parentForClickEvent)) { |
| 1385 | 1385 |
| 1386 // Dispatch mouseup directly w/o calling updateMouseEventTargetNode | 1386 // Dispatch mouseup directly w/o calling updateMouseEventTargetNode |
| (...skipping 97 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1484 | 1484 |
| 1485 if (!m_frame->view()) | 1485 if (!m_frame->view()) |
| 1486 return eventResult; | 1486 return eventResult; |
| 1487 | 1487 |
| 1488 HitTestRequest request(HitTestRequest::ReadOnly); | 1488 HitTestRequest request(HitTestRequest::ReadOnly); |
| 1489 MouseEventWithHitTestResults mev = prepareMouseEvent(request, event); | 1489 MouseEventWithHitTestResults mev = prepareMouseEvent(request, event); |
| 1490 | 1490 |
| 1491 // Drag events should never go to text nodes (following IE, and proper mouse
over/out dispatch) | 1491 // Drag events should never go to text nodes (following IE, and proper mouse
over/out dispatch) |
| 1492 RefPtrWillBeRawPtr<Node> newTarget = mev.innerNode(); | 1492 RefPtrWillBeRawPtr<Node> newTarget = mev.innerNode(); |
| 1493 if (newTarget && newTarget->isTextNode()) | 1493 if (newTarget && newTarget->isTextNode()) |
| 1494 newTarget = ComposedTreeTraversal::parent(*newTarget); | 1494 newTarget = FlatTreeTraversal::parent(*newTarget); |
| 1495 | 1495 |
| 1496 if (AutoscrollController* controller = autoscrollController()) | 1496 if (AutoscrollController* controller = autoscrollController()) |
| 1497 controller->updateDragAndDrop(newTarget.get(), event.position(), event.t
imestamp()); | 1497 controller->updateDragAndDrop(newTarget.get(), event.position(), event.t
imestamp()); |
| 1498 | 1498 |
| 1499 if (m_dragTarget != newTarget) { | 1499 if (m_dragTarget != newTarget) { |
| 1500 // FIXME: this ordering was explicitly chosen to match WinIE. However, | 1500 // FIXME: this ordering was explicitly chosen to match WinIE. However, |
| 1501 // it is sometimes incorrect when dragging within subframes, as seen wit
h | 1501 // it is sometimes incorrect when dragging within subframes, as seen wit
h |
| 1502 // LayoutTests/fast/events/drag-in-frames.html. | 1502 // LayoutTests/fast/events/drag-in-frames.html. |
| 1503 // | 1503 // |
| 1504 // Moreover, this ordering conforms to section 7.9.4 of the HTML 5 spec.
<http://dev.w3.org/html5/spec/Overview.html#drag-and-drop-processing-model>. | 1504 // Moreover, this ordering conforms to section 7.9.4 of the HTML 5 spec.
<http://dev.w3.org/html5/spec/Overview.html#drag-and-drop-processing-model>. |
| (...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1604 void EventHandler::updateMouseEventTargetNode(Node* targetNode, const PlatformMo
useEvent& mouseEvent) | 1604 void EventHandler::updateMouseEventTargetNode(Node* targetNode, const PlatformMo
useEvent& mouseEvent) |
| 1605 { | 1605 { |
| 1606 Node* result = targetNode; | 1606 Node* result = targetNode; |
| 1607 | 1607 |
| 1608 // If we're capturing, we always go right to that node. | 1608 // If we're capturing, we always go right to that node. |
| 1609 if (m_capturingMouseEventsNode) { | 1609 if (m_capturingMouseEventsNode) { |
| 1610 result = m_capturingMouseEventsNode.get(); | 1610 result = m_capturingMouseEventsNode.get(); |
| 1611 } else { | 1611 } else { |
| 1612 // If the target node is a text node, dispatch on the parent node - rdar
://4196646 | 1612 // If the target node is a text node, dispatch on the parent node - rdar
://4196646 |
| 1613 if (result && result->isTextNode()) | 1613 if (result && result->isTextNode()) |
| 1614 result = ComposedTreeTraversal::parent(*result); | 1614 result = FlatTreeTraversal::parent(*result); |
| 1615 } | 1615 } |
| 1616 RefPtrWillBeMember<Node> lastNodeUnderMouse = m_nodeUnderMouse; | 1616 RefPtrWillBeMember<Node> lastNodeUnderMouse = m_nodeUnderMouse; |
| 1617 m_nodeUnderMouse = result; | 1617 m_nodeUnderMouse = result; |
| 1618 | 1618 |
| 1619 PaintLayer* layerForLastNode = layerForNode(lastNodeUnderMouse.get()); | 1619 PaintLayer* layerForLastNode = layerForNode(lastNodeUnderMouse.get()); |
| 1620 PaintLayer* layerForNodeUnderMouse = layerForNode(m_nodeUnderMouse.get()); | 1620 PaintLayer* layerForNodeUnderMouse = layerForNode(m_nodeUnderMouse.get()); |
| 1621 Page* page = m_frame->page(); | 1621 Page* page = m_frame->page(); |
| 1622 | 1622 |
| 1623 if (lastNodeUnderMouse && (!m_nodeUnderMouse || m_nodeUnderMouse->document()
!= m_frame->document())) { | 1623 if (lastNodeUnderMouse && (!m_nodeUnderMouse || m_nodeUnderMouse->document()
!= m_frame->document())) { |
| 1624 // The mouse has moved between frames. | 1624 // The mouse has moved between frames. |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1684 // listeners" at http://www.w3.org/TR/uievents), but our code below preserve
s one such behavior from past only to | 1684 // listeners" at http://www.w3.org/TR/uievents), but our code below preserve
s one such behavior from past only to |
| 1685 // match Firefox and IE behavior. | 1685 // match Firefox and IE behavior. |
| 1686 // | 1686 // |
| 1687 // TODO(mustaq): Confirm spec conformance, double-check with other browsers. | 1687 // TODO(mustaq): Confirm spec conformance, double-check with other browsers. |
| 1688 | 1688 |
| 1689 // Create lists of all exited/entered ancestors, locate the common ancestor
& capturing listeners. | 1689 // Create lists of all exited/entered ancestors, locate the common ancestor
& capturing listeners. |
| 1690 WillBeHeapVector<RefPtrWillBeMember<Node>, 32> exitedAncestors; | 1690 WillBeHeapVector<RefPtrWillBeMember<Node>, 32> exitedAncestors; |
| 1691 WillBeHeapVector<RefPtrWillBeMember<Node>, 32> enteredAncestors; | 1691 WillBeHeapVector<RefPtrWillBeMember<Node>, 32> enteredAncestors; |
| 1692 if (isNodeInDocument(exitedNode)) { | 1692 if (isNodeInDocument(exitedNode)) { |
| 1693 exitedNode->updateDistribution(); | 1693 exitedNode->updateDistribution(); |
| 1694 for (Node* node = exitedNode; node; node = ComposedTreeTraversal::parent
(*node)) { | 1694 for (Node* node = exitedNode; node; node = FlatTreeTraversal::parent(*no
de)) { |
| 1695 exitedAncestors.append(node); | 1695 exitedAncestors.append(node); |
| 1696 } | 1696 } |
| 1697 } | 1697 } |
| 1698 if (isNodeInDocument(enteredNode)) { | 1698 if (isNodeInDocument(enteredNode)) { |
| 1699 enteredNode->updateDistribution(); | 1699 enteredNode->updateDistribution(); |
| 1700 for (Node* node = enteredNode; node; node = ComposedTreeTraversal::paren
t(*node)) { | 1700 for (Node* node = enteredNode; node; node = FlatTreeTraversal::parent(*n
ode)) { |
| 1701 enteredAncestors.append(node); | 1701 enteredAncestors.append(node); |
| 1702 } | 1702 } |
| 1703 } | 1703 } |
| 1704 | 1704 |
| 1705 size_t numExitedAncestors = exitedAncestors.size(); | 1705 size_t numExitedAncestors = exitedAncestors.size(); |
| 1706 size_t numEnteredAncestors = enteredAncestors.size(); | 1706 size_t numEnteredAncestors = enteredAncestors.size(); |
| 1707 | 1707 |
| 1708 size_t exitedAncestorIndex = numExitedAncestors; | 1708 size_t exitedAncestorIndex = numExitedAncestors; |
| 1709 size_t enteredAncestorIndex = numEnteredAncestors; | 1709 size_t enteredAncestorIndex = numEnteredAncestors; |
| 1710 for (size_t j = 0; j < numExitedAncestors; j++) { | 1710 for (size_t j = 0; j < numExitedAncestors; j++) { |
| (...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1969 | 1969 |
| 1970 LayoutPoint vPoint = view->rootFrameToContents(event.position()); | 1970 LayoutPoint vPoint = view->rootFrameToContents(event.position()); |
| 1971 | 1971 |
| 1972 HitTestRequest request(HitTestRequest::ReadOnly); | 1972 HitTestRequest request(HitTestRequest::ReadOnly); |
| 1973 HitTestResult result(request, vPoint); | 1973 HitTestResult result(request, vPoint); |
| 1974 doc->layoutView()->hitTest(result); | 1974 doc->layoutView()->hitTest(result); |
| 1975 | 1975 |
| 1976 Node* node = result.innerNode(); | 1976 Node* node = result.innerNode(); |
| 1977 // Wheel events should not dispatch to text nodes. | 1977 // Wheel events should not dispatch to text nodes. |
| 1978 if (node && node->isTextNode()) | 1978 if (node && node->isTextNode()) |
| 1979 node = ComposedTreeTraversal::parent(*node); | 1979 node = FlatTreeTraversal::parent(*node); |
| 1980 | 1980 |
| 1981 if (m_previousWheelScrolledNode) | 1981 if (m_previousWheelScrolledNode) |
| 1982 m_previousWheelScrolledNode = nullptr; | 1982 m_previousWheelScrolledNode = nullptr; |
| 1983 | 1983 |
| 1984 bool isOverWidget = result.isOverWidget(); | 1984 bool isOverWidget = result.isOverWidget(); |
| 1985 | 1985 |
| 1986 if (node) { | 1986 if (node) { |
| 1987 // Figure out which view to send the event to. | 1987 // Figure out which view to send the event to. |
| 1988 LayoutObject* target = node->layoutObject(); | 1988 LayoutObject* target = node->layoutObject(); |
| 1989 | 1989 |
| (...skipping 281 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 2271 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); | 2271 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); |
| 2272 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); | 2272 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); |
| 2273 } | 2273 } |
| 2274 m_clickNode = currentHitTest.innerNode(); | 2274 m_clickNode = currentHitTest.innerNode(); |
| 2275 | 2275 |
| 2276 // Capture data for showUnhandledTapUIIfNeeded. | 2276 // Capture data for showUnhandledTapUIIfNeeded. |
| 2277 RefPtrWillBeRawPtr<Node> tappedNode = m_clickNode; | 2277 RefPtrWillBeRawPtr<Node> tappedNode = m_clickNode; |
| 2278 IntPoint tappedPosition = gestureEvent.position(); | 2278 IntPoint tappedPosition = gestureEvent.position(); |
| 2279 | 2279 |
| 2280 if (m_clickNode && m_clickNode->isTextNode()) | 2280 if (m_clickNode && m_clickNode->isTextNode()) |
| 2281 m_clickNode = ComposedTreeTraversal::parent(*m_clickNode); | 2281 m_clickNode = FlatTreeTraversal::parent(*m_clickNode); |
| 2282 | 2282 |
| 2283 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa
lPosition(), | 2283 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa
lPosition(), |
| 2284 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(), | 2284 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(), |
| 2285 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::LeftBut
tonDown), | 2285 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::LeftBut
tonDown), |
| 2286 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerProp
erties::PointerType::Mouse); | 2286 PlatformMouseEvent::FromTouch, gestureEvent.timestamp(), WebPointerProp
erties::PointerType::Mouse); |
| 2287 WebInputEventResult mouseDownEventResult = dispatchMouseEvent(EventTypeNames
::mousedown, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown)
; | 2287 WebInputEventResult mouseDownEventResult = dispatchMouseEvent(EventTypeNames
::mousedown, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown)
; |
| 2288 selectionController().initializeSelectionState(); | 2288 selectionController().initializeSelectionState(); |
| 2289 if (mouseDownEventResult == WebInputEventResult::NotHandled) | 2289 if (mouseDownEventResult == WebInputEventResult::NotHandled) |
| 2290 mouseDownEventResult = handleMouseFocus(MouseEventWithHitTestResults(fak
eMouseDown, currentHitTest), InputDeviceCapabilities::firesTouchEventsSourceCapa
bilities()); | 2290 mouseDownEventResult = handleMouseFocus(MouseEventWithHitTestResults(fak
eMouseDown, currentHitTest), InputDeviceCapabilities::firesTouchEventsSourceCapa
bilities()); |
| 2291 if (mouseDownEventResult == WebInputEventResult::NotHandled) | 2291 if (mouseDownEventResult == WebInputEventResult::NotHandled) |
| (...skipping 1680 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3972 } else { | 3972 } else { |
| 3973 continue; | 3973 continue; |
| 3974 } | 3974 } |
| 3975 | 3975 |
| 3976 Node* node = result.innerNode(); | 3976 Node* node = result.innerNode(); |
| 3977 if (!node) | 3977 if (!node) |
| 3978 continue; | 3978 continue; |
| 3979 | 3979 |
| 3980 // Touch events should not go to text nodes | 3980 // Touch events should not go to text nodes |
| 3981 if (node->isTextNode()) | 3981 if (node->isTextNode()) |
| 3982 node = ComposedTreeTraversal::parent(*node); | 3982 node = FlatTreeTraversal::parent(*node); |
| 3983 | 3983 |
| 3984 if (!m_touchSequenceDocument) { | 3984 if (!m_touchSequenceDocument) { |
| 3985 // Keep track of which document should receive all touch events | 3985 // Keep track of which document should receive all touch events |
| 3986 // in the active sequence. This must be a single document to | 3986 // in the active sequence. This must be a single document to |
| 3987 // ensure we don't leak Nodes between documents. | 3987 // ensure we don't leak Nodes between documents. |
| 3988 m_touchSequenceDocument = &(result.innerNode()->document()); | 3988 m_touchSequenceDocument = &(result.innerNode()->document()); |
| 3989 ASSERT(m_touchSequenceDocument->frame()->view()); | 3989 ASSERT(m_touchSequenceDocument->frame()->view()); |
| 3990 } | 3990 } |
| 3991 | 3991 |
| 3992 // Ideally we'd ASSERT(!m_targetForTouchID.contains(point.id()) | 3992 // Ideally we'd ASSERT(!m_targetForTouchID.contains(point.id()) |
| (...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 4175 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() | 4175 PlatformEvent::Modifiers EventHandler::accessKeyModifiers() |
| 4176 { | 4176 { |
| 4177 #if OS(MACOSX) | 4177 #if OS(MACOSX) |
| 4178 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); | 4178 return static_cast<PlatformEvent::Modifiers>(PlatformEvent::CtrlKey | Platfo
rmEvent::AltKey); |
| 4179 #else | 4179 #else |
| 4180 return PlatformEvent::AltKey; | 4180 return PlatformEvent::AltKey; |
| 4181 #endif | 4181 #endif |
| 4182 } | 4182 } |
| 4183 | 4183 |
| 4184 } // namespace blink | 4184 } // namespace blink |
| OLD | NEW |