diff options
Diffstat (limited to 'components/script/dom/blob.rs')
-rw-r--r-- | components/script/dom/blob.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/components/script/dom/blob.rs b/components/script/dom/blob.rs index b42bcce573e..37a526eb15c 100644 --- a/components/script/dom/blob.rs +++ b/components/script/dom/blob.rs @@ -21,12 +21,12 @@ use util::str::DOMString; pub struct Blob { reflector_: Reflector, bytes: Option<Vec<u8>>, - typeString: DOMString, + typeString: String, global: GlobalField, isClosed_: Cell<bool> } -fn is_ascii_printable(string: &DOMString) -> bool { +fn is_ascii_printable(string: &str) -> bool { // Step 5.1 in Sec 5.1 of File API spec // http://dev.w3.org/2006/webapi/FileAPI/#constructorBlob string.chars().all(|c| { c >= '\x20' && c <= '\x7E' }) @@ -60,7 +60,7 @@ impl Blob { pub fn Constructor_(global: GlobalRef, blobParts: DOMString, blobPropertyBag: &BlobBinding::BlobPropertyBag) -> Fallible<Root<Blob>> { //TODO: accept other blobParts types - ArrayBuffer or ArrayBufferView or Blob - let bytes: Option<Vec<u8>> = Some(blobParts.into_bytes()); + let bytes: Option<Vec<u8>> = Some(blobParts.0.into_bytes()); let typeString = if is_ascii_printable(&blobPropertyBag.type_) { &*blobPropertyBag.type_ } else { @@ -85,7 +85,7 @@ impl BlobMethods for Blob { // https://dev.w3.org/2006/webapi/FileAPI/#dfn-type fn Type(&self) -> DOMString { - self.typeString.clone() + DOMString(self.typeString.clone()) } // https://dev.w3.org/2006/webapi/FileAPI/#slice-method-algo |