Changeset 107013 in webkit
- Timestamp:
- Feb 7, 2012 5:00:06 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r107012 r107013 1 2012-02-07 Anders Carlsson <andersca@apple.com> 2 3 Use the non-fast-scrollable region to detect when we can't do fast scrolling 4 https://bugs.webkit.org/show_bug.cgi?id=78056 5 <rdar://problem/10247932> 6 7 Reviewed by Sam Weinig. 8 9 * page/scrolling/ScrollingCoordinator.cpp: 10 (WebCore::ScrollingCoordinator::frameViewLayoutUpdated): 11 Actually set the non-fast scrollable region on the scrolling tree state. 12 13 * page/scrolling/ScrollingTree.cpp: 14 (WebCore::ScrollingTree::tryToHandleWheelEvent): 15 Check if the wheel event's position is inside the non-fast-scrollable region 16 and return false if it is. 17 18 (WebCore::ScrollingTree::updateMainFrameScrollPosition): 19 Store the cached main frame scroll position so we can use it in tryToHandleWheelEvent. 20 21 * platform/graphics/Region.cpp: 22 * platform/graphics/Region.h: 23 Add a simple contains(const IntPoint&) member function. 24 1 25 2012-02-07 Dan Bernstein <mitz@apple.com> 2 26 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r107001 r107013 118 118 m_scrollingTreeState->setViewportRect(IntRect(IntPoint(), frameView->visibleContentRect().size())); 119 119 m_scrollingTreeState->setContentsSize(frameView->contentsSize()); 120 m_scrollingTreeState->setNonFastScrollableRegion(nonScrollableRegion); 120 121 scheduleTreeStateCommit(); 121 122 } -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r107001 r107013 62 62 if (m_hasWheelEventHandlers) 63 63 return false; 64 65 if (!m_nonFastScrollableRegion.isEmpty()) { 66 // FIXME: This is not correct for non-default scroll origins. 67 IntPoint position = wheelEvent.position(); 68 position.moveBy(m_mainFrameScrollPosition); 69 if (m_nonFastScrollableRegion.contains(position)) 70 return false; 71 } 64 72 } 65 66 // FIXME: Check if we're over a subframe or overflow div.67 73 68 74 ScrollingThread::dispatch(bind(&ScrollingTree::handleWheelEvent, this, wheelEvent)); … … 107 113 return; 108 114 115 { 116 MutexLocker lock(m_mutex); 117 m_mainFrameScrollPosition = scrollPosition; 118 } 119 109 120 callOnMainThread(bind(&ScrollingCoordinator::updateMainFrameScrollPosition, m_scrollingCoordinator.get(), scrollPosition)); 110 121 } -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r107001 r107013 74 74 Mutex m_mutex; 75 75 Region m_nonFastScrollableRegion; 76 IntPoint m_mainFrameScrollPosition; 76 77 bool m_hasWheelEventHandlers; 77 78 }; -
trunk/Source/WebCore/platform/graphics/Region.cpp
r106893 r107013 71 71 } 72 72 73 bool Region::contains(const IntPoint& point) const 74 { 75 // FIXME: This is inefficient. We should be able to iterate over the spans and find 76 // out if the region contains the point. 77 return contains(IntRect(point, IntSize(1, 1))); 78 } 79 73 80 Region::Shape::Shape() 74 81 { -
trunk/Source/WebCore/platform/graphics/Region.h
r106893 r107013 50 50 // Returns true if the query region is a subset of this region. 51 51 bool contains(const Region&) const; 52 53 bool contains(const IntPoint&) const; 52 54 53 55 #ifndef NDEBUG
Note: See TracChangeset
for help on using the changeset viewer.