Changeset 107001 in webkit
- Timestamp:
- Feb 7, 2012 3:47:59 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 13 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r107000 r107001 1 2012-02-07 Anders Carlsson <andersca@apple.com> 2 3 Scrolling tree should keep track of region we can't do fast scrolling for 4 https://bugs.webkit.org/show_bug.cgi?id=78050 5 6 Reviewed by Dan Bernstein. 7 8 We currently won't do fast scrolling for subframes and other types of scrollable areas. 9 Because of this, we'll have the scrolling tree keep a region of the page for which we can't 10 do fast scrolling. This region will be updated after layout. 11 12 * page/FrameView.cpp: 13 (WebCore::FrameView::scrollableAreaBoundingBox): 14 Return the bounding box. 15 16 * page/scrolling/ScrollingCoordinator.cpp: 17 (WebCore::ScrollingCoordinator::frameViewLayoutUpdated): 18 Go through all the scrollable areas in this frame view and compute the region which we can't do 19 fast scrolling for. 20 21 * page/scrolling/ScrollingTree.cpp: 22 (WebCore::ScrollingTree::commitNewTreeState): 23 Update the non-fast-scrollable region. 24 25 * page/scrolling/ScrollingTreeState.cpp: 26 (WebCore::ScrollingTreeState::setNonFastScrollableRegion): 27 Set the non-fast-scrollable region if it's changed. 28 29 * platform/ScrollableArea.h: 30 Add scrollableAreaBoundingBox member function. 31 32 * rendering/RenderLayer.cpp: 33 (WebCore::RenderLayer::scrollableAreaBoundingBox): 34 Return the bounding box. 35 36 * rendering/RenderListBox.cpp: 37 (WebCore::RenderListBox::scrollableAreaBoundingBox): 38 Return the bounding box. 39 1 40 2012-02-07 Levi Weintraub <leviw@chromium.org> 2 41 -
trunk/Source/WebCore/page/FrameView.cpp
r106977 r107001 2550 2550 } 2551 2551 2552 IntRect FrameView::scrollableAreaBoundingBox() const 2553 { 2554 // FIXME: This isn't correct for transformed frames. We probably need to ask the renderer instead. 2555 return frameRect(); 2556 } 2557 2552 2558 bool FrameView::shouldSuspendScrollAnimations() const 2553 2559 { -
trunk/Source/WebCore/page/FrameView.h
r106977 r107001 372 372 virtual bool isOnActivePage() const; 373 373 virtual ScrollableArea* enclosingScrollableArea() const; 374 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; 374 375 375 376 #if USE(ACCELERATED_COMPOSITING) -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r106766 r107001 35 35 #include "Page.h" 36 36 #include "PlatformWheelEvent.h" 37 #include "Region.h" 37 38 #include "ScrollAnimator.h" 38 39 #include "ScrollingThread.h" … … 98 99 if (!coordinatesScrollingForFrameView(frameView)) 99 100 return; 101 102 // Compute the region of the page that we can't do fast scrolling for. This currently includes 103 // all scrollable areas, such as subframes, overflow divs and list boxes. 104 Region nonScrollableRegion; 105 if (const FrameView::ScrollableAreaSet* scrollableAreas = frameView->scrollableAreas()) { 106 for (FrameView::ScrollableAreaSet::const_iterator it = scrollableAreas->begin(), end = scrollableAreas->end(); it != end; ++it) { 107 ScrollableArea* scrollableArea = *it; 108 109 // Check if this area can be scrolled at all. 110 if ((!scrollableArea->horizontalScrollbar() || !scrollableArea->horizontalScrollbar()->enabled()) 111 && (!scrollableArea->verticalScrollbar() || !scrollableArea->verticalScrollbar()->enabled())) 112 continue; 113 114 nonScrollableRegion.unite(scrollableArea->scrollableAreaBoundingBox()); 115 } 116 } 100 117 101 118 m_scrollingTreeState->setViewportRect(IntRect(IntPoint(), frameView->visibleContentRect().size())); -
trunk/Source/WebCore/page/scrolling/ScrollingTree.cpp
r106766 r107001 90 90 ASSERT(ScrollingThread::isCurrentThread()); 91 91 92 if (scrollingTreeState->changedProperties() & ScrollingTreeState::WheelEventHandlerCount) {92 if (scrollingTreeState->changedProperties() & (ScrollingTreeState::WheelEventHandlerCount | ScrollingTreeState::NonFastScrollableRegion)) { 93 93 MutexLocker lock(m_mutex); 94 94 95 m_hasWheelEventHandlers = scrollingTreeState->wheelEventHandlerCount(); 95 if (scrollingTreeState->changedProperties() & ScrollingTreeState::WheelEventHandlerCount) 96 m_hasWheelEventHandlers = scrollingTreeState->wheelEventHandlerCount(); 97 if (scrollingTreeState->changedProperties() & ScrollingTreeState::NonFastScrollableRegion) 98 m_nonFastScrollableRegion = scrollingTreeState->nonFastScrollableRegion(); 96 99 } 97 100 -
trunk/Source/WebCore/page/scrolling/ScrollingTree.h
r106766 r107001 29 29 #if ENABLE(THREADED_SCROLLING) 30 30 31 #include "Region.h" 31 32 #include <wtf/OwnPtr.h> 32 33 #include <wtf/PassOwnPtr.h> … … 72 73 73 74 Mutex m_mutex; 75 Region m_nonFastScrollableRegion; 74 76 bool m_hasWheelEventHandlers; 75 77 }; -
trunk/Source/WebCore/page/scrolling/ScrollingTreeState.cpp
r106766 r107001 64 64 } 65 65 66 void ScrollingTreeState::setNonFastScrollableRegion(const Region& nonFastScrollableRegion) 67 { 68 if (m_nonFastScrollableRegion == nonFastScrollableRegion) 69 return; 70 71 m_nonFastScrollableRegion = nonFastScrollableRegion; 72 m_changedProperties |= NonFastScrollableRegion; 73 } 74 66 75 void ScrollingTreeState::setWheelEventHandlerCount(unsigned wheelEventHandlerCount) 67 76 { -
trunk/Source/WebCore/page/scrolling/ScrollingTreeState.h
r106766 r107001 31 31 #include "GraphicsLayer.h" 32 32 #include "IntRect.h" 33 #include "Region.h" 33 34 #include <wtf/PassOwnPtr.h> 34 35 … … 51 52 ViewportRect = 1 << 0, 52 53 ContentsSize = 1 << 1, 53 WheelEventHandlerCount = 1 << 2, 54 ScrollLayer = 1 << 3, 54 NonFastScrollableRegion = 1 << 2, 55 WheelEventHandlerCount = 1 << 3, 56 ScrollLayer = 1 << 4, 55 57 }; 56 58 … … 63 65 const IntSize& contentsSize() const { return m_contentsSize; } 64 66 void setContentsSize(const IntSize&); 67 68 const Region& nonFastScrollableRegion() const { return m_nonFastScrollableRegion; } 69 void setNonFastScrollableRegion(const Region&); 65 70 66 71 unsigned wheelEventHandlerCount() const { return m_wheelEventHandlerCount; } … … 81 86 IntSize m_contentsSize; 82 87 88 Region m_nonFastScrollableRegion; 89 83 90 unsigned m_wheelEventHandlerCount; 84 91 -
trunk/Source/WebCore/platform/ScrollableArea.h
r106977 r107001 156 156 virtual ScrollableArea* enclosingScrollableArea() const = 0; 157 157 158 // Returns the bounding box of this scrollable area, in the coordinate system of the enclosing scroll view. 159 virtual IntRect scrollableAreaBoundingBox() const { ASSERT_NOT_REACHED(); } 160 158 161 bool isPinnedInBothDirections(const IntSize&) const; 159 162 bool isPinnedHorizontallyInDirection(int horizontalScrollDelta) const; -
trunk/Source/WebCore/rendering/RenderLayer.cpp
r106977 r107001 887 887 } 888 888 889 IntRect RenderLayer::scrollableAreaBoundingBox() const 890 { 891 return renderer()->absoluteBoundingBoxRect(); 892 } 893 889 894 RenderLayer* RenderLayer::enclosingTransformedAncestor() const 890 895 { -
trunk/Source/WebCore/rendering/RenderLayer.h
r106977 r107001 665 665 virtual bool shouldSuspendScrollAnimations() const; 666 666 virtual bool isOnActivePage() const; 667 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; 667 668 668 669 // Rectangle encompassing the scroll corner and resizer rect. -
trunk/Source/WebCore/rendering/RenderListBox.cpp
r106977 r107001 822 822 } 823 823 824 IntRect RenderListBox::scrollableAreaBoundingBox() const 825 { 826 return absoluteBoundingBoxRect(); 827 } 828 824 829 PassRefPtr<Scrollbar> RenderListBox::createScrollbar() 825 830 { -
trunk/Source/WebCore/rendering/RenderListBox.h
r106977 r107001 121 121 122 122 virtual ScrollableArea* enclosingScrollableArea() const; 123 virtual IntRect scrollableAreaBoundingBox() const OVERRIDE; 123 124 124 125 // NOTE: This should only be called by the overriden setScrollOffset from ScrollableArea.
Note: See TracChangeset
for help on using the changeset viewer.