[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
Wed Jun 8 19:06:09 PDT 2011


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





--- Comment #20 from Annie Sullivan <sullivan at chromium.org>  2011-06-08 19:06:09 PST ---
(In reply to comment #19)
> (In reply to comment #18)
> > In IndentOutdentCommand::outdentParagraph(), the code that finds enclosingBlockFlow looks like this: enclosingBlock(visibleStartOfParagraph.deepEquivalent().deprecatedNode()). Then I make a Position from enclosingBlockFlow and pass it to splitTree.
> 
> We should be calling containerNode instead of deprecatedNode there.  Because if we're before or after a block, the block isn't enclosing the position at all.  If something goes wrong with that change, then we'd have to fix that bug.

I made some progress on this part. In 2 of the 3 cases I mentioned, all the layout tests pass when I switch to calling containerNode(). But I got two test failures in InsertListCommand::unlistifyParagraph().

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

Is there some better way to get the correct Position before end.next() (where end is a VisiblePosition)?

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