[Webkit-unassigned] [Bug 36037] typing at the end of a line in designMode documents is *very* slow

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Mar 11 16:50:25 PST 2010


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





--- Comment #3 from Ojan Vafai <ojan at chromium.org>  2010-03-11 16:50:25 PST ---
I think the bug is in PositionIterator::isCandidate. Still not sure though. The
call to endOfBlock is normally constant-time in the average case, but this is
hitting the worst-case where it never finds a candidate, so it loops over every
node in the body.

The offending block looks to be:
    if (!m_anchorNode->hasTagName(htmlTag) && renderer->isBlockFlow()) {
        if (toRenderBlock(renderer)->height() ||
m_anchorNode->hasTagName(bodyTag)) {
            if
(!Position::hasRenderedNonAnonymousDescendantsWithHeight(renderer))
                return atStartOfNode() &&
!Position::nodeIsUserSelectNone(m_anchorNode);
            return m_anchorNode->isContentEditable() &&
!Position::nodeIsUserSelectNone(m_anchorNode) &&
Position(*this).atEditingBoundary();
        }
    }

The return statement at the end is wrong I think. This is the case where we're
in the body element and it assumes that a position should only be in the body
element if we're at an editing boundary (i.e. on the end of a node that's not
editable). But this case where all the nodes are children of the body clearly
should return true here and doesn't.

Still not sure what the right fix is.

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