diff options
author | Rebecca <rebstar6@gmail.com> | 2016-03-29 18:48:07 -0400 |
---|---|---|
committer | Rebecca <rebstar6@gmail.com> | 2016-03-29 18:48:07 -0400 |
commit | 3c7e6a4be83ce406a21c6b23fd1a89ddaa2a67d2 (patch) | |
tree | a501e67ec0e655755a8d10a9c6ab04da459a57d1 /components/script/dom | |
parent | 183772583fcbb1f8103e8d6542a620134ba9182e (diff) | |
download | servo-3c7e6a4be83ce406a21c6b23fd1a89ddaa2a67d2.tar.gz servo-3c7e6a4be83ce406a21c6b23fd1a89ddaa2a67d2.zip |
Fix HtmlLabelElement activation to run on correct element
Also removes old code that caused radio button clicks on disabled elements
Diffstat (limited to 'components/script/dom')
-rw-r--r-- | components/script/dom/htmlinputelement.rs | 4 | ||||
-rw-r--r-- | components/script/dom/htmllabelelement.rs | 15 |
2 files changed, 9 insertions, 10 deletions
diff --git a/components/script/dom/htmlinputelement.rs b/components/script/dom/htmlinputelement.rs index 03c3bf83d0c..8a0fa78887e 100644 --- a/components/script/dom/htmlinputelement.rs +++ b/components/script/dom/htmlinputelement.rs @@ -861,10 +861,6 @@ impl VirtualMethods for HTMLInputElement { } if event.type_() == atom!("click") && !event.DefaultPrevented() { - if let InputType::InputRadio = self.input_type.get() { - self.update_checked_state(true, true); - } - // TODO: Dispatch events for non activatable inputs // https://html.spec.whatwg.org/multipage/#common-input-element-events 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 |