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:
bors-servo 2014-12-27 22:12:45 -07:00
commit 56d1b16d1b
131 changed files with 289 additions and 794 deletions

View file

@ -72,16 +72,16 @@ pub struct EventListenerEntry {
#[dom_struct]
pub struct EventTarget {
type_id: EventTargetTypeId,
reflector_: Reflector,
type_id: EventTargetTypeId,
handlers: DOMRefCell<HashMap<DOMString, Vec<EventListenerEntry>, FnvHasher>>,
}
impl EventTarget {
pub fn new_inherited(type_id: EventTargetTypeId) -> EventTarget {
EventTarget {
type_id: type_id,
reflector_: Reflector::new(),
type_id: type_id,
handlers: DOMRefCell::new(HashMap::with_hasher(FnvHasher)),
}
}
@ -301,12 +301,6 @@ impl<'a> EventTargetMethods for JSRef<'a, EventTarget> {
}
}
impl Reflectable for EventTarget {
fn reflector<'a>(&'a self) -> &'a Reflector {
&self.reflector_
}
}
impl<'a> VirtualMethods for JSRef<'a, EventTarget> {
fn super_type<'a>(&'a self) -> Option<&'a VirtualMethods> {
None