mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
Fix file-type input element
This commit is contained in:
parent
5478e605ae
commit
6ca531fb8f
8 changed files with 15 additions and 182 deletions
|
@ -302,6 +302,14 @@ impl HTMLInputElementMethods for HTMLInputElement {
|
|||
self.form_owner()
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-input-files
|
||||
fn GetFiles(&self) -> Option<Root<FileList>> {
|
||||
match self.filelist.get() {
|
||||
Some(ref fl) => Some(fl.clone()),
|
||||
None => None,
|
||||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/#dom-input-defaultchecked
|
||||
make_bool_getter!(DefaultChecked, "checked");
|
||||
|
||||
|
@ -796,6 +804,12 @@ impl VirtualMethods for HTMLInputElement {
|
|||
el.set_read_write_state(false);
|
||||
}
|
||||
|
||||
if new_type == InputType::InputFile {
|
||||
let window = window_from_node(self);
|
||||
let filelist = FileList::new(window.r(), vec![]);
|
||||
self.filelist.set(Some(&filelist));
|
||||
}
|
||||
|
||||
let new_value_mode = self.value_mode();
|
||||
|
||||
match (&old_value_mode, old_idl_value.is_empty(), new_value_mode) {
|
||||
|
|
|
@ -13,7 +13,7 @@ interface HTMLInputElement : HTMLElement {
|
|||
attribute DOMString dirName;
|
||||
attribute boolean disabled;
|
||||
readonly attribute HTMLFormElement? form;
|
||||
//readonly attribute FileList? files;
|
||||
readonly attribute FileList? files;
|
||||
attribute DOMString formAction;
|
||||
attribute DOMString formEnctype;
|
||||
attribute DOMString formMethod;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue