-
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
Add may-block reasons to NotRestoredReasons #10154
Conversation
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.
Thanks for doing all this work! I think this is crucial to getting interoperability if other browsers want to implement the bfcache blocking reasons API.
I know the most important thing to get settled here are the names. I added various small comments about some problematic ones, but I additionally have the following more wide-ranging concerns:
-
Insufficient consistency around reasons related to the initial navigation and the HTTP response. I think all of the following are related to properties of the HTTP response:
http-status-not-ok
,non-http-https-scheme
,http-not-get
,no-response-head
,cache-control-no-store
,cache-control-no-cache
,http-auth-required
. Sometimes you prefix withhttp-
, sometimes you don't. Sometimes you includeresponse
, sometimes you don't. Forstatus-not-ok
, you mention the noun, but fornot-get
, you don't.My suggestions:
response-status-not-ok
,response-scheme-not-http-or-https
,response-method-not-get
,response-head-missing
(?),response-cache-control-no-store
,response-cache-control-no-cache
,response-auth-required
. -
Inconsistency on how API names are incorporated. So far we have one API name reason,
websocket
, derived from the API namedWebSocket
. Some of your new reasons match this:serviceworker-*
,webtransport
,broadcastchannel
. Some introduce hyphens:SharedWorker
->shared-worker
,MediaStream
->media-stream
. And for some I can't find the connection to the objects at all:SmartCardConnection
->smart-card
,IdleDetector
->idle-manager
,SpeechRecognition
->speech-recognizer
,PaymentRequest
->payment-manager
,OTPCredential
->sms
. (I wonder if in these case it's some Chromium internal codebase object?) Also, ??? ->indexed-db-event
. Finally, some cases use specification names:picture-in-picture
,keyboard-lock
,webserial
,webrtc
.My suggestion would be to pick one of two paths here. If the failure is due to a very specific object being used, e.g. a
WebSocket
or aSpeechRecognition
object, then use that object's name, converted to all-lowercase with no hyphens. Otherwise, if tons of different APIs from a spec cause bfcache failures and you want to use one umbrella reason for all of them, then use the specification name. Prefer the former when possible, because it helps avoid exposing existing inconsistencies in how we name specs.
My next biggest concern after these inconsistencies is about the cases I've identified where I have no idea what the reason is indicating. I suspect if I don't know, other implementers won't, and so we won't get interoperability. We can help these cases by expanding on the descriptions until they become clearer.
In the end we may need more cross-specification links to do this. But I know adding those is a pain, so it's fine to leave that until the end of the process.
source
Outdated
and reached the timeout limit.</dd> | ||
|
||
<dt>"session-restored"</dt> | ||
<dd>Session was restored for this page.</dd> |
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 know what this means.
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.
This means the page is loaded via session history because of tab restore. Reworded this.
Thanks Domenic for the review! I think I addressed all of your comments. I changed the reason name to use object name as much as possible, and only when that's not possible the name is the generic API name. |
@smaug---- Can you PTAL at this? Thanks in advance! |
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.
Great work. I can understand almost all of these reasons now, and the naming feels very consistent. The work on the service worker reasons in particular is very, very helpful.
I left a lot of editorial comments, but to highlight the important ones that impact reason names or similar:
- We should remove
database
cookie-flushed
is a bit strange; maybe-deleted
or-removed
would be betterkeepalive-request
->response-keepalive
, I think? If I understand it correctly?- I don't understand
response-head-missing
loading
+subframe-navigating
should probably become eithernavigating
+frame-navigating
, orloading
+frame-loading
- I'm not sure I understand
timeout
Note to @smaug----, with my HTML editor hat on:
This list includes a lot of reasons that are specific to Chromium implementation choices. I strongly believe that's OK, and furthermore I commend the Chromium team and @rubberyuzu for bringing this through the standards process, creating this sort of centralized registry. We should encourage this style, instead of specs which have free-form fields for this sort of analytics data. So we should not criticize some of these reasons as Chromium-only. I think that goes even for Chromium-only reasons based on Chromium-only specs (e.g. smart card API). It's better to have everything documented and centralized. Having a smartcardconnection
bfcache blocking reason in HTML, doesn't sanction the existence of the Smart Card API in general.
If any other browser engine, like Gecko, wants to add their own very-specific reasons to the list, we should welcome that too.
But we would very much appreciate eyes from a second implementer to ensure that the reasons we're adding here are reusable if other browsers end up with similar implementation constraints. This means, basically, that the descriptions given here are clear enough to be interoperably implementable.
What I'm picturing here is a web developer, staring at their mountains of analytics data, and doing things like:
- Noticing that reason X is very high in both Firefox and Chrome. So they should fix their site!
- Noticing that reason X is high in Chrome, but not in Firefox. So they should bug Chromium developers to adopt whatever strategy Firefox took to avoid the problem!
These kind of use cases are enabled by us collaborating on the reason list, instead of letting it be a free-for-all string.
source
Outdated
<dt>"<dfn | ||
data-x="blocking-non-trivial-bcg" export> | ||
<code>non-trivial-browsing-context-group</code></dfn>"</dt> | ||
<dd>The <span>browsing context group</span> of this <code>Document</code> was non-trivial.</dd> |
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.
What does this mean?
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.
This means that related active contents exists for this document, i.e. the document called window.open().
9ae1fff
to
6abbb90
Compare
This CL renames the reporting strings of NotRestoredReasons API so that they match the spec draft[1]. [1]: whatwg/html#10154 Bug:331754704 Change-Id: If805ad7e30c14ff64b440c8d9515eaee38370fd8
This CL renames the reporting strings of NotRestoredReasons API so that they match the spec draft[1]. [1]: whatwg/html#10154 Bug: 331754704 Change-Id: If805ad7e30c14ff64b440c8d9515eaee38370fd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5392283 Commit-Queue: Yuzu Saijo <yuzus@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Cr-Commit-Position: refs/heads/main@{#1280059}
This CL renames the reporting strings of NotRestoredReasons API so that they match the spec draft[1]. [1]: whatwg/html#10154 Bug: 331754704 Change-Id: If805ad7e30c14ff64b440c8d9515eaee38370fd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5392283 Commit-Queue: Yuzu Saijo <yuzus@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Cr-Commit-Position: refs/heads/main@{#1280059}
This CL renames the reporting strings of NotRestoredReasons API so that they match the spec draft[1]. [1]: whatwg/html#10154 Bug: 331754704 Change-Id: If805ad7e30c14ff64b440c8d9515eaee38370fd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5392283 Commit-Queue: Yuzu Saijo <yuzus@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Cr-Commit-Position: refs/heads/main@{#1280059}
@smaug---- Please let me know if there's anything unclear. Thanks! |
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 for not re-reviewing after the last round. I found a few more potential renames...
Thanks Domenic and sorry for not noticing your review earlier! |
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.
This LGTM with a nit. I do not have any more substantial feedback or any rename suggestions.
I think it would be nicer for spec readers if everything that talked about another spec had a reference, like we currently do for "websocket
" with [WEBSOCKETS]
and "lock
" with [WEBLOCKS]
.
However, adding these is such an annoying process when editing HTML. And they are only used in this one context. I don't feel like it should be required to merge this PR.
As a compromise, I would appreciate it if you could add such references for specs that are already in the bibliography. So e.g. add various [SERVICEWORKERS]
and [INDEXEDDB]
and so on. But you don't need to add new bibliography entries for every single reason.
Thanks! I added existing spec references. @smaug---- Can you PTAL? Thanks in advance |
…ec, a=testonly Automatic update from web-platform-tests [bfcache] Rename reasons to match the spec This CL renames the reporting strings of NotRestoredReasons API so that they match the spec draft[1]. [1]: whatwg/html#10154 Bug: 331754704 Change-Id: If805ad7e30c14ff64b440c8d9515eaee38370fd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5392283 Commit-Queue: Yuzu Saijo <yuzus@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Cr-Commit-Position: refs/heads/main@{#1280059} -- wpt-commits: e99b8186f7272559b3d419445faef703958bfdd1 wpt-pr: 45408
…ec, a=testonly Automatic update from web-platform-tests [bfcache] Rename reasons to match the spec This CL renames the reporting strings of NotRestoredReasons API so that they match the spec draft[1]. [1]: whatwg/html#10154 Bug: 331754704 Change-Id: If805ad7e30c14ff64b440c8d9515eaee38370fd8 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5392283 Commit-Queue: Yuzu Saijo <yuzus@chromium.org> Reviewed-by: Rakina Zata Amni <rakina@chromium.org> Cr-Commit-Position: refs/heads/main@{#1280059} -- wpt-commits: e99b8186f7272559b3d419445faef703958bfdd1 wpt-pr: 45408
@smaug---- Can you PTAL? Thanks |
@smaug---- @petervanderbeken Another ping. |
We'll go through this later today. Sorry about delay. |
We're ok to expose those reasons which the web site can affect to (and which are based on some specification), but nothing happening possibly in cross-origin iframes (like "frame-navigating") or in the UA itself (like "cookie-disabled" or "extension-messaging") should be exposed. |
I removed all the "before unloading" and used "while unloading" if applicable. |
Thanks, PTAL again |
source
Outdated
<code>SyncManager.register</code>, <code>PeriodicSyncManager.register</code> | ||
, or <code>BackgroundFetchManager.fetch</code>.</dd> | ||
|
||
<dt>"<dfn data-x="blocking-broadcastchannel-message" export><code>broadcastchannel-message</code></dfn>"</dt> |
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.
You removed the plain "broadcastchannel", right? Maybe that name could be used 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.
I would rather keep message to make it clear that the existence of broadcastchannel is not blocking, and also with the history of having broadcastchannel as a reason.
source
Outdated
while the page was in <a href="#note-bfcache">back/forward cache</a>. | ||
<ref>SW</ref></dd> | ||
|
||
<dt>"<dfn data-x="blocking-sw-message" export><code>serviceworker-postmessage</code></dfn>"</dt> |
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.
or should it be "serviceworker-message" ?
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.
My two comments aren't blocking, but consider to use those, IMO clearer reason names. @petervanderbeken will also review
Can you ptal @petervanderbeken ? Thanks in advance! |
LGTM now. |
This CL updates the reason names reported by NotRestoredReasonsAPI so that they match the ones in the spec. On the spec PR we decided some reasons should not be exposed, i.e. reported as masked, and changed other reasons names. Mainly we are changing the reporting name to be 'masked' in this CL. The change is guarded with a runtime flag. Note that session restore should be reported as null but with this CL it is still reported as "session-restored". I will address this case and add a test in a separate CL. Spec PR: whatwg/html#10154 PSA: https://groups.google.com/a/chromium.org/g/blink-dev/c/keA8QE_uFxo/m/OqtfRXq6BwAJ?utm_medium=email&utm_source=footer Bug: 331754704 Change-Id: I0d4224f599bc4cdae7a70b9bbb38ff798bae2917 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/5907581 Commit-Queue: Yuzu Saijo <yuzus@chromium.org> Reviewed-by: Fergal Daly <fergal@chromium.org> Reviewed-by: Kent Tamura <tkent@chromium.org> Cr-Commit-Position: refs/heads/main@{#1381607}
This is a follow-up PR of #9360, where we added NotRestoredReasons.
This PR adds a list of NotRestoredReasons that user agents may choose to block with.
/document-lifecycle.html ( diff )
/infrastructure.html ( diff )
/nav-history-apis.html ( diff )