You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Replace all script uses of UrlWithBlobClaim::from_url_without_having_claimed_blob with ensure_blob_referenced_by_url_is_kept_alive #48890
A-content/scriptRelated to the script threadA-networkB-metaThis issue tracks the status of multiple, related pieces of workE-less-complexStraightforward. Recommended for a new contributor.
UrlWithBlobClaim is a type that ensures that the following JavaScript pattern works:
constblob=/* some blob object created from some bytes */;consturl=URL.createObjectURL(blob);img.src=url;URL.revokeObjectURL(url);
Usually revoking a blob URL makes it impossible to reference, but any existing URLs referencing are intended to continue working. This pattern applies to any JS API that interacts with URLs, so we need to fix up the remaining uses (and hopefully add tests if they don't trigger any behaviour changes in existing tests).
To work on this, please leave a comment claiming one of the unclaimed files, then make the fix in that file, then run the full WPT testsuite in your github fork. If there are no changes to test results, leave a comment here and we can discuss how to write a new test for the feature.
Fixing these will help us make progress on #25226. We won't assign this issue to a particular person since it can be worked on in parallel.
Also, what would be the best approach for naming the branch. Looking at the documentation it seems as though "issue-48890" is the approach that is recommended, as seen here.
But since there are multiple people that are working on this, would "issue-48890-websockets" suffice, where "websockets" is the file name?
Ah, that makes sense since we can't use a blob URL with websockets. Let's use UrlWithBlobClaim::for_url instead and call expect("blob URLs were already prevented").
I don't see an obvious way of getting the GlobalScope. There is one inside the Tokenizer constructor, but it's not accessible from the process_token method. Should I add a new field to the PrefetchSink struct, or is there a better way?
The only test I can imagine is one that creates an object URL, creates a string that contains an external script that uses the object URL as the src, and pass that as the srcdoc of an iframe. Figuring out when to revoke the object URL.is the tricky part...
Actually, we can't realistically revoke it before the script element has a chance to load it, either. I don't know if prefetching like this is even observable in a test if we can't revoke it immediately.
Given that, unless you have any other ideas, I don't think we can write a meaningful test for this.
Well, from what I understand, prefetching could be also triggered with a <link rel="prefetch">, and I just found out there's a whole speculation rules API (although I don't even know if it's currently implemented in servo), but I have no clue if it would make this any easier to test...
A-content/scriptRelated to the script threadA-networkB-metaThis issue tracks the status of multiple, related pieces of workE-less-complexStraightforward. Recommended for a new contributor.
Activity
servo-highfive commentedon Oct 13, 2026
Hi! If you have any questions regarding this issue, feel free to make a comment here, or ask it in Zulip.
Please read and follow our AI Usage Policy:
v-ju commentedon Oct 14, 2026
@jdm could i work on this ?
jdm commentedon Oct 14, 2026
@v-ju Yes! Please comment with which file you will work on so we don't duplicate effort.
Anshumancanrock commentedon Oct 15, 2026
hi @jdm , I would like to work on
components/script/navigation.rs. Could you please assign this to me?jdm commentedon Oct 15, 2026
slimfatima commentedon Oct 23, 2026
Good afternoon if they can assign this project to me or any available one
jdm commentedon Oct 23, 2026
The original description has instructions for claiming one of the available files to work on.
slimfatima commentedon Oct 23, 2026
yes i have done that already
lukasbauza commentedon Oct 25, 2026
I would like to work on
components/script/dom/document/websocket.rs. Can I have this task assigned to me, please?lukasbauza commentedon Oct 25, 2026
Also, what would be the best approach for naming the branch. Looking at the documentation it seems as though "issue-48890" is the approach that is recommended, as seen here.
But since there are multiple people that are working on this, would "issue-48890-websockets" suffice, where "websockets" is the file name?
jdm commentedon Oct 25, 2026
Branch names don't matter, since they only exist on your fork! You can use whatever system makes sense for you.
10 remaining items
jdm commentedon Nov 14, 2026
Ah, that makes sense since we can't use a blob URL with websockets. Let's use UrlWithBlobClaim::for_url instead and call expect("blob URLs were already prevented").
script: Use UrlWithBlobClaim::for_url in favicon.rs
script: Use UrlWithBlobClaim::for_url in navigator.rs
script: Use ensure_blob_referenced_by_url_is_kept_alive in layout_ima…
script: Use UrlWithBlobClaim::for_url in navigator.rs (servo#49636)
FinalStaticFox commentedon Nov 26, 2026
Hello, I would like to work on
components/script/dom/servoparser/prefetch.rsFinalStaticFox commentedon Nov 27, 2026
I don't see an obvious way of getting the
GlobalScope. There is one inside theTokenizerconstructor, but it's not accessible from theprocess_tokenmethod. Should I add a new field to thePrefetchSinkstruct, or is there a better way?jdm commentedon Nov 27, 2026
Yes, adding a new
Dom<GlobalScope>field to PrefetchSink looks like the right choice.FinalStaticFox commentedon Nov 27, 2026
Alright, so I ran
./mach try wptand it seems like it passed: https://github.com/FinalStaticFox/servo/actions/runs/46043258659.I assume new tests need to be written then?
jdm commentedon Nov 27, 2026
The only test I can imagine is one that creates an object URL, creates a string that contains an external script that uses the object URL as the src, and pass that as the srcdoc of an iframe. Figuring out when to revoke the object URL.is the tricky part...
Actually, we can't realistically revoke it before the script element has a chance to load it, either. I don't know if prefetching like this is even observable in a test if we can't revoke it immediately.
Given that, unless you have any other ideas, I don't think we can write a meaningful test for this.
script: Use ensure_blob_referenced_by_url_is_kept_alive in layout_ima…
FinalStaticFox commentedon Nov 28, 2026
Well, from what I understand, prefetching could be also triggered with a
<link rel="prefetch">, and I just found out there's a whole speculation rules API (although I don't even know if it's currently implemented in servo), but I have no clue if it would make this any easier to test...I'll just make a PR with what I have for now.
script: use ensure_blob_referenced_by_url_is_kept_alive in prefetch.rs
script: Use UrlWithBlobClaim::for_url in navigator.rs (servo#49636)
script: Use UrlWithBlobClaim::for_url in favicon.rs (servo#49774)