mirror of
https://github.com/servo/servo.git
synced 2025-08-04 05:00:08 +01:00
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:
parent
183772583f
commit
3c7e6a4be8
2 changed files with 9 additions and 10 deletions
|
@ -861,10 +861,6 @@ impl VirtualMethods for HTMLInputElement {
|
||||||
}
|
}
|
||||||
|
|
||||||
if event.type_() == atom!("click") && !event.DefaultPrevented() {
|
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
|
// TODO: Dispatch events for non activatable inputs
|
||||||
// https://html.spec.whatwg.org/multipage/#common-input-element-events
|
// https://html.spec.whatwg.org/multipage/#common-input-element-events
|
||||||
|
|
||||||
|
|
|
@ -63,13 +63,16 @@ impl Activatable for HTMLLabelElement {
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#run-post-click-activation-steps
|
// https://html.spec.whatwg.org/multipage/#run-post-click-activation-steps
|
||||||
fn activation_behavior(&self, _event: &Event, _target: &EventTarget) {
|
fn activation_behavior(&self, _event: &Event, _target: &EventTarget) {
|
||||||
synthetic_click_activation(self.upcast::<Element>(),
|
if let Some(e) = self.GetControl() {
|
||||||
|
let elem = e.upcast::<Element>();
|
||||||
|
synthetic_click_activation(elem,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
false,
|
false,
|
||||||
ActivationSource::NotFromClick);
|
ActivationSource::NotFromClick);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// https://html.spec.whatwg.org/multipage/#implicit-submission
|
// https://html.spec.whatwg.org/multipage/#implicit-submission
|
||||||
fn implicit_submission(&self, _ctrlKey: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) {
|
fn implicit_submission(&self, _ctrlKey: bool, _shiftKey: bool, _altKey: bool, _metaKey: bool) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue