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

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

Issue 1057603002: Expose scroll customization for touch to JS (behind REF). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Address haraken's comments. 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
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 186 matching lines...) Expand 10 before | Expand all | Expand 10 after
197 { 197 {
198 scrollChain.clear(); 198 scrollChain.clear();
199 199
200 ASSERT(startNode.layoutObject()); 200 ASSERT(startNode.layoutObject());
201 LayoutBox* curBox = startNode.layoutObject()->enclosingBox(); 201 LayoutBox* curBox = startNode.layoutObject()->enclosingBox();
202 202
203 // Scrolling propagates along the containing block chain. 203 // Scrolling propagates along the containing block chain.
204 while (curBox && !curBox->isLayoutView()) { 204 while (curBox && !curBox->isLayoutView()) {
205 Node* curNode = curBox->node(); 205 Node* curNode = curBox->node();
206 // FIXME: this should reject more elements, as part of crbug.com/410974. 206 // FIXME: this should reject more elements, as part of crbug.com/410974.
207 if (curNode && curNode->isElementNode()) 207 if (curNode && curNode->isElementNode()) {
208 scrollChain.prepend(toElement(curNode)); 208 Element* curElement = toElement(curNode);
209 if (curElement == frame.document()->scrollingElement())
210 break;
211 scrollChain.prepend(curElement);
212 }
209 curBox = curBox->containingBlock(); 213 curBox = curBox->containingBlock();
210 } 214 }
211 215 // TODO(tdresser): this should sometimes be excluded, as part of crbug.com/4 10974.
212 // FIXME: we should exclude the document in some cases, as part 216 // We need to ensure that the scrollingElement is always part of
213 // of crbug.com/410974. 217 // the scroll chain. In quirks mode, when the scrollingElement is
214 scrollChain.prepend(frame.document()->documentElement()); 218 // the body, some elements may use the documentElement as their
219 // containingBlock, so we ensure the scrollingElement is added
220 // here.
221 scrollChain.prepend(frame.document()->scrollingElement());
215 } 222 }
216 223
217 EventHandler::EventHandler(LocalFrame* frame) 224 EventHandler::EventHandler(LocalFrame* frame)
218 : m_frame(frame) 225 : m_frame(frame)
219 , m_mousePressed(false) 226 , m_mousePressed(false)
220 , m_capturesDragging(false) 227 , m_capturesDragging(false)
221 , m_mouseDownMayStartDrag(false) 228 , m_mouseDownMayStartDrag(false)
222 , m_selectionController(SelectionController::create(*frame)) 229 , m_selectionController(SelectionController::create(*frame))
223 , m_hoverTimer(this, &EventHandler::hoverTimerFired) 230 , m_hoverTimer(this, &EventHandler::hoverTimerFired)
224 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired) 231 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired)
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
302 m_lastMouseDownUserGestureToken.clear(); 309 m_lastMouseDownUserGestureToken.clear();
303 m_mousePressNode = nullptr; 310 m_mousePressNode = nullptr;
304 m_mousePressed = false; 311 m_mousePressed = false;
305 m_capturesDragging = false; 312 m_capturesDragging = false;
306 m_capturingMouseEventsNode = nullptr; 313 m_capturingMouseEventsNode = nullptr;
307 m_latchedWheelEventNode = nullptr; 314 m_latchedWheelEventNode = nullptr;
308 m_previousWheelScrolledNode = nullptr; 315 m_previousWheelScrolledNode = nullptr;
309 m_targetForTouchID.clear(); 316 m_targetForTouchID.clear();
310 m_touchSequenceDocument.clear(); 317 m_touchSequenceDocument.clear();
311 m_touchSequenceUserGestureToken.clear(); 318 m_touchSequenceUserGestureToken.clear();
312 m_scrollGestureHandlingNode = nullptr; 319 clearGestureScrollState();
313 m_lastGestureScrollOverWidget = false; 320 m_lastGestureScrollOverWidget = false;
314 m_previousGestureScrolledNode = nullptr;
315 m_scrollbarHandlingScrollGesture = nullptr; 321 m_scrollbarHandlingScrollGesture = nullptr;
316 m_maxMouseMovedDuration = 0; 322 m_maxMouseMovedDuration = 0;
317 m_touchPressed = false; 323 m_touchPressed = false;
318 m_pointerIdManager.clear(); 324 m_pointerIdManager.clear();
319 m_mouseDownMayStartDrag = false; 325 m_mouseDownMayStartDrag = false;
320 m_lastShowPressTimestamp = 0; 326 m_lastShowPressTimestamp = 0;
321 m_lastDeferredTapElement = nullptr; 327 m_lastDeferredTapElement = nullptr;
322 m_eventHandlerWillResetCapturingMouseEventsNode = false; 328 m_eventHandlerWillResetCapturingMouseEventsNode = false;
323 m_mouseDownMayStartAutoscroll = false; 329 m_mouseDownMayStartAutoscroll = false;
324 m_svgPan = false; 330 m_svgPan = false;
(...skipping 3564 matching lines...) Expand 10 before | Expand all | Expand 10 after
3889 unsigned EventHandler::accessKeyModifiers() 3895 unsigned EventHandler::accessKeyModifiers()
3890 { 3896 {
3891 #if OS(MACOSX) 3897 #if OS(MACOSX)
3892 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3898 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3893 #else 3899 #else
3894 return PlatformEvent::AltKey; 3900 return PlatformEvent::AltKey;
3895 #endif 3901 #endif
3896 } 3902 }
3897 3903
3898 } // namespace blink 3904 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698