Repository navigation
script: Use create_a_potential_cors_request_with_claim in htmltrackelement.rs - #49203
Conversation
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#64118) with upstreamable changes. |
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#64118) title and body. |
|
@jdm Would appreciate your review and input on this when you have a moment. |
| let url_with_blob_claim = | ||
| ensure_blob_referenced_by_url_is_kept_alive(&global, url.clone()); |
There was a problem hiding this comment.
To avoid intermittent failures in the new test, we need to claim this URL right after computing it in https://github.com/rogerkorantenng/servo/blob/f12b05e0733d7d14effecbd4fe7e4ec06c9b3c8f/components/script/dom/html/embedded_content/htmltrackelement.rs#L337-L338 . We should change the type of track_url to Option<UrlWithBlobClaim> and store the claimed URL there.
There was a problem hiding this comment.
Thanks! i changed track_url to Option and the url now gets claimed as soon as its parsed in attribute_mutated. The processing model just passes the stored claim straight to create_a_potential_cors_request_with_claim so nothing gets claimed later in the microtask anymore. i also had to adjust the test to match since the claim now happens when src is set, revoking the url any time after that doesnt affect the load. So the second subtest now revokes the url right after setting src instead of in a queueMicrotask and checks that the track still loads, no more timing dependence. and the third subtest now revokes the url before setting src and checks for an error
…ement.rs Signed-off-by: rogerkorantenng <[email protected]>
f12b05e to
aad5833
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#64118). |
jdm
left a comment
There was a problem hiding this comment.
Excellent! Thanks for your care with the tests!
Use
ensure_blob_referenced_by_url_is_kept_aliveto get aUrlWithBlobClaimfor the<track>element's source URL, then pass it tocreate_a_potential_cors_request_with_claiminstead of the temporarycreate_a_potential_cors_request.Testing: Added
tests/wpt/tests/html/semantics/embedded-content/media-elements/track/track-element/track-blob-url-revoked.window.js. It loads a<track>from a blob URL holding a small WebVTT file, and has three subtests.The main one revokes the URL in a microtask after the fetch has started and checks that the track still loads. The other two check that a blob URL that is never revoked loads normally, and that revoking it before loading starts gives an
errorevent../mach test-tidyis clean.Try run: https://github.com/rogerkorantenng/servo/actions/runs/39970828531
Fixes: Part of #48892