Skip to content
Permalink
Browse files

Fix HtmlLabelElement activation to run on correct element

Also removes old code that caused radio button clicks on disabled elements
  • Loading branch information...
rebstar6 committed Mar 29, 2016
1 parent 1837725 commit 3c7e6a4be83ce406a21c6b23fd1a89ddaa2a67d2
Showing with 9 additions and 10 deletions.
  1. +0 −4 components/script/dom/htmlinputelement.rs
  2. +9 −6 components/script/dom/htmllabelelement.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

@@ -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

0 comments on commit 3c7e6a4

Please sign in to comment.
You can’t perform that action at this time.