diff options
Diffstat (limited to 'components/script/dom/htmllabelelement.rs')
-rw-r--r-- | components/script/dom/htmllabelelement.rs | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/components/script/dom/htmllabelelement.rs b/components/script/dom/htmllabelelement.rs index 7042b98f0d7..90d4a16b86e 100644 --- a/components/script/dom/htmllabelelement.rs +++ b/components/script/dom/htmllabelelement.rs @@ -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 |