mirror of
https://github.com/servo/servo.git
synced 2025-08-03 04:30:10 +01:00
auto merge of #4173 : Manishearth/servo/a-more-dom-struct, r=kmcallister
Now `#[dom_struct]` also generates Reflectable impls, and there's another lint to ensure that a DOM struct only contains one bare DOM field (as the first field) or a Reflector. A lot of this was generated by sed -- each autogenerated change has its own commit for easy review; these will be squashed later.
This commit is contained in:
commit
56d1b16d1b
131 changed files with 289 additions and 794 deletions
|
@ -11,7 +11,7 @@ use dom::bindings::codegen::UnionTypes::FileOrString::{eFile, eString};
|
|||
use dom::bindings::error::{Fallible};
|
||||
use dom::bindings::global::{GlobalRef, GlobalField};
|
||||
use dom::bindings::js::{JS, JSRef, Temporary};
|
||||
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
|
||||
use dom::bindings::utils::{Reflector, reflect_dom_object};
|
||||
use dom::blob::Blob;
|
||||
use dom::file::File;
|
||||
use dom::htmlformelement::HTMLFormElement;
|
||||
|
@ -29,8 +29,8 @@ pub enum FormDatum {
|
|||
|
||||
#[dom_struct]
|
||||
pub struct FormData {
|
||||
data: DOMRefCell<HashMap<DOMString, Vec<FormDatum>>>,
|
||||
reflector_: Reflector,
|
||||
data: DOMRefCell<HashMap<DOMString, Vec<FormDatum>>>,
|
||||
global: GlobalField,
|
||||
form: Option<JS<HTMLFormElement>>
|
||||
}
|
||||
|
@ -38,8 +38,8 @@ pub struct FormData {
|
|||
impl FormData {
|
||||
fn new_inherited(form: Option<JSRef<HTMLFormElement>>, global: &GlobalRef) -> FormData {
|
||||
FormData {
|
||||
data: DOMRefCell::new(HashMap::new()),
|
||||
reflector_: Reflector::new(),
|
||||
data: DOMRefCell::new(HashMap::new()),
|
||||
global: GlobalField::from_rooted(global),
|
||||
form: form.map(|f| JS::from_rooted(f)),
|
||||
}
|
||||
|
@ -107,12 +107,6 @@ impl<'a> FormDataMethods for JSRef<'a, FormData> {
|
|||
}
|
||||
}
|
||||
|
||||
impl Reflectable for FormData {
|
||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||
&self.reflector_
|
||||
}
|
||||
}
|
||||
|
||||
trait PrivateFormDataHelpers{
|
||||
fn get_file_from_blob(&self, value: JSRef<Blob>, filename: Option<DOMString>) -> Temporary<File>;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue