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 2405 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 2416 dispatchMouseEvent(EventTypeNames::mousemove, currentHitTest.innerNode(), 0, fakeMouseMove, true); | 2416 dispatchMouseEvent(EventTypeNames::mousemove, currentHitTest.innerNode(), 0, fakeMouseMove, true); |
| 2417 | 2417 |
| 2418 // Do a new hit-test in case the mousemove event changed the DOM. | 2418 // Do a new hit-test in case the mousemove event changed the DOM. |
| 2419 // Note that if the original hit test wasn't over an element (eg. was over a scrollbar) we | 2419 // Note that if the original hit test wasn't over an element (eg. was over a scrollbar) we |
| 2420 // don't want to re-hit-test because it may be in the wrong frame (and there 's no way the page | 2420 // don't want to re-hit-test because it may be in the wrong frame (and there 's no way the page |
| 2421 // could have seen the event anyway). | 2421 // could have seen the event anyway). |
| 2422 // Also note that the position of the frame may have changed, so we need to recompute the content | 2422 // Also note that the position of the frame may have changed, so we need to recompute the content |
| 2423 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul d). | 2423 // co-ordinates (updating layout/style as hitTestResultAtPoint normally woul d). |
| 2424 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 | 2424 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 |
| 2425 if (currentHitTest.innerNode()) { | 2425 if (currentHitTest.innerNode()) { |
| 2426 LocalFrame* mainFrame = m_frame->localFrameRoot(); | |
|
chrishtr
2015/05/08 00:33:37
These are not needed because of the code in Layout
| |
| 2427 if (mainFrame && mainFrame->view()) | |
| 2428 mainFrame->view()->updateLayoutAndStyleIfNeededRecursive(); | |
| 2429 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); | 2426 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); |
| 2430 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); | 2427 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); |
| 2431 } | 2428 } |
| 2432 m_clickNode = currentHitTest.innerNode(); | 2429 m_clickNode = currentHitTest.innerNode(); |
| 2433 | 2430 |
| 2434 // Capture data for showUnhandledTapUIIfNeeded. | 2431 // Capture data for showUnhandledTapUIIfNeeded. |
| 2435 RefPtrWillBeRawPtr<Node> tappedNode = m_clickNode; | 2432 RefPtrWillBeRawPtr<Node> tappedNode = m_clickNode; |
| 2436 IntPoint tappedPosition = gestureEvent.position(); | 2433 IntPoint tappedPosition = gestureEvent.position(); |
| 2437 | 2434 |
| 2438 if (m_clickNode && m_clickNode->isTextNode()) | 2435 if (m_clickNode && m_clickNode->isTextNode()) |
| 2439 m_clickNode = ComposedTreeTraversal::parent(*m_clickNode); | 2436 m_clickNode = ComposedTreeTraversal::parent(*m_clickNode); |
| 2440 | 2437 |
| 2441 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa lPosition(), | 2438 PlatformMouseEvent fakeMouseDown(gestureEvent.position(), gestureEvent.globa lPosition(), |
| 2442 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(), | 2439 LeftButton, PlatformEvent::MousePressed, gestureEvent.tapCount(), |
| 2443 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::LeftBut tonDown), | 2440 static_cast<PlatformEvent::Modifiers>(modifiers | PlatformEvent::LeftBut tonDown), |
| 2444 PlatformMouseEvent::FromTouch, gestureEvent.timestamp()); | 2441 PlatformMouseEvent::FromTouch, gestureEvent.timestamp()); |
| 2445 bool swallowMouseDownEvent = !dispatchMouseEvent(EventTypeNames::mousedown, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown, true); | 2442 bool swallowMouseDownEvent = !dispatchMouseEvent(EventTypeNames::mousedown, currentHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseDown, true); |
| 2446 if (!swallowMouseDownEvent) | 2443 if (!swallowMouseDownEvent) |
| 2447 swallowMouseDownEvent = handleMouseFocus(MouseEventWithHitTestResults(fa keMouseDown, currentHitTest)); | 2444 swallowMouseDownEvent = handleMouseFocus(MouseEventWithHitTestResults(fa keMouseDown, currentHitTest)); |
| 2448 if (!swallowMouseDownEvent) | 2445 if (!swallowMouseDownEvent) |
| 2449 swallowMouseDownEvent = handleMousePressEvent(MouseEventWithHitTestResul ts(fakeMouseDown, currentHitTest)); | 2446 swallowMouseDownEvent = handleMousePressEvent(MouseEventWithHitTestResul ts(fakeMouseDown, currentHitTest)); |
| 2450 | 2447 |
| 2451 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 | 2448 // FIXME: Use a hit-test cache to avoid unnecessary hit tests. http://crbug. com/398920 |
| 2452 if (currentHitTest.innerNode()) { | 2449 if (currentHitTest.innerNode()) { |
| 2453 LocalFrame* mainFrame = m_frame->localFrameRoot(); | |
| 2454 if (mainFrame && mainFrame->view()) | |
| 2455 mainFrame->view()->updateLayoutAndStyleIfNeededRecursive(); | |
| 2456 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); | 2450 adjustedPoint = frameView->rootFrameToContents(gestureEvent.position()); |
| 2457 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); | 2451 currentHitTest = hitTestResultInFrame(m_frame, adjustedPoint, hitType); |
| 2458 } | 2452 } |
| 2459 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(), | 2453 PlatformMouseEvent fakeMouseUp(gestureEvent.position(), gestureEvent.globalP osition(), |
| 2460 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), | 2454 LeftButton, PlatformEvent::MouseReleased, gestureEvent.tapCount(), |
| 2461 static_cast<PlatformEvent::Modifiers>(modifiers), | 2455 static_cast<PlatformEvent::Modifiers>(modifiers), |
| 2462 PlatformMouseEvent::FromTouch, gestureEvent.timestamp()); | 2456 PlatformMouseEvent::FromTouch, gestureEvent.timestamp()); |
| 2463 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, curr entHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp, false); | 2457 bool swallowMouseUpEvent = !dispatchMouseEvent(EventTypeNames::mouseup, curr entHitTest.innerNode(), gestureEvent.tapCount(), fakeMouseUp, false); |
| 2464 | 2458 |
| 2465 bool swallowClickEvent = false; | 2459 bool swallowClickEvent = false; |
| (...skipping 1689 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 4155 unsigned EventHandler::accessKeyModifiers() | 4149 unsigned EventHandler::accessKeyModifiers() |
| 4156 { | 4150 { |
| 4157 #if OS(MACOSX) | 4151 #if OS(MACOSX) |
| 4158 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 4152 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
| 4159 #else | 4153 #else |
| 4160 return PlatformEvent::AltKey; | 4154 return PlatformEvent::AltKey; |
| 4161 #endif | 4155 #endif |
| 4162 } | 4156 } |
| 4163 | 4157 |
| 4164 } // namespace blink | 4158 } // namespace blink |
| OLD | NEW |