Upgrade to SM 39

This commit is contained in:
Michael Wu 2015-04-06 19:27:56 -04:00
parent a256f39796
commit 675267b782
205 changed files with 6546 additions and 5340 deletions

View file

@ -9,7 +9,7 @@ use dom::bindings::codegen::InheritTypes::{HTMLElementCast, NodeCast};
use dom::bindings::codegen::InheritTypes::{HTMLSelectElementDerived, HTMLFieldSetElementDerived};
use dom::bindings::codegen::UnionTypes::HTMLElementOrLong;
use dom::bindings::codegen::UnionTypes::HTMLOptionElementOrHTMLOptGroupElement;
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};
@ -42,7 +42,7 @@ static DEFAULT_SELECT_SIZE: u32 = 0;
impl HTMLSelectElement {
fn new_inherited(localName: DOMString,
prefix: Option<DOMString>,
document: JSRef<Document>) -> HTMLSelectElement {
document: &Document) -> HTMLSelectElement {
HTMLSelectElement {
htmlelement:
HTMLElement::new_inherited(HTMLElementTypeId::HTMLSelectElement, localName, prefix, document)
@ -52,15 +52,15 @@ impl HTMLSelectElement {
#[allow(unrooted_must_root)]
pub fn new(localName: DOMString,
prefix: Option<DOMString>,
document: JSRef<Document>) -> Temporary<HTMLSelectElement> {
document: &Document) -> Root<HTMLSelectElement> {
let element = HTMLSelectElement::new_inherited(localName, prefix, document);
Node::reflect_node(box element, document, HTMLSelectElementBinding::Wrap)
}
}
impl<'a> HTMLSelectElementMethods for JSRef<'a, HTMLSelectElement> {
fn Validity(self) -> Temporary<ValidityState> {
let window = window_from_node(self).root();
impl<'a> HTMLSelectElementMethods for &'a HTMLSelectElement {
fn Validity(self) -> Root<ValidityState> {
let window = window_from_node(self);
ValidityState::new(window.r())
}
@ -102,20 +102,20 @@ impl<'a> HTMLSelectElementMethods for JSRef<'a, HTMLSelectElement> {
}
}
impl<'a> VirtualMethods for JSRef<'a, HTMLSelectElement> {
impl<'a> VirtualMethods for &'a HTMLSelectElement {
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);
},
@ -123,14 +123,14 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLSelectElement> {
}
}
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);
node.check_ancestors_disabled_state_for_form_control();
@ -144,7 +144,7 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLSelectElement> {
s.bind_to_tree(tree_in_doc);
}
let node: JSRef<Node> = NodeCast::from_ref(*self);
let node = NodeCast::from_ref(*self);
node.check_ancestors_disabled_state_for_form_control();
}
@ -153,8 +153,8 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLSelectElement> {
s.unbind_from_tree(tree_in_doc);
}
let node: JSRef<Node> = NodeCast::from_ref(*self);
if node.ancestors().any(|ancestor| ancestor.root().r().is_htmlfieldsetelement()) {
let node = NodeCast::from_ref(*self);
if node.ancestors().any(|ancestor| ancestor.r().is_htmlfieldsetelement()) {
node.check_ancestors_disabled_state_for_form_control();
} else {
node.check_disabled_attribute();