Diff
Modified: trunk/Source/WebCore/ChangeLog (160651 => 160652)
--- trunk/Source/WebCore/ChangeLog 2013-12-16 19:23:24 UTC (rev 160651)
+++ trunk/Source/WebCore/ChangeLog 2013-12-16 19:57:27 UTC (rev 160652)
@@ -1,3 +1,38 @@
+2013-12-16 Simon Fraser <[email protected]>
+
+ Package up some data about scrollability into a struct for use in the scrolling tree
+ https://bugs.webkit.org/show_bug.cgi?id=125792
+
+ Reviewed by Beth Dakin.
+
+ Both scrolling state nodes and scrolling nodes share a set of parameters
+ relating to scrollability and rubberbanding, so package them into a struct
+ for re-use. Send the struct wholesale to the scrolling thread.
+
+ * page/scrolling/ScrollingCoordinator.h:
+ (WebCore::ScrollableAreaParameters::ScrollableAreaParameters): New struct.
+ (WebCore::ScrollableAreaParameters::operator==):
+ * page/scrolling/ScrollingStateScrollingNode.cpp:
+ (WebCore::ScrollingStateScrollingNode::ScrollingStateScrollingNode): Reordering.
+ (WebCore::ScrollingStateScrollingNode::setScrollOrigin): Moved.
+ (WebCore::ScrollingStateScrollingNode::setScrollableAreaParameters): Set the parameters all at once.
+ (WebCore::ScrollingStateScrollingNode::setRequestedScrollPosition):
+ * page/scrolling/ScrollingStateScrollingNode.h: Getters access the struct. Reorder member variables.
+ * page/scrolling/ScrollingTreeScrollingNode.cpp:
+ (WebCore::ScrollingTreeScrollingNode::ScrollingTreeScrollingNode):
+ (WebCore::ScrollingTreeScrollingNode::updateBeforeChildren):
+ * page/scrolling/ScrollingTreeScrollingNode.h:
+ (WebCore::ScrollingTreeScrollingNode::scrollOrigin):
+ (WebCore::ScrollingTreeScrollingNode::horizontalScrollElasticity):
+ (WebCore::ScrollingTreeScrollingNode::verticalScrollElasticity):
+ (WebCore::ScrollingTreeScrollingNode::hasEnabledHorizontalScrollbar):
+ (WebCore::ScrollingTreeScrollingNode::hasEnabledVerticalScrollbar):
+ (WebCore::ScrollingTreeScrollingNode::canHaveScrollbars):
+ * page/scrolling/mac/ScrollingCoordinatorMac.h:
+ * page/scrolling/mac/ScrollingCoordinatorMac.mm: Removed setScrollParametersForNode().
+ (WebCore::ScrollingCoordinatorMac::frameViewLayoutUpdated): Set the params in this
+ function. Reordering.
+
2013-12-16 Sam Weinig <[email protected]>
CTTE: Convert more of SVG to use references
Modified: trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h (160651 => 160652)
--- trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2013-12-16 19:23:24 UTC (rev 160651)
+++ trunk/Source/WebCore/page/scrolling/ScrollingCoordinator.h 2013-12-16 19:57:27 UTC (rev 160652)
@@ -69,6 +69,37 @@
SyncScrollingLayerPosition
};
+struct ScrollableAreaParameters {
+ ScrollElasticity horizontalScrollElasticity;
+ ScrollElasticity verticalScrollElasticity;
+
+ ScrollbarMode horizontalScrollbarMode;
+ ScrollbarMode verticalScrollbarMode;
+
+ bool hasEnabledHorizontalScrollbar;
+ bool hasEnabledVerticalScrollbar;
+
+ ScrollableAreaParameters()
+ : horizontalScrollElasticity(ScrollElasticityNone)
+ , verticalScrollElasticity(ScrollElasticityNone)
+ , horizontalScrollbarMode(ScrollbarAuto)
+ , verticalScrollbarMode(ScrollbarAuto)
+ , hasEnabledHorizontalScrollbar(false)
+ , hasEnabledVerticalScrollbar(false)
+ {
+ }
+
+ bool operator==(const ScrollableAreaParameters& other) const
+ {
+ return horizontalScrollElasticity == other.horizontalScrollElasticity
+ && verticalScrollElasticity == other.verticalScrollElasticity
+ && horizontalScrollbarMode == other.horizontalScrollbarMode
+ && verticalScrollbarMode == other.verticalScrollbarMode
+ && hasEnabledHorizontalScrollbar == other.hasEnabledHorizontalScrollbar
+ && hasEnabledVerticalScrollbar == other.hasEnabledVerticalScrollbar;
+ }
+};
+
class ScrollingCoordinator : public ThreadSafeRefCounted<ScrollingCoordinator> {
public:
static PassRefPtr<ScrollingCoordinator> create(Page*);
Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp (160651 => 160652)
--- trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp 2013-12-16 19:23:24 UTC (rev 160651)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.cpp 2013-12-16 19:57:27 UTC (rev 160652)
@@ -51,16 +51,10 @@
, m_frameScaleFactor(1)
, m_wheelEventHandlerCount(0)
, m_shouldUpdateScrollLayerPositionOnMainThread(0)
- , m_horizontalScrollElasticity(ScrollElasticityNone)
- , m_verticalScrollElasticity(ScrollElasticityNone)
- , m_hasEnabledHorizontalScrollbar(false)
- , m_hasEnabledVerticalScrollbar(false)
- , m_requestedScrollPositionRepresentsProgrammaticScroll(false)
- , m_horizontalScrollbarMode(ScrollbarAuto)
- , m_verticalScrollbarMode(ScrollbarAuto)
, m_behaviorForFixed(StickToDocumentBounds)
, m_headerHeight(0)
, m_footerHeight(0)
+ , m_requestedScrollPositionRepresentsProgrammaticScroll(false)
{
}
@@ -72,22 +66,17 @@
#endif
, m_viewportRect(stateNode.viewportRect())
, m_totalContentsSize(stateNode.totalContentsSize())
- , m_frameScaleFactor(stateNode.frameScaleFactor())
+ , m_scrollOrigin(stateNode.scrollOrigin())
+ , m_scrollableAreaParameters(stateNode.scrollableAreaParameters())
, m_nonFastScrollableRegion(stateNode.nonFastScrollableRegion())
+ , m_frameScaleFactor(stateNode.frameScaleFactor())
, m_wheelEventHandlerCount(stateNode.wheelEventHandlerCount())
, m_shouldUpdateScrollLayerPositionOnMainThread(stateNode.shouldUpdateScrollLayerPositionOnMainThread())
- , m_horizontalScrollElasticity(stateNode.horizontalScrollElasticity())
- , m_verticalScrollElasticity(stateNode.verticalScrollElasticity())
- , m_hasEnabledHorizontalScrollbar(stateNode.hasEnabledHorizontalScrollbar())
- , m_hasEnabledVerticalScrollbar(stateNode.hasEnabledVerticalScrollbar())
- , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
- , m_horizontalScrollbarMode(stateNode.horizontalScrollbarMode())
- , m_verticalScrollbarMode(stateNode.verticalScrollbarMode())
, m_behaviorForFixed(stateNode.scrollBehaviorForFixedElements())
- , m_requestedScrollPosition(stateNode.requestedScrollPosition())
- , m_scrollOrigin(stateNode.scrollOrigin())
, m_headerHeight(stateNode.headerHeight())
, m_footerHeight(stateNode.footerHeight())
+ , m_requestedScrollPosition(stateNode.requestedScrollPosition())
+ , m_requestedScrollPositionRepresentsProgrammaticScroll(stateNode.requestedScrollPositionRepresentsProgrammaticScroll())
{
setCounterScrollingLayer(stateNode.counterScrollingLayer());
setHeaderLayer(stateNode.headerLayer());
@@ -123,6 +112,26 @@
m_scrollingStateTree->setHasChangedProperties(true);
}
+void ScrollingStateScrollingNode::setScrollOrigin(const IntPoint& scrollOrigin)
+{
+ if (m_scrollOrigin == scrollOrigin)
+ return;
+
+ m_scrollOrigin = scrollOrigin;
+ setPropertyChanged(ScrollOrigin);
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
+void ScrollingStateScrollingNode::setScrollableAreaParameters(const ScrollableAreaParameters& parameters)
+{
+ if (m_scrollableAreaParameters == parameters)
+ return;
+
+ m_scrollableAreaParameters = parameters;
+ setPropertyChanged(ScrollableAreaParams);
+ m_scrollingStateTree->setHasChangedProperties(true);
+}
+
void ScrollingStateScrollingNode::setFrameScaleFactor(float scaleFactor)
{
if (m_frameScaleFactor == scaleFactor)
@@ -164,66 +173,6 @@
m_scrollingStateTree->setHasChangedProperties(true);
}
-void ScrollingStateScrollingNode::setHorizontalScrollElasticity(ScrollElasticity horizontalScrollElasticity)
-{
- if (m_horizontalScrollElasticity == horizontalScrollElasticity)
- return;
-
- m_horizontalScrollElasticity = horizontalScrollElasticity;
- setPropertyChanged(HorizontalScrollElasticity);
- m_scrollingStateTree->setHasChangedProperties(true);
-}
-
-void ScrollingStateScrollingNode::setVerticalScrollElasticity(ScrollElasticity verticalScrollElasticity)
-{
- if (m_verticalScrollElasticity == verticalScrollElasticity)
- return;
-
- m_verticalScrollElasticity = verticalScrollElasticity;
- setPropertyChanged(VerticalScrollElasticity);
- m_scrollingStateTree->setHasChangedProperties(true);
-}
-
-void ScrollingStateScrollingNode::setHasEnabledHorizontalScrollbar(bool hasEnabledHorizontalScrollbar)
-{
- if (m_hasEnabledHorizontalScrollbar == hasEnabledHorizontalScrollbar)
- return;
-
- m_hasEnabledHorizontalScrollbar = hasEnabledHorizontalScrollbar;
- setPropertyChanged(HasEnabledHorizontalScrollbar);
- m_scrollingStateTree->setHasChangedProperties(true);
-}
-
-void ScrollingStateScrollingNode::setHasEnabledVerticalScrollbar(bool hasEnabledVerticalScrollbar)
-{
- if (m_hasEnabledVerticalScrollbar == hasEnabledVerticalScrollbar)
- return;
-
- m_hasEnabledVerticalScrollbar = hasEnabledVerticalScrollbar;
- setPropertyChanged(HasEnabledVerticalScrollbar);
- m_scrollingStateTree->setHasChangedProperties(true);
-}
-
-void ScrollingStateScrollingNode::setHorizontalScrollbarMode(ScrollbarMode horizontalScrollbarMode)
-{
- if (m_horizontalScrollbarMode == horizontalScrollbarMode)
- return;
-
- m_horizontalScrollbarMode = horizontalScrollbarMode;
- setPropertyChanged(HorizontalScrollbarMode);
- m_scrollingStateTree->setHasChangedProperties(true);
-}
-
-void ScrollingStateScrollingNode::setVerticalScrollbarMode(ScrollbarMode verticalScrollbarMode)
-{
- if (m_verticalScrollbarMode == verticalScrollbarMode)
- return;
-
- m_verticalScrollbarMode = verticalScrollbarMode;
- setPropertyChanged(VerticalScrollbarMode);
- m_scrollingStateTree->setHasChangedProperties(true);
-}
-
void ScrollingStateScrollingNode::setScrollBehaviorForFixedElements(ScrollBehaviorForFixedElements behaviorForFixed)
{
if (m_behaviorForFixed == behaviorForFixed)
@@ -242,16 +191,6 @@
m_scrollingStateTree->setHasChangedProperties(true);
}
-void ScrollingStateScrollingNode::setScrollOrigin(const IntPoint& scrollOrigin)
-{
- if (m_scrollOrigin == scrollOrigin)
- return;
-
- m_scrollOrigin = scrollOrigin;
- setPropertyChanged(ScrollOrigin);
- m_scrollingStateTree->setHasChangedProperties(true);
-}
-
void ScrollingStateScrollingNode::setHeaderHeight(int headerHeight)
{
if (m_headerHeight == headerHeight)
Modified: trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h (160651 => 160652)
--- trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h 2013-12-16 19:23:24 UTC (rev 160651)
+++ trunk/Source/WebCore/page/scrolling/ScrollingStateScrollingNode.h 2013-12-16 19:57:27 UTC (rev 160652)
@@ -51,17 +51,12 @@
enum ChangedProperty {
ViewportRect = NumStateNodeBits,
TotalContentsSize,
+ ScrollOrigin,
+ ScrollableAreaParams,
FrameScaleFactor,
NonFastScrollableRegion,
WheelEventHandlerCount,
ShouldUpdateScrollLayerPositionOnMainThread,
- HorizontalScrollElasticity,
- VerticalScrollElasticity,
- HasEnabledHorizontalScrollbar,
- HasEnabledVerticalScrollbar,
- HorizontalScrollbarMode,
- VerticalScrollbarMode,
- ScrollOrigin,
RequestedScrollPosition,
CounterScrollingLayer,
HeaderHeight,
@@ -78,6 +73,9 @@
const IntSize& totalContentsSize() const { return m_totalContentsSize; }
void setTotalContentsSize(const IntSize&);
+ const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
+ void setScrollOrigin(const IntPoint&);
+
float frameScaleFactor() const { return m_frameScaleFactor; }
void setFrameScaleFactor(float);
@@ -90,33 +88,15 @@
MainThreadScrollingReasons shouldUpdateScrollLayerPositionOnMainThread() const { return m_shouldUpdateScrollLayerPositionOnMainThread; }
void setShouldUpdateScrollLayerPositionOnMainThread(MainThreadScrollingReasons);
- ScrollElasticity horizontalScrollElasticity() const { return m_horizontalScrollElasticity; }
- void setHorizontalScrollElasticity(ScrollElasticity);
+ const ScrollableAreaParameters& scrollableAreaParameters() const { return m_scrollableAreaParameters; }
+ void setScrollableAreaParameters(const ScrollableAreaParameters& params);
- ScrollElasticity verticalScrollElasticity() const { return m_verticalScrollElasticity; }
- void setVerticalScrollElasticity(ScrollElasticity);
-
- bool hasEnabledHorizontalScrollbar() const { return m_hasEnabledHorizontalScrollbar; }
- void setHasEnabledHorizontalScrollbar(bool);
-
- bool hasEnabledVerticalScrollbar() const { return m_hasEnabledVerticalScrollbar; }
- void setHasEnabledVerticalScrollbar(bool);
-
- ScrollbarMode horizontalScrollbarMode() const { return m_horizontalScrollbarMode; }
- void setHorizontalScrollbarMode(ScrollbarMode);
-
- ScrollbarMode verticalScrollbarMode() const { return m_verticalScrollbarMode; }
- void setVerticalScrollbarMode(ScrollbarMode);
-
ScrollBehaviorForFixedElements scrollBehaviorForFixedElements() const { return m_behaviorForFixed; }
void setScrollBehaviorForFixedElements(ScrollBehaviorForFixedElements);
const IntPoint& requestedScrollPosition() const { return m_requestedScrollPosition; }
void setRequestedScrollPosition(const IntPoint&, bool representsProgrammaticScroll);
- const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
- void setScrollOrigin(const IntPoint&);
-
int headerHeight() const { return m_headerHeight; }
void setHeaderHeight(int);
@@ -164,35 +144,21 @@
ScrollbarPainter m_verticalScrollbarPainter;
ScrollbarPainter m_horizontalScrollbarPainter;
#endif
-
+
IntRect m_viewportRect;
IntSize m_totalContentsSize;
+ IntPoint m_scrollOrigin;
- float m_frameScaleFactor;
-
+ ScrollableAreaParameters m_scrollableAreaParameters;
Region m_nonFastScrollableRegion;
-
+ float m_frameScaleFactor;
unsigned m_wheelEventHandlerCount;
-
MainThreadScrollingReasons m_shouldUpdateScrollLayerPositionOnMainThread;
-
- ScrollElasticity m_horizontalScrollElasticity;
- ScrollElasticity m_verticalScrollElasticity;
-
- bool m_hasEnabledHorizontalScrollbar;
- bool m_hasEnabledVerticalScrollbar;
- bool m_requestedScrollPositionRepresentsProgrammaticScroll;
-
- ScrollbarMode m_horizontalScrollbarMode;
- ScrollbarMode m_verticalScrollbarMode;
-
ScrollBehaviorForFixedElements m_behaviorForFixed;
-
- IntPoint m_requestedScrollPosition;
- IntPoint m_scrollOrigin;
-
int m_headerHeight;
int m_footerHeight;
+ IntPoint m_requestedScrollPosition;
+ bool m_requestedScrollPositionRepresentsProgrammaticScroll;
};
SCROLLING_STATE_NODE_TYPE_CASTS(ScrollingStateScrollingNode, isScrollingNode());
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp (160651 => 160652)
--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp 2013-12-16 19:23:24 UTC (rev 160651)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.cpp 2013-12-16 19:57:27 UTC (rev 160652)
@@ -36,15 +36,9 @@
ScrollingTreeScrollingNode::ScrollingTreeScrollingNode(ScrollingTree& scrollingTree, ScrollingNodeID nodeID)
: ScrollingTreeNode(scrollingTree, nodeID)
, m_frameScaleFactor(1)
- , m_shouldUpdateScrollLayerPositionOnMainThread(0)
- , m_horizontalScrollElasticity(ScrollElasticityNone)
- , m_verticalScrollElasticity(ScrollElasticityNone)
- , m_hasEnabledHorizontalScrollbar(false)
- , m_hasEnabledVerticalScrollbar(false)
- , m_horizontalScrollbarMode(ScrollbarAuto)
- , m_verticalScrollbarMode(ScrollbarAuto)
, m_headerHeight(0)
, m_footerHeight(0)
+ , m_shouldUpdateScrollLayerPositionOnMainThread(0)
, m_behaviorForFixed(StickToDocumentBounds)
{
}
@@ -68,33 +62,18 @@
m_totalContentsSize = state->totalContentsSize();
}
+ if (state->hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin))
+ m_scrollOrigin = state->scrollOrigin();
+
+ if (state->hasChangedProperty(ScrollingStateScrollingNode::ScrollableAreaParams))
+ m_scrollableAreaParameters = state->scrollableAreaParameters();
+
if (state->hasChangedProperty(ScrollingStateScrollingNode::FrameScaleFactor))
m_frameScaleFactor = state->frameScaleFactor();
if (state->hasChangedProperty(ScrollingStateScrollingNode::ShouldUpdateScrollLayerPositionOnMainThread))
m_shouldUpdateScrollLayerPositionOnMainThread = state->shouldUpdateScrollLayerPositionOnMainThread();
- if (state->hasChangedProperty(ScrollingStateScrollingNode::HorizontalScrollElasticity))
- m_horizontalScrollElasticity = state->horizontalScrollElasticity();
-
- if (state->hasChangedProperty(ScrollingStateScrollingNode::VerticalScrollElasticity))
- m_verticalScrollElasticity = state->verticalScrollElasticity();
-
- if (state->hasChangedProperty(ScrollingStateScrollingNode::HasEnabledHorizontalScrollbar))
- m_hasEnabledHorizontalScrollbar = state->hasEnabledHorizontalScrollbar();
-
- if (state->hasChangedProperty(ScrollingStateScrollingNode::HasEnabledVerticalScrollbar))
- m_hasEnabledVerticalScrollbar = state->hasEnabledVerticalScrollbar();
-
- if (state->hasChangedProperty(ScrollingStateScrollingNode::HorizontalScrollbarMode))
- m_horizontalScrollbarMode = state->horizontalScrollbarMode();
-
- if (state->hasChangedProperty(ScrollingStateScrollingNode::VerticalScrollbarMode))
- m_verticalScrollbarMode = state->verticalScrollbarMode();
-
- if (state->hasChangedProperty(ScrollingStateScrollingNode::ScrollOrigin))
- m_scrollOrigin = state->scrollOrigin();
-
if (state->hasChangedProperty(ScrollingStateScrollingNode::HeaderHeight))
m_headerHeight = state->headerHeight();
Modified: trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h (160651 => 160652)
--- trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h 2013-12-16 19:23:24 UTC (rev 160651)
+++ trunk/Source/WebCore/page/scrolling/ScrollingTreeScrollingNode.h 2013-12-16 19:57:27 UTC (rev 160652)
@@ -60,6 +60,7 @@
const IntRect& viewportRect() const { return m_viewportRect; }
const IntSize& totalContentsSize() const { return m_totalContentsSize; }
+ const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
// If the totalContentsSize changes in the middle of a rubber-band, we still want to use the old totalContentsSize for the sake of
// computing the stretchAmount(). Using the old value will keep the animation smooth. When there is no rubber-band in progress at
@@ -69,16 +70,14 @@
float frameScaleFactor() const { return m_frameScaleFactor; }
- ScrollElasticity horizontalScrollElasticity() const { return m_horizontalScrollElasticity; }
- ScrollElasticity verticalScrollElasticity() const { return m_verticalScrollElasticity; }
+ ScrollElasticity horizontalScrollElasticity() const { return m_scrollableAreaParameters.horizontalScrollElasticity; }
+ ScrollElasticity verticalScrollElasticity() const { return m_scrollableAreaParameters.verticalScrollElasticity; }
- bool hasEnabledHorizontalScrollbar() const { return m_hasEnabledHorizontalScrollbar; }
- bool hasEnabledVerticalScrollbar() const { return m_hasEnabledVerticalScrollbar; }
+ bool hasEnabledHorizontalScrollbar() const { return m_scrollableAreaParameters.hasEnabledHorizontalScrollbar; }
+ bool hasEnabledVerticalScrollbar() const { return m_scrollableAreaParameters.hasEnabledVerticalScrollbar; }
- bool canHaveScrollbars() const { return m_horizontalScrollbarMode != ScrollbarAlwaysOff || m_verticalScrollbarMode != ScrollbarAlwaysOff; }
+ bool canHaveScrollbars() const { return m_scrollableAreaParameters.horizontalScrollbarMode != ScrollbarAlwaysOff || m_scrollableAreaParameters.verticalScrollbarMode != ScrollbarAlwaysOff; }
- const IntPoint& scrollOrigin() const { return m_scrollOrigin; }
-
int headerHeight() const { return m_headerHeight; }
int footerHeight() const { return m_footerHeight; }
@@ -90,22 +89,14 @@
IntSize m_totalContentsSizeForRubberBand;
IntPoint m_scrollOrigin;
+ ScrollableAreaParameters m_scrollableAreaParameters;
+
float m_frameScaleFactor;
- MainThreadScrollingReasons m_shouldUpdateScrollLayerPositionOnMainThread;
-
- ScrollElasticity m_horizontalScrollElasticity;
- ScrollElasticity m_verticalScrollElasticity;
-
- bool m_hasEnabledHorizontalScrollbar;
- bool m_hasEnabledVerticalScrollbar;
-
- ScrollbarMode m_horizontalScrollbarMode;
- ScrollbarMode m_verticalScrollbarMode;
-
int m_headerHeight;
int m_footerHeight;
+ MainThreadScrollingReasons m_shouldUpdateScrollLayerPositionOnMainThread;
ScrollBehaviorForFixedElements m_behaviorForFixed;
};
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h (160651 => 160652)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h 2013-12-16 19:23:24 UTC (rev 160651)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.h 2013-12-16 19:57:27 UTC (rev 160652)
@@ -97,28 +97,6 @@
void ensureRootStateNodeForFrameView(FrameView*);
- struct ScrollParameters {
- ScrollElasticity horizontalScrollElasticity;
- ScrollElasticity verticalScrollElasticity;
-
- bool hasEnabledHorizontalScrollbar;
- bool hasEnabledVerticalScrollbar;
-
- ScrollbarMode horizontalScrollbarMode;
- ScrollbarMode verticalScrollbarMode;
-
- IntPoint scrollOrigin;
-
- IntRect viewportRect;
- IntSize totalContentsSize;
-
- float frameScaleFactor;
-
- int headerHeight;
- int footerHeight;
- };
-
- void setScrollParametersForNode(const ScrollParameters&, ScrollingStateScrollingNode*);
void setScrollLayerForNode(GraphicsLayer*, ScrollingStateNode*);
void setCounterScrollingLayerForNode(GraphicsLayer*, ScrollingStateScrollingNode*);
void setHeaderLayerForNode(GraphicsLayer*, ScrollingStateScrollingNode*);
@@ -128,7 +106,6 @@
void setWheelEventHandlerCountForNode(unsigned, ScrollingStateScrollingNode*);
void setScrollBehaviorForFixedElementsForNode(ScrollBehaviorForFixedElements, ScrollingStateScrollingNode*);
-
void updateMainFrameScrollLayerPosition();
void scheduleTreeStateCommit();
Modified: trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm (160651 => 160652)
--- trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm 2013-12-16 19:23:24 UTC (rev 160651)
+++ trunk/Source/WebCore/page/scrolling/mac/ScrollingCoordinatorMac.mm 2013-12-16 19:57:27 UTC (rev 160652)
@@ -135,7 +135,15 @@
Scrollbar* horizontalScrollbar = frameView->horizontalScrollbar();
setScrollbarPaintersFromScrollbarsForNode(verticalScrollbar, horizontalScrollbar, node);
- ScrollParameters scrollParameters;
+ node->setFrameScaleFactor(frameView->frame().frameScaleFactor());
+ node->setHeaderHeight(frameView->headerHeight());
+ node->setFooterHeight(frameView->footerHeight());
+
+ node->setScrollOrigin(frameView->scrollOrigin());
+ node->setViewportRect(IntRect(IntPoint(), frameView->visibleContentRect().size()));
+ node->setTotalContentsSize(frameView->totalContentsSize());
+
+ ScrollableAreaParameters scrollParameters;
scrollParameters.horizontalScrollElasticity = frameView->horizontalScrollElasticity();
scrollParameters.verticalScrollElasticity = frameView->verticalScrollElasticity();
scrollParameters.hasEnabledHorizontalScrollbar = horizontalScrollbar && horizontalScrollbar->enabled();
@@ -143,14 +151,8 @@
scrollParameters.horizontalScrollbarMode = frameView->horizontalScrollbarMode();
scrollParameters.verticalScrollbarMode = frameView->verticalScrollbarMode();
- scrollParameters.scrollOrigin = frameView->scrollOrigin();
- scrollParameters.viewportRect = IntRect(IntPoint(), frameView->visibleContentRect().size());
- scrollParameters.totalContentsSize = frameView->totalContentsSize();
- scrollParameters.frameScaleFactor = frameView->frame().frameScaleFactor();
- scrollParameters.headerHeight = frameView->headerHeight();
- scrollParameters.footerHeight = frameView->footerHeight();
-
- setScrollParametersForNode(scrollParameters, node);
+ node->setScrollableAreaParameters(scrollParameters);
+ scheduleTreeStateCommit();
}
void ScrollingCoordinatorMac::recomputeWheelEventHandlerCountForFrameView(FrameView* frameView)
@@ -298,25 +300,6 @@
scheduleTreeStateCommit();
}
-void ScrollingCoordinatorMac::setScrollParametersForNode(const ScrollParameters& scrollParameters, ScrollingStateScrollingNode* node)
-{
- node->setHorizontalScrollElasticity(scrollParameters.horizontalScrollElasticity);
- node->setVerticalScrollElasticity(scrollParameters.verticalScrollElasticity);
- node->setHasEnabledHorizontalScrollbar(scrollParameters.hasEnabledHorizontalScrollbar);
- node->setHasEnabledVerticalScrollbar(scrollParameters.hasEnabledVerticalScrollbar);
- node->setHorizontalScrollbarMode(scrollParameters.horizontalScrollbarMode);
- node->setVerticalScrollbarMode(scrollParameters.verticalScrollbarMode);
-
- node->setScrollOrigin(scrollParameters.scrollOrigin);
- node->setViewportRect(scrollParameters.viewportRect);
- node->setTotalContentsSize(scrollParameters.totalContentsSize);
- node->setFrameScaleFactor(scrollParameters.frameScaleFactor);
- node->setHeaderHeight(scrollParameters.headerHeight);
- node->setFooterHeight(scrollParameters.footerHeight);
-
- scheduleTreeStateCommit();
-}
-
void ScrollingCoordinatorMac::setWheelEventHandlerCountForNode(unsigned wheelEventHandlerCount, ScrollingStateScrollingNode* node)
{
node->setWheelEventHandlerCount(wheelEventHandlerCount);