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

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: Don't trigger layout on 0 delta. 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 166 matching lines...) Expand 10 before | Expand all | Expand 10 after
177 { 177 {
178 scrollChain.clear(); 178 scrollChain.clear();
179 179
180 ASSERT(startNode.layoutObject()); 180 ASSERT(startNode.layoutObject());
181 LayoutBox* curBox = startNode.layoutObject()->enclosingBox(); 181 LayoutBox* curBox = startNode.layoutObject()->enclosingBox();
182 182
183 // Scrolling propagates along the containing block chain. 183 // Scrolling propagates along the containing block chain.
184 while (curBox && !curBox->isLayoutView()) { 184 while (curBox && !curBox->isLayoutView()) {
185 Node* curNode = curBox->node(); 185 Node* curNode = curBox->node();
186 // FIXME: this should reject more elements, as part of crbug.com/410974. 186 // FIXME: this should reject more elements, as part of crbug.com/410974.
187 if (curNode && curNode->isElementNode()) 187 if (curNode && curNode->isElementNode()) {
188 scrollChain.prepend(toElement(curNode)); 188 Element* curElement = toElement(curNode);
189 if (curElement == frame.document()->scrollingElement())
190 break;
191 scrollChain.prepend(curElement);
192 }
189 curBox = curBox->containingBlock(); 193 curBox = curBox->containingBlock();
190 } 194 }
191 195 // TODO(tdresser): this should sometimes be excluded, as part of crbug.com/4 10974.
192 // FIXME: we should exclude the document in some cases, as part 196 // We need to ensure that the scrollingElement is always part of
193 // of crbug.com/410974. 197 // the scroll chain. In quirks mode, when the scrollingElement is
194 scrollChain.prepend(frame.document()->documentElement()); 198 // the body, some elements may use the documentElement as their
199 // containingBlock, so we ensure the scrollingElement is added
200 // here.
201 scrollChain.prepend(frame.document()->scrollingElement());
195 } 202 }
196 203
197 EventHandler::EventHandler(LocalFrame* frame) 204 EventHandler::EventHandler(LocalFrame* frame)
198 : m_frame(frame) 205 : m_frame(frame)
199 , m_mousePressed(false) 206 , m_mousePressed(false)
200 , m_capturesDragging(false) 207 , m_capturesDragging(false)
201 , m_mouseDownMayStartDrag(false) 208 , m_mouseDownMayStartDrag(false)
202 , m_selectionController(SelectionController::create(*frame)) 209 , m_selectionController(SelectionController::create(*frame))
203 , m_hoverTimer(this, &EventHandler::hoverTimerFired) 210 , m_hoverTimer(this, &EventHandler::hoverTimerFired)
204 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired) 211 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired)
(...skipping 77 matching lines...) Expand 10 before | Expand all | Expand 10 after
282 m_lastMouseDownUserGestureToken.clear(); 289 m_lastMouseDownUserGestureToken.clear();
283 m_mousePressNode = nullptr; 290 m_mousePressNode = nullptr;
284 m_mousePressed = false; 291 m_mousePressed = false;
285 m_capturesDragging = false; 292 m_capturesDragging = false;
286 m_capturingMouseEventsNode = nullptr; 293 m_capturingMouseEventsNode = nullptr;
287 m_latchedWheelEventNode = nullptr; 294 m_latchedWheelEventNode = nullptr;
288 m_previousWheelScrolledNode = nullptr; 295 m_previousWheelScrolledNode = nullptr;
289 m_targetForTouchID.clear(); 296 m_targetForTouchID.clear();
290 m_touchSequenceDocument.clear(); 297 m_touchSequenceDocument.clear();
291 m_touchSequenceUserGestureToken.clear(); 298 m_touchSequenceUserGestureToken.clear();
292 m_scrollGestureHandlingNode = nullptr; 299 clearGestureScrollState();
293 m_lastGestureScrollOverWidget = false; 300 m_lastGestureScrollOverWidget = false;
294 m_previousGestureScrolledNode = nullptr;
295 m_scrollbarHandlingScrollGesture = nullptr; 301 m_scrollbarHandlingScrollGesture = nullptr;
296 m_touchPressed = false; 302 m_touchPressed = false;
297 m_pointerIdManager.clear(); 303 m_pointerIdManager.clear();
298 m_mouseDownMayStartDrag = false; 304 m_mouseDownMayStartDrag = false;
299 m_lastShowPressTimestamp = 0; 305 m_lastShowPressTimestamp = 0;
300 m_lastDeferredTapElement = nullptr; 306 m_lastDeferredTapElement = nullptr;
301 m_eventHandlerWillResetCapturingMouseEventsNode = false; 307 m_eventHandlerWillResetCapturingMouseEventsNode = false;
302 m_mouseDownMayStartAutoscroll = false; 308 m_mouseDownMayStartAutoscroll = false;
303 m_svgPan = false; 309 m_svgPan = false;
304 m_mouseDownPos = IntPoint(); 310 m_mouseDownPos = IntPoint();
(...skipping 3563 matching lines...) Expand 10 before | Expand all | Expand 10 after
3868 unsigned EventHandler::accessKeyModifiers() 3874 unsigned EventHandler::accessKeyModifiers()
3869 { 3875 {
3870 #if OS(MACOSX) 3876 #if OS(MACOSX)
3871 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 3877 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
3872 #else 3878 #else
3873 return PlatformEvent::AltKey; 3879 return PlatformEvent::AltKey;
3874 #endif 3880 #endif
3875 } 3881 }
3876 3882
3877 } // namespace blink 3883 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698