Skip to content
Permalink
Browse files

[giow] (3) Fix window.open('') to be more like deployed browsers rath…

…er than defaulting to 'about:blank'.

Affected topics: DOM APIs

git-svn-id: https://svn.whatwg.org/webapps@8779 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information...
Hixie committed Sep 16, 2014
1 parent d13463e commit b907142d766809ef7fa49ac7d922a752be2f72f6
Showing with 103 additions and 58 deletions.
  1. +29 −16 complete.html
  2. +29 −16 index
  3. +45 −26 source

<ol><li><p>Let <var>entry settings</var> be the <a href=#entry-settings-object id=apis-for-creating-and-navigating-browsing-contexts-by-name:entry-settings-object>entry settings object</a> when the method
was invoked.<li><p>Let <var>incumbent settings</var> be the <a href=#incumbent-settings-object id=apis-for-creating-and-navigating-browsing-contexts-by-name:incumbent-settings-object>incumbent settings object</a> when the
method was invoked.<li><p>Let <var>url</var> be the first argument.<li><p>Let <var>target</var> be the second argument.<li><p>Let <var id=apis-for-creating-and-navigating-browsing-contexts-by-name:dom-open-features-2><a data-x-internal=dom-open-features href=http://dev.w3.org/csswg/cssom-view/#the-features-argument-to-the-open()-method>features</a></var> be the third argument.<li><p>Let <var>replace</var> be the fourth argument.<li><p>If <var>url</var> is the empty string, set <var>url</var> to
"<code id=apis-for-creating-and-navigating-browsing-contexts-by-name:about:blank-2><a href=#about:blank>about:blank</a></code>".<li><p><a href=#resolve-a-url id=apis-for-creating-and-navigating-browsing-contexts-by-name:resolve-a-url>Resolve</a> <var>url</var> relative to the <a href=#api-base-url id=apis-for-creating-and-navigating-browsing-contexts-by-name:api-base-url>API base
URL</a> specified by <var>entry settings</var>.<li><p>Let <var>resource</var> be the <a href=#resulting-absolute-url id=apis-for-creating-and-navigating-browsing-contexts-by-name:resulting-absolute-url>resulting absolute URL</a>, if any, or else an
error.<li><p>Let <var>source browsing context</var> be the <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context>responsible browsing context</a>
method was invoked.<li><p>Let <var>url</var> be the first argument.<li><p>Let <var>target</var> be the second argument.<li><p>Let <var id=apis-for-creating-and-navigating-browsing-contexts-by-name:dom-open-features-2><a data-x-internal=dom-open-features href=http://dev.w3.org/csswg/cssom-view/#the-features-argument-to-the-open()-method>features</a></var> be the third argument.<li><p>Let <var>replace</var> be the fourth argument.<li><p>Let <var>source browsing context</var> be the <a href=#responsible-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:responsible-browsing-context>responsible browsing context</a>
specified by <var>incumbent settings</var>.<li>

<p>If the user has indicated a preference for which <a href=#browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:browsing-context-2>browsing context</a> to navigate,
<li><p>If <var>target browsing context</var> was just created, either as part of <a href=#the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name id=apis-for-creating-and-navigating-browsing-contexts-by-name:the-rules-for-choosing-a-browsing-context-given-a-browsing-context-name-2>the rules
for choosing a browsing context given a browsing context name</a> or due to the user
indicating a preference for navigating a new <a href=#top-level-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:top-level-browsing-context-2>top-level browsing context</a>, then let
<var>new</var> be true. Otherwise, let it be false.<li><p>Interpret <var>features</var> as defined in the CSSOM View specification. <a href=#refsCSSOMVIEW>[CSSOMVIEW]</a><li><p>If <var>resource</var> is an error, then, optionally, set it to the <a href=#url id=apis-for-creating-and-navigating-browsing-contexts-by-name:url>URL</a>
"<code id=apis-for-creating-and-navigating-browsing-contexts-by-name:about:blank-3><a href=#about:blank>about:blank</a></code>". Otherwise, let it be a resource representing an inline error
page.<li><p>If <var>resource</var> is "<code id=apis-for-creating-and-navigating-browsing-contexts-by-name:about:blank-4><a href=#about:blank>about:blank</a></code>" and <var>new</var> is true,
<a href=#queue-a-task id=apis-for-creating-and-navigating-browsing-contexts-by-name:queue-a-task>queue a task</a> to <a href=#fire-a-simple-event id=apis-for-creating-and-navigating-browsing-contexts-by-name:fire-a-simple-event>fire a simple event</a> named <code id=apis-for-creating-and-navigating-browsing-contexts-by-name:event-load><a href=#event-load>load</a></code> at <var>target browsing context</var>'s <code id=apis-for-creating-and-navigating-browsing-contexts-by-name:window-2><a href=#window>Window</a></code>
object, with <i id=apis-for-creating-and-navigating-browsing-contexts-by-name:concept-event-target-override><a href=#concept-event-target-override>target override</a></i> set to <var>target
browsing context</var>'s <a href=#concept-document-window id=apis-for-creating-and-navigating-browsing-contexts-by-name:concept-document-window><code>Window</code> object's
<code>Document</code></a> object.<li><p>Otherwise, <var>resource</var> is either a <a href=#url id=apis-for-creating-and-navigating-browsing-contexts-by-name:url-2>URL</a> other than
"<code id=apis-for-creating-and-navigating-browsing-contexts-by-name:about:blank-5><a href=#about:blank>about:blank</a></code>" or a resource representing an inline error page, or <var>new</var> is
false. <a href=#navigate id=apis-for-creating-and-navigating-browsing-contexts-by-name:navigate-2>Navigate</a> <var>target browsing
context</var> to <var>resource</var>, with <a href=#exceptions-enabled id=apis-for-creating-and-navigating-browsing-contexts-by-name:exceptions-enabled>exceptions enabled</a>. If <var>new</var> is
true, then <a href=#replacement-enabled id=apis-for-creating-and-navigating-browsing-contexts-by-name:replacement-enabled>replacement must be enabled</a> also. The
<a href=#source-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:source-browsing-context>source browsing context</a> is <var>source browsing context</var>.<li><p>Return the <code id=apis-for-creating-and-navigating-browsing-contexts-by-name:windowproxy><a href=#windowproxy>WindowProxy</a></code> object of <var>target browsing
<var>new</var> be true. Otherwise, let it be false.<li><p>Interpret <var>features</var> as defined in the CSSOM View specification. <a href=#refsCSSOMVIEW>[CSSOMVIEW]</a><li>

