Fix HtmlLabelElement activation to run on correct element

Also removes old code that caused radio button clicks on disabled elements
This commit is contained in:
Rebecca 2016-03-29 18:48:07 -04:00
parent 183772583f
commit 3c7e6a4be8
2 changed files with 9 additions and 10 deletions

View file

@ -63,12 +63,15 @@ impl Activatable for HTMLLabelElement {
// https://html.spec.whatwg.org/multipage/#run-post-click-activation-steps
fn activation_behavior(&self, _event: &Event, _target: &EventTarget) {
synthetic_click_activation(self.upcast::<Element>(),
false,
false,
false,
false,
ActivationSource::NotFromClick);
if let Some(e) = self.GetControl() {
let elem = e.upcast::<Element>();
synthetic_click_activation(elem,
false,
false,
false,
false,
ActivationSource::NotFromClick);
}
}
// https://html.spec.whatwg.org/multipage/#implicit-submission