Investigate if document.innerHTML should be implemented

RESOLVED INVALID

Status

()

Core
DOM
RESOLVED INVALID
8 years ago
2 months ago

People

(Reporter: smaug, Unassigned)

Tracking

Trunk
x86
All
Points:
---

Firefox Tracking Flags

(Not tracked)

Details

I don't know which browsers support document.innerHTML, and which way.

HTML5 draft doesn't say exactly what should happen when trying to
insert several child nodes to document. I would assume some exceptions should
be fired.
AFAICT, it isn't supported by any browser, I filed a bug: <http://www.w3.org/Bugs/Public/show_bug.cgi?id=9649>.
(In reply to comment #0)
> HTML5 draft doesn't say exactly what should happen when trying to
> insert several child nodes to document. I would assume some exceptions should
> be fired.

Why?  Shouldn't it silently parse to whatever DOM you get when you have the same markup in an actual document?  An <html> tag in the "in body" insertion mode does nothing, except add any attributes to the existing <html>; and if there's an </html>, anything bad after it just resets the insertion mode to "in body".  So the HTML parser will never produce multiple root elements to start with.
(In reply to comment #2)

> Shouldn't it silently parse to whatever DOM you get when you have the
> same markup in an actual document?  
Yeah, I guess that could be ok given the strangeness of innerHTML in general.

Comment 4

6 years ago
The spec has moved to http://html5.org/specs/dom-parsing.html#innerhtml, and sadly, `document.innerHTML` has been removed.

Comment 5

2 months ago
INVALID per comment 4. Latest is now https://w3c.github.io/DOM-Parsing/.
Status: NEW → RESOLVED
Last Resolved: 2 months ago
Resolution: --- → INVALID
You need to log in before you can comment on or make changes to this bug.