Open Bug 1037055 Opened 10 years ago Updated 3 years ago

contenteditable fails in HTML documents auto-generated for images and PDFs

Categories

(Core :: DOM: Editor, defect, P5)

32 Branch
x86
macOS
defect

Tracking

()

UNCONFIRMED

People

(Reporter: jmjacobs, Unassigned)

Details

(Keywords: testcase)

User Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_9_4) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/35.0.1916.153 Safari/537.36

Steps to reproduce:

1. Visit any image (.jpg or .png or .gif) or PDF file. Here’s one:
https://mozorg.cdn.mozilla.net/media/img/mozorg/mozilla-256.jpg

2. Paste the following code in the JS console to add a contenteditable DIV to the page.
var div = document.createElement('div'); div.style.cssText = 'position:fixed;top:10px;left:10px;width:200px;height:100px;background-color:white'; div.contentEditable = true; document.body.appendChild(div);

3. Click the div and try to type in it.


Actual results:

The contenteditable DIV receives focus, but typing is ignored.


Expected results:

The contenteditable DIV should work normally, as it does in other HTML documents.

I encountered this issue because I have authored a browser extension (Kifi) that adds a contenteditable DIV to whatever page the user is on to let the user send a message to a friend on any page and have a live chat on the same page. Our users have reported that composing messages does not work on image pages and PDFs in Firefox and does work in other browsers.
This may be related to bug 478095 and bug 549048.

In particular, see this comment (https://bugzil.la/549048#c2):
> I believe editor needs the document to be an HTMLDocument to work in Gecko.

I’m no expert, but it seems as though the HTML document generated for images implements interface nsIImageDocument, unlike most HTML documents. It also seems to implement nsIDOMHTMLDocument though, so I’m not sure what the underlying issue is.
Component: Untriaged → Editor
Product: Firefox → Core
Keywords: testcase

Bulk-downgrade of unassigned, >=5 years untouched DOM/Storage bugs' priority and severity.

If you have reason to believe this is wrong, please write a comment and ni :jstutte.

Severity: normal → S4
Priority: -- → P5
You need to log in before you can comment on or make changes to this bug.