This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 25730 - Definition of window.document could be clarified
Summary: Definition of window.document could be clarified
Status: RESOLVED FIXED
Alias: None
Product: WHATWG
Classification: Unclassified
Component: HTML (show other bugs)
Version: unspecified
Hardware: Other other
: P3 normal
Target Milestone: Unsorted
Assignee: Ian 'Hixie' Hickson
QA Contact: contributor
URL: http://www.whatwg.org/specs/web-apps/...
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-05-15 18:42 UTC by contributor
Modified: 2014-09-19 23:35 UTC (History)
3 users (show)

See Also:


Attachments

Description contributor 2014-05-15 18:42:31 UTC
Specification: http://www.whatwg.org/specs/web-apps/current-work/multipage/browsers.html
Multipage: http://www.whatwg.org/C#dom-document-0
Complete: http://www.whatwg.org/c#dom-document-0
Referrer: http://www.whatwg.org/specs/web-apps/current-work/multipage/

Comment:
Definition of window.document could be clarified

Posted from: 91.182.79.155 by ms2ger@gmail.com
User agent: Mozilla/5.0 (X11; Linux x86_64; rv:29.0) Gecko/20100101 Firefox/29.0
Comment 1 Ms2ger 2014-05-15 18:55:56 UTC
The meaning of "the Window object's newest Document object" isn't immediately obvious, IMO, and the fact that #initialise-the-document-object says "change the document attribute of the Window object" also feels weird. Maybe something more like...

# Window objects have an associated **current document**.
#
# Note: the _current document_ associated with a Window can change in
# exactly one case, …about:blank….

(near #the-window-object)

# The **document** IDL attribute must return the Window object's
# _current document_.

(near #dom-document-0)

# If the browsing context's only entry in its session history is the
# about:blank Document that was added when the browsing context was
# created, and navigation is occurring with replacement enabled, and
# that Document has the same origin as the new Document, then change
# the _current document_ of the Window object of that Document to
# the new Document.
#
# Otherwise, create a new Window object with the new Document as its
# _current document_, and associate it with the Document.

(near #initialise-the-document-object)
Comment 2 Ian 'Hixie' Hickson 2014-08-04 18:36:01 UTC
There's a _lot_ of prose that just says things along the lines of "The Window object of the Document object of...". I don't think we'll ever catch all of it. So at some level, this will always rely on an implicit association between a Document and a Window.

Is there some way you would be satisfied that this was clarified that didn't involve introducing a new term that doesn't get used everywhere?
Comment 3 Ms2ger 2014-09-09 08:21:50 UTC
Maybe just add something like

# Note: the Document object associated with a Window can change in
# exactly one case, …about:blank….

then.
Comment 4 Ian 'Hixie' Hickson 2014-09-09 15:58:04 UTC
Oh, yeah, that's totally doable. I have that kind of thing in various places. Happy to add that here too.
Comment 5 contributor 2014-09-19 23:35:42 UTC
Checked in as WHATWG revision r8801.
Check-in comment: Add a note to clarify window.document, and fix some spellings
https://html5.org/tools/web-apps-tracker?from=8800&to=8801