void EventDispatcher::dispatchWheelEvent(Node* node, PlatformWheelEvent& event)
{
    ASSERT(!eventDispatchForbidden());
    if (!(event.deltaX() || event.deltaY()))
        return;

    EventDispatcher dispatcher(node);

    RefPtr<WheelEvent> wheelEvent = WheelEvent::create(event.wheelTicksX(), event.wheelTicksY(), event.deltaX(), event.deltaY(), granularity(event),
        node->document()->defaultView(), event.globalX(), event.globalY(), event.x(), event.y(),
        event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey());

    if (!dispatcher.dispatchEvent(wheelEvent) || wheelEvent->defaultHandled())
        event.accept();

}
Example #2
0
WheelEventDispatchMediator::WheelEventDispatchMediator(const PlatformWheelEvent& event, PassRefPtr<AbstractView> view)
{
    if (!(event.deltaX() || event.deltaY()))
        return;

    setEvent(WheelEvent::create(FloatPoint(event.wheelTicksX(), event.wheelTicksY()), FloatPoint(event.deltaX(), event.deltaY()), granularity(event),
                                view, IntPoint(event.globalX(), event.globalY()), IntPoint(event.x(), event.y()), event.ctrlKey(), event.altKey(), event.shiftKey(), event.metaKey()));

}