Changeset 107277 in webkit
- Timestamp:
- Feb 9, 2012 12:44:05 PM (12 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r107270 r107277 1 2012-02-09 Anders Carlsson <andersca@apple.com> 2 3 The scrolling tree should know more about the scrollbar state 4 https://bugs.webkit.org/show_bug.cgi?id=78268 5 6 Reviewed by Andreas Kling. 7 8 With this change, the scroll tree now keeps track of the horizontal scroll elasticity, 9 the vertical scroll elasticity and whether the page has enabled scrollbars. 10 11 This is needed in order to make rubber-banding work correctly when doing fast scrolling. 12 13 * page/scrolling/ScrollingCoordinator.cpp: 14 (WebCore::ScrollingCoordinator::frameViewLayoutUpdated): 15 * page/scrolling/ScrollingTreeNode.cpp: 16 (WebCore::ScrollingTreeNode::ScrollingTreeNode): 17 (WebCore::ScrollingTreeNode::update): 18 * page/scrolling/ScrollingTreeNode.h: 19 (ScrollingTreeNode): 20 * page/scrolling/ScrollingTreeState.cpp: 21 (WebCore::ScrollingTreeState::ScrollingTreeState): 22 (WebCore::ScrollingTreeState::setHorizontalScrollElasticity): 23 (WebCore): 24 (WebCore::ScrollingTreeState::setVerticalScrollElasticity): 25 (WebCore::ScrollingTreeState::setHasEnabledHorizontalScrollbar): 26 (WebCore::ScrollingTreeState::setHasEnabledVerticalScrollbar): 27 * page/scrolling/ScrollingTreeState.h: 28 (WebCore::ScrollingTreeState::horizontalScrollElasticity): 29 (ScrollingTreeState): 30 (WebCore::ScrollingTreeState::verticalScrollElasticity): 31 (WebCore::ScrollingTreeState::hasEnabledHorizontalScrollbar): 32 (WebCore::ScrollingTreeState::hasEnabledVerticalScrollbar): 33 1 34 2012-02-09 Xianzhu Wang <wangxianzhu@chromium.org> 2 35 -
trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.cpp
r107013 r107277 116 116 } 117 117 118 m_scrollingTreeState->setHorizontalScrollElasticity(frameView->horizontalScrollElasticity()); 119 m_scrollingTreeState->setVerticalScrollElasticity(frameView->verticalScrollElasticity()); 120 m_scrollingTreeState->setHasEnabledHorizontalScrollbar(frameView->horizontalScrollbar() && frameView->horizontalScrollbar()->enabled()); 121 m_scrollingTreeState->setHasEnabledVerticalScrollbar(frameView->verticalScrollbar() && frameView->verticalScrollbar()->enabled()); 122 118 123 m_scrollingTreeState->setViewportRect(IntRect(IntPoint(), frameView->visibleContentRect().size())); 119 124 m_scrollingTreeState->setContentsSize(frameView->contentsSize()); -
trunk/Source/WebCore/page/scrolling/ScrollingTreeNode.cpp
r106711 r107277 35 35 ScrollingTreeNode::ScrollingTreeNode(ScrollingTree* scrollingTree) 36 36 : m_scrollingTree(scrollingTree) 37 , m_horizontalScrollElasticity(ScrollElasticityNone) 38 , m_verticalScrollElasticity(ScrollElasticityNone) 39 , m_hasEnabledHorizontalScrollbar(false) 40 , m_hasEnabledVerticalScrollbar(false) 37 41 { 38 42 } … … 49 53 if (state->changedProperties() & ScrollingTreeState::ContentsSize) 50 54 m_contentsSize = state->contentsSize(); 55 56 if (state->changedProperties() & ScrollingTreeState::HorizontalScrollElasticity) 57 m_horizontalScrollElasticity = state->horizontalScrollElasticity(); 58 59 if (state->changedProperties() & ScrollingTreeState::VerticalScrollElasticity) 60 m_verticalScrollElasticity = state->verticalScrollElasticity(); 61 62 if (state->changedProperties() & ScrollingTreeState::HasEnabledHorizontalScrollbar) 63 m_hasEnabledHorizontalScrollbar = state->hasEnabledHorizontalScrollbar(); 64 65 if (state->changedProperties() & ScrollingTreeState::HasEnabledVerticalScrollbar) 66 m_hasEnabledVerticalScrollbar = state->hasEnabledVerticalScrollbar(); 51 67 } 52 68 -
trunk/Source/WebCore/page/scrolling/ScrollingTreeNode.h
r106720 r107277 30 30 31 31 #include "IntRect.h" 32 #include "ScrollTypes.h" 32 33 #include <wtf/PassOwnPtr.h> 33 34 … … 58 59 IntRect m_viewportRect; 59 60 IntSize m_contentsSize; 61 62 ScrollElasticity m_horizontalScrollElasticity; 63 ScrollElasticity m_verticalScrollElasticity; 64 65 bool m_hasEnabledHorizontalScrollbar; 66 bool m_hasEnabledVerticalScrollbar; 60 67 }; 61 68 -
trunk/Source/WebCore/page/scrolling/ScrollingTreeState.cpp
r107001 r107277 39 39 : m_changedProperties(0) 40 40 , m_wheelEventHandlerCount(0) 41 , m_horizontalScrollElasticity(ScrollElasticityNone) 42 , m_verticalScrollElasticity(ScrollElasticityNone) 43 , m_hasEnabledHorizontalScrollbar(false) 44 , m_hasEnabledVerticalScrollbar(false) 41 45 { 42 46 } … … 82 86 } 83 87 88 void ScrollingTreeState::setHorizontalScrollElasticity(ScrollElasticity horizontalScrollElasticity) 89 { 90 if (m_horizontalScrollElasticity == horizontalScrollElasticity) 91 return; 92 93 m_horizontalScrollElasticity = horizontalScrollElasticity; 94 m_changedProperties |= HorizontalScrollElasticity; 95 } 96 97 void ScrollingTreeState::setVerticalScrollElasticity(ScrollElasticity verticalScrollElasticity) 98 { 99 if (m_verticalScrollElasticity == verticalScrollElasticity) 100 return; 101 102 m_verticalScrollElasticity = verticalScrollElasticity; 103 m_changedProperties |= VerticalScrollElasticity; 104 } 105 106 void ScrollingTreeState::setHasEnabledHorizontalScrollbar(bool hasEnabledHorizontalScrollbar) 107 { 108 if (m_hasEnabledHorizontalScrollbar == hasEnabledHorizontalScrollbar) 109 return; 110 111 m_hasEnabledHorizontalScrollbar = hasEnabledHorizontalScrollbar; 112 m_changedProperties |= HasEnabledHorizontalScrollbar; 113 } 114 115 void ScrollingTreeState::setHasEnabledVerticalScrollbar(bool hasEnabledVerticalScrollbar) 116 { 117 if (m_hasEnabledVerticalScrollbar == hasEnabledVerticalScrollbar) 118 return; 119 120 m_hasEnabledVerticalScrollbar = hasEnabledVerticalScrollbar; 121 m_changedProperties |= HasEnabledVerticalScrollbar; 122 } 123 84 124 PassOwnPtr<ScrollingTreeState> ScrollingTreeState::commit() 85 125 { -
trunk/Source/WebCore/page/scrolling/ScrollingTreeState.h
r107001 r107277 32 32 #include "IntRect.h" 33 33 #include "Region.h" 34 #include "ScrollTypes.h" 34 35 #include <wtf/PassOwnPtr.h> 35 36 … … 54 55 NonFastScrollableRegion = 1 << 2, 55 56 WheelEventHandlerCount = 1 << 3, 56 ScrollLayer = 1 << 4, 57 HorizontalScrollElasticity = 1 << 4, 58 VerticalScrollElasticity = 1 << 5, 59 HasEnabledHorizontalScrollbar = 1 << 6, 60 HasEnabledVerticalScrollbar = 1 << 7, 61 ScrollLayer = 1 << 8, 57 62 }; 58 63 … … 71 76 unsigned wheelEventHandlerCount() const { return m_wheelEventHandlerCount; } 72 77 void setWheelEventHandlerCount(unsigned); 78 79 ScrollElasticity horizontalScrollElasticity() const { return m_horizontalScrollElasticity; } 80 void setHorizontalScrollElasticity(ScrollElasticity); 81 82 ScrollElasticity verticalScrollElasticity() const { return m_verticalScrollElasticity; } 83 void setVerticalScrollElasticity(ScrollElasticity); 84 85 bool hasEnabledHorizontalScrollbar() const { return m_hasEnabledHorizontalScrollbar; } 86 void setHasEnabledHorizontalScrollbar(bool); 87 88 bool hasEnabledVerticalScrollbar() const { return m_hasEnabledVerticalScrollbar; } 89 void setHasEnabledVerticalScrollbar(bool); 73 90 74 91 PlatformLayer* platformScrollLayer() const; … … 90 107 unsigned m_wheelEventHandlerCount; 91 108 109 ScrollElasticity m_horizontalScrollElasticity; 110 ScrollElasticity m_verticalScrollElasticity; 111 112 bool m_hasEnabledHorizontalScrollbar; 113 bool m_hasEnabledVerticalScrollbar; 114 92 115 #if PLATFORM(MAC) 93 116 RetainPtr<PlatformLayer> m_platformScrollLayer;
Note: See TracChangeset
for help on using the changeset viewer.