[Webkit-unassigned] [Bug 112240] execCommand("RemoveFormat") might remove format after the selection

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 15 08:55:10 PDT 2013


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





--- Comment #8 from Claudio Saavedra <csaavedra at igalia.com>  2013-04-15 08:53:26 PST ---
(In reply to comment #7)
> So, to make this clearer, this is p = lastPositionInOrAfterNode(node):
> 
>   {m_anchorNode = {m_ptr = 0xaa6b00}, m_offset = 0, m_anchorType = 4, m_isLegacyEditingPosition = false}
> 
> and this is p.upstream():
> 
>   {m_anchorNode = {m_ptr = 0xaa6b00}, m_offset = 0, m_anchorType = 0, m_isLegacyEditingPosition = false}
> 
> node is <B> with a text child of length != 0. p is after the child (m_anchorType = 4 means PositionIsAfterChildren) while p.upstream() is *before* the child (m_anchorType = 0 means PositionIsOffsetInAnchor with m_offset = 0).

Apparently this happens because upstream() is iterating through all of the text node instead of returning the last position in the text node, as it should.

First iteration:

{m_anchorNode = 0x787ae0,    m_nodeAfterPositionInAnchor = 0x0, m_offsetInAnchor = 1}

with anchor node the node with the B tag and the offset in anchor indicating that we are after the child text node.

Second iteration, after the iterator is decremented:

 {m_anchorNode = 0xaad7e0,    m_nodeAfterPositionInAnchor = 0x0, m_offsetInAnchor = 3}

with node now pointing to the text node which is a child of the B tag, and given offset points to the position after the "Foo" text. Unless I am understanding the semantics of WebCore::Position::upstream() totally wrong, *this* should be the position returned by this method. However, this is not the case, and the iteration continues until the iterator moves to a position that is visually distinct and the last visible position is returned instead.

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