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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Sat Jan 30 05:31:51 PST 2010


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





--- Comment #16 from Tony Chang (Google) <tony at chromium.org>  2010-01-30 05:31:49 PST ---
(In reply to comment #15)
> I think that a simpler and cleaner approach would be to modify
> DeleteSelectionCommand to add a placeholder in a case like this.
> Creating a placeholder when you are deleting is easier than trying to find the
> correct position after you deleted.
> It has the benefit of minimizing the code changes without introducing a new way
> of finding the position, while still keeping the benefit of eliminating all the
> spans.

That was my first attempt at fixing the bug :)

The problem was that adding a placeholder changes the behavior of
DeleteSelection.  It changes how mergeParagraphs works and it changes the logic
about whether to insert a break or not at the end of a document.  This causes
lots of other layout tests to fail.

This lead me to the current approaches on this bug: keep track of the position
by not modifying the DOM.  The first patch on this bug does that, but doesn't
handle the isCaret() case so it doesn't fix bug 23993.  This could be fixed,
but it ends up being more complicated because it has to handle cases where the
insertion position is deleted by DeleteSelection (because, e.g., dom nodes are
copied or paragraphs are merged).  It turns out that it is simpler to just
compute the position after the all the DOM modifications have ended.

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