1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:17:44 +00:00

LibWeb: Move line boxes from Layout::Box to BlockContainer

Per the spec, only a BlockContainer" can have line boxes, so let's not
clutter up every Layout::Box with line boxes.

This also allows us to establish an invariant that BFC and IFC always
operate on a Layout::BlockContainer.

Note that if BlockContainer has all block-level children, its line boxes
are not used for anything. They are only used in the all inline-level
children scenario.
This commit is contained in:
Andreas Kling 2021-10-06 21:53:25 +02:00
parent a0bea52a5f
commit f73aa8e2bd
13 changed files with 80 additions and 74 deletions

View file

@ -8,7 +8,6 @@
#include <AK/OwnPtr.h>
#include <LibGfx/Rect.h>
#include <LibWeb/Layout/LineBox.h>
#include <LibWeb/Layout/Node.h>
#include <LibWeb/Painting/BorderPainting.h>
#include <LibWeb/Painting/StackingContext.h>
@ -118,12 +117,6 @@ public:
virtual void paint_box_shadow(PaintContext& context);
virtual void paint_background(PaintContext& context);
Vector<LineBox>& line_boxes() { return m_line_boxes; }
const Vector<LineBox>& line_boxes() const { return m_line_boxes; }
LineBox& ensure_last_line_box();
LineBox& add_line_box();
virtual float width_of_logical_containing_block() const;
Painting::BorderRadiusData normalized_border_radius_data();
@ -141,8 +134,6 @@ protected:
virtual void did_set_rect() { }
Vector<LineBox> m_line_boxes;
private:
virtual bool is_box() const final { return true; }