diff options
author | Michael Wu <mwu@mozilla.com> | 2015-04-06 19:27:56 -0400 |
---|---|---|
committer | Michael Wu <mwu@mozilla.com> | 2015-06-19 18:42:48 -0400 |
commit | 675267b7822d2d6c30c0e36fc22e0191b741b973 (patch) | |
tree | 640b22869e8a7eb7d5657df3074f0b0ccd528c29 /components/script/dom/htmloptgroupelement.rs | |
parent | a256f39796270cd3a5f40f33eaa4e407117b0cc6 (diff) | |
download | servo-675267b7822d2d6c30c0e36fc22e0191b741b973.tar.gz servo-675267b7822d2d6c30c0e36fc22e0191b741b973.zip |
Upgrade to SM 39
Diffstat (limited to 'components/script/dom/htmloptgroupelement.rs')
-rw-r--r-- | components/script/dom/htmloptgroupelement.rs | 22 |
1 files changed, 10 insertions, 12 deletions
diff --git a/components/script/dom/htmloptgroupelement.rs b/components/script/dom/htmloptgroupelement.rs index 15e70190ba3..76f0a3c283e 100644 --- a/components/script/dom/htmloptgroupelement.rs +++ b/components/script/dom/htmloptgroupelement.rs @@ -8,7 +8,7 @@ use dom::bindings::codegen::Bindings::HTMLOptGroupElementBinding; use dom::bindings::codegen::Bindings::HTMLOptGroupElementBinding::HTMLOptGroupElementMethods; use dom::bindings::codegen::InheritTypes::{HTMLElementCast, NodeCast}; use dom::bindings::codegen::InheritTypes::{HTMLOptGroupElementDerived, HTMLOptionElementDerived}; -use dom::bindings::js::{JSRef, Rootable, Temporary}; +use dom::bindings::js::Root; use dom::document::Document; use dom::element::AttributeHandlers; use dom::eventtarget::{EventTarget, EventTargetTypeId}; @@ -35,7 +35,7 @@ impl HTMLOptGroupElementDerived for EventTarget { impl HTMLOptGroupElement { fn new_inherited(localName: DOMString, prefix: Option<DOMString>, - document: JSRef<Document>) -> HTMLOptGroupElement { + document: &Document) -> HTMLOptGroupElement { HTMLOptGroupElement { htmlelement: HTMLElement::new_inherited(HTMLElementTypeId::HTMLOptGroupElement, localName, prefix, document) @@ -45,13 +45,13 @@ impl HTMLOptGroupElement { #[allow(unrooted_must_root)] pub fn new(localName: DOMString, prefix: Option<DOMString>, - document: JSRef<Document>) -> Temporary<HTMLOptGroupElement> { + document: &Document) -> Root<HTMLOptGroupElement> { let element = HTMLOptGroupElement::new_inherited(localName, prefix, document); Node::reflect_node(box element, document, HTMLOptGroupElementBinding::Wrap) } } -impl<'a> HTMLOptGroupElementMethods for JSRef<'a, HTMLOptGroupElement> { +impl<'a> HTMLOptGroupElementMethods for &'a HTMLOptGroupElement { // https://www.whatwg.org/html#dom-optgroup-disabled make_bool_getter!(Disabled); @@ -59,24 +59,23 @@ impl<'a> HTMLOptGroupElementMethods for JSRef<'a, HTMLOptGroupElement> { make_bool_setter!(SetDisabled, "disabled"); } -impl<'a> VirtualMethods for JSRef<'a, HTMLOptGroupElement> { +impl<'a> VirtualMethods for &'a HTMLOptGroupElement { fn super_type<'b>(&'b self) -> Option<&'b VirtualMethods> { - let htmlelement: &JSRef<HTMLElement> = HTMLElementCast::from_borrowed_ref(self); + let htmlelement: &&HTMLElement = HTMLElementCast::from_borrowed_ref(self); Some(htmlelement as &VirtualMethods) } - fn after_set_attr(&self, attr: JSRef<Attr>) { + fn after_set_attr(&self, attr: &Attr) { if let Some(ref s) = self.super_type() { s.after_set_attr(attr); } match attr.local_name() { &atom!("disabled") => { - let node: JSRef<Node> = NodeCast::from_ref(*self); + let node = NodeCast::from_ref(*self); node.set_disabled_state(true); node.set_enabled_state(false); for child in node.children() { - let child = child.root(); if child.r().is_htmloptionelement() { child.r().set_disabled_state(true); child.r().set_enabled_state(false); @@ -87,18 +86,17 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLOptGroupElement> { } } - fn before_remove_attr(&self, attr: JSRef<Attr>) { + fn before_remove_attr(&self, attr: &Attr) { if let Some(ref s) = self.super_type() { s.before_remove_attr(attr); } match attr.local_name() { &atom!("disabled") => { - let node: JSRef<Node> = NodeCast::from_ref(*self); + let node = NodeCast::from_ref(*self); node.set_disabled_state(false); node.set_enabled_state(true); for child in node.children() { - let child = child.root(); if child.r().is_htmloptionelement() { child.r().check_disabled_attribute(); } |