mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-12-07 21:59:54 +00:00
LibWeb: Derive implicit aria-level for h1–h6 from tag name
This commit is contained in:
parent
d7f830cdd1
commit
c6b289c3dc
Notes:
github-actions[bot]
2025-10-10 16:19:11 +00:00
Author: https://github.com/Dowsley 🔰
Commit: c6b289c3dc
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/6256
Reviewed-by: https://github.com/AtkinsSJ ✅
6 changed files with 40 additions and 2 deletions
|
|
@ -26,8 +26,11 @@ public:
|
|||
|
||||
virtual Optional<String> aria_level() const override
|
||||
{
|
||||
// TODO: aria-level = the number in the element's tag name
|
||||
return get_attribute("aria-level"_fly_string);
|
||||
if (auto const attr = get_attribute(ARIA::AttributeNames::aria_level); attr.has_value())
|
||||
return attr;
|
||||
|
||||
// Implicit defaults to the number in the element's tag name.
|
||||
return MUST(local_name().to_string().substring_from_byte_offset(1));
|
||||
}
|
||||
|
||||
private:
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue