fetch icon indicating copy to clipboard operation
fetch copied to clipboard

Pass in response status to mark resource timing

Open abinpaul1 opened this issue 2 years ago • 1 comments

These changes are to support addition of http response status code to Perfomance resource timing. Further details are available at https://github.com/w3c/resource-timing/pull/335

  • [x] At least two implementers are interested (and none opposed):
    • Chromium : https://chromestatus.com/feature/5163838794629120
    • Firefox : https://github.com/mozilla/standards-positions/issues/665
  • [ ] Tests are written and can be reviewed and commented upon at:
    • https://chromium-review.googlesource.com/c/chromium/src/+/3754923
  • [ ] Implementation bugs are filed:
    • Chrome: https://bugs.chromium.org/p/chromium/issues/detail?id=1343293
    • Firefox: …
    • Safari: …
    • Deno (not for CORS changes): …

(See WHATWG Working Mode: Changes for more details.)


Preview | Diff

abinpaul1 avatar Jul 09 '22 14:07 abinpaul1

Also, we'd want tests and implementation issues before this lands.

yoavweiss avatar Jul 11 '22 12:07 yoavweiss

A rough sketch of using existing infrastructure:

@abinpaul1 @annevk - does this make sense?

yoavweiss avatar Oct 04 '22 12:10 yoavweiss

Kinda, but then "has cross-origin redirects" needs to be state that Fetch maintains, I suspect. I'm also confused by "navigate an iframe" as I suspect some of those steps also need to apply to embed and object and processing the final response doesn't just result in a report but also needs to actually render something and such.

annevk avatar Oct 07 '22 09:10 annevk

  • The information regarding if there were any cross origin redirects can be determined if needed in fetch, but currently its stored in the has cross-origin redirects boolean on navigation params struct in HTML.
  • I could see this boolean is used mainly in two places ([1], [2]). In both these places we also have access to the response as navigation param's response.
  • Is it possible to consider moving the has cross-origin redirects boolean as a field to the response? Its value could be determined in the Fetch spec and it could be used as needed in the above two places as well and for our use case as well. This would maybe help us to easily reuse the boolean without having to pass it along to different algorithms.

@annevk @yoavweiss

abinpaul1 avatar Oct 11 '22 12:10 abinpaul1

Yeah that seems reasonable. And since we copy request's URL list over to the eventual response we might be able to reuse part of https://fetch.spec.whatwg.org/#concept-request-tainted-origin somehow.

(Apologies for taking so long. In the future please bug me on Matrix if I'm not responsive. Or ask the design question there as others might be able to answer as well.)

annevk avatar Oct 17 '22 08:10 annevk

Have added the has-cross-origin-redirects boolean to the response. I'll also modify html spec to reuse this in place of has cross-origin redirects boolean on navigation params. Building html spec seems to be failing since it can't reference this new boolean.

abinpaul1 avatar Oct 18 '22 15:10 abinpaul1

In HTML you have to explicitly add the reference (search for data-x-href). If you cannot figure it out please PR what you do have and ask for help. Should not be too hard to get it all working. (Also, if it was not HTML it would be somewhat expected that CI fails and we just have to land things carefully with some delay so there's time for indexing the new terms.)

annevk avatar Oct 19 '22 15:10 annevk

@annevk Thanks for the pointer. I've opened the HTML PR with the changes. https://github.com/whatwg/html/pull/8405

abinpaul1 avatar Oct 19 '22 18:10 abinpaul1

@abinpaul1 can you file bugs on Gecko and WebKit? That's the last thing remaining here.

annevk avatar Oct 21 '22 12:10 annevk

Filed the bugs

abinpaul1 avatar Oct 21 '22 14:10 abinpaul1