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 170 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
181 { | 181 { |
182 scrollChain.clear(); | 182 scrollChain.clear(); |
183 | 183 |
184 ASSERT(startNode.layoutObject()); | 184 ASSERT(startNode.layoutObject()); |
185 LayoutBox* curBox = startNode.layoutObject()->enclosingBox(); | 185 LayoutBox* curBox = startNode.layoutObject()->enclosingBox(); |
186 | 186 |
187 // Scrolling propagates along the containing block chain. | 187 // Scrolling propagates along the containing block chain. |
188 while (curBox && !curBox->isLayoutView()) { | 188 while (curBox && !curBox->isLayoutView()) { |
189 Node* curNode = curBox->node(); | 189 Node* curNode = curBox->node(); |
190 // FIXME: this should reject more elements, as part of crbug.com/410974. | 190 // FIXME: this should reject more elements, as part of crbug.com/410974. |
191 if (curNode && curNode->isElementNode()) { | 191 if (curNode && curNode->isElementNode()) |
192 Element* curElement = toElement(curNode); | 192 scrollChain.prepend(toElement(curNode)); |
193 if (curElement == frame.document()->scrollingElement()) | |
194 break; | |
195 scrollChain.prepend(curElement); | |
196 } | |
197 curBox = curBox->containingBlock(); | 193 curBox = curBox->containingBlock(); |
198 } | 194 } |
199 // TODO(tdresser): this should sometimes be excluded, as part of crbug.com/4
10974. | 195 |
200 // We need to ensure that the scrollingElement is always part of | 196 // FIXME: we should exclude the document in some cases, as part |
201 // the scroll chain. In quirks mode, when the scrollingElement is | 197 // of crbug.com/410974. |
202 // the body, some elements may use the documentElement as their | 198 scrollChain.prepend(frame.document()->documentElement()); |
203 // containingBlock, so we ensure the scrollingElement is added | |
204 // here. | |
205 scrollChain.prepend(frame.document()->scrollingElement()); | |
206 } | 199 } |
207 | 200 |
208 EventHandler::EventHandler(LocalFrame* frame) | 201 EventHandler::EventHandler(LocalFrame* frame) |
209 : m_frame(frame) | 202 : m_frame(frame) |
210 , m_mousePressed(false) | 203 , m_mousePressed(false) |
211 , m_capturesDragging(false) | 204 , m_capturesDragging(false) |
212 , m_mouseDownMayStartDrag(false) | 205 , m_mouseDownMayStartDrag(false) |
213 , m_selectionController(SelectionController::create(*frame)) | 206 , m_selectionController(SelectionController::create(*frame)) |
214 , m_hoverTimer(this, &EventHandler::hoverTimerFired) | 207 , m_hoverTimer(this, &EventHandler::hoverTimerFired) |
215 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired) | 208 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired) |
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
294 m_lastMouseDownUserGestureToken.clear(); | 287 m_lastMouseDownUserGestureToken.clear(); |
295 m_mousePressNode = nullptr; | 288 m_mousePressNode = nullptr; |
296 m_mousePressed = false; | 289 m_mousePressed = false; |
297 m_capturesDragging = false; | 290 m_capturesDragging = false; |
298 m_capturingMouseEventsNode = nullptr; | 291 m_capturingMouseEventsNode = nullptr; |
299 m_latchedWheelEventNode = nullptr; | 292 m_latchedWheelEventNode = nullptr; |
300 m_previousWheelScrolledNode = nullptr; | 293 m_previousWheelScrolledNode = nullptr; |
301 m_targetForTouchID.clear(); | 294 m_targetForTouchID.clear(); |
302 m_touchSequenceDocument.clear(); | 295 m_touchSequenceDocument.clear(); |
303 m_touchSequenceUserGestureToken.clear(); | 296 m_touchSequenceUserGestureToken.clear(); |
304 clearGestureScrollState(); | 297 m_scrollGestureHandlingNode = nullptr; |
305 m_lastGestureScrollOverWidget = false; | 298 m_lastGestureScrollOverWidget = false; |
| 299 m_previousGestureScrolledNode = nullptr; |
306 m_scrollbarHandlingScrollGesture = nullptr; | 300 m_scrollbarHandlingScrollGesture = nullptr; |
307 m_touchPressed = false; | 301 m_touchPressed = false; |
308 m_pointerIdManager.clear(); | 302 m_pointerIdManager.clear(); |
309 m_inPointerCanceledState = false; | 303 m_inPointerCanceledState = false; |
310 m_mouseDownMayStartDrag = false; | 304 m_mouseDownMayStartDrag = false; |
311 m_lastShowPressTimestamp = 0; | 305 m_lastShowPressTimestamp = 0; |
312 m_lastDeferredTapElement = nullptr; | 306 m_lastDeferredTapElement = nullptr; |
313 m_eventHandlerWillResetCapturingMouseEventsNode = false; | 307 m_eventHandlerWillResetCapturingMouseEventsNode = false; |
314 m_mouseDownMayStartAutoscroll = false; | 308 m_mouseDownMayStartAutoscroll = false; |
315 m_svgPan = false; | 309 m_svgPan = false; |
(...skipping 3710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4026 unsigned EventHandler::accessKeyModifiers() | 4020 unsigned EventHandler::accessKeyModifiers() |
4027 { | 4021 { |
4028 #if OS(MACOSX) | 4022 #if OS(MACOSX) |
4029 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 4023 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
4030 #else | 4024 #else |
4031 return PlatformEvent::AltKey; | 4025 return PlatformEvent::AltKey; |
4032 #endif | 4026 #endif |
4033 } | 4027 } |
4034 | 4028 |
4035 } // namespace blink | 4029 } // namespace blink |
OLD | NEW |