mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 23:58:11 +00:00
LibWeb: Keep track of the parent of each formatting context
This will allow us to find the containing block formatting context when needed later on.
This commit is contained in:
parent
2f491e7769
commit
b1e75437c9
9 changed files with 25 additions and 19 deletions
|
@ -37,11 +37,14 @@ public:
|
|||
Box& context_box() { return m_context_box; }
|
||||
const Box& context_box() const { return m_context_box; }
|
||||
|
||||
FormattingContext* parent() { return m_parent; }
|
||||
const FormattingContext* parent() const { return m_parent; }
|
||||
|
||||
protected:
|
||||
FormattingContext(Box&);
|
||||
FormattingContext(Box&, FormattingContext* parent = nullptr);
|
||||
virtual ~FormattingContext();
|
||||
|
||||
static void layout_inside(Box&, LayoutMode);
|
||||
void layout_inside(Box&, LayoutMode);
|
||||
|
||||
struct ShrinkToFitResult {
|
||||
float preferred_width { 0 };
|
||||
|
@ -50,6 +53,7 @@ protected:
|
|||
|
||||
ShrinkToFitResult calculate_shrink_to_fit_widths(Box&);
|
||||
|
||||
FormattingContext* m_parent { nullptr };
|
||||
Box& m_context_box;
|
||||
};
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue