ScrollingStateOverflowScrollingNode.cpp [plain text]
#include "config.h"
#include "ScrollingStateOverflowScrollingNode.h"
#if ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)
#include "ScrollingStateTree.h"
#include "TextStream.h"
namespace WebCore {
Ref<ScrollingStateOverflowScrollingNode> ScrollingStateOverflowScrollingNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
{
return adoptRef(*new ScrollingStateOverflowScrollingNode(stateTree, nodeID));
}
ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
: ScrollingStateScrollingNode(stateTree, OverflowScrollingNode, nodeID)
{
}
ScrollingStateOverflowScrollingNode::ScrollingStateOverflowScrollingNode(const ScrollingStateOverflowScrollingNode& stateNode, ScrollingStateTree& adoptiveTree)
: ScrollingStateScrollingNode(stateNode, adoptiveTree)
{
if (hasChangedProperty(ScrolledContentsLayer))
setScrolledContentsLayer(stateNode.scrolledContentsLayer().toRepresentation(adoptiveTree.preferredLayerRepresentation()));
}
ScrollingStateOverflowScrollingNode::~ScrollingStateOverflowScrollingNode()
{
}
Ref<ScrollingStateNode> ScrollingStateOverflowScrollingNode::clone(ScrollingStateTree& adoptiveTree)
{
return adoptRef(*new ScrollingStateOverflowScrollingNode(*this, adoptiveTree));
}
void ScrollingStateOverflowScrollingNode::setScrolledContentsLayer(const LayerRepresentation& layerRepresentation)
{
if (layerRepresentation == m_scrolledContentsLayer)
return;
m_scrolledContentsLayer = layerRepresentation;
setPropertyChanged(ScrolledContentsLayer);
}
void ScrollingStateOverflowScrollingNode::dumpProperties(TextStream& ts, int indent) const
{
ts << "(" << "Overflow scrolling node" << "\n";
ScrollingStateScrollingNode::dumpProperties(ts, indent);
if (m_scrolledContentsLayer.layerID()) {
writeIndent(ts, indent + 1);
ts << "(scrolled contents layer " << m_scrolledContentsLayer.layerID() << ")\n";
}
}
}
#endif // ENABLE(ASYNC_SCROLLING) || USE(COORDINATED_GRAPHICS)