mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 16:17:45 +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
|
@ -188,7 +188,7 @@ HTML::HTMLHtmlElement* Document::html_element()
|
|||
{
|
||||
auto* html = document_element();
|
||||
if (is<HTML::HTMLHtmlElement>(html))
|
||||
return downcast<HTML::HTMLHtmlElement>(html);
|
||||
return verify_cast<HTML::HTMLHtmlElement>(html);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
@ -423,7 +423,7 @@ static void update_style_recursively(DOM::Node& node)
|
|||
node.for_each_child([&](auto& child) {
|
||||
if (child.needs_style_update()) {
|
||||
if (is<Element>(child))
|
||||
downcast<Element>(child).recompute_style();
|
||||
verify_cast<Element>(child).recompute_style();
|
||||
child.set_needs_style_update(false);
|
||||
}
|
||||
if (child.child_needs_style_update()) {
|
||||
|
@ -836,7 +836,7 @@ ExceptionOr<NonnullRefPtr<Node>> Document::adopt_node_binding(NonnullRefPtr<Node
|
|||
if (is<ShadowRoot>(*node))
|
||||
return DOM::HierarchyRequestError::create("Cannot adopt a shadow root into a document");
|
||||
|
||||
if (is<DocumentFragment>(*node) && downcast<DocumentFragment>(*node).host())
|
||||
if (is<DocumentFragment>(*node) && verify_cast<DocumentFragment>(*node).host())
|
||||
return node;
|
||||
|
||||
adopt_node(*node);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue