Is the "document" identifier defined in the standards?

# Kevin Chen (2 months ago)

Hello, Looking through the DOM and HTML standards I have seen several implicit references to the current document object using the identifier "document". But I do not see a guarantee within the standards that the browser will provide an object called "document" containing the current document object (irrespective of the fact that this does seem to be the case in practice). So I'm wondering if this convention actually is codified as a standard, or whether it remains a de facto standard only.

Thanks for your answers.-

Contact us to advertise here
# Domenic Denicola (2 months ago)

From: whatwg [mailto:whatwg-bounces at lists.whatwg.org] On Behalf Of Kevin Chen

But I do not see a guarantee within the standards that the browser will provide an object called "document" containing the current document object (irrespective of the fact that this does seem to be the case in practice).

This is specified at html.spec.whatwg.org/#window as

[Unforgeable] readonly attribute Document document;

and if you click on "document" there it takes you to html.spec.whatwg.org/#dom-document-2 which says

# Domenic Denicola (2 months ago)

From: whatwg [mailto:whatwg-bounces at lists.whatwg.org] On Behalf Of Kevin Chen

But I do not see a guarantee within the standards that the browser will provide an object called "document" containing the current document object (irrespective of the fact that this does seem to be the case in practice).

This is specified at html.spec.whatwg.org/#window as

[Unforgeable] readonly attribute Document document;

and if you click on "document" there it takes you to html.spec.whatwg.org/#dom-document-2 which says

Want more features?

Request early access to our private beta of readable email premium.