Skip to content

Commit

Permalink
Set active worker for non-top-level browsing context's document
Browse files Browse the repository at this point in the history
This follow-up commit makes the active worker of a document, whose
address is local and who has its creator (a parent or an opener),
initialized to the creator's document's active worker.

The relevant steps are added both in the creating a new browsing
context algorithm and in the initializing a new document algorithms.
  • Loading branch information
jungkees committed Apr 8, 2016
1 parent f8b1380 commit 51e5b39
Showing 1 changed file with 27 additions and 8 deletions.
35 changes: 27 additions & 8 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2691,6 +2691,7 @@ a.setAttribute('href', 'http://example.com/'); // change the content attribute d
<li><dfn data-noexport="" data-x-href="https://url.spec.whatwg.org/#concept-ipv4">IPv4 address</dfn>
<li><dfn data-noexport="" data-x-href="https://url.spec.whatwg.org/#concept-ipv6">IPv6 address</dfn>
<li><dfn data-noexport="" data-x-href="https://url.spec.whatwg.org/#concept-url">URL</dfn>
<li><dfn data-noexport="" data-x-href="https://url.spec.whatwg.org/#is-local">is local</dfn>
<li><dfn data-noexport="" data-x="concept-url-origin" data-x-href="https://url.spec.whatwg.org/#concept-url-origin">Origin</dfn> of URLs
<li><dfn data-noexport="" data-x-href="https://url.spec.whatwg.org/#syntax-url-absolute">Absolute URL</dfn>
<li><dfn data-noexport="" data-x-href="https://url.spec.whatwg.org/#syntax-url-relative">Relative URL</dfn>
Expand Down Expand Up @@ -27129,10 +27130,6 @@ href="?audio">audio&lt;/a> test instead.)&lt;/p></pre>
<p>The resulting <code>Document</code> must be considered <span>an <code>iframe</code> <code
data-x="attr-iframe-srcdoc">srcdoc</code> document</span>.</p>

<p>Set the resulting <code>Document</code>'s <span data-x="concept-document-active-
worker">active worker</span> to the <code>iframe</code> element's <span>node document</span>'s
<span data-x="concept-document-active-worker">active worker</span>.</p>

</dd>

<dt>Otherwise, if the element has no <code data-x="attr-iframe-src">src</code> attribute
Expand Down Expand Up @@ -76052,6 +76049,11 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> {
referrer">referrer</span> to <span data-x="the document's address">the address</span> of that
<span>creator <code>Document</code></span>.</p></li>

<li><p>If the new <span>browsing context</span> has a <span>creator browsing context</span>, then
set the <code>Document</code>'s <span data-x="concept-document-active-worker">active
worker</span> to the <span>creator browsing context</span>'s <span>active document</span>'s <span
data-x="concept-document-active-worker">active worker</span>.</p></li>

<li><p>Ensure that <var>document</var> has a single child <code>html</code> node, which itself
has two empty child nodes: a <code>head</code> element, and a <code>body</code>
element.</p></li>
Expand Down Expand Up @@ -81106,10 +81108,27 @@ State: &lt;OUTPUT NAME=I>1&lt;/OUTPUT> &lt;INPUT VALUE="Increment" TYPE=BUTTON O

<li>

<p>If <span>the document's address</span> <span data-x="scope-match-algorithm">matched</span>
a <span data-x="service-worker-registration">service worker registration</span>
<var>registration</var> when the fetch algorithm obtained the resource, and
<var>registration</var>'s <span data-x="active-worker">active worker</span> <var>active
<p>If <span>the document's address</span> <span>is local</span>, then: if the
<span>browsing context</span> has a <span>creator browsing context</span>, then set the
<code>Document</code>'s <span data-x="concept-document-active-worker">active worker</span> to
the <span>creator browsing context</span>'s <span>active document</span>'s <span
data-x="concept-document-active-worker">active worker</span>.</p>

<p class="note">A document in a <span>nested browsing context</span> whose address <span>is
local</span> (e.g. an <span data-x="an iframe srcdoc document"><code>iframe</code> <code
data-x="attr-iframe-srcdoc">srcdoc</code> document</span> or a document in an
<code>iframe</code> having its <code data-x="attr-iframe-src">src</code> attribute set to the
empty string) inherits the <span data-x="concept-document-active-worker">active
worker</span> from its parent document.</p>

</li>

<li>

<p>Otherwise, if <span>the document's address</span> <span data-x="scope-match-
algorithm">matched</span> a <span data-x="service-worker-registration">service worker
registration</span> <var>registration</var> when the fetch algorithm obtained the resource,
and <var>registration</var>'s <span data-x="active-worker">active worker</span> <var>active
worker</var> is not null, set the <code>Document</code>'s <span data-x="concept-document-
active-worker">active worker</span> to <var>active worker</var>.</p>

Expand Down

0 comments on commit 51e5b39

Please sign in to comment.