LibWeb: Use is_viewport helper

This method exists precicely to simplify the check being done here,
so lets use it!
This commit is contained in:
Jonne Ransijn 2024-11-23 20:28:58 +01:00 committed by Alexander Kalenik
parent 6ad93d2b21
commit d2ca522540
Notes: github-actions[bot] 2024-11-23 21:07:32 +00:00

View file

@ -865,7 +865,7 @@ TraversalDecision PaintableBox::hit_test(CSSPixelPoint position, HitTestType typ
if (hit_test_scrollbars(position_adjusted_by_scroll_offset, callback) == TraversalDecision::Break)
return TraversalDecision::Break;
if (layout_node_with_style_and_box_metrics().is_viewport()) {
if (is_viewport()) {
auto& viewport_paintable = const_cast<ViewportPaintable&>(static_cast<ViewportPaintable const&>(*this));
viewport_paintable.build_stacking_context_tree_if_needed();
viewport_paintable.document().update_paint_and_hit_testing_properties_if_needed();