diff options
Diffstat (limited to 'components/script/dom/file.rs')
-rw-r--r-- | components/script/dom/file.rs | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/components/script/dom/file.rs b/components/script/dom/file.rs index 75f73aeda59..f9b181dbf1a 100644 --- a/components/script/dom/file.rs +++ b/components/script/dom/file.rs @@ -54,7 +54,8 @@ impl File { let global = GlobalRef::Window(window); - File::new(global, BlobImpl::new_from_file(selected.id), name, Some(selected.modified as i64), "") + File::new(global, BlobImpl::new_from_file(selected.id, selected.filename, selected.size), + name, Some(selected.modified as i64), &selected.type_string) } // https://w3c.github.io/FileAPI/#file-constructor @@ -69,10 +70,13 @@ impl File { }; let ref blobPropertyBag = filePropertyBag.parent; - let typeString = blobPropertyBag.get_typestring(); + let ref typeString = blobPropertyBag.type_; let modified = filePropertyBag.lastModified; - Ok(File::new(global, BlobImpl::new_from_bytes(bytes), filename, modified, &typeString)) + // NOTE: Following behaviour might be removed in future, + // see https://github.com/w3c/FileAPI/issues/41 + let replaced_filename = DOMString::from_string(filename.replace("/", ":")); + Ok(File::new(global, BlobImpl::new_from_bytes(bytes), replaced_filename, modified, typeString)) } pub fn name(&self) -> &DOMString { |