Repository navigation
Implement Blob URL's DOM interfaces - #11716
Conversation
|
Heads up! This PR modifies the following files:
|
|
I am still not very sure about how to deal with this: the net thread need the There are also other holes in the code, I might fix them later in this PR or following ones. |
|
For now just send it from the script thread and add a comment saying that net should actually be determining it from the pipeline id. Fetch/http_loader does this too right now. Its wrong, but I wouldn't bother fixing it for the purpose of this pr. If you want to we can try and fix it once everything else is working, otherwise it is on my list-of-things-I'll-eventually-do 😄 |
| type_string: blob.Type().to_string(), | ||
| filename: None, // XXX: the filename is currently only in File object now | ||
| size: blob.Size(), | ||
| bytes: bytes.to_vec(), |
There was a problem hiding this comment.
Shoudlnt we be checking for file blobs? And slice blobs, but you haven't implemented that yet.
There was a problem hiding this comment.
Yes, you are right. I haven't yet make Blob as powerful as it is expected to. But this field is necessary anyway.
Cool. Do we have an issue or something to track this? |
|
Good idea. #11722 |
|
Okay, for now send the origin from script (and leave a comment saying we shouldn't trust it linking to that issue). If you want, we could land this first and focus on file blob uris later, or fix it in this PR itself, either way works for me. |
|
Okay, I still have several gaps to fill. I am okay with the idea of leave a comment if the |
|
New code was committed to pull request. |
| // https://w3c.github.io/FileAPI/#dfn-createObjectURL | ||
| pub fn CreateObjectURL(global: GlobalRef, blob: &Blob) -> DOMString { | ||
| /// XXX: Second field is an unicode-serialized Origin, it is a temporary workaround | ||
| /// and should not be trusted. See issue https://github.com/servo/servo/issues/11722 |
There was a problem hiding this comment.
Noted both here and in BlobURLStoreMsg definition.
|
Do any new wpt tests pass? Do you know how to update expectations? @bors-servo try |
Implement Blob URL's DOM interfaces r? @Manishearth Implement the two functions in `URL` to create/revoke Blob URLs, and related code to approximate our proposed design to make things work together. <!-- Please describe your changes on the following line: --> --- <!-- 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 part of #10539, related to #11131 <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because _____ <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11716) <!-- Reviewable:end -->
|
New code was committed to pull request. |
Yes, sorry about that I forgot to check this out. I have pushed the new code. |
|
|
||
| this method call does nothing. User agents may display a message on the error console. | ||
|
|
||
| XXX: First condition can't be enforced given current design |
There was a problem hiding this comment.
Why not?
Anyway, this step seems to already be run on the fm thread, sort of.
There was a problem hiding this comment.
Change this comment to mention that the first step is unnecessary, since closed blobs do not exist in the store.
|
@bors-servo r+ |
|
📌 Commit 6672534 has been approved by |
|
looks like the manifest_changed thing failed. Apply this diff, and r=manishearth diff --git a/tests/wpt/metadata/MANIFEST.json b/tests/wpt/metadata/MANIFEST.json
index f7861cb..9689adf 100644
--- a/tests/wpt/metadata/MANIFEST.json
+++ b/tests/wpt/metadata/MANIFEST.json
@@ -36026,6 +36026,12 @@
"deleted_reftests": {},
"items": {
"testharness": {
+ "FileAPI/url/url_xmlhttprequest.html": [
+ {
+ "path": "FileAPI/url/url_xmlhttprequest.html",
+ "url": "/FileAPI/url/url_xmlhttprequest.html"
+ }
+ ],
"cssom-view/scrolling-no-browsing-context.html": [
{
"path": "cssom-view/scrolling-no-browsing-context.html",
@bors-servo r- delegate+ |
|
✌️ @izgzhen can now approve this pull request |
|
Ahh my bad ... I thought both the ini and the metadata needs to be updated |
|
New code was committed to pull request. |
|
Implement Blob URL's DOM interfaces r? @Manishearth Implement the two functions in `URL` to create/revoke Blob URLs, and related code to approximate our proposed design to make things work together. <!-- Please describe your changes on the following line: --> --- <!-- 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 part of #10539, related to #11131 <!-- Either: --> - [x] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11716) <!-- Reviewable:end -->
oh, it tried to run a worker with a blob url. I didn't notice that 😄 |
|
💔 Test failed - linux-rel |
|
|
@jdm Before I retry, do I have to consider the "Worker::PostMessage panicked" problem? |
|
☔ The latest upstream changes (presumably #11717) made this pull request unmergeable. Please resolve the merge conflicts. |
|
Yes, I would prefer that. |
|
@jdm I checked the code a bit and found that the worker constructor will load resource ( However, since I have not yet routed the Besides, I can't reproduce this locally, and also I am not ready to route the blob URL request yet (still needs more integration), I personally prefer to check if this PR will break again on homu and maybe submit a new issue for it (if it is unreproducible). |
|
☔ The latest upstream changes (presumably #11764) made this pull request unmergeable. Please resolve the merge conflicts. |
|
@izgzhen It should be enough to use |
|
|
||
| // NOTE: step 9 of https://html.spec.whatwg.org/multipage/comms.html#dom-messageport-postmessage | ||
| // indicates that a nonexistent communication channel should result in a silent error. | ||
| let _ = self.sender.send((address, WorkerScriptMsg::DOMMessage(data))); |
|
@bors-servo: r=Manishearth |
|
📌 Commit 4d33793 has been approved by |
Implement Blob URL's DOM interfaces r? @Manishearth Implement the two functions in `URL` to create/revoke Blob URLs, and related code to approximate our proposed design to make things work together. <!-- Please describe your changes on the following line: --> --- <!-- 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 part of #10539, related to #11131 <!-- Either: --> - [x] There are tests for these changes OR <!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. --> <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/11716) <!-- Reviewable:end -->
|
☀️ Test successful - android, arm32, arm64, linux-dev, linux-rel, mac-dev-unit, mac-rel-css, mac-rel-wpt, windows |
r? @Manishearth
Implement the two functions in
URLto create/revoke Blob URLs, and related code to approximate our proposed design to make things work together../mach build -ddoes not report any errors./mach test-tidydoes not report any errorsThis change is