This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
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
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)
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?
Maybe just add something like # Note: the Document object associated with a Window can change in # exactly one case, …about:blank…. then.
Oh, yeah, that's totally doable. I have that kind of thing in various places. Happy to add that here too.
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