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::error::Fallible;
|
|||
use dom::bindings::error::Error::{InvalidCharacter, NamespaceError};
|
||||
use dom::bindings::global::GlobalRef;
|
||||
use dom::bindings::js::{JS, JSRef, Root, Temporary, OptionalRootable};
|
||||
use dom::bindings::utils::{Reflector, Reflectable, reflect_dom_object};
|
||||
use dom::bindings::utils::{Reflector, reflect_dom_object};
|
||||
use dom::bindings::utils::xml_name_type;
|
||||
use dom::bindings::utils::XMLName::{QName, Name, InvalidXMLName};
|
||||
use dom::document::{Document, DocumentHelpers, IsHTMLDocument};
|
||||
|
@ -27,15 +27,15 @@ use servo_util::str::DOMString;
|
|||
|
||||
#[dom_struct]
|
||||
pub struct DOMImplementation {
|
||||
document: JS<Document>,
|
||||
reflector_: Reflector,
|
||||
document: JS<Document>,
|
||||
}
|
||||
|
||||
impl DOMImplementation {
|
||||
fn new_inherited(document: JSRef<Document>) -> DOMImplementation {
|
||||
DOMImplementation {
|
||||
document: JS::from_rooted(document),
|
||||
reflector_: Reflector::new(),
|
||||
document: JS::from_rooted(document),
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -47,12 +47,6 @@ impl DOMImplementation {
|
|||
}
|
||||
}
|
||||
|
||||
impl Reflectable for DOMImplementation {
|
||||
fn reflector<'a>(&'a self) -> &'a Reflector {
|
||||
&self.reflector_
|
||||
}
|
||||
}
|
||||
|
||||
// http://dom.spec.whatwg.org/#domimplementation
|
||||
impl<'a> DOMImplementationMethods for JSRef<'a, DOMImplementation> {
|
||||
// http://dom.spec.whatwg.org/#dom-domimplementation-createdocumenttype
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue