diff options
author | Andreas Kling <kling@serenityos.org> | 2022-03-10 11:12:06 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2022-03-11 00:21:49 +0100 |
commit | 7af03df4c3aa50acb5d73fbc69b1181cfbbed536 (patch) | |
tree | db1fcaa293bbd1313c2777c1895067de84a58156 /Userland/Libraries/LibWeb/Layout/Node.cpp | |
parent | 9f5cbcaad39aa9df43694140613fdd8b3b2fe5b2 (diff) | |
download | serenity-7af03df4c3aa50acb5d73fbc69b1181cfbbed536.zip |
LibWeb: Make Painting::Box virtual and add Painting::BoxWithLines
BlockContainer paint boxes are the only ones that have line boxes
associated, so let's not waste memory on line boxes in all the other
types of boxes.
This also adds Layout::Box::paint_box() and the more tightly typed
Layout::BlockContainer::paint_box() to get at the paint box from the
corresponding layout box.
Diffstat (limited to 'Userland/Libraries/LibWeb/Layout/Node.cpp')
-rw-r--r-- | Userland/Libraries/LibWeb/Layout/Node.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Userland/Libraries/LibWeb/Layout/Node.cpp b/Userland/Libraries/LibWeb/Layout/Node.cpp index e27ee86c92..835c737cd3 100644 --- a/Userland/Libraries/LibWeb/Layout/Node.cpp +++ b/Userland/Libraries/LibWeb/Layout/Node.cpp @@ -112,7 +112,7 @@ InitialContainingBlock& Node::root() void Node::set_needs_display() { if (auto* block = containing_block()) { - block->m_paint_box->for_each_fragment([&](auto& fragment) { + block->paint_box()->for_each_fragment([&](auto& fragment) { if (&fragment.layout_node() == this || is_ancestor_of(fragment.layout_node())) { browsing_context().set_needs_display(enclosing_int_rect(fragment.absolute_rect())); } @@ -128,7 +128,7 @@ Gfx::FloatPoint Node::box_type_agnostic_position() const VERIFY(is_inline()); Gfx::FloatPoint position; if (auto* block = containing_block()) { - block->m_paint_box->for_each_fragment([&](auto& fragment) { + block->paint_box()->for_each_fragment([&](auto& fragment) { if (&fragment.layout_node() == this || is_ancestor_of(fragment.layout_node())) { position = fragment.absolute_rect().location(); return IterationDecision::Break; |