mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-20 06:59:47 +00:00
LibWeb: Fix case insensitivity for HTMLElement "hidden" attribute
This commit is contained in:
parent
bf8b8c260a
commit
5e23df7d8a
Notes:
github-actions[bot]
2025-09-11 13:21:48 +00:00
Author: https://github.com/veeti
Commit: 5e23df7d8a
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6153
Reviewed-by: https://github.com/gmta ✅
Reviewed-by: https://github.com/tcl3
5 changed files with 111 additions and 2 deletions
|
@ -852,13 +852,15 @@ GC::Ptr<DOM::NodeList> HTMLElement::labels()
|
|||
return m_labels;
|
||||
}
|
||||
|
||||
// https://html.spec.whatwg.org/multipage/interaction.html#dom-hidden
|
||||
Variant<bool, double, String> HTMLElement::hidden() const
|
||||
{
|
||||
// 1. If the hidden attribute is in the hidden until found state, then return "until-found".
|
||||
if (get_attribute(HTML::AttributeNames::hidden) == "until-found")
|
||||
auto const& hidden = get_attribute(HTML::AttributeNames::hidden);
|
||||
if (hidden.has_value() && hidden->equals_ignoring_ascii_case("until-found"sv))
|
||||
return "until-found"_string;
|
||||
// 2. If the hidden attribute is set, then return true.
|
||||
if (has_attribute(HTML::AttributeNames::hidden))
|
||||
if (hidden.has_value())
|
||||
return true;
|
||||
// 3. Return false.
|
||||
return false;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue