[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
Tue Jun 21 15:35:11 PDT 2011


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





--- Comment #27 from Annie Sullivan <sullivan at chromium.org>  2011-06-21 15:35:11 PST ---
(From update of attachment 97678)
I'm working on addressing the comments but I had a question and a follow-up comment.

View in context: https://bugs.webkit.org/attachment.cgi?id=97678&action=review

>> Source/WebCore/editing/CompositeEditCommand.cpp:1245
>> +        // FIXME: startNode can be null if traverseNextNode returns null. What should it be set to in that case?
> 
> If startNode ends up being null, then we're trying to split a node at the very end of the tree.  In that case, we shouldn't be splitting the tree so this should be fine.
> I think you should remove this comment.

Should there be a return value in this case though?

>> Source/WebCore/editing/FormatBlockCommand.cpp:64
>> +    RefPtr<Node> outerBlock = (start.deprecatedNode() == nodeToSplitTo) ? start.deprecatedNode() : splitTree(firstPositionInNode(start.deprecatedNode()), nodeToSplitTo);
> 
> So you can't just pass start here?  Also, you should probably call firstPositionInOrBeforeNode instead.

Unfortunately, a lot of edge cases around top-level non-block elements fail here. For example, if the editable div contains only a <hr>, start.deprectatedNode() is the <hr> and start.containerNode() is the editable div. The ASSERT(start.containerNode() != end) fails, and if I take it out I end up with a crash later on.

I'll try firstPositionInOrBeforeNode 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