mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-08-07 00:29:15 +00:00
LibWeb: Add missing handler in affected_by_invalidation_property()
...for :placeholder-shown pseudo-class.
This commit is contained in:
parent
aaff6f98b1
commit
9f75e26385
Notes:
github-actions[bot]
2025-01-25 23:53:34 +00:00
Author: https://github.com/kalenikaliaksandr
Commit: 9f75e26385
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3365
Reviewed-by: https://github.com/gmta
3 changed files with 34 additions and 0 deletions
|
@ -1169,6 +1169,14 @@ bool Element::affected_by_invalidation_property(CSS::InvalidationSet::Property c
|
|||
// FIXME: This could be narrowed down to return true only if element is actually checked.
|
||||
return is<HTML::HTMLInputElement>(*this) || is<HTML::HTMLOptionElement>(*this);
|
||||
}
|
||||
case CSS::PseudoClass::PlaceholderShown: {
|
||||
if (is<HTML::HTMLInputElement>(*this) && has_attribute(HTML::AttributeNames::placeholder)) {
|
||||
auto const& input_element = static_cast<HTML::HTMLInputElement const&>(*this);
|
||||
return input_element.placeholder_element() && input_element.placeholder_value().has_value();
|
||||
}
|
||||
// - FIXME: textarea elements that have a placeholder attribute whose value is currently being presented to the user.
|
||||
return false;
|
||||
}
|
||||
default:
|
||||
VERIFY_NOT_REACHED();
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue