[Webkit-unassigned] [Bug 29389] [Qt] isAccepted() from mouse event handling seems very wrong.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Mar 8 13:09:37 PST 2010


https://bugs.webkit.org/show_bug.cgi?id=29389


Robert Hogan <robert at webkit.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |robert at webkit.org




--- Comment #4 from Robert Hogan <robert at webkit.org>  2010-03-08 13:09:36 PST ---
(In reply to comment #0)
> This bug report originated from issue QTBUG-2959
> <http://bugreports.qt.nokia.com/browse/QTBUG-2959>
> 
> --- Description ---
> 
> For webkit page showing www.google.com, clicking in the empty white areas
> produces mouse events that QWebPage marks as isAccepted(), whereas clicking on
> links and buttons produces mouse events that QWebPage marks as !isAccepted().
> 
> This seems barkwards.

I think it's correct - insofar as WebCore seems to be only interested in
accepting mousePressEvents that initiate or manage a selection. Clicking links
and buttons can't be the start of a selection in practice, no matter how hard
you try. ;-)

bool EventHandler::handleMousePressEvent(const MouseEventWithHitTestResults&
event)
{
<..>
    // If we got the event back, that must mean it wasn't prevented,
    // so it's allowed to start a drag or selection.
    m_mouseDownMayStartSelect = canMouseDownStartSelect(event.targetNode());
<..>
    bool swallowEvent = false;
    m_frame->selection()->setCaretBlinkingSuspended(true);
    m_mousePressed = true;
    m_beganSelectingText = false;

    if (event.event().clickCount() == 2)
        swallowEvent = handleMousePressEventDoubleClick(event);
    else if (event.event().clickCount() >= 3)
        swallowEvent = handleMousePressEventTripleClick(event);
    else
        swallowEvent = handleMousePressEventSingleClick(event);

    return swallowEvent;

}

// Whether or not a mouse down can begin the creation of a selection.  Fires
the selectStart event.
bool EventHandler::canMouseDownStartSelect(Node* node)
{
    if (!node || !node->renderer())
        return true;

    // Some controls and images can't start a select on a mouse down.
    if (!node->canStartSelection())
        return false;

    for (RenderObject* curr = node->renderer(); curr; curr = curr->parent()) {
        if (Node* node = curr->node())
            return
node->dispatchEvent(Event::create(eventNames().selectstartEvent, true, true));
    }

    return true;
}

bool EventHandler::handleMousePressEventSingleClick(const
MouseEventWithHitTestResults& event)
{
    Node* innerNode = event.targetNode();
    if (!(innerNode && innerNode->renderer() && m_mouseDownMayStartSelect))
        return false;
<..>

}

-- 
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.



More information about the webkit-unassigned mailing list