mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: CSS selector read-write honor is_allowed_to_be_readonly
This commit is contained in:
Notes:
github-actions[bot]
2025-10-24 18:17:09 +00:00
Author: https://github.com/lpas Commit: https://github.com/LadybirdBrowser/ladybird/commit/fb258639d12 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6552 Reviewed-by: https://github.com/AtkinsSJ ✅
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user