mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-27 06:48:49 +00:00
LibWeb: Minor code cleanup: Replace some first_is_one_of with is_one_of
This commit is contained in:
parent
2983a17ea6
commit
5ba847b1c4
Notes:
github-actions[bot]
2024-12-28 06:52:16 +00:00
Author: https://github.com/sideshowbarker
Commit: 5ba847b1c4
Pull-request: https://github.com/LadybirdBrowser/ladybird/pull/3068
1 changed files with 2 additions and 2 deletions
|
@ -725,7 +725,7 @@ Optional<ARIA::Role> HTMLElement::default_role() const
|
|||
if (local_name() == TagNames::aside) {
|
||||
// https://w3c.github.io/html-aam/#el-aside
|
||||
for (auto const* ancestor = parent_element(); ancestor; ancestor = ancestor->parent_element()) {
|
||||
if (first_is_one_of(ancestor->local_name(), TagNames::article, TagNames::aside, TagNames::nav, TagNames::section)
|
||||
if (ancestor->local_name().is_one_of(TagNames::article, TagNames::aside, TagNames::nav, TagNames::section)
|
||||
&& accessible_name(document()).value().is_empty())
|
||||
return ARIA::Role::generic;
|
||||
}
|
||||
|
@ -769,7 +769,7 @@ Optional<ARIA::Role> HTMLElement::default_role() const
|
|||
// complementary, main, navigation or region then (footer) role=contentinfo (header) role=banner. Otherwise,
|
||||
// role=generic.
|
||||
for (auto const* ancestor = parent_element(); ancestor; ancestor = ancestor->parent_element()) {
|
||||
if (first_is_one_of(ancestor->local_name(), TagNames::article, TagNames::aside, TagNames::main, TagNames::nav, TagNames::section)) {
|
||||
if (ancestor->local_name().is_one_of(TagNames::article, TagNames::aside, TagNames::main, TagNames::nav, TagNames::section)) {
|
||||
if (local_name() == TagNames::footer)
|
||||
return ARIA::Role::sectionfooter;
|
||||
return ARIA::Role::sectionheader;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue