-
Notifications
You must be signed in to change notification settings - Fork 2.8k
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
Set request's reload-navigation flag when the navigation is reload-trigerred #3592
Conversation
source
Outdated
@@ -81809,6 +81810,13 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface | |||
data-export=""><var>exceptions enabled flag</var></dfn>, the user agent must run these steps:</p> | |||
|
|||
<ol> | |||
<li><p>If <var>resource</var> is a <span data-x="concept-request">request</span>, then set | |||
<var>resource</var> to a copy of <var>resource</var>.</p></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.
Why is this 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.
With this change the algorithm may set a flag on the request. I thought that call-sites might be surprised by that behavior, and made a copy in case. If that's not the case I can remove this statement.
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 think all the callers of navigate don't hold onto the objects they pass. And I think only <form>
passes request objects, so that should be easy to verify.
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.
(Which also means that location.reload()
doesn't, which means this patch doesn't do what it wants I think.)
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.
Sorry, what kind of object does location.reload() pass? If it's neither URL nor request, is it handled by "If resource is a request whose url's scheme is a fetch scheme..." statement?
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.
Ah sorry, I think location.reload()
does pass a URL at the moment, but I think it should pass a "session history entry" since it's supposed to take into account whether the document was POSTed and such.
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.
Ok, I deleted this statement.
source
Outdated
|
||
<li><p>If <var>resource</var> is a <span data-x="concept-request">request</span> and this is | ||
a <dfn>reload-triggered navigation</dfn>, then set <var>resource</var>'s <span | ||
data-x="concept-request-reload-navigation-flag">reload-navigation flag</span>. |
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.
Doesn't this mean that a manual refresh wouldn't set the flag?
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.
Sorry, what do you mean by "manual refresh"?
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.
A user-initiated refresh.
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.
Oops, I put the statement in a wrong place. Fixed.
@annevk, are you happy with this change? |
This doesn't work when resource is a session history entry, which I'm pretty sure is a thing it can be. |
When resource is a session history entry, no substep in
works, so I think that's out-of-scope? Or are you asking me to fix the existing spec first? |
I'll defer to @domenic I suppose. But this is the main problem I had with adding more features on top of navigation, before fixing the specification. It becomes rather unclear how everything works since the current algorithm is broken and not fully tested. It's like building a house on a swamp or some such. |
I'm fine filing bugs about broken navigation cases and letting this move forward. |
Done. |
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.
LGTM with nit
source
Outdated
@@ -81850,7 +81855,7 @@ interface <dfn>Location</dfn> { // but see also <a href="#the-location-interface | |||
<span>prompt to unload</span> algorithm.</p></li> | |||
<!-- https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=1946 to 1955 --> | |||
|
|||
<li id="navigate-fragid-step"><p>If this is not a <dfn>reload-triggered navigation</dfn>, | |||
<li id="navigate-fragid-step"><p>If this is not a <span>reload-triggered navigation</span> |
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.
Missing comma here
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.
Done.
See whatwg/fetch#685, whatwg/html#3592, and discussion in w3c/ServiceWorker#1167.
And also a member on the request concept (reload-navigation flag) to support this API. See w3c/ServiceWorker#1167 for the discussion that led to this. Tests: web-platform-tests/wpt#10192. Corresponding HTML change: whatwg/html#3592.
…, a=testonly Automatic update from web-platform-testsAdd tests for Request.isReloadNavigation See whatwg/fetch#685, whatwg/html#3592, and discussion in w3c/ServiceWorker#1167. -- wpt-commits: 58ee169367245c6fe5edc01177eac68f76c12f4a wpt-pr: 10192
…, a=testonly Automatic update from web-platform-testsAdd tests for Request.isReloadNavigation See whatwg/fetch#685, whatwg/html#3592, and discussion in w3c/ServiceWorker#1167. -- wpt-commits: 58ee169367245c6fe5edc01177eac68f76c12f4a wpt-pr: 10192 UltraBlame original commit: 96c5380b8719433164c1c86dac5b4c8db50c1966
…, a=testonly Automatic update from web-platform-testsAdd tests for Request.isReloadNavigation See whatwg/fetch#685, whatwg/html#3592, and discussion in w3c/ServiceWorker#1167. -- wpt-commits: 58ee169367245c6fe5edc01177eac68f76c12f4a wpt-pr: 10192 UltraBlame original commit: 96c5380b8719433164c1c86dac5b4c8db50c1966
…, a=testonly Automatic update from web-platform-testsAdd tests for Request.isReloadNavigation See whatwg/fetch#685, whatwg/html#3592, and discussion in w3c/ServiceWorker#1167. -- wpt-commits: 58ee169367245c6fe5edc01177eac68f76c12f4a wpt-pr: 10192 UltraBlame original commit: 96c5380b8719433164c1c86dac5b4c8db50c1966
This is for w3c/ServiceWorker#1167.
/acknowledgements.html ( diff )
/browsing-the-web.html ( diff )
/infrastructure.html ( diff )