mirror of
https://github.com/servo/servo.git
synced 2025-08-03 20:50:07 +01:00
Allow mutating <input disabled type=checkbox/radio>
This commit is contained in:
parent
12f5411aad
commit
82386953b9
2 changed files with 10 additions and 20 deletions
|
@ -2728,18 +2728,18 @@ impl Activatable for HTMLInputElement {
|
||||||
// https://html.spec.whatwg.org/multipage/#reset-button-state-%28type=reset%29:activation-behaviour-2
|
// https://html.spec.whatwg.org/multipage/#reset-button-state-%28type=reset%29:activation-behaviour-2
|
||||||
// https://html.spec.whatwg.org/multipage/#checkbox-state-%28type=checkbox%29:activation-behaviour-2
|
// https://html.spec.whatwg.org/multipage/#checkbox-state-%28type=checkbox%29:activation-behaviour-2
|
||||||
// https://html.spec.whatwg.org/multipage/#radio-button-state-%28type=radio%29:activation-behaviour-2
|
// https://html.spec.whatwg.org/multipage/#radio-button-state-%28type=radio%29:activation-behaviour-2
|
||||||
InputType::Submit |
|
InputType::Submit | InputType::Reset | InputType::File => self.is_mutable(),
|
||||||
InputType::Reset |
|
InputType::Checkbox | InputType::Radio => true,
|
||||||
InputType::File |
|
|
||||||
InputType::Checkbox |
|
|
||||||
InputType::Radio => self.is_mutable(),
|
|
||||||
_ => false,
|
_ => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// https://dom.spec.whatwg.org/#eventtarget-legacy-pre-activation-behavior
|
// https://dom.spec.whatwg.org/#eventtarget-legacy-pre-activation-behavior
|
||||||
fn legacy_pre_activation_behavior(&self) -> Option<InputActivationState> {
|
fn legacy_pre_activation_behavior(&self) -> Option<InputActivationState> {
|
||||||
if !self.is_mutable() {
|
if !self.is_mutable() &&
|
||||||
|
self.input_type() != InputType::Checkbox &&
|
||||||
|
self.input_type() != InputType::Radio
|
||||||
|
{
|
||||||
return None;
|
return None;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -2777,7 +2777,10 @@ impl Activatable for HTMLInputElement {
|
||||||
// https://dom.spec.whatwg.org/#eventtarget-legacy-canceled-activation-behavior
|
// https://dom.spec.whatwg.org/#eventtarget-legacy-canceled-activation-behavior
|
||||||
fn legacy_canceled_activation_behavior(&self, cache: Option<InputActivationState>) {
|
fn legacy_canceled_activation_behavior(&self, cache: Option<InputActivationState>) {
|
||||||
// Step 1
|
// Step 1
|
||||||
if !self.is_mutable() {
|
if !self.is_mutable() &&
|
||||||
|
self.input_type() != InputType::Checkbox &&
|
||||||
|
self.input_type() != InputType::Radio
|
||||||
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
let ty = self.input_type();
|
let ty = self.input_type();
|
||||||
|
|
|
@ -2,16 +2,3 @@
|
||||||
type: testharness
|
type: testharness
|
||||||
[event state during post-click handling]
|
[event state during post-click handling]
|
||||||
expected: FAIL
|
expected: FAIL
|
||||||
|
|
||||||
[disabled radio should be checked from dispatchEvent(new MouseEvent("click"))]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[disabled checkbox should be checked from dispatchEvent(new MouseEvent("click"))]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[disabled radio should get legacy-canceled-activation behavior]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
[disabled checkbox should get legacy-canceled-activation behavior]
|
|
||||||
expected: FAIL
|
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue