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

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: Fix test expectations. Created 5 years, 4 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 172 matching lines...) Expand 10 before | Expand all | Expand 10 after
183 { 183 {
184 scrollChain.clear(); 184 scrollChain.clear();
185 185
186 ASSERT(startNode.layoutObject()); 186 ASSERT(startNode.layoutObject());
187 LayoutBox* curBox = startNode.layoutObject()->enclosingBox(); 187 LayoutBox* curBox = startNode.layoutObject()->enclosingBox();
188 188
189 // Scrolling propagates along the containing block chain. 189 // Scrolling propagates along the containing block chain.
190 while (curBox && !curBox->isLayoutView()) { 190 while (curBox && !curBox->isLayoutView()) {
191 Node* curNode = curBox->node(); 191 Node* curNode = curBox->node();
192 // FIXME: this should reject more elements, as part of crbug.com/410974. 192 // FIXME: this should reject more elements, as part of crbug.com/410974.
193 if (curNode && curNode->isElementNode()) 193 if (curNode && curNode->isElementNode()) {
194 scrollChain.prepend(toElement(curNode)); 194 Element* curElement = toElement(curNode);
195 if (curElement == frame.document()->scrollingElement())
196 break;
197 scrollChain.prepend(curElement);
198 }
195 curBox = curBox->containingBlock(); 199 curBox = curBox->containingBlock();
196 } 200 }
197 201 // TODO(tdresser): this should sometimes be excluded, as part of crbug.com/4 10974.
198 // FIXME: we should exclude the document in some cases, as part 202 // We need to ensure that the scrollingElement is always part of
199 // of crbug.com/410974. 203 // the scroll chain. In quirks mode, when the scrollingElement is
200 scrollChain.prepend(frame.document()->documentElement()); 204 // the body, some elements may use the documentElement as their
205 // containingBlock, so we ensure the scrollingElement is added
206 // here.
207 scrollChain.prepend(frame.document()->scrollingElement());
201 } 208 }
202 209
203 EventHandler::EventHandler(LocalFrame* frame) 210 EventHandler::EventHandler(LocalFrame* frame)
204 : m_frame(frame) 211 : m_frame(frame)
205 , m_mousePressed(false) 212 , m_mousePressed(false)
206 , m_capturesDragging(false) 213 , m_capturesDragging(false)
207 , m_mouseDownMayStartDrag(false) 214 , m_mouseDownMayStartDrag(false)
208 , m_selectionController(SelectionController::create(*frame)) 215 , m_selectionController(SelectionController::create(*frame))
209 , m_hoverTimer(this, &EventHandler::hoverTimerFired) 216 , m_hoverTimer(this, &EventHandler::hoverTimerFired)
210 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired) 217 , m_cursorUpdateTimer(this, &EventHandler::cursorUpdateTimerFired)
(...skipping 76 matching lines...) Expand 10 before | Expand all | Expand 10 after
287 m_lastKnownMouseGlobalPosition = IntPoint(); 294 m_lastKnownMouseGlobalPosition = IntPoint();
288 m_lastMouseDownUserGestureToken.clear(); 295 m_lastMouseDownUserGestureToken.clear();
289 m_mousePressNode = nullptr; 296 m_mousePressNode = nullptr;
290 m_mousePressed = false; 297 m_mousePressed = false;
291 m_capturesDragging = false; 298 m_capturesDragging = false;
292 m_capturingMouseEventsNode = nullptr; 299 m_capturingMouseEventsNode = 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 3724 matching lines...) Expand 10 before | Expand all | Expand 10 after
4034 unsigned EventHandler::accessKeyModifiers() 4040 unsigned EventHandler::accessKeyModifiers()
4035 { 4041 {
4036 #if OS(MACOSX) 4042 #if OS(MACOSX)
4037 return PlatformEvent::CtrlKey | PlatformEvent::AltKey; 4043 return PlatformEvent::CtrlKey | PlatformEvent::AltKey;
4038 #else 4044 #else
4039 return PlatformEvent::AltKey; 4045 return PlatformEvent::AltKey;
4040 #endif 4046 #endif
4041 } 4047 }
4042 4048
4043 } // namespace blink 4049 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698