mirror of
https://github.com/servo/servo.git
synced 2025-08-04 13:10:20 +01:00
script: Simplify propagation of disabled state for form controls.
That's a silly exponential algorithm btw.
This commit is contained in:
parent
d1b175d145
commit
157ce33105
1 changed files with 5 additions and 9 deletions
|
@ -2663,15 +2663,11 @@ impl Element {
|
||||||
self.set_enabled_state(false);
|
self.set_enabled_state(false);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
match ancestor.children()
|
if let Some(ref legend) = ancestor.children().find(|n| n.is::<HTMLLegendElement>()) {
|
||||||
.find(|child| child.is::<HTMLLegendElement>()) {
|
// XXXabinader: should we save previous ancestor to avoid this iteration?
|
||||||
Some(ref legend) => {
|
if node.ancestors().any(|ancestor| ancestor == *legend) {
|
||||||
// XXXabinader: should we save previous ancestor to avoid this iteration?
|
continue;
|
||||||
if node.ancestors().any(|ancestor| ancestor == *legend) {
|
}
|
||||||
continue;
|
|
||||||
}
|
|
||||||
},
|
|
||||||
None => (),
|
|
||||||
}
|
}
|
||||||
self.set_disabled_state(true);
|
self.set_disabled_state(true);
|
||||||
self.set_enabled_state(false);
|
self.set_enabled_state(false);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue