diff options
author | Gregory Terzian <gterzian@users.noreply.github.com> | 2019-09-01 03:18:42 +0800 |
---|---|---|
committer | Gregory Terzian <gterzian@users.noreply.github.com> | 2019-12-11 22:46:50 +0800 |
commit | 6e8a85482c2068d4dbccb992954271f725570f91 (patch) | |
tree | b30f6d82a018df0b196fa4d47d3b6667d708313e /components/script/body.rs | |
parent | 7aa68c8fe7ca0865a7323ab1e5b9526efa588ca2 (diff) | |
download | servo-6e8a85482c2068d4dbccb992954271f725570f91.tar.gz servo-6e8a85482c2068d4dbccb992954271f725570f91.zip |
re-structure blob, structured serialization
Diffstat (limited to 'components/script/body.rs')
-rw-r--r-- | components/script/body.rs | 8 |
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)) } |