LibWeb: Allow all elements with tabindex attribute to be focusable

This commit is contained in:
Lorenz A 2025-11-11 14:05:06 +01:00 committed by Jelle Raaijmakers
parent 154e9db033
commit 3bc061d028
Notes: github-actions[bot] 2025-11-12 12:58:21 +00:00
5 changed files with 183 additions and 1 deletions

View file

@ -4277,6 +4277,12 @@ bool Element::should_indicate_focus() const
return false;
}
// https://html.spec.whatwg.org/multipage/interaction.html#tabindex-value
bool Element::is_focusable() const
{
return HTML::parse_integer(get_attribute_value(HTML::AttributeNames::tabindex)).has_value();
}
void Element::set_had_duplicate_attribute_during_tokenization(Badge<HTML::HTMLParser>)
{
m_had_duplicate_attribute_during_tokenization = true;