-
Notifications
You must be signed in to change notification settings - Fork 332
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
Call finalize and report timing
automatically on end-of-body
#1413
Conversation
d39af3e
to
41bc255
Compare
(Note that this is a breaking change, not sure if to leave |
I would prefer it if we attempt to swap it all at once. And we should also try to preserve working ID. Removing references seem fine as ideally we'd fix all of those as part of the swap. |
OK, I'll add an alternate ID and work on the corresponding HTML/CSS/XHR patches |
Depends on whatwg/fetch#1413 This clarifies that a resource timing entry is always for a fetch and not for a request or response.
Depends on whatwg/fetch#1413 This clarifies that resource-timing reports are specific to a fetch and not to a request or a response.
@annevk: I posted 6 related PRs... |
3f27782
to
c18e61a
Compare
Depends on whatwg/fetch#1413 This clarifies that resource-timing reports are specific to a fetch and not to a request or a response.
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 generally looks like an improvement to me, but there's a couple of things that still need to be worked out.
d497c09
to
4df5920
Compare
Another review, @annevk ? |
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.
As I mentioned on Matrix, I think it would be good if someone else looked at this before I give it a final pass. Maybe @yutakahirano is interested?
Are you looking for a pure code review, or do you want to know how likely Chrome implements the spec change? |
The current spec change is purely editorial but will allow subsequent behavior-affecting changes, such as defining how encoded/decoded body size works when service workers are involved |
I suspect you've already discussed this, but I'm not very comfortable with allowing / asking external users (xhr, html, etc) to control controller's state (abort is an exception). Is it possible / desirable to call "conclude" in the fetch spec and allow external users to set parameters (to fetch params, for example)? |
Yes it's been discussed months ago... Also terminating is something that external specs can do. We chose to do it this way because then it's clear when the reporting happens relative to other observable behaviors such as element load/error events. |
One thing I'm open to is to separate timing-reporting from the state change - allow fetch to set the "concluded" state on error/EOF but leave the reporting to the caller, which can only happen post-conclude. @annevk WDYT? |
That sounds great to me. |
@annevk does that sound ok to you? |
Don't we set the "done flag" in "fetch response handover" today? Currently "finalize and report timing" does not make any state changes of that sort that I can see and it's called from one of the callback algorithms, at least in |
9f14e94
to
43be574
Compare
Triaged again, I think all comments have been handled. |
@annevk: ping for review? |
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, I think we're close, but there's at least one somewhat involved problem left.
To be clear, in the future please either resolve them (if you're a 100% sure) or add a comment (if you'd like another pass on that comment thread). I've now gone and resolved the older comments, but help with that is appreciated. |
Sure, will do. Thanks! |
Tentative commit 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.
@yutakahirano any final thoughts on this?
Looks good! Should I update the OP or unnecessary? |
No need, I'll give @yutakahirano a couple more days before I merge this. |
See whatwg/fetch#1413 Fetch now reports timing automatically if initiator is passed.
The correct downstream link for CSS is w3c/csswg-drafts#7355 |
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.
Still LGTM.
fetch.bs
Outdated
<a for="request">initiator type</a> is non-null and <var>fetchParams</var>'s | ||
<a for="fetch params">request</a>'s <a for=request>client</a> is non-null, then run | ||
<var>fetchParams</var>'s <a for="fetch params">controller</a>'s | ||
<a for="fetch controller">report timing steps</a> given <var>fetchParams</var>'s |
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.
We need to give only one argument ("global") to report timing steps
, right?
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.
Right, removed extra arg, good catch
See whatwg/fetch#1413 Fetch now reports timing automatically if initiator is passed.
Closes #1208
Closes w3c/navigation-timing#131
A new method called
conclude
reports the timing for the resource.The timing info used is the one attached to the fetch rather than
one attached to a response.
This is done to reduce ambiguities when timing info is attached to
the
response
, as it's unclear what happens to that timing infowhen a response is cloned, reused, serialized or stored & restored
from cache.
Call-site patches:
Update resource/navigation to use
conclude
/resource-info
: whatwg/html#7722Update XHR to use
conclude
: whatwg/xhr#347Update CSS to use
conclude
: w3c/csswg-drafts#7355Update beacon to use
conclude
: w3c/beacon#75Update resource timing to use
resource info
: w3c/resource-timing#321Update navigation timing to use
resource info
: https://github.com/w3c/navigation-timing/pull/1760(See WHATWG Working Mode: Changes for more details.)
Preview | Diff