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 225 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
236 ASSERT(!m_fakeMouseMoveEventTimer.isActive()); | 236 ASSERT(!m_fakeMouseMoveEventTimer.isActive()); |
237 } | 237 } |
238 | 238 |
239 void EventHandler::trace(Visitor* visitor) | 239 void EventHandler::trace(Visitor* visitor) |
240 { | 240 { |
241 #if ENABLE(OILPAN) | 241 #if ENABLE(OILPAN) |
242 visitor->trace(m_mousePressNode); | 242 visitor->trace(m_mousePressNode); |
243 visitor->trace(m_capturingMouseEventsNode); | 243 visitor->trace(m_capturingMouseEventsNode); |
244 visitor->trace(m_nodeUnderMouse); | 244 visitor->trace(m_nodeUnderMouse); |
245 visitor->trace(m_lastNodeUnderMouse); | 245 visitor->trace(m_lastNodeUnderMouse); |
| 246 visitor->trace(m_lastMouseMoveEventSubframe); |
246 visitor->trace(m_clickNode); | 247 visitor->trace(m_clickNode); |
247 visitor->trace(m_dragTarget); | 248 visitor->trace(m_dragTarget); |
248 visitor->trace(m_frameSetBeingResized); | 249 visitor->trace(m_frameSetBeingResized); |
249 visitor->trace(m_latchedWheelEventNode); | 250 visitor->trace(m_latchedWheelEventNode); |
250 visitor->trace(m_previousWheelScrolledNode); | 251 visitor->trace(m_previousWheelScrolledNode); |
251 visitor->trace(m_targetForTouchID); | 252 visitor->trace(m_targetForTouchID); |
252 visitor->trace(m_touchSequenceDocument); | 253 visitor->trace(m_touchSequenceDocument); |
253 visitor->trace(m_scrollGestureHandlingNode); | 254 visitor->trace(m_scrollGestureHandlingNode); |
254 visitor->trace(m_previousGestureScrolledNode); | 255 visitor->trace(m_previousGestureScrolledNode); |
255 visitor->trace(m_lastDeferredTapElement); | 256 visitor->trace(m_lastDeferredTapElement); |
(...skipping 974 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1230 LayoutPoint documentPoint = documentPointForWindowPoint(m_frame, mouseEvent.
position()); | 1231 LayoutPoint documentPoint = documentPointForWindowPoint(m_frame, mouseEvent.
position()); |
1231 MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(re
quest, documentPoint, mouseEvent); | 1232 MouseEventWithHitTestResults mev = m_frame->document()->prepareMouseEvent(re
quest, documentPoint, mouseEvent); |
1232 | 1233 |
1233 if (!mev.innerNode()) { | 1234 if (!mev.innerNode()) { |
1234 invalidateClick(); | 1235 invalidateClick(); |
1235 return false; | 1236 return false; |
1236 } | 1237 } |
1237 | 1238 |
1238 m_mousePressNode = mev.innerNode(); | 1239 m_mousePressNode = mev.innerNode(); |
1239 | 1240 |
1240 RefPtr<LocalFrame> subframe = subframeForHitTestResult(mev); | 1241 RefPtrWillBeRawPtr<LocalFrame> subframe = subframeForHitTestResult(mev); |
1241 if (subframe && passMousePressEventToSubframe(mev, subframe.get())) { | 1242 if (subframe && passMousePressEventToSubframe(mev, subframe.get())) { |
1242 // Start capturing future events for this frame. We only do this if we
didn't clear | 1243 // Start capturing future events for this frame. We only do this if we
didn't clear |
1243 // the m_mousePressed flag, which may happen if an AppKit widget entered
a modal event loop. | 1244 // the m_mousePressed flag, which may happen if an AppKit widget entered
a modal event loop. |
1244 m_capturesDragging = subframe->eventHandler().capturesDragging(); | 1245 m_capturesDragging = subframe->eventHandler().capturesDragging(); |
1245 if (m_mousePressed && m_capturesDragging) { | 1246 if (m_mousePressed && m_capturesDragging) { |
1246 m_capturingMouseEventsNode = mev.innerNode(); | 1247 m_capturingMouseEventsNode = mev.innerNode(); |
1247 m_eventHandlerWillResetCapturingMouseEventsNode = true; | 1248 m_eventHandlerWillResetCapturingMouseEventsNode = true; |
1248 } | 1249 } |
1249 invalidateClick(); | 1250 invalidateClick(); |
1250 return true; | 1251 return true; |
(...skipping 185 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
1436 else { | 1437 else { |
1437 if (!scrollbar) | 1438 if (!scrollbar) |
1438 scrollbar = mev.scrollbar(); | 1439 scrollbar = mev.scrollbar(); |
1439 | 1440 |
1440 updateLastScrollbarUnderMouse(scrollbar, !m_mousePressed); | 1441 updateLastScrollbarUnderMouse(scrollbar, !m_mousePressed); |
1441 if (onlyUpdateScrollbars) | 1442 if (onlyUpdateScrollbars) |
1442 return true; | 1443 return true; |
1443 } | 1444 } |
1444 | 1445 |
1445 bool swallowEvent = false; | 1446 bool swallowEvent = false; |
1446 RefPtr<LocalFrame> newSubframe = m_capturingMouseEventsNode.get() ? subframe
ForTargetNode(m_capturingMouseEventsNode.get()) : subframeForHitTestResult(mev); | 1447 RefPtrWillBeRawPtr<LocalFrame> newSubframe = m_capturingMouseEventsNode.get(
) ? subframeForTargetNode(m_capturingMouseEventsNode.get()) : subframeForHitTest
Result(mev); |
1447 | 1448 |
1448 // We want mouseouts to happen first, from the inside out. First send a mov
e event to the last subframe so that it will fire mouseouts. | 1449 // We want mouseouts to happen first, from the inside out. First send a mov
e event to the last subframe so that it will fire mouseouts. |
1449 if (m_lastMouseMoveEventSubframe && m_lastMouseMoveEventSubframe->tree().isD
escendantOf(m_frame) && m_lastMouseMoveEventSubframe != newSubframe) | 1450 if (m_lastMouseMoveEventSubframe && m_lastMouseMoveEventSubframe->tree().isD
escendantOf(m_frame) && m_lastMouseMoveEventSubframe != newSubframe) |
1450 passMouseMoveEventToSubframe(mev, m_lastMouseMoveEventSubframe.get()); | 1451 passMouseMoveEventToSubframe(mev, m_lastMouseMoveEventSubframe.get()); |
1451 | 1452 |
1452 if (newSubframe) { | 1453 if (newSubframe) { |
1453 // Update over/out state before passing the event to the subframe. | 1454 // Update over/out state before passing the event to the subframe. |
1454 updateMouseEventTargetNode(mev.innerNode(), mouseEvent, true); | 1455 updateMouseEventTargetNode(mev.innerNode(), mouseEvent, true); |
1455 | 1456 |
1456 // Event dispatch in updateMouseEventTargetNode may have caused the subf
rame of the target | 1457 // Event dispatch in updateMouseEventTargetNode may have caused the subf
rame of the target |
(...skipping 2422 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
3879 unsigned EventHandler::accessKeyModifiers() | 3880 unsigned EventHandler::accessKeyModifiers() |
3880 { | 3881 { |
3881 #if OS(MACOSX) | 3882 #if OS(MACOSX) |
3882 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 3883 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
3883 #else | 3884 #else |
3884 return PlatformEvent::AltKey; | 3885 return PlatformEvent::AltKey; |
3885 #endif | 3886 #endif |
3886 } | 3887 } |
3887 | 3888 |
3888 } // namespace blink | 3889 } // namespace blink |
OLD | NEW |