[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:37:38 PDT 2011


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





--- Comment #28 from Ryosuke Niwa <rniwa at webkit.org>  2011-06-21 15:37:38 PST ---
(From update of attachment 97678)
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?

You should probably return the original startNode in that case because that's what we do when we don't split any node.

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

I see. Okay. I suppose we can live with this code for now.

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