Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(15)

Side by Side Diff: Source/core/input/EventHandler.cpp

Issue 1209183004: Expose scroll customization for touch to JS (behind REF). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address skobes' nits. Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « Source/core/dom/Element.idl ('k') | Source/core/page/scrolling/ScrollCustomizationCallbacks.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 scrollChain.prepend(toElement(curNode)); 192 Element* curElement = toElement(curNode);
193 if (curElement == frame.document()->scrollingElement())
194 break;
195 scrollChain.prepend(curElement);
196 }
193 curBox = curBox->containingBlock(); 197 curBox = curBox->containingBlock();
194 } 198 }
195 199 // TODO(tdresser): this should sometimes be excluded, as part of crbug.com/4 10974.
196 // FIXME: we should exclude the document in some cases, as part 200 // We need to ensure that the scrollingElement is always part of
197 // of crbug.com/410974. 201 // the scroll chain. In quirks mode, when the scrollingElement is
198 scrollChain.prepend(frame.document()->documentElement()); 202 // the body, some elements may use the documentElement as their
203 // containingBlock, so we ensure the scrollingElement is added
204 // here.
205 scrollChain.prepend(frame.document()->scrollingElement());
199 } 206 }
200 207
201 EventHandler::EventHandler(LocalFrame* frame) 208 EventHandler::EventHandler(LocalFrame* frame)
202 : m_frame(frame) 209 : m_frame(frame)
203 , m_mousePressed(false) 210 , m_mousePressed(false)
204 , m_capturesDragging(false) 211 , m_capturesDragging(false)
205 , m_mouseDownMayStartDrag(false) 212 , m_mouseDownMayStartDrag(false)
206 , m_selectionController(SelectionController::create(*frame)) 213 , m_selectionController(SelectionController::create(*frame))
207 , m_hoverTimer(this, &EventHandler::hoverTimerFired) 214 , m_hoverTimer(this, &EventHandler::hoverTimerFired)
208 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired) 215 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired)
(...skipping 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 m_lastMouseDownUserGestureToken.clear(); 294 m_lastMouseDownUserGestureToken.clear();
288 m_mousePressNode = nullptr; 295 m_mousePressNode = nullptr;
289 m_mousePressed = false; 296 m_mousePressed = false;
290 m_capturesDragging = false; 297 m_capturesDragging = false;
291 m_capturingMouseEventsNode = nullptr; 298 m_capturingMouseEventsNode = nullptr;
292 m_latchedWheelEventNode = nullptr; 299 m_latchedWheelEventNode = nullptr;
293 m_previousWheelScrolledNode = nullptr; 300 m_previousWheelScrolledNode = nullptr;
294 m_targetForTouchID.clear(); 301 m_targetForTouchID.clear();
295 m_touchSequenceDocument.clear(); 302 m_touchSequenceDocument.clear();
296 m_touchSequenceUserGestureToken.clear(); 303 m_touchSequenceUserGestureToken.clear();
297 m_scrollGestureHandlingNode = nullptr; 304 clearGestureScrollState();
298 m_lastGestureScrollOverWidget = false; 305 m_lastGestureScrollOverWidget = false;
299 m_previousGestureScrolledNode = nullptr;
300 m_scrollbarHandlingScrollGesture = nullptr; 306 m_scrollbarHandlingScrollGesture = nullptr;
301 m_touchPressed = false; 307 m_touchPressed = false;
302 m_pointerIdManager.clear(); 308 m_pointerIdManager.clear();
303 m_inPointerCanceledState = false; 309 m_inPointerCanceledState = false;
304 m_mouseDownMayStartDrag = false; 310 m_mouseDownMayStartDrag = false;
305 m_lastShowPressTimestamp = 0; 311 m_lastShowPressTimestamp = 0;
306 m_lastDeferredTapElement = nullptr; 312 m_lastDeferredTapElement = nullptr;
307 m_eventHandlerWillResetCapturingMouseEventsNode = false; 313 m_eventHandlerWillResetCapturingMouseEventsNode = false;
308 m_mouseDownMayStartAutoscroll = false; 314 m_mouseDownMayStartAutoscroll = false;
309 m_svgPan = false; 315 m_svgPan = false;
(...skipping 3710 matching lines...) Expand 10 before | Expand all | Expand 10 after
4020 unsigned EventHandler::accessKeyModifiers() 4026 unsigned EventHandler::accessKeyModifiers()
4021 { 4027 {
4022 #if OS(MACOSX) 4028 #if OS(MACOSX)
4023 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4029 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4024 #else 4030 #else
4025 return PlatformEvent::AltKey; 4031 return PlatformEvent::AltKey;
4026 #endif 4032 #endif
4027 } 4033 }
4028 4034
4029 } // namespace blink 4035 } // namespace blink
OLDNEW
« no previous file with comments | « Source/core/dom/Element.idl ('k') | Source/core/page/scrolling/ScrollCustomizationCallbacks.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698