Bug 16196
Summary: | Pasted content appears at the end of the document instead where the caret was | ||
---|---|---|---|
Product: | WebKit | Reporter: | Matt Lilek <dev+webkit> |
Component: | HTML Editing | Assignee: | Nobody <webkit-unassigned> |
Status: | RESOLVED INVALID | ||
Severity: | Normal | CC: | jparent, jubal-webkit-20111123, justin.garcia |
Priority: | P2 | Keywords: | GoogleBug, InRadar, NeedsReduction |
Version: | 528+ (Nightly build) | ||
Hardware: | Mac | ||
OS: | OS X 10.5 |
Matt Lilek
Go to Blogger and create a new entry. Try pasting anything into the rich text editor - it will appear outside the edit area and isn't posted or saved.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Justin Garcia
The caret moves to an editable region before just before the Paste is performed. This also happens *just by opening the Edit menu*. Looking into this...
Justin Garcia
Their code is focusing a div at the end of the document just before paste time and when the Edit menu is opened.
Justin Garcia
According to ...-richedit.common.js Blogger intentionally first pastes the content into a div at the bottom of the document, in an attempt to workaround bugs in IE's URL autocompletion. Two problems occur, one, the div is intended to be hidden and its not (in Safari) and the content is never brought over to the original insertion position, inside the editable iframe.
Justin Garcia
Also, the fact that the div at the bottom of the document is focused when the Edit menu opens leads me to believe that onbeforepaste might be called when the Edit menu is opened, which would be a bug.
Justin Garcia
(onbeforepaste is where Blogger focuses the hidden div)
Justin Garcia
Looks like we fail to insert the content because we don't support Range::pasteHTML. Mozilla doesn't either, but they don't get to this point because they don't support onbeforepaste. Looks like the Blogger code just assumes that the browser is IE if it supports onbeforepaste...
Justin Garcia
We could fix this bug by supporting Range::select and Range::pasteHTML, but then we would look even more like IE, do we want to add support for these methods, or ask Blogger to change their code?
Justin Garcia
(In reply to comment #7)
> We could fix this bug by supporting Range::select and Range::pasteHTML, but
> then we would look even more like IE, do we want to add support for these
> methods, or ask Blogger to change their code?
Range::pasteHTML isn't exactly an equivalent to document.execCommand("InsertHTML", ...), since it doesn't require a selection, so it would probably be useful to add support for. I think we should add it.
Justin Garcia
These are actually TextRange methods, not Range methods.
David Harrison
rdar://5559595
Eric Seidel (no email)
This only seems to affect Mac Safari. Safari 3.1 on windows does not seem to hit this bug, assuming I'm testing correctly.
Julie Parent
We *just* launched a new editor on draft.blogger.com (You'll see a different toolbar if you are getting the new version). This bug should be fixed with the new editor and will go to regular blogger.com soon.
Jubal Kessler
Looking forward to "soon". Tried draft.blogger.com and it seems to work.
Maciej Stachowiak
Closing as INVALID since this turned out to be a Google bug and was fixed on that end.