servo: Merge #4799 - Mark HTMLAreaElement and KeyboardEvent as DOM structs (from Ms2ger:dom-structs); r=jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: 3286d2812a083aa4a081d888a40e86b0b12b5c20
This commit is contained in:
Ms2ger 2015-02-02 02:24:49 -07:00
Родитель 4ba063a3b5
Коммит f638baf1e4
2 изменённых файлов: 4 добавлений и 19 удалений

Просмотреть файл

@ -8,7 +8,7 @@ use dom::bindings::codegen::Bindings::HTMLAreaElementBinding::HTMLAreaElementMet
use dom::bindings::codegen::InheritTypes::{HTMLAreaElementDerived, HTMLElementCast};
use dom::bindings::codegen::InheritTypes::ElementCast;
use dom::bindings::js::{MutNullableJS, JSRef, Temporary};
use dom::bindings::utils::{Reflectable, Reflector};
use dom::bindings::utils::Reflectable;
use dom::document::Document;
use dom::domtokenlist::DOMTokenList;
use dom::element::ElementTypeId;
@ -21,9 +21,7 @@ use std::default::Default;
use string_cache::Atom;
use util::str::DOMString;
#[jstraceable]
#[must_root]
#[privatize]
#[dom_struct]
pub struct HTMLAreaElement {
htmlelement: HTMLElement,
rel_list: MutNullableJS<DOMTokenList>,
@ -64,12 +62,6 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLAreaElement> {
}
}
impl Reflectable for HTMLAreaElement {
fn reflector<'a>(&'a self) -> &'a Reflector {
self.htmlelement.reflector()
}
}
impl<'a> HTMLAreaElementMethods for JSRef<'a, HTMLAreaElement> {
fn RelList(self) -> Temporary<DOMTokenList> {
self.rel_list.or_init(|| {

Просмотреть файл

@ -9,7 +9,7 @@ use dom::bindings::codegen::InheritTypes::{EventCast, UIEventCast, KeyboardEvent
use dom::bindings::error::Fallible;
use dom::bindings::global::GlobalRef;
use dom::bindings::js::{JSRef, Temporary, RootedReference};
use dom::bindings::utils::{Reflectable, Reflector, reflect_dom_object};
use dom::bindings::utils::{Reflectable, reflect_dom_object};
use dom::event::{Event, EventTypeId};
use dom::uievent::UIEvent;
use dom::window::Window;
@ -19,8 +19,7 @@ use util::str::DOMString;
use std::borrow::ToOwned;
use std::cell::{RefCell, Cell};
#[jstraceable]
#[must_root]
#[dom_struct]
pub struct KeyboardEvent {
uievent: UIEvent,
key: RefCell<DOMString>,
@ -632,9 +631,3 @@ impl<'a> KeyboardEventMethods for JSRef<'a, KeyboardEvent> {
self.char_code.get().unwrap_or(self.KeyCode())
}
}
impl Reflectable for KeyboardEvent {
fn reflector<'a>(&'a self) -> &'a Reflector {
self.uievent.reflector()
}
}