mirror of
https://github.com/servo/servo.git
synced 2025-08-10 16:05:43 +01:00
Fixes related to file input and File API
This commit is contained in:
parent
e65009f317
commit
e0f3cdafe1
3 changed files with 15 additions and 6 deletions
|
@ -18,14 +18,15 @@ pub struct File {
|
|||
}
|
||||
|
||||
impl File {
|
||||
fn new_inherited(_file_bits: &Blob, name: DOMString) -> File {
|
||||
fn new_inherited(file_bits: &Blob, name: DOMString) -> File {
|
||||
// TODO: FilePropertyBag
|
||||
let mut bytes = Vec::new();
|
||||
bytes.extend_from_slice(file_bits.get_data().get_all_bytes().as_slice());
|
||||
|
||||
File {
|
||||
//TODO: get type from the underlying filesystem instead of "".to_string()
|
||||
blob: Blob::new_inherited(Arc::new(Vec::new()), None, None, ""),
|
||||
blob: Blob::new_inherited(Arc::new(bytes), None, None, ""),
|
||||
name: name,
|
||||
}
|
||||
// XXXManishearth Once Blob is able to store data
|
||||
// the relevant subfields of file_bits should be copied over
|
||||
}
|
||||
|
||||
pub fn new(global: GlobalRef, file_bits: &Blob, name: DOMString) -> Root<File> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue