Changeset 73984 in webkit


Ignore:
Timestamp:
Dec 13, 2010 4:24:48 PM (13 years ago)
Author:
commit-queue@webkit.org
Message:

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

Reviewed by Dimitri Glazkov.

Change SelectionController::setFocusedNodeIfNeeded to traverse the DOM
tree instead of the render tree.
https://bugs.webkit.org/show_bug.cgi?id=50989

  • editing/SelectionController.cpp: (WebCore::SelectionController::setFocusedNodeIfNeeded): Walk up DOM/hosted tree rather than render tree and remove FIXME comment that does't apply (SelectionController and EventHandler needs different checks).
Location:
trunk/WebCore
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/WebCore/ChangeLog

    r73983 r73984  
     12010-12-13  Emil Eklund  <eae@chromium.org>
     2
     3        Reviewed by Dimitri Glazkov.
     4
     5        Change SelectionController::setFocusedNodeIfNeeded to traverse the DOM
     6        tree instead of the render tree.
     7        https://bugs.webkit.org/show_bug.cgi?id=50989
     8
     9        * editing/SelectionController.cpp:
     10        (WebCore::SelectionController::setFocusedNodeIfNeeded):
     11        Walk up DOM/hosted tree rather than render tree and remove FIXME comment
     12        that does't apply (SelectionController and EventHandler needs different
     13        checks).
     14
    1152010-12-13  Chris Fleizach  <cfleizach@apple.com>
    216
  • trunk/WebCore/editing/SelectionController.cpp

    r73942 r73984  
    15521552
    15531553    if (Node* target = rootEditableElement()) {
    1554         RenderObject* renderer = target->renderer();
    1555 
    1556         // Walk up the render tree to search for a node to focus.
    1557         // Walking up the DOM tree wouldn't work for shadow trees, like those behind the engine-based text fields.
    1558         // FIXME: Combine with the same traversal code in EventHandle::dispatchMouseEvent.
    1559         while (renderer) {
     1554        // Walk up the DOM tree to search for a node to focus.
     1555        while (target) {
    15601556            // We don't want to set focus on a subframe when selecting in a parent frame,
    15611557            // so add the !isFrameElement check here. There's probably a better way to make this
     
    15651561                return;
    15661562            }
    1567             renderer = renderer->parent();
    1568             if (renderer)
    1569                 target = renderer->node();
     1563            target = target->parentOrHostNode();
    15701564        }
    15711565        m_frame->document()->setFocusedNode(0);
Note: See TracChangeset for help on using the changeset viewer.