aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmloptionelement.rs
diff options
context:
space:
mode:
authorBobby Holley <bobbyholley@gmail.com>2015-10-07 20:02:00 -0700
committerBobby Holley <bobbyholley@gmail.com>2015-10-16 17:56:31 -0700
commit75ec093334ff8f8f7ef41b90007588b924c40731 (patch)
treeba73c6dc51812c01f118e63c90ede1d8638f060d /components/script/dom/htmloptionelement.rs
parent628c2a04326b27ac2743771dca52612c8ce30ad2 (diff)
downloadservo-75ec093334ff8f8f7ef41b90007588b924c40731.tar.gz
servo-75ec093334ff8f8f7ef41b90007588b924c40731.zip
Move Event States to |Element|.
Conceptually they belong there, rather than on |Node|. Fixes #7934.
Diffstat (limited to 'components/script/dom/htmloptionelement.rs')
-rw-r--r--components/script/dom/htmloptionelement.rs27
1 files changed, 14 insertions, 13 deletions
diff --git a/components/script/dom/htmloptionelement.rs b/components/script/dom/htmloptionelement.rs
index 74454c14355..b84fc43af34 100644
--- a/components/script/dom/htmloptionelement.rs
+++ b/components/script/dom/htmloptionelement.rs
@@ -12,9 +12,9 @@ use dom::bindings::codegen::InheritTypes::{HTMLElementCast, HTMLScriptElementDer
use dom::bindings::codegen::InheritTypes::{NodeCast, TextDerived};
use dom::bindings::js::Root;
use dom::document::Document;
-use dom::element::{AttributeMutation, Element};
+use dom::element::{AttributeMutation, Element, IN_ENABLED_STATE};
use dom::htmlelement::HTMLElement;
-use dom::node::{IN_ENABLED_STATE, Node, NodeFlags};
+use dom::node::{Node};
use dom::virtualmethods::VirtualMethods;
use std::cell::Cell;
use util::str::{DOMString, split_html_space_chars, str_join};
@@ -36,7 +36,7 @@ impl HTMLOptionElement {
document: &Document) -> HTMLOptionElement {
HTMLOptionElement {
htmlelement:
- HTMLElement::new_inherited_with_flags(NodeFlags::new() | IN_ENABLED_STATE,
+ HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document),
selectedness: Cell::new(false),
dirtiness: Cell::new(false),
@@ -151,16 +151,16 @@ impl VirtualMethods for HTMLOptionElement {
self.super_type().unwrap().attribute_mutated(attr, mutation);
match attr.local_name() {
&atom!(disabled) => {
- let node = NodeCast::from_ref(self);
+ let el = ElementCast::from_ref(self);
match mutation {
AttributeMutation::Set(_) => {
- node.set_disabled_state(true);
- node.set_enabled_state(false);
+ el.set_disabled_state(true);
+ el.set_enabled_state(false);
},
AttributeMutation::Removed => {
- node.set_disabled_state(false);
- node.set_enabled_state(true);
- node.check_parent_disabled_state_for_option();
+ el.set_disabled_state(false);
+ el.set_enabled_state(true);
+ el.check_parent_disabled_state_for_option();
}
}
},
@@ -189,8 +189,8 @@ impl VirtualMethods for HTMLOptionElement {
s.bind_to_tree(tree_in_doc);
}
- let node = NodeCast::from_ref(self);
- node.check_parent_disabled_state_for_option();
+ let el = ElementCast::from_ref(self);
+ el.check_parent_disabled_state_for_option();
}
fn unbind_from_tree(&self, tree_in_doc: bool) {
@@ -199,10 +199,11 @@ impl VirtualMethods for HTMLOptionElement {
}
let node = NodeCast::from_ref(self);
+ let el = ElementCast::from_ref(self);
if node.GetParentNode().is_some() {
- node.check_parent_disabled_state_for_option();
+ el.check_parent_disabled_state_for_option();
} else {
- node.check_disabled_attribute();
+ el.check_disabled_attribute();
}
}
}