diff --git a/Libraries/LibWeb/Layout/Node.cpp b/Libraries/LibWeb/Layout/Node.cpp index a0e69a21bf1..bfe1e218c19 100644 --- a/Libraries/LibWeb/Layout/Node.cpp +++ b/Libraries/LibWeb/Layout/Node.cpp @@ -1049,8 +1049,8 @@ void NodeWithStyle::apply_style(CSS::ComputedProperties const& computed_style) propagate_style_to_anonymous_wrappers(); - if (is(this)) - static_cast(*this).propagate_style_along_continuation(computed_style); + if (auto* box_node = as_if(*this)) + box_node->propagate_style_along_continuation(computed_style); } void NodeWithStyle::propagate_style_to_anonymous_wrappers()