[Webkit-unassigned] [Bug 21840] New: execCommand insertImage inserts image into wrong place
bugzilla-daemon at webkit.org
bugzilla-daemon at webkit.org
Thu Oct 23 15:12:11 PDT 2008
https://bugs.webkit.org/show_bug.cgi?id=21840
Summary: execCommand insertImage inserts image into wrong place
Product: WebKit
Version: 525.x (Safari 3.1)
Platform: PC
URL: http://www.plexode.com/cgi-
bin/eval2.py#var%20div%20%3D%20document.createElement(%2
2div%22)%3B%0Adiv.contentEditable%20%3D%20true%3B%0Adocu
ment.body.appendChild(div)%3B%0Adiv.innerHTML%20%3D%20'%
3Cb%3EInside%3C%2Fb%3EOutside'%3B%0Avar%20b%20%3D%20div.
childNodes%5B1%5D%3B%0A%0A%2F%2F%20Select%20the%20text%2
0%22Outside%22%0Avar%20sel%20%3D%20window.getSelection()
%3B%0Avar%20rng%20%3D%20document.createRange()%3B%0Arng.
selectNode(b)%3B%0Asel.removeAllRanges()%3B%0Asel.addRan
ge(rng)%3B%0Adiv.focus()%3B%0A%0A%2F%2F%20Insert%20an%20
image%20on%20top%20of%20%22Outside%22%0Adocument.execCom
mand(%22insertImage%22%2C%20false%2C%20%22http%3A%2F%2Fw
ww.google.com%2Fimages%2Fart.gif%22)%3B%0A%2F%2F%20Image
%20is%20inside%20B%20tag%20now%0Adiv.innerHTML%0A
OS/Version: Mac OS X 10.5
Status: NEW
Severity: Normal
Priority: P2
Component: HTML Editing
AssignedTo: webkit-unassigned at lists.webkit.org
ReportedBy: jparent at google.com
CC: justin.garcia at apple.com
Given the following html: <b>inside</b>outside
1. Select "outside"
2. execCommand('insertImage', false, 'myFavoriteImageUrl')
result: <b>inside<img src='myFavoriteImageUrl'></b> (image inside B tag)
expected result: <b>inside</b><img src='myFavoriteImageUrl'> (image outside B
tag)
Click "eval once" in the link above to see demo.
Also seen in Chrome.
You can run the same demo in FF 3 and see that the image goes outside the B
tag.
--
Configure bugmail: https://bugs.webkit.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug, or are watching the assignee.
More information about the webkit-unassigned
mailing list