ScrollingTreeScrollingNode.cpp [plain text]
#include "config.h"
#include "ScrollingTreeScrollingNode.h"
#if ENABLE(THREADED_SCROLLING)
#include "ScrollingStateTree.h"
namespace WebCore {
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)
{
}
ScrollingTreeScrollingNode::~ScrollingTreeScrollingNode()
{
}
void ScrollingTreeScrollingNode::updateBeforeChildren(ScrollingStateNode* stateNode)
{
ScrollingStateScrollingNode* state = toScrollingStateScrollingNode(stateNode);
if (state->hasChangedProperty(ScrollingStateScrollingNode::ViewportRect))
m_viewportRect = state->viewportRect();
if (state->hasChangedProperty(ScrollingStateScrollingNode::TotalContentsSize))
m_totalContentsSize = state->totalContentsSize();
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();
if (state->hasChangedProperty(ScrollingStateScrollingNode::FooterHeight))
m_footerHeight = state->footerHeight();
}
}
#endif // ENABLE(THREADED_SCROLLING)