mirror of
https://github.com/LadybirdBrowser/ladybird
synced 2026-04-26 01:35:08 +02:00
LibWeb: Fix case insensitivity for HTMLElement "hidden" attribute
This commit is contained in:
committed by
Jelle Raaijmakers
parent
bf8b8c260a
commit
5e23df7d8a
Notes:
github-actions[bot]
2025-09-11 13:21:48 +00:00
Author: https://github.com/veeti Commit: https://github.com/LadybirdBrowser/ladybird/commit/5e23df7d8a4 Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6153 Reviewed-by: https://github.com/gmta ✅ Reviewed-by: https://github.com/tcl3
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user