Skip to content

Commit

Permalink
[giow] (1) Spec location.ancestorOrigins
Browse files Browse the repository at this point in the history
Fixing https://www.w3.org/Bugs/Public/show_bug.cgi?id=22699
Affected topics: DOM APIs

git-svn-id: https://svn.whatwg.org/webapps@8881 340c8d12-0b0e-0410-8428-c7bf67bfef74
  • Loading branch information
Hixie committed Jan 15, 2015
1 parent 5cf7951 commit 2285ea3
Show file tree
Hide file tree
Showing 3 changed files with 123 additions and 34 deletions.
57 changes: 40 additions & 17 deletions complete.html
Expand Up @@ -59359,6 +59359,8 @@ <h4 id=the-location-interface>7.5.3 The <code id=the-location-interface:location
void <a href=#dom-location-assign id=the-location-interface:dom-location-assign>assign</a>(DOMString url);
void <a href=#dom-location-replace id=the-location-interface:dom-location-replace>replace</a>(DOMString url);
void <a href=#dom-location-reload id=the-location-interface:dom-location-reload>reload</a>();

[SameObject] readonly attribute <span>DOMString</span>[] <a href=#dom-location-ancestororigins id=the-location-interface:dom-location-ancestororigins>ancestorOrigins</a>;
};
<a href=#location id=the-location-interface:location-7>Location</a> implements <a href=#urlutils id=the-location-interface:urlutils>URLUtils</a>;</pre>

Expand All @@ -59374,25 +59376,30 @@ <h4 id=the-location-interface>7.5.3 The <code id=the-location-interface:location

<p>Reloads the current page.</p>

<dt><var>location</var> . <code id=the-location-interface:dom-location-ancestororigins-2><a href=#dom-location-ancestororigins>ancestorOrigins</a></code><dd>

<p>Returns an array values are the origins of the ancestor <a href=#browsing-context id=the-location-interface:browsing-context-5>browsing contexts</a>, from the <a href=#parent-browsing-context id=the-location-interface:parent-browsing-context>parent browsing context</a> to the
<a href=#top-level-browsing-context id=the-location-interface:top-level-browsing-context>top-level browsing context</a>.</p>

</dl>



<p>The <i>relevant <code id=the-location-interface:document-6><a href=#document>Document</a></code></i> is the <code id=the-location-interface:location-8><a href=#location>Location</a></code> object's associated
<code id=the-location-interface:document-7><a href=#document>Document</a></code> object's <a href=#browsing-context id=the-location-interface:browsing-context-5>browsing context</a>'s <a href=#active-document id=the-location-interface:active-document-2>active document</a>.</p>
<code id=the-location-interface:document-7><a href=#document>Document</a></code> object's <a href=#browsing-context id=the-location-interface:browsing-context-6>browsing context</a>'s <a href=#active-document id=the-location-interface:active-document-2>active document</a>.</p>

<p>When the <dfn id=dom-location-assign><code>assign(<var>url</var>)</code></dfn>
method is invoked, the UA must <a href=#resolve-a-url id=the-location-interface:resolve-a-url>resolve</a> the argument, relative
to the <a href=#api-base-url id=the-location-interface:api-base-url>API base URL</a> specified by the <a href=#entry-settings-object id=the-location-interface:entry-settings-object>entry settings object</a>, and if that
is successful, must <a href=#navigate id=the-location-interface:navigate>navigate</a> the <a href=#browsing-context id=the-location-interface:browsing-context-6>browsing
is successful, must <a href=#navigate id=the-location-interface:navigate>navigate</a> the <a href=#browsing-context id=the-location-interface:browsing-context-7>browsing
context</a> to the specified <var>url</var>, with <a href=#exceptions-enabled id=the-location-interface:exceptions-enabled>exceptions enabled</a>. If
the <a href=#browsing-context id=the-location-interface:browsing-context-7>browsing context</a>'s <a href=#session-history id=the-location-interface:session-history>session history</a> contains only one
the <a href=#browsing-context id=the-location-interface:browsing-context-8>browsing context</a>'s <a href=#session-history id=the-location-interface:session-history>session history</a> contains only one
<code id=the-location-interface:document-8><a href=#document>Document</a></code>, and that was the <code id=the-location-interface:about:blank><a href=#about:blank>about:blank</a></code> <code id=the-location-interface:document-9><a href=#document>Document</a></code> created
when the <a href=#browsing-context id=the-location-interface:browsing-context-8>browsing context</a> was created, then the navigation must be done with
when the <a href=#browsing-context id=the-location-interface:browsing-context-9>browsing context</a> was created, then the navigation must be done with
<a href=#replacement-enabled id=the-location-interface:replacement-enabled>replacement enabled</a>.</p>

<p>When the <dfn id=dom-location-replace><code>replace(<var>url</var>)</code></dfn> method is invoked, the UA must <a href=#resolve-a-url id=the-location-interface:resolve-a-url-2>resolve</a> the argument, relative to the <a href=#api-base-url id=the-location-interface:api-base-url-2>API base URL</a> specified by the
<a href=#entry-settings-object id=the-location-interface:entry-settings-object-2>entry settings object</a>, and if that is successful, <a href=#navigate id=the-location-interface:navigate-2>navigate</a> the <a href=#browsing-context id=the-location-interface:browsing-context-9>browsing context</a> to the specified <var>url</var> with <a href=#replacement-enabled id=the-location-interface:replacement-enabled-2>replacement enabled</a> and <a href=#exceptions-enabled id=the-location-interface:exceptions-enabled-2>exceptions enabled</a>.</p>
<a href=#entry-settings-object id=the-location-interface:entry-settings-object-2>entry settings object</a>, and if that is successful, <a href=#navigate id=the-location-interface:navigate-2>navigate</a> the <a href=#browsing-context id=the-location-interface:browsing-context-10>browsing context</a> to the specified <var>url</var> with <a href=#replacement-enabled id=the-location-interface:replacement-enabled-2>replacement enabled</a> and <a href=#exceptions-enabled id=the-location-interface:exceptions-enabled-2>exceptions enabled</a>.</p>

<p>Navigation for the <code id=the-location-interface:dom-location-assign-3><a href=#dom-location-assign>assign()</a></code> and <code id=the-location-interface:dom-location-replace-3><a href=#dom-location-replace>replace()</a></code> methods must be done with the <a href=#responsible-browsing-context id=the-location-interface:responsible-browsing-context>responsible
browsing context</a> specified by the <a href=#incumbent-settings-object id=the-location-interface:incumbent-settings-object>incumbent settings object</a> as the
Expand All @@ -59404,26 +59411,26 @@ <h4 id=the-location-interface>7.5.3 The <code id=the-location-interface:location
<p>When the <dfn id=dom-location-reload><code>reload()</code></dfn> method is invoked, the
user agent must run the appropriate steps from the following list:</p>

<dl class=switch><dt>If the currently executing <a href=#concept-task id=the-location-interface:concept-task>task</a> is the dispatch of a <code id=the-location-interface:event-resize><a href=#event-resize>resize</a></code> event in response to the user resizing the <a href=#browsing-context id=the-location-interface:browsing-context-10>browsing
context</a><dd><p>Repaint the <a href=#browsing-context id=the-location-interface:browsing-context-11>browsing context</a> and abort these steps.<dt>If the <a href=#browsing-context id=the-location-interface:browsing-context-12>browsing context</a>'s <a href=#active-document id=the-location-interface:active-document-3>active document</a> is <a href=#an-iframe-srcdoc-document id=the-location-interface:an-iframe-srcdoc-document>an
<dl class=switch><dt>If the currently executing <a href=#concept-task id=the-location-interface:concept-task>task</a> is the dispatch of a <code id=the-location-interface:event-resize><a href=#event-resize>resize</a></code> event in response to the user resizing the <a href=#browsing-context id=the-location-interface:browsing-context-11>browsing
context</a><dd><p>Repaint the <a href=#browsing-context id=the-location-interface:browsing-context-12>browsing context</a> and abort these steps.<dt>If the <a href=#browsing-context id=the-location-interface:browsing-context-13>browsing context</a>'s <a href=#active-document id=the-location-interface:active-document-3>active document</a> is <a href=#an-iframe-srcdoc-document id=the-location-interface:an-iframe-srcdoc-document>an
<code>iframe</code> <code>srcdoc</code> document</a><dd><p><a href=#process-the-iframe-attributes id=the-location-interface:process-the-iframe-attributes>Reprocess the <code>iframe</code>
attributes</a> of the <a href=#browsing-context id=the-location-interface:browsing-context-13>browsing context</a>'s <a href=#browsing-context-container id=the-location-interface:browsing-context-container>browsing context
container</a>.<dt>If the <a href=#browsing-context id=the-location-interface:browsing-context-14>browsing context</a>'s <a href=#active-document id=the-location-interface:active-document-4>active document</a> has its <a href=#reload-override-flag id=the-location-interface:reload-override-flag>reload
override flag</a> set<dd><p>Perform <a href=#an-overridden-reload id=the-location-interface:an-overridden-reload>an overridden reload</a>, with the <a href=#browsing-context id=the-location-interface:browsing-context-15>browsing context</a> being
navigated as the <a href=#responsible-browsing-context id=the-location-interface:responsible-browsing-context-2>responsible browsing context</a>.<dt>Otherwise<dd><p><a href=#navigate id=the-location-interface:navigate-3>Navigate</a> the <a href=#browsing-context id=the-location-interface:browsing-context-16>browsing context</a> to
attributes</a> of the <a href=#browsing-context id=the-location-interface:browsing-context-14>browsing context</a>'s <a href=#browsing-context-container id=the-location-interface:browsing-context-container>browsing context
container</a>.<dt>If the <a href=#browsing-context id=the-location-interface:browsing-context-15>browsing context</a>'s <a href=#active-document id=the-location-interface:active-document-4>active document</a> has its <a href=#reload-override-flag id=the-location-interface:reload-override-flag>reload
override flag</a> set<dd><p>Perform <a href=#an-overridden-reload id=the-location-interface:an-overridden-reload>an overridden reload</a>, with the <a href=#browsing-context id=the-location-interface:browsing-context-16>browsing context</a> being
navigated as the <a href=#responsible-browsing-context id=the-location-interface:responsible-browsing-context-2>responsible browsing context</a>.<dt>Otherwise<dd><p><a href=#navigate id=the-location-interface:navigate-3>Navigate</a> the <a href=#browsing-context id=the-location-interface:browsing-context-17>browsing context</a> to
<a id="the-location-interface:the-document's-address-2" href=https://dom.spec.whatwg.org/#concept-document-url data-x-internal="the-document's-address">the document's address</a> with <a href=#replacement-enabled id=the-location-interface:replacement-enabled-3>replacement enabled</a> and <a href=#exceptions-enabled id=the-location-interface:exceptions-enabled-3>exceptions
enabled</a>. The <a href=#source-browsing-context id=the-location-interface:source-browsing-context-2>source browsing context</a> must be the <a href=#browsing-context id=the-location-interface:browsing-context-17>browsing
enabled</a>. The <a href=#source-browsing-context id=the-location-interface:source-browsing-context-2>source browsing context</a> must be the <a href=#browsing-context id=the-location-interface:browsing-context-18>browsing
context</a> being navigated. This is a <a href=#reload-triggered-navigation id=the-location-interface:reload-triggered-navigation>reload-triggered navigation</a>.</dl>

<p>When a user requests that the <a href=#active-document id=the-location-interface:active-document-5>active document</a> of a <a href=#browsing-context id=the-location-interface:browsing-context-18>browsing context</a>
be reloaded through a user interface element, the user agent should <a href=#navigate id=the-location-interface:navigate-4>navigate</a> the <a href=#browsing-context id=the-location-interface:browsing-context-19>browsing context</a> to the same resource as that
<p>When a user requests that the <a href=#active-document id=the-location-interface:active-document-5>active document</a> of a <a href=#browsing-context id=the-location-interface:browsing-context-19>browsing context</a>
be reloaded through a user interface element, the user agent should <a href=#navigate id=the-location-interface:navigate-4>navigate</a> the <a href=#browsing-context id=the-location-interface:browsing-context-20>browsing context</a> to the same resource as that
<code id=the-location-interface:document-10><a href=#document>Document</a></code>, with <a href=#replacement-enabled id=the-location-interface:replacement-enabled-4>replacement enabled</a>. In the case of non-idempotent
methods (e.g. HTTP POST), the user agent should prompt the user to confirm the operation first,
since otherwise transactions (e.g. purchases or database modifications) could be repeated. User
agents may allow the user to explicitly override any caches when reloading. If <a href=#browsing-context id=the-location-interface:browsing-context-20>browsing
agents may allow the user to explicitly override any caches when reloading. If <a href=#browsing-context id=the-location-interface:browsing-context-21>browsing
context</a>'s <a href=#active-document id=the-location-interface:active-document-6>active document</a>'s <a href=#reload-override-flag id=the-location-interface:reload-override-flag-2>reload override flag</a> is set, then the
user agent may instead perform <a href=#an-overridden-reload id=the-location-interface:an-overridden-reload-2>an overridden reload</a> rather than the navigation
described in this paragraph (with the <a href=#browsing-context id=the-location-interface:browsing-context-21>browsing context</a> being reloaded as the
described in this paragraph (with the <a href=#browsing-context id=the-location-interface:browsing-context-22>browsing context</a> being reloaded as the
<a href=#source-browsing-context id=the-location-interface:source-browsing-context-3>source browsing context</a>).</p>

<hr>
Expand Down Expand Up @@ -59464,6 +59471,22 @@ <h4 id=the-location-interface>7.5.3 The <code id=the-location-interface:location

<li><p>If <var>mode</var> is <i>normal navigation</i>, then act as if the <code id=the-location-interface:dom-location-assign-5><a href=#dom-location-assign>assign()</a></code> method had been called with <var>value</var> as its argument. Otherwise, act as if the <code id=the-location-interface:dom-location-replace-5><a href=#dom-location-replace>replace()</a></code> method had been called with <var>value</var> as its argument.</ol>

<hr>

<p>The <dfn id=dom-location-ancestororigins><code>ancestorOrigins</code></dfn> attribute, on
getting, must return a <a href=#dfn-read-only-array id=the-location-interface:dfn-read-only-array>read only</a> array whose values are
determined as follows. The same object must be returned each time the attribute's value is
obtained for any particular <code id=the-location-interface:location-11><a href=#location>Location</a></code> object.</p>

<ol><li><p>Let <var>output</var> be an empty ordered list of strings.</p>

<li><p>Let <var>current</var> be the <a href=#browsing-context id=the-location-interface:browsing-context-23>browsing context</a> of the <code id=the-location-interface:document-14><a href=#document>Document</a></code>
with which the <code id=the-location-interface:location-12><a href=#location>Location</a></code> object is associated.<li><p><i>Loop</i>: If <var>current</var> has no <a href=#parent-browsing-context id=the-location-interface:parent-browsing-context-2>parent browsing context</a>, jump to
the step labeled <i>end</i>.<li><p>Let <var>current</var> be <var>current</var>'s <a href=#parent-browsing-context id=the-location-interface:parent-browsing-context-3>parent browsing
context</a>.<li><p>Append the <a href=#unicode-serialisation-of-an-origin id=the-location-interface:unicode-serialisation-of-an-origin>Unicode serialisation</a>
of <var>current</var>'s <a href=#active-document id=the-location-interface:active-document-7>active document</a>'s <a href=#origin-2 id=the-location-interface:origin-2>origin</a> to <var>output</var>
as a new value.<li><p>Return to the step labeled <i>loop</i>.<li><p><i>End</i>: Let <var>output</var> be the values of the array, in the same order.</ol>




Expand Down Expand Up @@ -64460,7 +64483,7 @@ <h4 id=document.writeln()>8.3.4 <code id=document.writeln():dom-document-writeln



<h3 id=timers>8.4 Timers</h3><div class=status><input onclick=toggleStatus(this) value=⋰ type=button><p class=bugs><strong>Spec bugs:</strong> <a href="https://www.w3.org/Bugs/Public/show_bug.cgi?id=23744" title="Use the WebIDL callback logic in the setTimeout prose">23744</a></div>
<h3 id=timers>8.4 Timers</h3>

<p>The <code id=timers:dom-windowtimers-settimeout><a href=#dom-windowtimers-settimeout>setTimeout()</a></code>
and <code id=timers:dom-windowtimers-setinterval><a href=#dom-windowtimers-setinterval>setInterval()</a></code>
Expand Down

0 comments on commit 2285ea3

Please sign in to comment.