-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Specify active service worker inheritance #2809
base: main
Are you sure you want to change the base?
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -76812,6 +76812,10 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> { | |
<dt><dfn>creator context security</dfn></dt> | ||
<dd>The result of executing <span>Is environment settings object a secure context?</span> on | ||
<var>creator document</var>'s <span>relevant settings object</span></dd> | ||
|
||
<dt><dfn>creator active service worker</dfn></dt> | ||
<dd><var>creator document</var>'s <span>relevant settings object</span>'s <span | ||
data-x="concept-environment-active-service-worker">active service worker</span></dd> | ||
</dl> | ||
|
||
<div w-nodev> | ||
|
@@ -76854,27 +76858,32 @@ dictionary <dfn>DragEventInit</dfn> : <span>MouseEventInit</span> { | |
<var>document</var>.</p></li> | ||
|
||
<li> | ||
<p id="about-blank-origin">Set the <span>origin</span> of <var>document</var>:</p> | ||
<p>If <var>browsingContext</var> has a <span>creator browsing context</span>, then:</p> | ||
|
||
<ul> | ||
<li><p>If <var>browsingContext</var> has a <span>creator browsing context</span>, then the | ||
<span>origin</span> of <var>document</var> is the <span>creator origin</span>.</p></li> | ||
<ol> | ||
<li><p id="about-blank-origin">Set the <span>origin</span> of <var>document</var> to the | ||
<span>creator origin</span>.</p></li> | ||
|
||
<li><p>Otherwise, the <span>origin</span> of <var>document</var> is a unique <span | ||
data-x="concept-origin-opaque">opaque origin</span>.</p></li> | ||
</ul> | ||
</li> | ||
<li><p>Set <var>document</var>'s <span data-x="the document's referrer">referrer</span> to the | ||
<span data-x="concept-url-serializer">serialization</span> of <span>creator | ||
URL</span>.</p></li> | ||
|
||
<li><p>If <var>browsingContext</var> has a <span>creator browsing context</span>, then set | ||
<var>document</var>'s <span data-x="the document's referrer">referrer</span> to the <span | ||
data-x="concept-url-serializer">serialization</span> of <span>creator URL</span>.</p></li> | ||
<li><p>Set <var>document</var>'s <span data-x="concept-document-referrer-policy">referrer | ||
policy</span> to the <span>creator referrer policy</span>.</p></li> | ||
|
||
<li><p>If <var>browsingContext</var> has a <span>creator browsing context</span>, then set | ||
<var>document</var>'s <span data-x="concept-document-referrer-policy">referrer policy</span> to | ||
the <span>creator referrer policy</span>.</p></li> | ||
<li><p>Set <var>settingsObject</var>'s | ||
<span data-x="concept-environment-active-service-worker">active service worker</span> to the | ||
<span>creator active service worker</span>.</p></li> | ||
</ol> | ||
</li> | ||
|
||
<li><p><span>Implement the sandboxing</span> for <var>document</var>.</p></li> | ||
|
||
<li><p>If <var>document</var>'s <span>active sandboxing flag set</span> has its <span>sandboxed | ||
origin browsing context flag</span> set, then set <var>document</var>'s <span>relevant settings | ||
object</span>'s <span data-x="concept-environment-active-service-worker">active service | ||
worker</span> to null.</p></li> | ||
|
||
<li><p><span>Set the allow* flags</span> for <var>document</var>.</p></li> | ||
|
||
<li><p>Add <var>document</var> to <var>browsingContext</var>'s <span>session | ||
|
@@ -79251,8 +79260,10 @@ callback <dfn>FrameRequestCallback</dfn> = void (<span>DOMHighResTimeStamp</span | |
|
||
<dt>If the <code>Document</code> is the initial "<code>about:blank</code>" document</dt> | ||
|
||
<dd><p><a href="#about-blank-origin">The one it was assigned when its browsing context was | ||
created</a>.</p></dd> | ||
<dd><p>A unique <span data-x="concept-origin-opaque">opaque origin</span> assigned when the | ||
<code>Document</code> is created or <a href="#about-blank-origin">the one it was assigned when | ||
its browsing context was created</a> if the <span>browsing context</span> had a <span>creator | ||
browsing context</span>.</p></dd> | ||
|
||
|
||
<dt>If the <code>Document</code> is a non-initial "<code>about:blank</code>" document</dt> | ||
|
@@ -82134,11 +82145,40 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O | |
additionally run the following algorithm after creating the new object:</p> | ||
|
||
<ol> | ||
<li><p>If <var>browsingContext</var>'s only entry in its <span>session history</span> is the | ||
<code>about:blank</code> <code>Document</code> that was added when <var>browsingContext</var> | ||
was <span data-x="creating a new browsing context">created</span>, and navigation is occurring | ||
with <span>replacement enabled</span>, and that <code>Document</code> has the <span>same | ||
origin</span> as the new <code>Document</code>, then do nothing.</p></li> | ||
<li> | ||
<p>If <var>browsingContext</var>'s only entry in its <span>session history</span> is the | ||
<code>about:blank</code> <code>Document</code> that was added when <var>browsingContext</var> | ||
was <span data-x="creating a new browsing context">created</span>, and navigation is occurring | ||
with <span>replacement enabled</span>, and that <code>Document</code> has the <span>same | ||
origin</span> as the new <code>Document</code>, then:</p> | ||
|
||
<ol> | ||
<li><p>Let <var>settingsObject</var> be <var>browsingContext</var>'s <span>active | ||
document</span>'s <span>environment settings object</span>.</p></li> | ||
|
||
<li><p>Set <var>settingsObject</var>'s <span | ||
data-x="concept-environment-creation-url">creation URL</span> to | ||
<var>reservedEnvironment</var>'s <span data-x="concept-environment-creation-url">creation | ||
URL</span>.</p></li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. So this is the "old" document? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Though I guess for the settings object that doesn't matter... There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Right. This should be the old one because the new one isn't installed yet. This is just to get the handle to the settings object anyway as you pointed. |
||
|
||
<li><p>Set <var>settingsObject</var>'s <span | ||
data-x="concept-environment-active-service-worker">active service worker</span> to | ||
<var>reservedEnvironment</var>'s <span | ||
data-x="concept-environment-active-service-worker">active service worker</span>.</p></li> | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Should this be done either way? Is this something that's wrong today? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. We reuse the "old" environment settings object for the new Document in this case, but don't have any steps to change the creation URL and the active service worker. Currently without adding this, the resulting (old) environment settings object won't get a controller even though the navigate fetch matched and delivered one. |
||
|
||
<li><p>Set <var>reservedEnvironment</var>'s <span data-x="concept-environment-id">id</span> | ||
to the empty string.</p></li> | ||
</ol> | ||
|
||
<p class="note">The initial <code>about:blank</code> <code>Document</code>'s <span>environment | ||
settings object</span> is reused for the new <code>Document</code> in this case. The reserved | ||
environment transfers its <span data-x="concept-environment-creation-url">creation URL</span> | ||
and <span data-x="concept-environment-active-service-worker">active service worker</span> to | ||
the reused <span>environment settings object</span> but does not transfer its <span | ||
data-x="concept-environment-id">id</span>. The reserved environment is not searchable by the | ||
<span>environment</span>’s <span data-x="concept-environment-id">id</span> from this point | ||
on.</p> | ||
</li> | ||
|
||
<li> | ||
<p>Otherwise:</p> | ||
|
@@ -82161,7 +82201,7 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O | |
</li> | ||
|
||
<li><p><span>Set up a window environment settings object</span> with <var>realm execution | ||
context</var> and <var>reservedEnvironment</var>, if present.</p></li> | ||
context</var> and <var>reservedEnvironment</var>.</p></li> | ||
</ol> | ||
</li> | ||
|
||
|
@@ -82195,6 +82235,12 @@ State: <OUTPUT NAME=I>1</OUTPUT> <INPUT VALUE="Increment" TYPE=BUTTON O | |
|
||
<li><p><span>Implement the sandboxing</span> for the <code>Document</code>.</p></li> | ||
|
||
<li><p>If the <code>Document</code>'s <span>active sandboxing flag set</span> has its | ||
<span>sandboxed origin browsing context flag</span> set, then set the <code>Document</code>'s | ||
<span>relevant settings object</span>'s <span | ||
data-x="concept-environment-active-service-worker">active service worker</span> to | ||
null.</p></li> | ||
|
||
<li><p><span>Set the allow* flags</span> for the <code>Document</code>.</p></li> | ||
</ol> | ||
</li> | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand this conditional.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I was trying to exclude the case where the navigate was done against the (non-initial) about:blank Document. (This is basically the part that overrides the active service worker and the creation URL of the "old" environment settings object with the new values gotten from the navigate fetch.)
Thinking on your comment, I noticed that the about:blank document should have a unique origin. So, I think this condition isn't needed.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Addressed this in the follow-up commit.