From 1dafd08794f9886fd6da81ac26d47f124ad96025 Mon Sep 17 00:00:00 2001
From: Timothy Gu The Web IDL specification also defines the following types that are used in Web IDL fragments
@@ -9168,7 +9169,7 @@ partial interface Document {
readonly attribute HTMLOrSVGScriptElement? currentScript; // classic scripts in a document tree only
// dynamic markup insertion
- [CEReactions] Document open(optional DOMString type, optional DOMString replace); // both type and replace are ignored
+ [CEReactions] Document open(optional DOMString unused1, optional DOMString unused2); // both arguments are ignored
WindowProxy open(USVString url, DOMString name, DOMString features);
[CEReactions] void close();
[CEReactions] void write(DOMString... text);
@@ -66097,8 +66098,7 @@ console.log(plasticButton.outerHTML); // will output '<button is="plastic-but
this). The constructor must not use the document.write()
- or document.open(type, replace)
- methods.document.open()
methods.
The element's attributes and children must not be inspected, as in the non-upgrade case none will be present, and relying on
@@ -79513,10 +79513,10 @@ interface BarProp {
origin assigned when the Document
is
created.
The document.open(type,
- replace)
method can change the Document
's URL to "about:blank
". Therefore the
- origin is assigned when the Document
is created.
The document.open()
method can change
+ the Document
's URL to
+ "about:blank
". Therefore the origin is assigned when the
+ Document
is created.
For example, the URL of the
responsible document is used to set the URL of the Document
after it has been reset
- using document.open(type,
- replace)
.
document.open()
.
If the responsible event loop is not a browsing context event loop, then the environment settings object has no responsible document.
@@ -89968,7 +89967,7 @@ dictionary PromiseRejectionEventInit : EventInit {This algorithm is used to define document.open(type, replace)
.
To activate an event handler given an EventTarget
object
eventTarget and a string name that is the custom element constructors from being
- able to use document.open(type,
- replace)
, document.close()
, and document.open()
, document.close()
, and document.write()
when they are invoked by the parser.
Initially, the counter must be set to zero.
open
( [ type [, replace ] ] )open
( )Causes the Document
to be replaced in-place, as if it was a new
Document
object, but reusing the previous object, which is then returned.
The resulting Document
has an HTML parser associated with it, which can be given
- data to parse using document.write()
. (The
- type argument is ignored.)
If the replace argument is present and has the value "replace
", the existing entries in the session history for the
- Document
object are removed.
document.write()
.
The method has no effect if the Document
is still being parsed.
Document
objects have an ignore-opens-during-unload counter, which is
- used to prevent scripts from invoking the document.open(type, replace)
method
- (directly or indirectly) while the document is being
- unloaded. Initially, the counter must be set to zero.
document.open()
+ method (directly or indirectly) while the document is being
+ unloaded. Initially, the counter must be set to zero.
The document open steps, given a document, are as follows:
@@ -91000,19 +90992,17 @@ document.body.appendChild(frame)If document has an active parser whose script nesting level is greater than 0, then return document.
-This basically causes document.open(type, replace)
to be
- ignored when it's called in an inline script found during parsing, while still letting it have
- an effect when called from a non-parser task such as a timer callback or event handler.
This basically causes document.open()
to
+ be ignored when it's called in an inline script found during parsing, while still letting it
+ have an effect when called from a non-parser task such as a timer callback or event handler.
Similarly, if document's ignore-opens-during-unload counter is greater than 0, then return document.
-This basically causes document.open(type, replace)
to be
- ignored when it's called from a beforeunload
, This basically causes
document.open()
to
+ be ignored when it's called from a beforeunload
, pagehide
, or unload
event
handler while the Document
is being unloaded.
Create a new HTML parser and associate it with document. This is a
script-created parser (meaning that it can be closed by the document.open(type, replace)
and document.open()
and document.close()
methods, and that the tokenizer will wait for
an explicit call to document.close()
before emitting an
end-of-file token). The encoding confidence is
@@ -91057,11 +91047,17 @@ document.body.appendChild(frame)
The document open steps do not affect whether a Document
is ready for post-load tasks or completely loaded.
The The The type argument is ignored. The unused1 and
+ unused2 arguments are ignored, but kept in the IDL to allow code that calls the
+ function with one or two arguments to continue working. They are necessary due to Web IDL
+ overload resolution algorithm rules, which would throw a The Closes the input stream that was opened by the open(type,
- replace)
method must return the result of running the document open
+ open(unused1,
+ unused2)
method must return the result of running the document open
steps with this Document
object.
- TypeError
+ exception for such calls had the arguments not been there. heycam/webidl#581 investigates changing the
+ algorithm to allow for their removal. open(url, name,
features)
method must run these steps:document.open(type, replace)
method.
Throws an "InvalidStateError
" DOMException
if the
Document
is an XML document.
<plaintext>
" or "<!--
"). In other cases,
the call can clear the current page first, as if document.open(type, replace)
had been
- called. In yet more cases, the method is simply ignored, or throws an exception. Users agents
- are explicitly allowed to avoid executing
+ data-x="dom-document-open">document.open() had been called. In yet more cases, the method
+ is simply ignored, or throws an exception. Users agents are explicitly allowed to avoid executing
script
elements inserted via this method. And to make matters even worse, the
exact behavior of this method can in some cases be dependent on network latency