mirror of
https://github.com/RGBCube/serenity
synced 2025-05-23 18:55:08 +00:00
LibWeb: Switch to using AK::is and AK::downcast
This commit is contained in:
parent
fe6474e692
commit
71556e39a4
73 changed files with 249 additions and 433 deletions
|
@ -131,7 +131,7 @@ bool matches(const Selector& selector, int component_list_index, const Element&
|
|||
for (auto* ancestor = element.parent(); ancestor; ancestor = ancestor->parent()) {
|
||||
if (!is<Element>(*ancestor))
|
||||
continue;
|
||||
if (matches(selector, component_list_index - 1, to<Element>(*ancestor)))
|
||||
if (matches(selector, component_list_index - 1, downcast<Element>(*ancestor)))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -139,7 +139,7 @@ bool matches(const Selector& selector, int component_list_index, const Element&
|
|||
ASSERT(component_list_index != 0);
|
||||
if (!element.parent() || !is<Element>(*element.parent()))
|
||||
return false;
|
||||
return matches(selector, component_list_index - 1, to<Element>(*element.parent()));
|
||||
return matches(selector, component_list_index - 1, downcast<Element>(*element.parent()));
|
||||
case Selector::ComplexSelector::Relation::AdjacentSibling:
|
||||
ASSERT(component_list_index != 0);
|
||||
if (auto* sibling = element.previous_element_sibling())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue