1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 10:38:13 +00:00

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.
This commit is contained in:
Andreas Kling 2022-03-10 11:12:06 +01:00
parent 9f5cbcaad3
commit 7af03df4c3
11 changed files with 79 additions and 26 deletions

View file

@ -20,6 +20,9 @@ struct LineBoxFragmentCoordinate {
class Box : public NodeWithStyleAndBoxModelMetrics {
public:
Painting::Box const* paint_box() const { return m_paint_box.ptr(); }
void set_paint_box(OwnPtr<Painting::Box>);
OwnPtr<Painting::Box> m_paint_box;
bool is_out_of_flow(FormattingContext const&) const;