aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/body.rs
diff options
context:
space:
mode:
authorbors-servo <lbergstrom+bors@mozilla.com>2019-12-19 16:16:56 -0500
committerGitHub <noreply@github.com>2019-12-19 16:16:56 -0500
commitbac9903fbeed0a394a86c0091e727aada665433d (patch)
tree15f61a4fdcc8bbcc09f10a39e25495fb49cb9a75 /components/script/body.rs
parentaa36d5f657eb32b59d994d08b177a02372b4b01c (diff)
parent6e8a85482c2068d4dbccb992954271f725570f91 (diff)
downloadservo-bac9903fbeed0a394a86c0091e727aada665433d.tar.gz
servo-bac9903fbeed0a394a86c0091e727aada665433d.zip
Auto merge of #24123 - gterzian:redo_blob, r=jdm
Restructure Blob, structured serialization <!-- Please describe your changes on the following line: --> FIX #24052 and also address the "cloning" half of FIX #23917 --- <!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: --> - [ ] `./mach build -d` does not report any errors - [ ] `./mach test-tidy` does not report any errors - [ ] These changes fix #___ (GitHub issue number if applicable) <!-- Either: --> - [ ] There are tests for these changes OR - [ ] These changes do not require tests because ___ <!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.--> <!-- 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="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/24123) <!-- Reviewable:end -->
Diffstat (limited to 'components/script/body.rs')
-rw-r--r--components/script/body.rs8
1 files changed, 6 insertions, 2 deletions
diff --git a/components/script/body.rs b/components/script/body.rs
index 728315bf1fa..e38dd1b0a98 100644
--- a/components/script/body.rs
+++ b/components/script/body.rs
@@ -9,7 +9,7 @@ use crate::dom::bindings::reflector::DomObject;
use crate::dom::bindings::root::DomRoot;
use crate::dom::bindings::str::USVString;
use crate::dom::bindings::trace::RootedTraceableBox;
-use crate::dom::blob::{Blob, BlobImpl};
+use crate::dom::blob::{normalize_type_string, Blob};
use crate::dom::formdata::FormData;
use crate::dom::globalscope::GlobalScope;
use crate::dom::promise::Promise;
@@ -24,6 +24,7 @@ use js::rust::wrappers::JS_GetPendingException;
use js::rust::wrappers::JS_ParseJSON;
use js::typedarray::{ArrayBuffer, CreateWith};
use mime::{self, Mime};
+use script_traits::serializable::BlobImpl;
use std::cell::Ref;
use std::ptr;
use std::rc::Rc;
@@ -166,7 +167,10 @@ fn run_blob_data_algorithm(
} else {
"".to_string()
};
- let blob = Blob::new(root, BlobImpl::new_from_bytes(bytes), mime_string);
+ let blob = Blob::new(
+ root,
+ BlobImpl::new_from_bytes(bytes, normalize_type_string(&mime_string)),
+ );
Ok(FetchedData::BlobData(blob))
}