1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 18:27:35 +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:
Andreas Kling 2021-06-24 19:53:42 +02:00
parent 6215a9c2cb
commit ee3a73ddbb
61 changed files with 262 additions and 262 deletions

View file

@ -60,7 +60,7 @@ void ImageBox::prepare_for_replaced_layout()
}
if (renders_as_alt_text()) {
auto& image_element = downcast<HTML::HTMLImageElement>(dom_node());
auto& image_element = verify_cast<HTML::HTMLImageElement>(dom_node());
auto& font = Gfx::FontDatabase::default_font();
auto alt = image_element.alt();
if (alt.is_empty())
@ -88,7 +88,7 @@ void ImageBox::paint(PaintContext& context, PaintPhase phase)
if (phase == PaintPhase::Foreground) {
if (renders_as_alt_text()) {
auto& image_element = downcast<HTML::HTMLImageElement>(dom_node());
auto& image_element = verify_cast<HTML::HTMLImageElement>(dom_node());
context.painter().set_font(Gfx::FontDatabase::default_font());
Gfx::StylePainter::paint_frame(context.painter(), enclosing_int_rect(absolute_rect()), context.palette(), Gfx::FrameShape::Container, Gfx::FrameShadow::Sunken, 2);
auto alt = image_element.alt();