Changeset 163558 in webkit
- Timestamp:
- Feb 6, 2014 12:43:56 PM (10 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r163556 r163558 1 2014-02-05 Brent Fulgham <bfulgham@apple.com> 2 3 Wheel events don't latch to inner scrollable elements 4 https://bugs.webkit.org/show_bug.cgi?id=128225 5 6 Reviewed by Beth Dakin. 7 8 * page/EventHandler.cpp: 9 (WebCore::EventHandler::handleWheelEvent): Identify the case 10 where we have hit the end of a scroll, and treat that as a 11 valid 'handled' case. If the scroll event is just starting, 12 treat end-of-scroll as unhandled so the parent element can 13 handle things. 14 * page/WheelEventDeltaTracker.h: 15 (WebCore::WheelEventDeltaTracker::isFirstWheelEvent): Added. 16 1 17 2014-02-06 Commit Queue <commit-queue@webkit.org> 2 18 -
trunk/Source/WebCore/page/EventHandler.cpp
r163440 r163558 1 1 /* 2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2013 Apple Inc. All rights reserved.2 * Copyright (C) 2006, 2007, 2008, 2009, 2010, 2011, 2013, 2014 Apple Inc. All rights reserved. 3 3 * Copyright (C) 2006 Alexey Proskuryakov (ap@webkit.org) 4 4 * Copyright (C) 2012 Digia Plc. and/or its subsidiary(-ies) … … 2529 2529 // We do another check on the frame view because the event handler can run JS which results in the frame getting destroyed. 2530 2530 view = m_frame.view(); 2531 2532 #if PLATFORM(MAC) 2533 if (useLatchedWheelEventElement && m_latchedWheelEventElement == element) { 2534 bool enclosingFrameIsMainFrame = view ? view->frame().isMainFrame() : false; 2535 2536 // If we are latched, and have nowhere to scroll, treat the scroll event as ended so that we don't 2537 // cause the scroll to break free of the current scrolling widget. 2538 if (!enclosingFrameIsMainFrame) { 2539 bool didHandleWheelEvent = view ? view->wheelEvent(event) : false; 2540 if (!didHandleWheelEvent) { 2541 // If we are just starting a scroll event, and have nowhere left to scroll, allow 2542 // the enclosing frame to handle the scroll. 2543 didHandleWheelEvent = !m_recentWheelEventDeltaTracker->isFirstWheelEvent(); 2544 } 2545 2546 m_isHandlingWheelEvent = false; 2547 return didHandleWheelEvent; 2548 } 2549 2550 if (!m_recentWheelEventDeltaTracker->isFirstWheelEvent()) { 2551 // When the main frame is our parent, and we have been scrolling within this region, we do not 2552 // want to have the main frame consume any remaining scroll events. Keep them latched to this 2553 // element. 2554 m_isHandlingWheelEvent = false; 2555 return true; 2556 } 2557 } 2558 #endif 2559 2531 2560 bool didHandleEvent = view ? view->wheelEvent(event) : false; 2532 2561 m_isHandlingWheelEvent = false; -
trunk/Source/WebCore/page/WheelEventDeltaTracker.h
r163180 r163558 52 52 53 53 bool isTrackingDeltas() const { return m_isTrackingDeltas; } 54 bool isFirstWheelEvent() const { return m_recentWheelEventDeltas.size() <= 1; } 54 55 55 56 void recordWheelEventDelta(const PlatformWheelEvent&);
Note: See TracChangeset
for help on using the changeset viewer.