mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 15:38:10 +00:00
AK: Rename downcast<T> => verify_cast<T>
This makes it much clearer what this cast actually does: it will VERIFY that the thing we're casting is a T (using is<T>()).
This commit is contained in:
parent
6215a9c2cb
commit
ee3a73ddbb
61 changed files with 262 additions and 262 deletions
|
@ -212,7 +212,7 @@ static bool matches(const CSS::Selector& selector, int component_list_index, con
|
|||
for (auto* ancestor = element.parent(); ancestor; ancestor = ancestor->parent()) {
|
||||
if (!is<DOM::Element>(*ancestor))
|
||||
continue;
|
||||
if (matches(selector, component_list_index - 1, downcast<DOM::Element>(*ancestor)))
|
||||
if (matches(selector, component_list_index - 1, verify_cast<DOM::Element>(*ancestor)))
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
|
@ -220,7 +220,7 @@ static bool matches(const CSS::Selector& selector, int component_list_index, con
|
|||
VERIFY(component_list_index != 0);
|
||||
if (!element.parent() || !is<DOM::Element>(*element.parent()))
|
||||
return false;
|
||||
return matches(selector, component_list_index - 1, downcast<DOM::Element>(*element.parent()));
|
||||
return matches(selector, component_list_index - 1, verify_cast<DOM::Element>(*element.parent()));
|
||||
case CSS::Selector::ComplexSelector::Relation::AdjacentSibling:
|
||||
VERIFY(component_list_index != 0);
|
||||
if (auto* sibling = element.previous_element_sibling())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue