[Webkit-unassigned] [Bug 25057] remove rangeCompliantEquivalent and replace it with Position methods

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Wed Jan 5 08:28:44 PST 2011


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





--- Comment #14 from Levi Weintraub <leviw at google.com>  2011-01-05 08:28:43 PST ---
(In reply to comment #11)
> (From update of attachment 75931 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=75931&action=review
> 
> Sorry, I keep noticing something new.
> 
> > WebCore/dom/Position.cpp:157
> > +    // Handle quirks with tables and legacy positions offsets
> > +    if (m_offset <= 0) {
> 
> On my second thought, shouldn't we also check that it's a legacy position?  m_offset <= 0 is also true when m_anchorType != PositionIsOffsetInAnchor, no?
> 
> > WebCore/dom/Position.cpp:162
> > +    if (!m_anchorNode->offsetInCharacters() && static_cast<unsigned>(m_offset) == m_anchorNode->childNodeCount()
> 
> Ditto here.

We also need to go through this code path for positions before and after Tables, which aren't legacy positions. I could use the following instead:

    if (m_isLegacyEditingPosition || isTableElement(m_anchorNode.get())) {
        if (m_offset <= 0) {
            if (m_anchorNode->parentNode() && (editingIgnoresContent(m_anchorNode.get()) || isTableElement(m_anchorNode.get())))
                return positionInParentBeforeNode(m_anchorNode.get());
            return Position(m_anchorNode, 0);
        }
        if (!m_anchorNode->offsetInCharacters() && static_cast<unsigned>(m_offset) == m_anchorNode->childNodeCount() &&
            (editingIgnoresContent(m_anchorNode.get()) || isTableElement(m_anchorNode.get()))) {
            return positionInParentAfterNode(m_anchorNode.get());
        }
    }


if (!m_anchorNode->offsetInCharacters() && static_cast<unsigned>(m_offset) == m_anchorNode->childNodeCount()

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