Skip to content
Permalink
Browse files

[e] (0) Simplify window.open even further

Affected topics: DOM APIs

git-svn-id: https://svn.whatwg.org/webapps@8778 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Sep 16, 2014
1 parent 8a31542 commit d13463e47b6ca917e9e4ff11c5adb4b5c7e9d376
Showing with 10 additions and 13 deletions.
  1. +4 −5 complete.html
  2. +4 −5 index
  3. +2 −3 source

<ol><li><p>Let <var>target browsing context</var> be the <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-3>browsing context</a> indicated by
the user.<li><p>If <var>target browsing context</var> is a new <a href=#top-level-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:top-level-browsing-context>top-level browsing context</a>,
let the <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context-2>responsible browsing context</a> specified by <var>incumbent settings</var> be
set as <var>target browsing context</var>'s <a href=#one-permitted-sandboxed-navigator id=apis-for-creating-and-navigating-browsing-contexts-by-name:one-permitted-sandboxed-navigator>one permitted sandboxed
navigator</a>.</ol>
let the <var>source browsing context</var> be set as <var>target browsing context</var>'s
<a href=#one-permitted-sandboxed-navigator id=apis-for-creating-and-navigating-browsing-contexts-by-name:one-permitted-sandboxed-navigator>one permitted sandboxed navigator</a>.</ol>

<p class=example>For example, suppose there is a user agent that supports control-clicking a
link to open it in a new tab. If a user clicks in that user agent on an element whose <code id=apis-for-creating-and-navigating-browsing-contexts-by-name:handler-onclick><a href=#handler-onclick>onclick</a></code> handler uses the <code id=apis-for-creating-and-navigating-browsing-contexts-by-name:dom-open-2><a href=#dom-open>window.open()</a></code> API to open a page in an iframe, but, while doing so,
objects should, if all the following conditions are met, <a href=#close-a-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:close-a-browsing-context>close</a> the <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-7>browsing context</a> <var>A</var>:

<ul class=brief><li>The corresponding <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-8>browsing context</a> <var>A</var> is
<a href=#script-closable id=apis-for-creating-and-navigating-browsing-contexts-by-name:script-closable>script-closable</a>.<li>The <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context-3>responsible browsing context</a> specified by the <a href=#incumbent-settings-object id=apis-for-creating-and-navigating-browsing-contexts-by-name:incumbent-settings-object-2>incumbent settings
object</a> is <a href=#familiar-with id=apis-for-creating-and-navigating-browsing-contexts-by-name:familiar-with>familiar with</a> the <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-9>browsing context</a> <var>A</var>.<li id=sandboxClose>The <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context-4>responsible browsing context</a> specified by the
<a href=#script-closable id=apis-for-creating-and-navigating-browsing-contexts-by-name:script-closable>script-closable</a>.<li>The <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context-2>responsible browsing context</a> specified by the <a href=#incumbent-settings-object id=apis-for-creating-and-navigating-browsing-contexts-by-name:incumbent-settings-object-2>incumbent settings
object</a> is <a href=#familiar-with id=apis-for-creating-and-navigating-browsing-contexts-by-name:familiar-with>familiar with</a> the <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-9>browsing context</a> <var>A</var>.<li id=sandboxClose>The <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context-3>responsible browsing context</a> specified by the
<a href=#incumbent-settings-object id=apis-for-creating-and-navigating-browsing-contexts-by-name:incumbent-settings-object-3>incumbent settings object</a> is <a href=#allowed-to-navigate id=apis-for-creating-and-navigating-browsing-contexts-by-name:allowed-to-navigate>allowed to navigate</a> the <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-10>browsing
context</a> <var>A</var>.</ul>

9 index

<ol><li><p>Let <var>target browsing context</var> be the <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-3>browsing context</a> indicated by
the user.<li><p>If <var>target browsing context</var> is a new <a href=#top-level-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:top-level-browsing-context>top-level browsing context</a>,
let the <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context-2>responsible browsing context</a> specified by <var>incumbent settings</var> be
set as <var>target browsing context</var>'s <a href=#one-permitted-sandboxed-navigator id=apis-for-creating-and-navigating-browsing-contexts-by-name:one-permitted-sandboxed-navigator>one permitted sandboxed
navigator</a>.</ol>
let the <var>source browsing context</var> be set as <var>target browsing context</var>'s
<a href=#one-permitted-sandboxed-navigator id=apis-for-creating-and-navigating-browsing-contexts-by-name:one-permitted-sandboxed-navigator>one permitted sandboxed navigator</a>.</ol>

<p class=example>For example, suppose there is a user agent that supports control-clicking a
link to open it in a new tab. If a user clicks in that user agent on an element whose <code id=apis-for-creating-and-navigating-browsing-contexts-by-name:handler-onclick><a href=#handler-onclick>onclick</a></code> handler uses the <code id=apis-for-creating-and-navigating-browsing-contexts-by-name:dom-open-2><a href=#dom-open>window.open()</a></code> API to open a page in an iframe, but, while doing so,
objects should, if all the following conditions are met, <a href=#close-a-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:close-a-browsing-context>close</a> the <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-7>browsing context</a> <var>A</var>:

<ul class=brief><li>The corresponding <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-8>browsing context</a> <var>A</var> is
<a href=#script-closable id=apis-for-creating-and-navigating-browsing-contexts-by-name:script-closable>script-closable</a>.<li>The <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context-3>responsible browsing context</a> specified by the <a href=#incumbent-settings-object id=apis-for-creating-and-navigating-browsing-contexts-by-name:incumbent-settings-object-2>incumbent settings
object</a> is <a href=#familiar-with id=apis-for-creating-and-navigating-browsing-contexts-by-name:familiar-with>familiar with</a> the <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-9>browsing context</a> <var>A</var>.<li id=sandboxClose>The <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context-4>responsible browsing context</a> specified by the
<a href=#script-closable id=apis-for-creating-and-navigating-browsing-contexts-by-name:script-closable>script-closable</a>.<li>The <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context-2>responsible browsing context</a> specified by the <a href=#incumbent-settings-object id=apis-for-creating-and-navigating-browsing-contexts-by-name:incumbent-settings-object-2>incumbent settings
object</a> is <a href=#familiar-with id=apis-for-creating-and-navigating-browsing-contexts-by-name:familiar-with>familiar with</a> the <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-9>browsing context</a> <var>A</var>.<li id=sandboxClose>The <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context-3>responsible browsing context</a> specified by the
<a href=#incumbent-settings-object id=apis-for-creating-and-navigating-browsing-contexts-by-name:incumbent-settings-object-3>incumbent settings object</a> is <a href=#allowed-to-navigate id=apis-for-creating-and-navigating-browsing-contexts-by-name:allowed-to-navigate>allowed to navigate</a> the <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-10>browsing
context</a> <var>A</var>.</ul>

5 source
the user.</p></li>

<li><p>If <var>target browsing context</var> is a new <span>top-level browsing context</span>,
let the <span>responsible browsing context</span> specified by <var>incumbent settings</var> be
set as <var>target browsing context</var>'s <span>one permitted sandboxed
navigator</span>.</p></li>
let the <var>source browsing context</var> be set as <var>target browsing context</var>'s
<span>one permitted sandboxed navigator</span>.</p></li>

</ol>

0 comments on commit d13463e

Please sign in to comment.
You can’t perform that action at this time.