servo: Merge #5456 - Rewrite NodeChildrenIterator to return Temporary (from Ms2ger:children); r=jdm

Source-Repo: https://github.com/servo/servo
Source-Revision: 88bc64444c99fc47febf8e99c0e19c6ae3500990
This commit is contained in:
Ms2ger
2015-04-02 05:15:38 -06:00
parent 80951f486a
commit 9e2c5e0024
12 changed files with 223 additions and 144 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();
}
}
},
_ => ()