[Webkit-unassigned] [Bug 55626] Node::attach() and Node::nextRenderer() account for over 50% of Peacekeeper's domDynamicCreationCreateElement

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 4 18:13:47 PST 2011


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





--- Comment #5 from Eric Seidel <eric at webkit.org>  2011-03-04 18:13:47 PST ---
Maciej suggested computing nextRenderer from the previous renderer for the createRendererIfNeeded() case.

However after a few attempts I'm not sure it's that easy.  nextRenderer() avoids anonymous renderers and continuations, and gives you the next renderer relating to the position in the DOM (not necessarily relating to where something would be rendered.

My most recent attempt:

static RenderObject* fastNextRendererForCreateRenderer(Node* node)
{
    // It is more common to have a previousRenderer than a nextRenderer since
    // we attach from first to last child in the list.
    RenderObject* previousRenderer = node->previousRenderer();
    RenderObject* nextRenderer = 0;
    if (previousRenderer) {
        // previousRenderer may be wrapped in an anonymous renderer.
        if (previousRenderer->parent() != node->parentOrHostNode()->renderer())
            return node->nextRenderer();
        nextRenderer = previousRenderer->nextSibling();
    } else
        nextRenderer = node->parentOrHostNode()->renderer()->firstChild();

    // If we found an anonymous renderer fall back to a (slow) walk of the node list.
    if (nextRenderer && nextRenderer->isAnonymous())
        return node->nextRenderer();

    ASSERT(nextRenderer == node->nextRenderer());
    if (!nextRenderer)
        return 0;

    ASSERT(nextRenderer != node->renderer());
    ASSERT(nextRenderer->node()->parentOrHostNode() == node->parentOrHostNode());
    return nextRenderer;
}

Fails editing/deleting/pruning-after-merge-1.html (And a few other editing tests) still.

-- 
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