Update fetch-later spec according to WPT expectations #1902
Update fetch-later spec according to WPT expectations
#1902TimvdLippe wants to merge 2 commits intowhatwg:mainfrom
Conversation
There were two missing parts: 1. The body can either be null or empty (it was missing the empty case) 2. Quota computation shouldn't include aborted or already completed requests. WPT uses `AbortController` to ensure quota is freed up. This also makes sense, since they are no longer relevant. Therefore, only consider pending deferred fetches when computing quota.
|
FYI @noamr PTAL |
|
(2) is fine |
|
Well, Chrome currently blocks such requests: https://wpt.fyi/results/fetch/fetch-later/quota/empty-payload.https.window.html?label=experimental&label=master&aligned If I didn't implement that case, Servo wouldn't match Chrome's behaviour. |
@mingyc the spec only prevents @TimvdLippe we should check whether this is an implementation oversight or a spec oversight before defaulting to "spec what chromium does"... For the time being I think that the other part of the PR is ok. |
|
I wasn't aware of the streaming part. Since the test wasn't marked as tentative, I thought this part of the spec was meant to imply the empty case behaviour. I don't mind either behaviour (not familiar with streaming or anything), so happy to update it to whatever you folks decide. |
|
Friendly ping @mingyc on Chromiums perspective |
I suggest to make the other change and propose a WPT pr to align with the spec re empty request bodies |
Per the spec discussion in [1] we should only check for a length of `null` and not zero. [1]: whatwg/fetch#1902 Signed-off-by: Tim van der Lippe <[email protected]>
Per the spec discussion in [1] we should only check for a length of `null` and not zero. [1]: whatwg/fetch#1902 Signed-off-by: Tim van der Lippe <[email protected]>
|
Updated this PR and updated Servo + tests, see the WPT export in web-platform-tests/wpt#58726 Please review that PR. |
Per the spec discussion in [1] we should only check for a length of `null` and not zero. [1]: whatwg/fetch#1902 Signed-off-by: Tim van der Lippe <[email protected]>
Per the spec discussion in [1] we should only check for a length of `null` and not zero. [1]: whatwg/fetch#1902 Signed-off-by: Tim van der Lippe <[email protected]>
|
Sorry about missing this thread
I roughly remember there was some discussion about posting with empty body should be replaced by a GET request (can't find it now). Isn't null body the same as empty body in this context? |
|
No they are distinct. One has a |
There were two missing parts:
empty case)
completed requests. WPT uses
AbortControllerto ensurequota is freed up. This also makes sense, since they are
no longer relevant. Therefore, only consider pending
deferred fetches when computing quota.
(See WHATWG Working Mode: Changes for more details.)
Preview | Diff