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 980 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 991 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Ac tive); | 991 HitTestRequest request(HitTestRequest::ReadOnly | HitTestRequest::Ac tive); |
| 992 mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent); | 992 mev = m_frame->document()->prepareMouseEvent(request, documentPoint, mouseEvent); |
| 993 } | 993 } |
| 994 | 994 |
| 995 if (passMousePressEventToScrollbar(mev)) | 995 if (passMousePressEventToScrollbar(mev)) |
| 996 swallowEvent = true; | 996 swallowEvent = true; |
| 997 else | 997 else |
| 998 swallowEvent = handleMousePressEvent(mev); | 998 swallowEvent = handleMousePressEvent(mev); |
| 999 } | 999 } |
| 1000 | 1000 |
| 1001 if (mev.hitTestResult().innerNode() && mouseEvent.button() == LeftButton) { | |
| 1002 ASSERT(mouseEvent.type() == PlatformEvent::MousePressed); | |
| 1003 HitTestResult result = mev.hitTestResult(); | |
| 1004 result.setToShadowHostIfInUserAgentShadowRoot(); | |
| 1005 m_frame->chromeClient().onClickInput(result.innerNode()); | |
| 1006 } | |
| 1007 | |
| 1001 return swallowEvent; | 1008 return swallowEvent; |
| 1002 } | 1009 } |
| 1003 | 1010 |
| 1004 static DeprecatedPaintLayer* layerForNode(Node* node) | 1011 static DeprecatedPaintLayer* layerForNode(Node* node) |
| 1005 { | 1012 { |
| 1006 if (!node) | 1013 if (!node) |
| 1007 return nullptr; | 1014 return nullptr; |
| 1008 | 1015 |
| 1009 LayoutObject* layoutObject = node->layoutObject(); | 1016 LayoutObject* layoutObject = node->layoutObject(); |
| 1010 if (!layoutObject) | 1017 if (!layoutObject) |
| (...skipping 1056 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2067 swallowMouseUpEvent = handleMouseReleaseEvent(MouseEventWithHitTestResul ts(fakeMouseUp, currentHitTest)); | 2074 swallowMouseUpEvent = handleMouseReleaseEvent(MouseEventWithHitTestResul ts(fakeMouseUp, currentHitTest)); |
| 2068 | 2075 |
| 2069 bool swallowed = swallowMouseDownEvent | swallowMouseUpEvent | swallowClickE vent; | 2076 bool swallowed = swallowMouseDownEvent | swallowMouseUpEvent | swallowClickE vent; |
| 2070 if (!swallowed && tappedNode && m_frame->page()) { | 2077 if (!swallowed && tappedNode && m_frame->page()) { |
| 2071 bool domTreeChanged = preDispatchDomTreeVersion != m_frame->document()-> domTreeVersion(); | 2078 bool domTreeChanged = preDispatchDomTreeVersion != m_frame->document()-> domTreeVersion(); |
| 2072 bool styleChanged = preDispatchStyleVersion != m_frame->document()->styl eVersion(); | 2079 bool styleChanged = preDispatchStyleVersion != m_frame->document()->styl eVersion(); |
| 2073 | 2080 |
| 2074 IntPoint tappedPositionInViewport = m_frame->page()->frameHost().pinchVi ewport().rootFrameToViewport(tappedPosition); | 2081 IntPoint tappedPositionInViewport = m_frame->page()->frameHost().pinchVi ewport().rootFrameToViewport(tappedPosition); |
| 2075 m_frame->chromeClient().showUnhandledTapUIIfNeeded(tappedPositionInViewp ort, tappedNode.get(), domTreeChanged || styleChanged); | 2082 m_frame->chromeClient().showUnhandledTapUIIfNeeded(tappedPositionInViewp ort, tappedNode.get(), domTreeChanged || styleChanged); |
| 2076 } | 2083 } |
| 2084 | |
| 2085 if (currentHitTest.innerNode()) { | |
|
Rick Byers
2015/06/18 17:02:10
If we're going to invoke this after mousedown for
Yufeng Shen (Slow to review)
2015/06/18 18:29:03
done.
Moved the onMouseDown() up to right after h
| |
| 2086 ASSERT(gestureEvent.type() == PlatformEvent::GestureTap); | |
| 2087 HitTestResult result = currentHitTest; | |
| 2088 result.setToShadowHostIfInUserAgentShadowRoot(); | |
| 2089 m_frame->chromeClient().onClickInput(result.innerNode()); | |
| 2090 } | |
| 2091 | |
| 2077 return swallowed; | 2092 return swallowed; |
| 2078 } | 2093 } |
| 2079 | 2094 |
| 2080 bool EventHandler::handleGestureLongPress(const GestureEventWithHitTestResults& targetedEvent) | 2095 bool EventHandler::handleGestureLongPress(const GestureEventWithHitTestResults& targetedEvent) |
| 2081 { | 2096 { |
| 2082 const PlatformGestureEvent& gestureEvent = targetedEvent.event(); | 2097 const PlatformGestureEvent& gestureEvent = targetedEvent.event(); |
| 2083 IntPoint adjustedPoint = gestureEvent.position(); | 2098 IntPoint adjustedPoint = gestureEvent.position(); |
| 2084 | 2099 |
| 2085 unsigned modifiers = gestureEvent.modifiers(); | 2100 unsigned modifiers = gestureEvent.modifiers(); |
| 2086 | 2101 |
| (...skipping 1674 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 3761 unsigned EventHandler::accessKeyModifiers() | 3776 unsigned EventHandler::accessKeyModifiers() |
| 3762 { | 3777 { |
| 3763 #if OS(MACOSX) | 3778 #if OS(MACOSX) |
| 3764 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3779 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 3765 #else | 3780 #else |
| 3766 return PlatformEvent::AltKey; | 3781 return PlatformEvent::AltKey; |
| 3767 #endif | 3782 #endif |
| 3768 } | 3783 } |
| 3769 | 3784 |
| 3770 } // namespace blink | 3785 } // namespace blink |
| OLD | NEW |