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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
194 { | 194 { |
195 scrollChain.clear(); | 195 scrollChain.clear(); |
196 | 196 |
197 ASSERT(startNode.layoutObject()); | 197 ASSERT(startNode.layoutObject()); |
198 LayoutBox* curBox = startNode.layoutObject()->enclosingBox(); | 198 LayoutBox* curBox = startNode.layoutObject()->enclosingBox(); |
199 | 199 |
200 // Scrolling propagates along the containing block chain. | 200 // Scrolling propagates along the containing block chain. |
201 while (curBox && !curBox->isLayoutView()) { | 201 while (curBox && !curBox->isLayoutView()) { |
202 Node* curNode = curBox->node(); | 202 Node* curNode = curBox->node(); |
203 // FIXME: this should reject more elements, as part of crbug.com/410974. | 203 // FIXME: this should reject more elements, as part of crbug.com/410974. |
204 if (curNode && curNode->isElementNode()) | 204 if (curNode && curNode->isElementNode()) { |
205 scrollChain.prepend(toElement(curNode)); | 205 Element* curElement = toElement(curNode); |
| 206 if (curElement == frame.document()->scrollingElement()) |
| 207 break; |
| 208 scrollChain.prepend(curElement); |
| 209 } |
206 curBox = curBox->containingBlock(); | 210 curBox = curBox->containingBlock(); |
207 } | 211 } |
208 | 212 // TODO(tdresser): this should sometimes be excluded, as part of crbug.com/4
10974. |
209 // FIXME: we should exclude the document in some cases, as part | 213 // We need to ensure that the scrollingElement is always part of |
210 // of crbug.com/410974. | 214 // the scroll chain. In quirks mode, when the scrollingElement is |
211 scrollChain.prepend(frame.document()->documentElement()); | 215 // the body, some elements may use the documentElement as their |
| 216 // containingBlock, so we ensure the scrollingElement is added |
| 217 // here. |
| 218 scrollChain.prepend(frame.document()->scrollingElement()); |
212 } | 219 } |
213 | 220 |
214 EventHandler::EventHandler(LocalFrame* frame) | 221 EventHandler::EventHandler(LocalFrame* frame) |
215 : m_frame(frame) | 222 : m_frame(frame) |
216 , m_mousePressed(false) | 223 , m_mousePressed(false) |
217 , m_capturesDragging(false) | 224 , m_capturesDragging(false) |
218 , m_mouseDownMayStartDrag(false) | 225 , m_mouseDownMayStartDrag(false) |
219 , m_selectionController(SelectionController::create(*frame)) | 226 , m_selectionController(SelectionController::create(*frame)) |
220 , m_hoverTimer(this, &EventHandler::hoverTimerFired) | 227 , m_hoverTimer(this, &EventHandler::hoverTimerFired) |
221 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired) | 228 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired) |
(...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
296 m_lastKnownMouseGlobalPosition = IntPoint(); | 303 m_lastKnownMouseGlobalPosition = IntPoint(); |
297 m_lastMouseDownUserGestureToken.clear(); | 304 m_lastMouseDownUserGestureToken.clear(); |
298 m_mousePressNode = nullptr; | 305 m_mousePressNode = nullptr; |
299 m_mousePressed = false; | 306 m_mousePressed = false; |
300 m_capturesDragging = false; | 307 m_capturesDragging = false; |
301 m_capturingMouseEventsNode = nullptr; | 308 m_capturingMouseEventsNode = nullptr; |
302 m_previousWheelScrolledNode = nullptr; | 309 m_previousWheelScrolledNode = nullptr; |
303 m_targetForTouchID.clear(); | 310 m_targetForTouchID.clear(); |
304 m_touchSequenceDocument.clear(); | 311 m_touchSequenceDocument.clear(); |
305 m_touchSequenceUserGestureToken.clear(); | 312 m_touchSequenceUserGestureToken.clear(); |
306 m_scrollGestureHandlingNode = nullptr; | 313 clearGestureScrollState(); |
307 m_lastGestureScrollOverWidget = false; | 314 m_lastGestureScrollOverWidget = false; |
308 m_previousGestureScrolledNode = nullptr; | |
309 m_scrollbarHandlingScrollGesture = nullptr; | 315 m_scrollbarHandlingScrollGesture = nullptr; |
310 m_touchPressed = false; | 316 m_touchPressed = false; |
311 m_pointerIdManager.clear(); | 317 m_pointerIdManager.clear(); |
312 m_inPointerCanceledState = false; | 318 m_inPointerCanceledState = false; |
313 m_mouseDownMayStartDrag = false; | 319 m_mouseDownMayStartDrag = false; |
314 m_lastShowPressTimestamp = 0; | 320 m_lastShowPressTimestamp = 0; |
315 m_lastDeferredTapElement = nullptr; | 321 m_lastDeferredTapElement = nullptr; |
316 m_eventHandlerWillResetCapturingMouseEventsNode = false; | 322 m_eventHandlerWillResetCapturingMouseEventsNode = false; |
317 m_mouseDownMayStartAutoscroll = false; | 323 m_mouseDownMayStartAutoscroll = false; |
318 m_svgPan = false; | 324 m_svgPan = false; |
(...skipping 3710 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
4029 unsigned EventHandler::accessKeyModifiers() | 4035 unsigned EventHandler::accessKeyModifiers() |
4030 { | 4036 { |
4031 #if OS(MACOSX) | 4037 #if OS(MACOSX) |
4032 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; | 4038 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; |
4033 #else | 4039 #else |
4034 return PlatformEvent::AltKey; | 4040 return PlatformEvent::AltKey; |
4035 #endif | 4041 #endif |
4036 } | 4042 } |
4037 | 4043 |
4038 } // namespace blink | 4044 } // namespace blink |
OLD | NEW |