Skip to content

Commit

Permalink
Remove showModalDialog()
Browse files Browse the repository at this point in the history
  • Loading branch information
domenic authored and annevk committed Dec 15, 2015
1 parent cf0355d commit eec9646
Showing 1 changed file with 2 additions and 290 deletions.
292 changes: 2 additions & 290 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -78382,7 +78382,6 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
boolean <span data-x="dom-confirm">confirm</span>(optional DOMString message = "");
DOMString? <span data-x="dom-prompt">prompt</span>(optional DOMString message = "", optional DOMString default = "");
void <span data-x="dom-print">print</span>();
any <span data-x="dom-showModalDialog">showModalDialog</span>(DOMString url, optional any argument<!--, optional DOMString features-->); // deprecated

unsigned long <span data-x="dom-window-requestAnimationFrame">requestAnimationFrame</span>(<span>FrameRequestCallback</span> callback);
void <span data-x="dom-window-cancelAnimationFrame">cancelAnimationFrame</span>(unsigned long handle);
Expand Down Expand Up @@ -79788,9 +79787,8 @@ x === this; // true</pre>
<dd>

<p>This flag <a href="#sandboxWindowOpen">prevents content from creating new auxiliary browsing
contexts</a>, e.g. using the <code data-x="attr-hyperlink-target">target</code> attribute, the
<code data-x="dom-open">window.open()</code> method, or the <code
data-x="dom-showModalDialog">showModalDialog()</code> method.</p>
contexts</a>, e.g. using the <code data-x="attr-hyperlink-target">target</code> attribute or
the <code data-x="dom-open">window.open()</code> method.</p>

</dd>

Expand Down Expand Up @@ -79949,7 +79947,6 @@ x === this; // true</pre>
<li><code data-x="dom-confirm">window.confirm()</code></li>
<li><code data-x="dom-print">window.print()</code></li>
<li><code data-x="dom-prompt">window.prompt()</code></li>
<li><code data-x="dom-showmodaldialog">window.showModalDialog()</code></li>
<li>the <code data-x="event-beforeunload">beforeunload</code> event</li>
</ul>

Expand Down Expand Up @@ -89206,291 +89203,6 @@ scheduleWork(); // queues a task to do lots of work</pre>
</div>


<!--TOPIC:DOM APIs-->
<h4 id="dialogs-implemented-using-separate-documents">Dialogs implemented using separate documents with <code data-x="dom-showModalDialog">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
data-x="dom-showModalDialog">showModalDialog()</code> API at this time is highly discouraged.</p>

<!--
<dl class="domintro">

<dt><var>result</var> = <var>window</var> . <code subdfn data-x="dom-showModalDialog">showModalDialog</code>(<var>url</var> [, <var>argument</var>] )</dt>

<dd>

<p>Prompts the user with the given page, waits for that page to close, and returns the return
value.</p>

<p>A call to the <code
data-x="dom-navigator-yieldForStorageUpdates">navigator.yieldForStorageUpdates()</code> method
is implied when this method is invoked.</p>

</dd>

</dl>
-->

<div w-nodev>

<p>The <dfn><code data-x="dom-showModalDialog">showModalDialog(<var>url</var>, <var>argument</var><!--, <var>features</var>-->)</code></dfn> method, when invoked,
must cause the user agent to run the following steps:</p>

<ol>

<li>

<p><span data-x="resolve a url">Resolve</span> <var>url</var> relative to the
<span>API base URL</span> specified by the <span>entry settings object</span>.</p>

<p>If this fails, then throw a <code>SyntaxError</code> exception and abort these steps.</p>

</li>

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

<li>

<p>Release the <span>storage mutex</span>.</p>

</li>

<li>

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

<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>

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

</li>

<li>

<p>Let <var>incumbent origin</var> be the <span>effective script origin</span>
specified by the <span>incumbent settings object</span> at the time the <code
data-x="dom-showModalDialog">showModalDialog()</code> method was called.</p>

</li>

<li>

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

<ul>

<li>are part of the same <span>unit of related browsing contexts</span> as the browsing context
of the <code>Window</code> object on which the <code
data-x="dom-showModalDialog">showModalDialog()</code> method was called, and that</li>

<li>have an <span>active document</span> whose <span>origin</span> is the <span data-x="same
origin">same</span> as <var>incumbent origin</var>,</li> <!-- Note that changing
document.domain to talk to another domain doesn't make you able to block that domain -->

</ul>

<p>...as well as any browsing contexts that are nested inside any of the browsing contexts
matching those conditions.</p>

</li>

<li>

<p>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.</p>

</li>

<li>

<p><span data-x="creating a new browsing context">Create</span> a new <span>auxiliary browsing context</span>, with the <span>opener browsing
context</span> being the browsing context of the <code>Window</code> object on which the <code
data-x="dom-showModalDialog">showModalDialog()</code> method was called. The new auxiliary
browsing context has no name.</p>

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

</li>

<li>

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

</li>

<li>

<p>Let the <span>dialog arguments</span> 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.</p>

</li>

<li>

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

</li>

<li>

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

</li>

<li>

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

</li>

<li>

<p><span>Navigate</span><!--DONAV showModalDialog--> the new <span>browsing context</span> to
the <span>absolute URL</span> that resulted from <span data-x="resolve a url">resolving</span>
<var>url</var> earlier, with <span>replacement enabled</span>, and with the
<span>responsible browsing context</span> specified by the <span>incumbent settings
object</span> as the <span>source browsing context</span>.</p>

<!-- we don't call this with <span>exceptions enabled</span>, since that would risk leaving the
browser in an unusable state (or would require that we catch and rethrow the exception, and
this API is deprecated so we're not worried about keeping it sane) -->

</li>

<li>

<p><span>Spin the event loop</span> until the new <span>browsing context</span> is <span
data-x="close a browsing context">closed</span>. The user agent must allow the user to indicate
that the <span>browsing context</span> is to be closed.</p>

</li>

<li>

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

</li>

<li>

<p>If the <span>auxiliary browsing context</span>'s <span>return value origin</span> at the time
the browsing context was <span data-x="close a browsing context">closed</span> was the <span
data-x="same origin">same</span> as <var>incumbent origin</var>, then let <var>return value</var> be the <span>auxiliary browsing context</span>'s <span>return
value</span> as it stood when the browsing context was <span data-x="close a browsing
context">closed</span>.</p>

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

</li>

<li>

<p>Return <var>return value</var>.</p>

</li>

</ol>

<p>The <code>Window</code> objects of <code>Document</code>s hosted by <span data-x="browsing
context">browsing contexts</span> created by the above algorithm must also implement the
<code>WindowModal</code> interface.</p>

<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 data-x="dom-alert">window.alert()</code>
method).</p>

</div>

<pre class="idl">[NoInterfaceObject]
interface <dfn>WindowModal</dfn> {
readonly attribute any <span data-x="dom-WindowModal-dialogArguments">dialogArguments</span>;
attribute any <span data-x="dom-WindowModal-returnValue">returnValue</span>;
};</pre>

<dl class="domintro">

<dt><var>window</var> . <code subdfn data-x="dom-WindowModal-dialogArguments">dialogArguments</code></dt>

<dd>

<p>Returns the <var>argument</var> argument that was passed to the <code
data-x="dom-showModalDialog">showModalDialog()</code> method.</p>

</dd>

<dt><var>window</var> . <code subdfn data-x="dom-WindowModal-returnValue">returnValue</code> [ = <var>value</var> ]</dt>

<dd>

<p>Returns the current return value for the window.</p>

<p>Can be set, to change the value that will be returned by the <code
data-x="dom-showModalDialog">showModalDialog()</code> method.</p>

</dd>

</dl>

<div w-nodev>

<p>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
data-x="dom-showModalDialog">showModalDialog()</code> method in the algorithm above, when the
browsing context is created, based on the arguments provided to the method.</p>

<p>The <dfn><code data-x="dom-WindowModal-dialogArguments">dialogArguments</code></dfn> IDL
attribute, on getting, must check whether its browsing context's <span>active document</span>'s
<span>effective script origin</span> is the <span data-x="same origin">same</span> as the <span>dialog arguments'
origin</span>. If it is, then the browsing context's <span>dialog arguments</span> must be
returned unchanged. Otherwise, the IDL attribute must return <i>undefined</i>.</p>

<p>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
data-x="dom-showModalDialog">showModalDialog()</code> method in the algorithm above, when the
browsing context is created.</p>

<p>The <dfn><code data-x="dom-WindowModal-returnValue">returnValue</code></dfn> IDL attribute, on
getting, must check whether its browsing context's <span>active document</span>'s <span>effective
script origin</span> is the <span data-x="same origin">same</span> as the current <span>return
value origin</span>. If it is, then the browsing context's <span>return value</span> must be
returned unchanged. Otherwise, the IDL attribute must return <i>undefined</i>. On setting, the
attribute must set the <span>return value</span> to the given new value, and the <span>return
value origin</span> to the browsing context's <span>active document</span>'s <span>effective
script origin</span>.</p>

</div>

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


<h3>System state and capabilities</h3>

<h4>The <code>Navigator</code> object</h4>
Expand Down

0 comments on commit eec9646

Please sign in to comment.