mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-07-06 00:51:51 +00:00
LibWeb: Implement :required/:optional pseudo-classes
This commit is contained in:
parent
fbd1f77161
commit
7acc0f4a42
Notes:
github-actions[bot]
2025-05-24 09:32:37 +00:00
Author: https://github.com/Gingeh
Commit: 7acc0f4a42
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/4838
Reviewed-by: https://github.com/AtkinsSJ ✅
13 changed files with 300 additions and 2 deletions
|
@ -3002,6 +3002,31 @@ bool HTMLInputElement::multiple_applies() const
|
|||
}
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/input.html#do-not-apply
|
||||
bool HTMLInputElement::required_applies() const
|
||||
{
|
||||
switch (type_state()) {
|
||||
case TypeAttributeState::Text:
|
||||
case TypeAttributeState::Search:
|
||||
case TypeAttributeState::Telephone:
|
||||
case TypeAttributeState::URL:
|
||||
case TypeAttributeState::Email:
|
||||
case TypeAttributeState::Password:
|
||||
case TypeAttributeState::Date:
|
||||
case TypeAttributeState::Month:
|
||||
case TypeAttributeState::Week:
|
||||
case TypeAttributeState::Time:
|
||||
case TypeAttributeState::LocalDateAndTime:
|
||||
case TypeAttributeState::Number:
|
||||
case TypeAttributeState::Checkbox:
|
||||
case TypeAttributeState::RadioButton:
|
||||
case TypeAttributeState::FileUpload:
|
||||
return true;
|
||||
default:
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
bool HTMLInputElement::has_selectable_text() const
|
||||
{
|
||||
// Potential FIXME: Date, Month, Week, Time and LocalDateAndTime are rendered as a basic text input for now,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue