This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
This was was cloned from bug 17077 as part of operation convergence. Originally filed: 2012-05-16 11:20:00 +0000 Original reporter: Henri Sivonen <hsivonen@iki.fi> ================================================================================ #0 Henri Sivonen 2012-05-16 11:20:04 +0000 -------------------------------------------------------------------------------- http://www.whatwg.org/specs/web-apps/current-work/#dom-document-open says, in part: "If the document has an active parser that isn't a script-created parser, and the insertion point associated with that parser's input stream is not undefined (that is, it does point to somewhere in the input stream), then the method does nothing. Abort these steps and return the Document object on which the method was invoked." AFAICT, the part " that isn't a script-created parser" is bogus per the behavior of Firefox (tested trunk), Chrome (tested dev), Opera (tested Next) and IE (tested 9). See these demos: http://hsivonen.iki.fi/test/moz/document-open-during-network-parse.html http://hsivonen.iki.fi/test/moz/document-open-during-script-created-parse.html (Aside: It seems that the spec sides with WebKit and Presto rather than Gecko and Trident on the " and return the Document object on which the method was invoked" point.) ================================================================================ #1 Ian 'Hixie' Hickson 2012-06-21 06:36:11 +0000 -------------------------------------------------------------------------------- I wonder why I wrote that then. Weird. ================================================================================
http://www.hixie.ch/tests/adhoc/dom/level0/document/open/005.html is the test that led to the current text. It shows that document.open() does work while you're in a script-created parser. But I guess this means this should be defined differently. Is it just that while the script nesting level is greater than zero (i.e. script is invoked from parser) you ignore document.open()? (Regarding the return value, please file a separate bug if you want that changed.)
Checked in as WHATWG revision r7757. Check-in comment: Try to define when document.open() doesn't work more precisely. http://html5.org/tools/web-apps-tracker?from=7756&to=7757