diff options
author | Andreas Kling <kling@serenityos.org> | 2020-07-26 17:16:18 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-07-26 17:51:00 +0200 |
commit | 71556e39a461e045015fa28a984c1649c9d15b83 (patch) | |
tree | 26669f0d6ab67b859680930df2ccca9875fe9f69 /Libraries/LibWeb/Layout/LayoutBlock.cpp | |
parent | fe6474e69273a033a22f7961228b75a9eb967ab7 (diff) | |
download | serenity-71556e39a461e045015fa28a984c1649c9d15b83.zip |
LibWeb: Switch to using AK::is and AK::downcast
Diffstat (limited to 'Libraries/LibWeb/Layout/LayoutBlock.cpp')
-rw-r--r-- | Libraries/LibWeb/Layout/LayoutBlock.cpp | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/Libraries/LibWeb/Layout/LayoutBlock.cpp b/Libraries/LibWeb/Layout/LayoutBlock.cpp index d475fc37a9..686662f3ef 100644 --- a/Libraries/LibWeb/Layout/LayoutBlock.cpp +++ b/Libraries/LibWeb/Layout/LayoutBlock.cpp @@ -155,13 +155,13 @@ void LayoutBlock::layout_contained_boxes(LayoutMode layout_mode) return IterationDecision::Continue; box.layout(layout_mode); if (box.is_replaced()) - place_block_level_replaced_element_in_normal_flow(to<LayoutReplaced>(box)); + place_block_level_replaced_element_in_normal_flow(downcast<LayoutReplaced>(box)); else if (box.is_block()) - place_block_level_non_replaced_element_in_normal_flow(to<LayoutBlock>(box)); + place_block_level_non_replaced_element_in_normal_flow(downcast<LayoutBlock>(box)); else dbg() << "FIXME: LayoutBlock::layout_contained_boxes doesn't know how to place a " << box.class_name(); content_height = max(content_height, box.effective_offset().y() + box.height() + box.box_model().margin_box(*this).bottom); - content_width = max(content_width, to<LayoutBox>(box).width()); + content_width = max(content_width, downcast<LayoutBox>(box).width()); return IterationDecision::Continue; }); @@ -257,7 +257,7 @@ void LayoutBlock::layout_inline_children(LayoutMode layout_mode) } if (fragment.layout_node().is_inline_block()) { - auto& inline_block = const_cast<LayoutBlock&>(to<LayoutBlock>(fragment.layout_node())); + auto& inline_block = const_cast<LayoutBlock&>(downcast<LayoutBlock>(fragment.layout_node())); inline_block.set_size(fragment.size()); inline_block.layout(layout_mode); } @@ -587,7 +587,7 @@ LayoutBlock::ShrinkToFitResult LayoutBlock::calculate_shrink_to_fit_width() } else { for_each_child([&](auto& child) { if (child.is_box()) - max_width = max(max_width, to<LayoutBox>(child).width()); + max_width = max(max_width, downcast<LayoutBox>(child).width()); }); } return max_width; @@ -725,11 +725,11 @@ HitTestResult LayoutBlock::hit_test(const Gfx::IntPoint& position) const HitTestResult last_good_candidate; for (auto& line_box : m_line_boxes) { for (auto& fragment : line_box.fragments()) { - if (is<LayoutBox>(fragment.layout_node()) && to<LayoutBox>(fragment.layout_node()).stacking_context()) + if (is<LayoutBox>(fragment.layout_node()) && downcast<LayoutBox>(fragment.layout_node()).stacking_context()) continue; if (enclosing_int_rect(fragment.absolute_rect()).contains(position)) { if (fragment.layout_node().is_block()) - return to<LayoutBlock>(fragment.layout_node()).hit_test(position); + return downcast<LayoutBlock>(fragment.layout_node()).hit_test(position); return { fragment.layout_node(), fragment.text_index_at(position.x()) }; } if (fragment.absolute_rect().top() <= position.y()) |