Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplement Blob URL's DOM interfaces #11716
Conversation
highfive
commented
Jun 10, 2016
|
Heads up! This PR modifies the following files:
|
highfive
commented
Jun 10, 2016
|
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(), |
This comment has been minimized.
This comment has been minimized.
Manishearth
Jun 10, 2016
Member
Shoudlnt we be checking for file blobs? And slice blobs, but you haven't implemented that yet.
This comment has been minimized.
This comment has been minimized.
izgzhen
Jun 11, 2016
Author
Contributor
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 |
highfive
commented
Jun 11, 2016
|
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 |
This comment has been minimized.
This comment has been minimized.
|
|
||
| // https://w3c.github.io/FileAPI/#unicodeSerializationOfBlobURL | ||
| fn unicode_serialization_blob_url(origin: &str, id: &str) -> String { | ||
| // Step 1, 2 |
This comment has been minimized.
This comment has been minimized.
izgzhen
Jun 11, 2016
Author
Contributor
filled now. I feel like there is no more gaps to fill in this PR topic.
|
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 -->
highfive
commented
Jun 11, 2016
|
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 |
This comment has been minimized.
This comment has been minimized.
Manishearth
Jun 11, 2016
Member
Why not?
Anyway, this step seems to already be run on the fm thread, sort of.
This comment has been minimized.
This comment has been minimized.
Manishearth
Jun 14, 2016
Member
Change this comment to mention that the first step is unnecessary, since closed blobs do not exist in the store.
|
@bors-servo r+ |
|
|
|
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+ |
|
|
|
Ahh my bad ... I thought both the ini and the metadata needs to be updated |
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 |
|
|
highfive
commented
Jun 14, 2016
|
|
@jdm Before I retry, do I have to consider the "Worker::PostMessage panicked" problem? |
|
|
|
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). |
|
|
|
@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))); |
This comment has been minimized.
This comment has been minimized.
|
@bors-servo: r=Manishearth |
|
|
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 -->
|
|
izgzhen commentedJun 10, 2016
•
edited
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