aboutsummaryrefslogtreecommitdiffstats
path: root/components/script/dom/htmlfieldsetelement.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/htmlfieldsetelement.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/htmlfieldsetelement.rs')
-rw-r--r--components/script/dom/htmlfieldsetelement.rs23
1 files changed, 13 insertions, 10 deletions
diff --git a/components/script/dom/htmlfieldsetelement.rs b/components/script/dom/htmlfieldsetelement.rs
index c50f3bf6756..2eb696affb8 100644
--- a/components/script/dom/htmlfieldsetelement.rs
+++ b/components/script/dom/htmlfieldsetelement.rs
@@ -5,16 +5,16 @@
use dom::attr::Attr;
use dom::bindings::codegen::Bindings::HTMLFieldSetElementBinding;
use dom::bindings::codegen::Bindings::HTMLFieldSetElementBinding::HTMLFieldSetElementMethods;
-use dom::bindings::codegen::InheritTypes::{ElementTypeId, HTMLElementCast};
+use dom::bindings::codegen::InheritTypes::{ElementCast, ElementTypeId, HTMLElementCast};
use dom::bindings::codegen::InheritTypes::{HTMLElementTypeId, HTMLLegendElementDerived};
use dom::bindings::codegen::InheritTypes::{NodeCast, NodeTypeId};
use dom::bindings::js::{Root, RootedReference};
use dom::document::Document;
-use dom::element::{AttributeMutation, Element};
+use dom::element::{AttributeMutation, Element, IN_ENABLED_STATE};
use dom::htmlcollection::{CollectionFilter, HTMLCollection};
use dom::htmlelement::HTMLElement;
use dom::htmlformelement::{FormControl, HTMLFormElement};
-use dom::node::{IN_ENABLED_STATE, Node, NodeFlags, window_from_node};
+use dom::node::{Node, window_from_node};
use dom::validitystate::ValidityState;
use dom::virtualmethods::VirtualMethods;
use util::str::{DOMString, StaticStringVec};
@@ -30,7 +30,7 @@ impl HTMLFieldSetElement {
document: &Document) -> HTMLFieldSetElement {
HTMLFieldSetElement {
htmlelement:
- HTMLElement::new_inherited_with_flags(NodeFlags::new() | IN_ENABLED_STATE,
+ HTMLElement::new_inherited_with_state(IN_ENABLED_STATE,
localName, prefix, document)
}
}
@@ -99,8 +99,9 @@ impl VirtualMethods for HTMLFieldSetElement {
AttributeMutation::Removed => false,
};
let node = NodeCast::from_ref(self);
- node.set_disabled_state(disabled_state);
- node.set_enabled_state(!disabled_state);
+ let el = ElementCast::from_ref(self);
+ el.set_disabled_state(disabled_state);
+ el.set_enabled_state(!disabled_state);
let mut found_legend = false;
let children = node.children().filter(|node| {
if found_legend {
@@ -135,13 +136,15 @@ impl VirtualMethods for HTMLFieldSetElement {
});
if disabled_state {
for field in fields {
- field.set_disabled_state(true);
- field.set_enabled_state(false);
+ let el = ElementCast::to_ref(field.r()).unwrap();
+ el.set_disabled_state(true);
+ el.set_enabled_state(false);
}
} else {
for field in fields {
- field.check_disabled_attribute();
- field.check_ancestors_disabled_state_for_form_control();
+ let el = ElementCast::to_ref(field.r()).unwrap();
+ el.check_disabled_attribute();
+ el.check_ancestors_disabled_state_for_form_control();
}
}
},