#include "config.h"
#include "OverflowEvent.h"
#include "EventNames.h"
namespace WebCore {
OverflowEvent::OverflowEvent()
: m_orient(VERTICAL)
, m_horizontalOverflow(false)
, m_verticalOverflow(false)
{
}
OverflowEvent::OverflowEvent(bool horizontalOverflowChanged, bool horizontalOverflow, bool verticalOverflowChanged, bool verticalOverflow)
: Event(eventNames().overflowchangedEvent, false, false)
, m_horizontalOverflow(horizontalOverflow)
, m_verticalOverflow(verticalOverflow)
{
ASSERT(horizontalOverflowChanged || verticalOverflowChanged);
if (horizontalOverflowChanged && verticalOverflowChanged)
m_orient = BOTH;
else if (horizontalOverflowChanged)
m_orient = HORIZONTAL;
else
m_orient = VERTICAL;
}
OverflowEvent::OverflowEvent(const AtomicString& type, const Init& initializer, IsTrusted isTrusted)
: Event(type, initializer, isTrusted)
, m_orient(initializer.orient)
, m_horizontalOverflow(initializer.horizontalOverflow)
, m_verticalOverflow(initializer.verticalOverflow)
{
}
EventInterface OverflowEvent::eventInterface() const
{
return OverflowEventInterfaceType;
}
void OverflowEvent::initOverflowEvent(unsigned short orient, bool horizontalOverflow, bool verticalOverflow)
{
if (isBeingDispatched())
return;
initEvent(eventNames().overflowchangedEvent, false, false);
m_orient = orient;
m_horizontalOverflow = horizontalOverflow;
m_verticalOverflow = verticalOverflow;
}
}