ScrollingTreeNode.cpp [plain text]
#include "config.h"
#include "ScrollingTreeNode.h"
#if ENABLE(THREADED_SCROLLING)
#include "ScrollingTreeState.h"
namespace WebCore {
ScrollingTreeNode::ScrollingTreeNode(ScrollingTree* scrollingTree)
: m_scrollingTree(scrollingTree)
, m_shouldUpdateScrollLayerPositionOnMainThread(false)
, m_horizontalScrollElasticity(ScrollElasticityNone)
, m_verticalScrollElasticity(ScrollElasticityNone)
, m_hasEnabledHorizontalScrollbar(false)
, m_hasEnabledVerticalScrollbar(false)
, m_horizontalScrollbarMode(ScrollbarAuto)
, m_verticalScrollbarMode(ScrollbarAuto)
{
}
ScrollingTreeNode::~ScrollingTreeNode()
{
}
void ScrollingTreeNode::update(ScrollingTreeState* state)
{
if (state->changedProperties() & ScrollingTreeState::ViewportRect)
m_viewportRect = state->viewportRect();
if (state->changedProperties() & ScrollingTreeState::ContentsSize)
m_contentsSize = state->contentsSize();
if (state->changedProperties() & ScrollingTreeState::ShouldUpdateScrollLayerPositionOnMainThread)
m_shouldUpdateScrollLayerPositionOnMainThread = state->shouldUpdateScrollLayerPositionOnMainThread();
if (state->changedProperties() & ScrollingTreeState::HorizontalScrollElasticity)
m_horizontalScrollElasticity = state->horizontalScrollElasticity();
if (state->changedProperties() & ScrollingTreeState::VerticalScrollElasticity)
m_verticalScrollElasticity = state->verticalScrollElasticity();
if (state->changedProperties() & ScrollingTreeState::HasEnabledHorizontalScrollbar)
m_hasEnabledHorizontalScrollbar = state->hasEnabledHorizontalScrollbar();
if (state->changedProperties() & ScrollingTreeState::HasEnabledVerticalScrollbar)
m_hasEnabledVerticalScrollbar = state->hasEnabledVerticalScrollbar();
if (state->changedProperties() & ScrollingTreeState::HorizontalScrollbarMode)
m_horizontalScrollbarMode = state->horizontalScrollbarMode();
if (state->changedProperties() & ScrollingTreeState::VerticalScrollbarMode)
m_verticalScrollbarMode = state->verticalScrollbarMode();
if (state->changedProperties() & ScrollingTreeState::ScrollOrigin)
m_scrollOrigin = state->scrollOrigin();
}
}
#endif // ENABLE(THREADED_SCROLLING)