[Webkit-unassigned] [Bug 61594] REGRESSION: Hitting enter in the middle of this span causes the cursor to go to the end of the span

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Thu Jun 9 09:45:52 PDT 2011


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





--- Comment #21 from Ryosuke Niwa <rniwa at webkit.org>  2011-06-09 09:45:52 PST ---
(In reply to comment #20)
> Line 268 of my patch used to be:
> nextListChild = enclosingListChild(end.next().deepEquivalent().deprecatedNode(), listNode);
> I switched it to:
> nextListChild = enclosingListChild(end.next().deepEquivalent().containerNode(), listNode);

I don't understand why you'd call next.  That seems wrong.

> I got two layout tests failures:
> editing/execCommand/remove-list-items.html
> editing/execCommand/switch-list-type.html
> 
> In both tests, sometimes the position is a PositionIsOffsetInAnchor, and the containerNode, anchorNode, and deprecatedNode are all the same node. Everything works fine in that case. But sometimes the position is a PositionIsBeforeAnchor, before the <br><br> after item1. In that case, the deprecatedNode and anchorNode are the <br>, where the split is supposed to occur. But the containerNode() is the parent <ol>. So the split occurs in the wrong place.

I see.  <br> is certainly NOT the enclosing list child for a position before or after the br.  I think what you need to do is check whether the containerNode is a list element or not, and if it is, just pass end as the place to split rather than finding the enclosing list child.  Another way to fix this is to make enclosingListChild also take const Position&.

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