mirror of
https://github.com/servo/servo.git
synced 2025-08-02 20:20:14 +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/#checkbox-state-%28type=checkbox%29:activation-behaviour-2
|
||||
// https://html.spec.whatwg.org/multipage/#radio-button-state-%28type=radio%29:activation-behaviour-2
|
||||
InputType::Submit |
|
||||
InputType::Reset |
|
||||
InputType::File |
|
||||
InputType::Checkbox |
|
||||
InputType::Radio => self.is_mutable(),
|
||||
InputType::Submit | InputType::Reset | InputType::File => self.is_mutable(),
|
||||
InputType::Checkbox | InputType::Radio => true,
|
||||
_ => false,
|
||||
}
|
||||
}
|
||||
|
||||
// https://dom.spec.whatwg.org/#eventtarget-legacy-pre-activation-behavior
|
||||
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;
|
||||
}
|
||||
|
||||
|
@ -2777,7 +2777,10 @@ impl Activatable for HTMLInputElement {
|
|||
// https://dom.spec.whatwg.org/#eventtarget-legacy-canceled-activation-behavior
|
||||
fn legacy_canceled_activation_behavior(&self, cache: Option<InputActivationState>) {
|
||||
// Step 1
|
||||
if !self.is_mutable() {
|
||||
if !self.is_mutable() &&
|
||||
self.input_type() != InputType::Checkbox &&
|
||||
self.input_type() != InputType::Radio
|
||||
{
|
||||
return;
|
||||
}
|
||||
let ty = self.input_type();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue