Rewrite NodeChildrenIterator to return Temporary.

This commit is contained in:
Ms2ger 2015-03-30 14:12:20 +02:00
parent bc8ed81dc1
commit c8106da277
11 changed files with 208 additions and 129 deletions

View file

@ -69,9 +69,12 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLOptGroupElement> {
let node: JSRef<Node> = NodeCast::from_ref(*self);
node.set_disabled_state(true);
node.set_enabled_state(false);
for child in node.children().filter(|child| child.is_htmloptionelement()) {
child.set_disabled_state(true);
child.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);
}
}
},
_ => (),
@ -88,8 +91,11 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLOptGroupElement> {
let node: JSRef<Node> = NodeCast::from_ref(*self);
node.set_disabled_state(false);
node.set_enabled_state(true);
for child in node.children().filter(|child| child.is_htmloptionelement()) {
child.check_disabled_attribute();
for child in node.children() {
let child = child.root();
if child.r().is_htmloptionelement() {
child.r().check_disabled_attribute();
}
}
},
_ => ()