mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-05-01 00:38:48 +00:00
LibWeb: Implement CSS validity pseudo-classes
This commit is contained in:
parent
39e17e83f9
commit
bad7324307
Notes:
github-actions[bot]
2025-02-05 12:52:56 +00:00
Author: https://github.com/Psychpsyo
Commit: bad7324307
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3436
Reviewed-by: https://github.com/AtkinsSJ ✅
15 changed files with 745 additions and 29 deletions
|
@ -110,7 +110,8 @@ i32 HTMLTextAreaElement::default_tab_index_value() const
|
|||
// https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element:concept-form-reset-control
|
||||
void HTMLTextAreaElement::reset_algorithm()
|
||||
{
|
||||
// The reset algorithm for textarea elements is to set the dirty value flag back to false,
|
||||
// The reset algorithm for textarea elements is to set the user validity to false, dirty value flag back to false,
|
||||
m_user_validity = false;
|
||||
m_dirty_value = false;
|
||||
// and set the raw value of element to its child text content.
|
||||
set_raw_value(child_text_content());
|
||||
|
@ -486,4 +487,12 @@ bool HTMLTextAreaElement::is_focusable() const
|
|||
return enabled();
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element%3Asuffering-from-being-missing
|
||||
bool HTMLTextAreaElement::suffering_from_being_missing() const
|
||||
{
|
||||
// If the element has its required attribute specified, and the element is mutable, and the element's value is the empty string, then the element is suffering from
|
||||
// being missing.
|
||||
return has_attribute(HTML::AttributeNames::required) && is_mutable() && value().is_empty();
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue