[Webkit-unassigned] [Bug 21840] execCommand insertImage inserts image into wrong place

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 25 21:07:53 PST 2010


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


Tony Chang (Google) <tony at chromium.org> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |tony at chromium.org




--- Comment #4 from Tony Chang (Google) <tony at chromium.org>  2010-01-25 21:07:51 PST ---
ReplaceSelection first deletes the selected text, then inserts the new HTML. 
Unfortunately, DeleteSelection updates the cursor position after the delete to
a visible position.  After the text is deleted, all we have left is
<b>inside</b> and the visible position is inside the </b>.

To work around this, I save the insertion position as a dom node + offset (in
this case, it would be that parent of the bold node with an offset of 1) before
the delete and set the insertion position after the delete has happened rather
than just using the cursor 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