Skip to content
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

Drop prefetch/prerender responses without an ok status. #144

Merged
merged 5 commits into from
Feb 24, 2022

Conversation

jeremyroman
Copy link
Collaborator

@jeremyroman jeremyroman commented Feb 18, 2022

No description provided.

@jeremyroman jeremyroman requested review from noamr and domenic February 18, 2022 03:37
@jeremyroman jeremyroman changed the title Drop prefetch responses without an ok status. Drop prefetch/prerender responses without an ok status. Feb 18, 2022
@jeremyroman
Copy link
Collaborator Author

A slightly interesting consequence of this is that this also affects navigations initiated within the prerendering browsing context after the first one. We could not do that if we think it's better, but this is consistent with the versions already there.

prerendering.bs Outdated
@@ -573,6 +576,15 @@ Patch the [=navigate=] algorithm to prevent certain navigations in a [=prerender

<p class="issue">Portals might need an extra hook to close the portal in these cases. Or should we reconsider and just do nothing for portals too? That might be more elegant. I think it just requires portals to not be so zealous about clearing the host element/browsing context link, which isn't observable anyway?

<div algorithm>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No need for a new algorithm, this should be incorporated into https://wicg.github.io/nav-speculation/prerendering.html#no-bad-navs

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, I think just adding "response does not support prefetch" to that list would be pretty nice and minimal. Although I appreciate the motivation to have a clearly-named "supports prerender" algorithm, all the other stuff in the no-bad-navs section arguably also would belong there...

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Indeed that is the call site of this algorithm. :)

This might be a little preemptive, but my thinking is that this is likely to evolve to also check the resolved value of the Supports-Loading-Mode header etc., and at that time it will be convenient to have this in an algorithm rather than a complicated boolean expression. I'll just inline it for now rather and we can always extract it if that does come to pass.

prefetch.bs Outdated Show resolved Hide resolved
prerendering.bs Outdated
@@ -573,6 +576,15 @@ Patch the [=navigate=] algorithm to prevent certain navigations in a [=prerender

<p class="issue">Portals might need an extra hook to close the portal in these cases. Or should we reconsider and just do nothing for portals too? That might be more elegant. I think it just requires portals to not be so zealous about clearing the host element/browsing context link, which isn't observable anyway?

<div algorithm>
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1, I think just adding "response does not support prefetch" to that list would be pretty nice and minimal. Although I appreciate the motivation to have a clearly-named "supports prerender" algorithm, all the other stuff in the no-bad-navs section arguably also would belong there...

@jeremyroman jeremyroman merged commit 8aa249f into WICG:main Feb 24, 2022
@jeremyroman jeremyroman deleted the supported-response branch February 24, 2022 18:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants