ScrollingStateFrameHostingNode.cpp [plain text]
#include "config.h"
#include "ScrollingStateFrameHostingNode.h"
#if ENABLE(ASYNC_SCROLLING)
#include "ScrollingStateTree.h"
#include <wtf/text/TextStream.h>
namespace WebCore {
Ref<ScrollingStateFrameHostingNode> ScrollingStateFrameHostingNode::create(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
{
return adoptRef(*new ScrollingStateFrameHostingNode(stateTree, nodeID));
}
ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode(ScrollingStateTree& stateTree, ScrollingNodeID nodeID)
: ScrollingStateNode(ScrollingNodeType::FrameHosting, stateTree, nodeID)
{
ASSERT(isFrameHostingNode());
}
ScrollingStateFrameHostingNode::ScrollingStateFrameHostingNode(const ScrollingStateFrameHostingNode& stateNode, ScrollingStateTree& adoptiveTree)
: ScrollingStateNode(stateNode, adoptiveTree)
, m_parentRelativeScrollableRect(stateNode.parentRelativeScrollableRect())
{
}
ScrollingStateFrameHostingNode::~ScrollingStateFrameHostingNode() = default;
Ref<ScrollingStateNode> ScrollingStateFrameHostingNode::clone(ScrollingStateTree& adoptiveTree)
{
return adoptRef(*new ScrollingStateFrameHostingNode(*this, adoptiveTree));
}
void ScrollingStateFrameHostingNode::setPropertyChangedBitsAfterReattach()
{
setPropertyChangedBit(ParentRelativeScrollableRect);
ScrollingStateNode::setPropertyChangedBitsAfterReattach();
}
void ScrollingStateFrameHostingNode::setParentRelativeScrollableRect(const LayoutRect& parentRelativeScrollableRect)
{
if (m_parentRelativeScrollableRect == parentRelativeScrollableRect)
return;
m_parentRelativeScrollableRect = parentRelativeScrollableRect;
setPropertyChanged(ParentRelativeScrollableRect);
}
void ScrollingStateFrameHostingNode::dumpProperties(TextStream& ts, ScrollingStateTreeAsTextBehavior behavior) const
{
ts << "Frame hosting node";
ScrollingStateNode::dumpProperties(ts, behavior);
if (!m_parentRelativeScrollableRect.isEmpty())
ts.dumpProperty("parent relative scrollable rect", m_parentRelativeScrollableRect);
}
}
#endif // ENABLE(ASYNC_SCROLLING)