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

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Jan 29 14:54:00 PST 2010


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





--- Comment #15 from Enrica Casucci <enrica at apple.com>  2010-01-29 14:53:59 PST ---
(In reply to comment #14)
> Nevermind, as tony said, the case I'm pointing out currently fails on trunk and
> is a separate, but related bug. Test page:
> http://www.plexode.com/cgi-bin/eval3.py#ht=%3Cdiv%20id%3Douter%20contentEditable%3E%3Cb%20id%3Dinner%3EInside%3C%2Fb%3EOutside%3C%2Fdiv%3E&ohh=1&ohj=0&jt=var%20b%20%3D%20inner.firstChild%3B%0Awindow.getSelection().setBaseAndExtent(b%2C%201%2C%20b%2C%206)%3B%0Adocument.execCommand(%22insertImage%22%2C%20false%2C%20%22http%3A%2F%2Fwww.google.com%2Fimages%2Fart.gif%22)%3B%0Aouter.innerHTML&ojh=1&ojj=0&ms=100&oth=0&otj=0&cex=1

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.

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