mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
LibWeb: Implement <input type=checkbox switch> experimentally
In conformance with the requirements of the spec PR at https://github.com/whatwg/html/pull/9546, this change adds support for the “switch” attribute for type=checkbox “input” elements — which is shipping in Safari (since Safari 17.4). This change also implements support for exposing it to AT users with role=switch.
This commit is contained in:
parent
eee90f4aa2
commit
583ca6af89
Notes:
github-actions[bot]
2024-12-13 11:32:27 +00:00
Author: https://github.com/sideshowbarker
Commit: 583ca6af89
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/2887
Reviewed-by: https://github.com/AtkinsSJ ✅
Reviewed-by: https://github.com/shannonbooth
16 changed files with 268 additions and 3 deletions
|
@ -201,7 +201,9 @@ static inline bool matches_indeterminate_pseudo_class(DOM::Element const& elemen
|
|||
auto const& input_element = static_cast<HTML::HTMLInputElement const&>(element);
|
||||
switch (input_element.type_state()) {
|
||||
case HTML::HTMLInputElement::TypeAttributeState::Checkbox:
|
||||
return input_element.indeterminate();
|
||||
// https://whatpr.org/html-attr-input-switch/9546/semantics-other.html#selector-indeterminate
|
||||
// input elements whose type attribute is in the Checkbox state, whose switch attribute is not set
|
||||
return input_element.indeterminate() && !element.has_attribute(HTML::AttributeNames::switch_);
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue