mirror of
https://github.com/fergalmoran/ladybird.git
synced 2026-01-04 15:45:25 +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:
@@ -261,7 +261,7 @@ void TextNode::handle_mousedown(Badge<EventHandler>, const Gfx::IntPoint& positi
|
||||
{
|
||||
if (!parent() || !is<Label>(*parent()))
|
||||
return;
|
||||
downcast<Label>(*parent()).handle_mousedown_on_label({}, position, button);
|
||||
verify_cast<Label>(*parent()).handle_mousedown_on_label({}, position, button);
|
||||
browsing_context().event_handler().set_mouse_event_tracking_layout_node(this);
|
||||
}
|
||||
|
||||
@@ -273,7 +273,7 @@ void TextNode::handle_mouseup(Badge<EventHandler>, const Gfx::IntPoint& position
|
||||
// NOTE: Changing the state of the DOM node may run arbitrary JS, which could disappear this node.
|
||||
NonnullRefPtr protect = *this;
|
||||
|
||||
downcast<Label>(*parent()).handle_mouseup_on_label({}, position, button);
|
||||
verify_cast<Label>(*parent()).handle_mouseup_on_label({}, position, button);
|
||||
browsing_context().event_handler().set_mouse_event_tracking_layout_node(nullptr);
|
||||
}
|
||||
|
||||
@@ -281,7 +281,7 @@ void TextNode::handle_mousemove(Badge<EventHandler>, const Gfx::IntPoint& positi
|
||||
{
|
||||
if (!parent() || !is<Label>(*parent()))
|
||||
return;
|
||||
downcast<Label>(*parent()).handle_mousemove_on_label({}, position, button);
|
||||
verify_cast<Label>(*parent()).handle_mousemove_on_label({}, position, button);
|
||||
}
|
||||
|
||||
TextNode::ChunkIterator::ChunkIterator(StringView const& text, LayoutMode layout_mode, bool wrap_lines, bool wrap_breaks)
|
||||
|
||||
Reference in New Issue
Block a user