Use a simple Temporary value in TreeIterator

This commit is contained in:
Anthony Ramine 2015-04-11 14:12:44 +02:00
parent c026825e69
commit e20d997b37
9 changed files with 156 additions and 133 deletions

View file

@ -104,13 +104,14 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLFieldSetElement> {
}
for descendant in child.r().traverse_preorder() {
match descendant.type_id() {
let descendant = descendant.root();
match descendant.r().type_id() {
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLButtonElement)) |
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLInputElement)) |
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLSelectElement)) |
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTextAreaElement)) => {
descendant.set_disabled_state(true);
descendant.set_enabled_state(false);
descendant.r().set_disabled_state(true);
descendant.r().set_enabled_state(false);
},
_ => ()
}
@ -142,13 +143,14 @@ impl<'a> VirtualMethods for JSRef<'a, HTMLFieldSetElement> {
}
for descendant in child.r().traverse_preorder() {
match descendant.type_id() {
let descendant = descendant.root();
match descendant.r().type_id() {
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLButtonElement)) |
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLInputElement)) |
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLSelectElement)) |
NodeTypeId::Element(ElementTypeId::HTMLElement(HTMLElementTypeId::HTMLTextAreaElement)) => {
descendant.check_disabled_attribute();
descendant.check_ancestors_disabled_state_for_form_control();
descendant.r().check_disabled_attribute();
descendant.r().check_ancestors_disabled_state_for_form_control();
},
_ => ()
}