servo/components/script
bors-servo 37f26f5250
Auto merge of #29451 - servo:fix-blob-slice-text, r=Loirooriol
script: fix BorrowError in (new Blob).slice(0,0).text()

When getting the text of a sliced Blob, we call GlobalScope.get_blob_url_id, which borrows the blob_state field mutably and calls the get_blob_size method (aka [Blob#size](https://w3c.github.io/FileAPI/#dfn-size)), which tries to borrow the same field immutably, causing a panic.

This patch inlines the relevant parts of get_blob_size into get_blob_url_id, so we can reuse the mutable borrow.

* /FileAPI/Blob-methods-from-detached-frame.html was 4/4 FAIL, will be 4/4 PASS once #29396 also lands
* /fetch/api/basic/scheme-blob.sub.any.html was CRASH, now 10/17 PASS and 7/17 FAIL
* /fetch/api/basic/scheme-blob.sub.any.worker.html was CRASH, now 10/17 PASS and 7/17 FAIL

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [x] `./mach build -d` does not report any errors
- [x] `./mach test-tidy` does not report any errors
- [x] These changes fix #29450

<!-- Either: -->
- [x] There are tests for these changes OR
- [ ] These changes do not require tests because ___
2023-03-02 17:04:58 +01:00
..
docs Update doc links and code snippet for trace implementation 2020-05-03 19:03:33 +05:30
dom Auto merge of #29451 - servo:fix-blob-slice-text, r=Loirooriol 2023-03-02 17:04:58 +01:00
task_source
animation_timeline.rs Move most animation processing to script 2020-05-12 10:22:14 +02:00
animations.rs fix(script): request animation ticks if Animations::pending_events is not empty 2023-02-10 14:44:27 +01:00
body.rs fix streaming request bodies, terminate fetch if the body stream errors 2020-06-16 13:14:38 +08:00
build.rs Port some code to Python3 2021-02-18 09:35:46 -05:00
canvas_state.rs Bump euclid to 0.22 2023-01-26 08:59:21 +01:00
Cargo.toml Switch to the sha2 crate for SRI digests. 2023-02-24 18:38:06 -08:00
clipboard_provider.rs
devtools.rs Update mozjs. 2021-02-18 09:35:45 -05:00
document_loader.rs
euclidext.rs Update euclid 2020-04-07 08:51:08 -07:00
fetch.rs Make url for "client" referrer mandatory 2020-06-17 19:07:14 +02:00
image_listener.rs Refactor ImageCache::find_image_or_metadata API. 2020-04-17 11:58:18 -04:00
init.rs Added is_platform_object_static check to is_dom_object 2020-11-26 18:40:41 -05:00
layout_image.rs Make url for "client" referrer mandatory 2020-06-17 19:07:14 +02:00
lib.rs Fix warnings. 2022-04-01 00:36:48 -04:00
mem.rs
microtask.rs ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
network_listener.rs
realms.rs
script_module.rs Format. 2022-11-23 10:04:53 -05:00
script_runtime.rs Format. 2022-11-23 10:04:53 -05:00
script_thread.rs fix(script): request animation ticks if Animations::pending_events is not empty 2023-02-10 14:44:27 +01:00
serviceworker_manager.rs feat: shorten thread names 2021-07-19 00:57:48 +09:00
stylesheet_loader.rs Fix invalid use of ReferrerUrl 2020-06-17 19:07:15 +02:00
stylesheet_set.rs
task.rs ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
task_manager.rs ensure clean shutdown of all threads running JS 2020-06-30 13:22:38 +08:00
task_queue.rs
test.rs
textinput.rs Form constraints validation 2020-04-02 10:16:46 +02:00
timers.rs Set private reference for classic script 2020-07-18 00:43:34 +09:00
unpremultiplytable.rs
webdriver_handlers.rs Update mozjs to 0.14.1 2020-08-28 20:54:18 +08:00