<p>If <var>url</var> is the empty string, run the appropriate steps from the following list:</p>

<dl><dt>If <var>new</var> is false<dd><p>Jump to the step labeled <i>end</i>.<dt>If <var>new</var> is true<dd><p>Let <var>resource</var> be the <a href=#url id=apis-for-creating-and-navigating-browsing-contexts-by-name:url>URL</a> "<code id=apis-for-creating-and-navigating-browsing-contexts-by-name:about:blank-2><a href=#about:blank>about:blank</a></code>".</dl>

<p>Otherwise, <a href=#resolve-a-url id=apis-for-creating-and-navigating-browsing-contexts-by-name:resolve-a-url>resolve</a> <var>url</var> relative to the
<a href=#api-base-url id=apis-for-creating-and-navigating-browsing-contexts-by-name:api-base-url>API base URL</a> specified by <var>entry settings</var>, and let <var>resource</var> be
the <a href=#resulting-absolute-url id=apis-for-creating-and-navigating-browsing-contexts-by-name:resulting-absolute-url>resulting absolute URL</a>, if any. If the <a href=#resolve-a-url id=apis-for-creating-and-navigating-browsing-contexts-by-name:resolve-a-url-2>resolve a URL</a> algorithm
failed, then run one of the following two steps instead:</p>

<ul><li><p>Let <var>resource</var> be a resource representing an inline error page.<li><p>If <var>new</var> is false, jump to the step labeled <i>end</i>, otherwise, let
<var>resource</var> be the <a href=#url id=apis-for-creating-and-navigating-browsing-contexts-by-name:url-2>URL</a> "<code id=apis-for-creating-and-navigating-browsing-contexts-by-name:about:blank-3><a href=#about:blank>about:blank</a></code>".</ul>

<li>

<p>If <var>resource</var> is "<code id=apis-for-creating-and-navigating-browsing-contexts-by-name:about:blank-4><a href=#about:blank>about:blank</a></code>" and <var>new</var> is true, <a href=#queue-a-task id=apis-for-creating-and-navigating-browsing-contexts-by-name:queue-a-task>queue
a task</a> to <a href=#fire-a-simple-event id=apis-for-creating-and-navigating-browsing-contexts-by-name:fire-a-simple-event>fire a simple event</a> named <code id=apis-for-creating-and-navigating-browsing-contexts-by-name:event-load><a href=#event-load>load</a></code> at
<var>target browsing context</var>'s <code id=apis-for-creating-and-navigating-browsing-contexts-by-name:window-2><a href=#window>Window</a></code> object, with <i id=apis-for-creating-and-navigating-browsing-contexts-by-name:concept-event-target-override><a href=#concept-event-target-override>target override</a></i> set to <var>target browsing
context</var>'s <a href=#concept-document-window id=apis-for-creating-and-navigating-browsing-contexts-by-name:concept-document-window><code>Window</code> object's
<code>Document</code></a> object.</p>

<p>Otherwise, <a href=#navigate id=apis-for-creating-and-navigating-browsing-contexts-by-name:navigate-2>navigate</a> <var>target browsing context</var>
to <var>resource</var>, with <a href=#exceptions-enabled id=apis-for-creating-and-navigating-browsing-contexts-by-name:exceptions-enabled>exceptions enabled</a>. If <var>new</var> is true, then
<a href=#replacement-enabled id=apis-for-creating-and-navigating-browsing-contexts-by-name:replacement-enabled>replacement must be enabled</a> also. The <a href=#source-browsing-context id=apis-for-creating-and-navigating-browsing-contexts-by-name:source-browsing-context>source
browsing context</a> is <var>source browsing context</var>.</p>

<li><p><i>End</i>: Return the <code id=apis-for-creating-and-navigating-browsing-contexts-by-name:windowproxy><a href=#windowproxy>WindowProxy</a></code> object of <var>target browsing
context</var>.</ol>

<hr>
Oops, something went wrong.

0 comments on commit b907142

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