| 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 1983 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 1994 // Do a new hit-test in case the mousemove event changed the DOM. | 1994 // Do a new hit-test in case the mousemove event changed the DOM. |
| 1995 // Note that if the original hit test wasn't over an element (eg. was over a
scrollbar) we | 1995 // Note that if the original hit test wasn't over an element (eg. was over a
scrollbar) we |
| 1996 // don't want to re-hit-test because it may be in the wrong frame (and there
's no way the page | 1996 // don't want to re-hit-test because it may be in the wrong frame (and there
's no way the page |
| 1997 // could have seen the event anyway). | 1997 // could have seen the event anyway). |
| 1998 // Also note that the position of the frame may have changed, so we need to
recompute the content | 1998 // Also note that the position of the frame may have changed, so we need to
recompute the content |
| 1999 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul
d). | 1999 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul
d). |
| 2000 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug.
com/398920 | 2000 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug.
com/398920 |
| 2001 if (currentHitTest.innerNode()) { | 2001 if (currentHitTest.innerNode()) { |
| 2002 LocalFrame* mainFrame = m_frame->localFrameRoot(); | 2002 LocalFrame* mainFrame = m_frame->localFrameRoot(); |
| 2003 if (mainFrame && mainFrame->view()) | 2003 if (mainFrame && mainFrame->view()) |
| 2004 mainFrame->view()->updateLayoutAndStyleForPainting(); | 2004 mainFrame->view()->updateAllLifecyclePhases(); |
| 2005 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); | 2005 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); |
| 2006 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); | 2006 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); |
| 2007 } | 2007 } |
| 2008 m_clickNode = currentHitTest.innerNode(); | 2008 m_clickNode = currentHitTest.innerNode(); |
| 2009 | 2009 |
| 2010 // Capture data for showUnhandledTapUIIfNeeded. | 2010 // Capture data for showUnhandledTapUIIfNeeded. |
| 2011 RefPtrWillBeRawPtr<Node> tappedNode = m_clickNode; | 2011 RefPtrWillBeRawPtr<Node> tappedNode = m_clickNode; |
| 2012 IntPoint tappedPosition = gestureEvent.position(); | 2012 IntPoint tappedPosition = gestureEvent.position(); |
| 2013 | 2013 |
| 2014 if (m_clickNode && m_clickNode->isTextNode()) | 2014 if (m_clickNode && m_clickNode->isTextNode()) |
| (...skipping 13 matching lines...) Expand all Loading... |
| 2028 ASSERT(gestureEvent.type() == PlatformEvent::GestureTap); | 2028 ASSERT(gestureEvent.type() == PlatformEvent::GestureTap); |
| 2029 HitTestResult result = currentHitTest; | 2029 HitTestResult result = currentHitTest; |
| 2030 result.setToShadowHostIfInUserAgentShadowRoot(); | 2030 result.setToShadowHostIfInUserAgentShadowRoot(); |
| 2031 m_frame->chromeClient().onMouseDown(result.innerNode()); | 2031 m_frame->chromeClient().onMouseDown(result.innerNode()); |
| 2032 } | 2032 } |
| 2033 | 2033 |
| 2034 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug.
com/398920 | 2034 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug.
com/398920 |
| 2035 if (currentHitTest.innerNode()) { | 2035 if (currentHitTest.innerNode()) { |
| 2036 LocalFrame* mainFrame = m_frame->localFrameRoot(); | 2036 LocalFrame* mainFrame = m_frame->localFrameRoot(); |
| 2037 if (mainFrame && mainFrame->view()) | 2037 if (mainFrame && mainFrame->view()) |
| 2038 mainFrame->view()->updateLayoutAndStyleForPainting(); | 2038 mainFrame->view()->updateAllLifecyclePhases(); |
| 2039 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); | 2039 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); |
| 2040 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); | 2040 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); |
| 2041 } | 2041 } |
| 2042 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP
osition(), | 2042 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP
osition(), |
| 2043 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), | 2043 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), |
| 2044 static_cast<PlatformEvent::Modifiers>(modifiers), | 2044 static_cast<PlatformEvent::Modifiers>(modifiers), |
| 2045 PlatformMouseEvent::FromTouch, gestureEvent.timestamp()); | 2045 PlatformMouseEvent::FromTouch, gestureEvent.timestamp()); |
| 2046 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, curr
entHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp, false); | 2046 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, curr
entHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp, false); |
| 2047 | 2047 |
| 2048 bool swallowClickEvent = false; | 2048 bool swallowClickEvent = false; |
| (...skipping 1817 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 3866 unsigned EventHandler::accessKeyModifiers() | 3866 unsigned EventHandler::accessKeyModifiers() |
| 3867 { | 3867 { |
| 3868 #if OS(MACOSX) | 3868 #if OS(MACOSX) |
| 3869 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3869 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 3870 #else | 3870 #else |
| 3871 return PlatformEvent::AltKey; | 3871 return PlatformEvent::AltKey; |
| 3872 #endif | 3872 #endif |
| 3873 } | 3873 } |
| 3874 | 3874 |
| 3875 } // namespace blink | 3875 } // namespace blink |
| OLD | NEW |