Skip to content

HTMLDocument interface is missing #2679

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
Joris-van-der-Wel opened this issue May 15, 2017 · 4 comments
Closed

HTMLDocument interface is missing #2679

Joris-van-der-Wel opened this issue May 15, 2017 · 4 comments

Comments

@Joris-van-der-Wel
Copy link
Contributor

Joris-van-der-Wel commented May 15, 2017

For historical reasons, Window objects must also have a writable, configurable, non-enumerable property named HTMLDocument whose value is the Document interface object.

(line 78382 616df18)

This is not the case in Firefox 53, Chrome 57, Safari 10, IE11:

>> Document === HTMLDocument
false

>> Object.getPrototypeOf(HTMLDocument.prototype) === Document.prototype
true

>> Object.prototype.toString.call(document)
"[object HTMLDocument]"

>> Object.keys(HTMLDocument.prototype).length > 0
true

Nor can I find a HTMLDocument interface in the DOM or HTML spec. This was changed in 83f13ee.

Since all the browsers do not follow the specification, I think the specification should be updated?
(Also, I suspect that scripts in the wild might use the string tag [object HTMLDocument] to detect document objects)

@Joris-van-der-Wel
Copy link
Contributor Author

Since all the browsers do something different

I meant "Since all the browsers do not follow the specification"

@annevk
Copy link
Member

annevk commented May 15, 2017

This is whatwg/dom#221 basically. To address it we must first redo how we allocate document objects. That will make it easier to allocate a different one for XML vs HTML, etc. #2657 has some thoughts on how to get there and my three most recent PRs will help us get there I think.

@annevk
Copy link
Member

annevk commented May 15, 2017

(I need to write more PRs after that, but I'd rather do it in incremental steps since having too many PRs depend on each other gets confusing fast.)

@domenic
Copy link
Member

domenic commented Jun 16, 2017

Let's consolidate this into whatwg/dom#221 and #2657.

@domenic domenic closed this as completed Jun 16, 2017
# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Development

No branches or pull requests

3 participants