mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-08 06:09:58 +00:00
LibWeb: CSS selector read-write honor is_allowed_to_be_readonly
This commit is contained in:
parent
cd4ac4f30f
commit
fb258639d1
Notes:
github-actions[bot]
2025-10-24 18:17:09 +00:00
Author: https://github.com/lpas
Commit: fb258639d1
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6552
Reviewed-by: https://github.com/AtkinsSJ ✅
5 changed files with 181 additions and 19 deletions
|
|
@ -873,9 +873,9 @@ void HTMLInputElement::update_text_input_shadow_tree()
|
|||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/input.html#the-input-element:attr-input-readonly-3
|
||||
static bool is_allowed_to_be_readonly(HTML::HTMLInputElement::TypeAttributeState state)
|
||||
bool HTMLInputElement::is_allowed_to_be_readonly() const
|
||||
{
|
||||
switch (state) {
|
||||
switch (m_type) {
|
||||
case HTML::HTMLInputElement::TypeAttributeState::Text:
|
||||
case HTML::HTMLInputElement::TypeAttributeState::Search:
|
||||
case HTML::HTMLInputElement::TypeAttributeState::Telephone:
|
||||
|
|
@ -3676,7 +3676,7 @@ bool HTMLInputElement::is_mutable() const
|
|||
|
||||
// https://html.spec.whatwg.org/multipage/input.html#the-readonly-attribute:concept-fe-mutable
|
||||
// The readonly attribute is a boolean attribute that controls whether or not the user can edit the form control. When specified, the element is not mutable.
|
||||
&& !(has_attribute(AttributeNames::readonly) && is_allowed_to_be_readonly(m_type));
|
||||
&& !(has_attribute(AttributeNames::readonly) && is_allowed_to_be_readonly());
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/rendering.html#button-layout
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue