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

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

Issue 1236913004: Expose scroll customization for touch to JS (behind REF). (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add to leak expectations. Created 5 years, 3 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 183 matching lines...) Expand 10 before | Expand all | Expand 10 after
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
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 3711 matching lines...) Expand 10 before | Expand all | Expand 10 after
4030 unsigned EventHandler::accessKeyModifiers() 4036 unsigned EventHandler::accessKeyModifiers()
4031 { 4037 {
4032 #if OS(MACOSX) 4038 #if OS(MACOSX)
4033 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4039 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4034 #else 4040 #else
4035 return PlatformEvent::AltKey; 4041 return PlatformEvent::AltKey;
4036 #endif 4042 #endif
4037 } 4043 }
4038 4044
4039 } // namespace blink 4045 } // 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