ScrollLatchingState.cpp [plain text]
#include "config.h"
#include "ScrollLatchingState.h"
#include "Element.h"
#include <wtf/text/TextStream.h>
namespace WebCore {
ScrollLatchingState::ScrollLatchingState() = default;
ScrollLatchingState::~ScrollLatchingState() = default;
void ScrollLatchingState::clear()
{
m_wheelEventElement = nullptr;
m_frame = nullptr;
m_scrollableContainer = nullptr;
m_widgetIsLatched = false;
m_previousWheelScrolledElement = nullptr;
}
void ScrollLatchingState::setWheelEventElement(Element* element)
{
m_wheelEventElement = makeWeakPtr(element);
}
void ScrollLatchingState::setWidgetIsLatched(bool isOverWidget)
{
m_widgetIsLatched = isOverWidget;
}
void ScrollLatchingState::setPreviousWheelScrolledElement(Element* element)
{
m_previousWheelScrolledElement = makeWeakPtr(element);
}
void ScrollLatchingState::setScrollableContainer(ContainerNode* container)
{
m_scrollableContainer = makeWeakPtr(container);
}
TextStream& operator<<(TextStream& ts, const ScrollLatchingState& state)
{
TextStream multilineStream;
multilineStream.setIndent(ts.indent() + 2);
multilineStream.dumpProperty("element", state.wheelEventElement());
multilineStream.dumpProperty("previousElement", state.previousWheelScrolledElement());
multilineStream.dumpProperty("scrollable container", state.scrollableContainer());
multilineStream.dumpProperty("widgetIsLatched", state.widgetIsLatched());
multilineStream.dumpProperty("started at limit", state.startedGestureAtScrollLimit());
ts << "ScrollLatchingState " << multilineStream.release();
return ts;
}
}