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);
|
||||
return;
|
||||
}
|
||||
match ancestor.children()
|
||||
.find(|child| child.is::<HTMLLegendElement>()) {
|
||||
Some(ref legend) => {
|
||||
// XXXabinader: should we save previous ancestor to avoid this iteration?
|
||||
if node.ancestors().any(|ancestor| ancestor == *legend) {
|
||||
continue;
|
||||
}
|
||||
},
|
||||
None => (),
|
||||
if let Some(ref legend) = ancestor.children().find(|n| n.is::<HTMLLegendElement>()) {
|
||||
// XXXabinader: should we save previous ancestor to avoid this iteration?
|
||||
if node.ancestors().any(|ancestor| ancestor == *legend) {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
self.set_disabled_state(true);
|
||||
self.set_enabled_state(false);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue