Skip to content
This repository has been archived by the owner on Jul 30, 2019. It is now read-only.

Commit

Permalink
Remove showModalDialog to sync with whatwg (#799)
Browse files Browse the repository at this point in the history
  • Loading branch information
arronei authored and travisleithead committed Feb 16, 2017
1 parent ab83dae commit bb58dad
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 244 deletions.
4 changes: 1 addition & 3 deletions sections/browsers.include
Expand Up @@ -1033,7 +1033,6 @@
boolean confirm(optional DOMString message = ""); boolean confirm(optional DOMString message = "");
DOMString? prompt(optional DOMString message = "", optional DOMString default = ""); DOMString? prompt(optional DOMString message = "", optional DOMString default = "");
void print(); void print();
any showModalDialog(DOMString url, optional any argument); // deprecated


unsigned long requestAnimationFrame(FrameRequestCallback callback); unsigned long requestAnimationFrame(FrameRequestCallback callback);
void cancelAnimationFrame(unsigned long handle); void cancelAnimationFrame(unsigned long handle);
Expand Down Expand Up @@ -2091,7 +2090,7 @@


This flag <a>prevents content from creating new auxiliary browsing This flag <a>prevents content from creating new auxiliary browsing
contexts</a>, e.g., using the <code>target</code> attribute, the contexts</a>, e.g., using the <code>target</code> attribute, the
<code>window.open()</code> method, or the <code>showModalDialog()</code> method. <code>window.open()</code> method.


</dd> </dd>


Expand Down Expand Up @@ -2208,7 +2207,6 @@
<li><code>window.confirm()</code></li> <li><code>window.confirm()</code></li>
<li><code>window.print()</code></li> <li><code>window.print()</code></li>
<li><code>window.prompt()</code></li> <li><code>window.prompt()</code></li>
<li><code>window.showModalDialog()</code></li>
<li>the <code>beforeunload</code> event</li> <li>the <code>beforeunload</code> event</li>
</ul> </ul>


Expand Down
241 changes: 0 additions & 241 deletions sections/webappapis.include
Expand Up @@ -3110,247 +3110,6 @@


</ol> </ol>


<h4 id="dialogs-implemented-using-separate-documents-with-showmodaldialog">Dialogs implemented using separate documents with <code>showModalDialog()</code></h4>

<p class="critical">This feature is in the process of being removed from the Web platform. (This
is a long process that takes many years.) Using the <code>showModalDialog()</code> API at this time is highly discouraged.

The
<dfn method for="Window" lt="showModalDialog()|showModalDialog(url)|showModalDialog(url, argument)"><code>showModalDialog(<var>url</var>, <var>argument</var>)</code></dfn>
method, when invoked, must cause the user agent to run the following steps:

<ol>

<li>

<a>Parse</a> <var>url</var> relative to the
<a>API base URL</a> specified by the <a>entry settings object</a>.

If this fails, then throw a "{{SyntaxError}}" {{DOMException}} and abort these steps.

</li>

<li>If the <a>event loop</a>'s <a>termination nesting level</a> is non-zero,
optionally abort these steps, returning the empty string.</li>


<li>

If the user agent is configured such that this invocation of <code>showModalDialog()</code> is somehow disabled, then return the empty
string and abort these steps.

<p class="note">
User agents are expected to disable this method in certain cases to avoid user
annoyance (e.g., as part of their popup blocker feature). For instance, a user agent could
require that a site be safelisted before enabling this method, or the user agent could be
configured to only allow one modal dialog at a time.
</p>

</li>

<li>

If the <a>active sandboxing flag set</a> of the <a>active document</a> of the
<a>responsible browsing context</a> specified by the <a>incumbent settings
object</a> has either the <a>sandboxed auxiliary navigation browsing context flag</a>
or <a>sandboxed modals flag</a> set, then return the empty string and abort these
steps.

</li>

<li>

Let <var>incumbent origin</var> be the [=concept/origin=]
specified by the <a>incumbent settings object</a> at the time the <code>showModalDialog()</code> method was called.

</li>

<li>

Let <var>the list of background browsing contexts</var> be a list of all the
browsing contexts that:

<ul>

<li>are part of the same <a>unit of related browsing contexts</a> as the browsing context
of the <code>Window</code> object on which the <code>showModalDialog()</code> method was called, and that</li>

<li>have an <a>active document</a> whose [=concept/origin=] is the same as <var>incumbent origin</var>,</li>

</ul>

...as well as any browsing contexts that are nested inside any of the browsing contexts
matching those conditions.

</li>

<li>

Disable the user interface for all the browsing contexts in <var>the list of
background browsing contexts</var>. This should prevent the user from navigating those browsing
contexts, causing events to be sent to those browsing context, or editing any content in those
browsing contexts. However, it does not prevent those browsing contexts from receiving events
from sources other than the user, from running scripts, from running animations, and so
forth.

</li>

<li>

Create a new <a>auxiliary browsing context</a>, with the <a>opener browsing context</a> being the browsing context of the <code>Window</code> object on which the <code>showModalDialog()</code> method was called. The new auxiliary
browsing context has no name.

<p class="note">
This <a>browsing context</a>'s <code>Document</code>s' <code>Window</code>
objects all implement the <code>WindowModal</code> interface.
</p>

</li>

<li>

Set all the flags in the new browsing context's <a>popup sandboxing flag set</a> that
are set in the <a>active sandboxing flag set</a> of the <a>active document</a> of
the <a>responsible browsing context</a> specified by the <a>incumbent settings
object</a>. The <a>responsible browsing context</a> specified by the <a>incumbent
settings object</a> must be set as the new browsing context's <a>one permitted sandboxed
navigator</a>.

</li>

<li>

Let the <a>dialog arguments</a> of the new browsing context be set to the value of <var>argument</var>, or the <i>undefined</i> value if the argument was omitted.

</li>

<li>

Let the <a>dialog arguments' origin</a> be <var>incumbent origin</var>.

</li>

<li>

Let the <a>return value</a> of the new browsing context be the <i>undefined</i> value.

</li>

<li>

Let the <a>return value origin</a> be <var>incumbent origin</var>.

</li>

<li>

<a>Navigate</a> the new <a>browsing context</a> to
the <a>absolute URL</a> that resulted from <a>parsing</a>
<var>url</var> earlier, with <a>replacement enabled</a>, and with the
<a>responsible browsing context</a> specified by the <a>incumbent settings
object</a> as the <a>source browsing context</a>.

</li>

<li>

<a>Spin the event loop</a> until the new <a>browsing context</a> is closed. The user agent must allow the user to indicate
that the <a>browsing context</a> is to be closed.

</li>

<li>

Reenable the user interface for all the browsing contexts in <var>the list of
background browsing contexts</var>.

</li>

<li>

If the <a>auxiliary browsing context</a>'s <a>return value origin</a> at the time
the browsing context was closed was the same as <var>incumbent origin</var>, then let <var>return value</var> be the <a>auxiliary browsing context</a>'s <a>return
value</a> as it stood when the browsing context was closed.

Otherwise, let <var>return value</var> be undefined.

</li>

<li>

Return <var>return value</var>.

</li>

</ol>

The <code>Window</code> objects of <code>Document</code>s hosted by <a>browsing contexts</a> created by the above algorithm must also implement the
<code>WindowModal</code> interface.

<p class="note">
When this happens, the members of the <code>WindowModal</code> interface, in
JavaScript environments, appear to actually be part of the <code>Window</code> interface (e.g.,
they are on the same prototype chain as the <code>window.alert()</code>
method).
</p>

<pre class="idl" data-highlight="webidl">
[NoInterfaceObject]
interface WindowModal {
readonly attribute any dialogArguments;
attribute any returnValue;
};
</pre>

<dl class="domintro">

<dt><var>window</var> . {{WindowModal/dialogArguments}}</dt>

<dd>

Returns the <var>argument</var> argument that was passed to the <code>showModalDialog()</code> method.

</dd>

<dt><var>window</var> . {{WindowModal/returnValue}} [ = <var>value</var> ]</dt>

<dd>

Returns the current return value for the window.

Can be set, to change the value that will be returned by the <code>showModalDialog()</code> method.

</dd>

</dl>

Such browsing contexts have associated <dfn>dialog arguments</dfn>, which are stored along with
the <dfn>dialog arguments' origin</dfn>. These values are set by the <code>showModalDialog()</code> method in the algorithm above, when the
browsing context is created, based on the arguments provided to the method.

The <dfn attribute for="WindowModal"><code>dialogArguments</code></dfn> IDL
attribute, on getting, must check whether its browsing context's <a>active document</a>'s
[=concept/origin=] is the <a>same origin-domain</a> as the <a>dialog arguments' origin</a>. If it is,
then the browsing context's <a>dialog arguments</a> must be returned unchanged. Otherwise, the
IDL attribute must return <i>undefined</i>.

These browsing contexts also have an associated <dfn>return value</dfn> and
<dfn>return value origin</dfn>. As with the previous two values, these values are set by the <code>showModalDialog()</code> method in the algorithm above, when the
browsing context is created.

The <dfn attribute for="WindowModal"><code>returnValue</code></dfn> IDL attribute, on
getting, must check whether its browsing context's <a>active document</a>'s
[=concept/origin=] is the <a>same origin-domain</a> as the current <a>return value origin</a>. If it
is, then the <a>browsing context</a>'s <a>return value</a> must be returned unchanged. Otherwise,
the IDL attribute must return <i>undefined</i>. On setting, the attribute must set the
<a>return value</a> to the given new value, and the <a>return value origin</a> to the
<a>browsing context</a>'s <a>active document</a>'s [=concept/origin=].

<p class="note">
The <code>window.close()</code> method can be used to
close the browsing context.
</p>

<h3 id="system-state-and-capabilities">System state and capabilities</h3> <h3 id="system-state-and-capabilities">System state and capabilities</h3>


<h4 id="the-navigator-object">The <code>Navigator</code> object</h4> <h4 id="the-navigator-object">The <code>Navigator</code> object</h4>
Expand Down

0 comments on commit bb58dad

Please sign in to comment.