Esempio n. 1
0
Node* MouseEvent::fromElement() const
{
    // MSIE extension - "object from which activation or the mouse pointer is exiting during the event" (huh?)
    if (type() != eventNames().mouseoutEvent)
        return relatedTarget() ? relatedTarget()->toNode() : 0;
    
    return target() ? target()->toNode() : 0;
}
Esempio n. 2
0
Node* MouseEvent::toElement() const
{
    // MSIE extension - "the object toward which the user is moving the mouse pointer"
    if (type() == eventNames().mouseoutEvent) 
        return relatedTarget() ? relatedTarget()->toNode() : 0;
    
    return target() ? target()->toNode() : 0;
}
Esempio n. 3
0
Node* MouseEvent::toElement() const
{
    // MSIE extension - "the object toward which the user is moving the mouse pointer"
    if (type() == EventTypeNames::mouseout || type() == EventTypeNames::mouseleave)
        return relatedTarget() ? relatedTarget()->toNode() : nullptr;

    return target() ? target()->toNode() : nullptr;
}
Esempio n. 4
0
Node* MouseEvent::fromElement() const
{
    // MSIE extension - "object from which activation or the mouse pointer is exiting during the event" (huh?)
    if (type() != EventTypeNames::mouseout && type() != EventTypeNames::mouseleave)
        return relatedTarget() ? relatedTarget()->toNode() : nullptr;

    return target() ? target()->toNode() : nullptr;
}
Esempio n. 5
0
void NodeEventContext::handleLocalEvents(Event* event) const
{
    if (touchEventContext()) {
        touchEventContext()->handleLocalEvents(event);
    } else if (relatedTarget()) {
        if (event->isMouseEvent()) {
            toMouseEvent(event)->setRelatedTarget(relatedTarget());
        } else if (event->isFocusEvent()) {
            toFocusEvent(event)->setRelatedTarget(relatedTarget());
        }
    }
    event->setTarget(target());
    event->setCurrentTarget(m_currentTarget.get());
    m_node->handleLocalEvents(event);
}