2010-12-10 Emil Eklund <eae@chromium.org>

        Reviewed by Eric Seidel.

        Change EventHandler::dispatchMouseEvent code to use DOM traversal instead of render tree traversal
        https://bugs.webkit.org/show_bug.cgi?id=49982

        * page/EventHandler.cpp:
        (WebCore::EventHandler::dispatchMouseEvent):
        Walk up DOM/hosted tree rather than render tree.

git-svn-id: http://svn.webkit.org/repository/webkit/trunk@73717 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 0a742e70
2010-12-10 Emil Eklund <eae@chromium.org>
Reviewed by Eric Seidel.
Change EventHandler::dispatchMouseEvent code to use DOM traversal instead of render tree traversal
https://bugs.webkit.org/show_bug.cgi?id=49982
* page/EventHandler.cpp:
(WebCore::EventHandler::dispatchMouseEvent):
Walk up DOM/hosted tree rather than render tree.
2010-12-10 Jocelyn Turcotte <jocelyn.turcotte@nokia.com>
Reviewed by Kenneth Rohde Christiansen.
......
......@@ -1855,16 +1855,12 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe
// is expected by some sites that rely on onChange handlers running
// from form fields before the button click is processed.
Node* node = m_nodeUnderMouse.get();
RenderObject* renderer = node ? node->renderer() : 0;
// Walk up the render tree to search for a node to focus.
// Walking up the DOM tree wouldn't work for shadow trees, like those behind the engine-based text fields.
// FIXME: Rework to use shadowParent. No need to traverse with the render tree.
while (renderer) {
node = renderer->node();
if (node && node->isMouseFocusable()) {
// To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus a
// node on mouse down if it's selected and inside a focused node. It will be
// Walk up the DOM tree to search for a node to focus.
while (node) {
if (node->isMouseFocusable()) {
// To fix <rdar://problem/4895428> Can't drag selected ToDo, we don't focus a
// node on mouse down if it's selected and inside a focused node. It will be
// focused if the user does a mouseup over it, however, because the mouseup
// will set a selection inside it, which will call setFocuseNodeIfNeeded.
ExceptionCode ec = 0;
......@@ -1876,8 +1872,7 @@ bool EventHandler::dispatchMouseEvent(const AtomicString& eventType, Node* targe
break;
}
renderer = renderer->parent();
node = node->parentOrHostNode();
}
// If focus shift is blocked, we eat the event. Note we should never clear swallowEvent
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment