[Webkit-unassigned] [Bug 71771] Inserting empty html moves caret

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Apr 9 13:02:03 PDT 2012


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





--- Comment #2 from Antaryami Pandia <antaryami.pandia at motorola.com>  2012-04-09 13:02:03 PST ---
Got disconnected while discussing with rniwa on IRC. So puting some queries here.

When I insert a character no new rendertext is created, it simply inserted into the existing text.But when I click on the middle of the text run (say 16th pos) and insert the empty string by clicking on the button, a new text run of 16 characters is created. Is this expected?

This new rendertext is craeted by a call to "splitTextNode" method. The "splitTextNode" method is called because the "performTrivialReplace" return false when we add an empty string. We do have a check for fragment.firstChild(), but I think the call to "splitTextNode" changes the behavior.

There is a code to check firstChild in "performTrivialReplace":-
    if (!fragment.firstChild() || fragment.firstChild() != fragment.lastChild() || !fragment.firstChild()->isTextNode())
        return false;

Is there any other case when the firstchild be null other then the case when inserting empty string?

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