LibWeb: Allow stacking context to only be created by PaintableBox

For a while we used the wider Paintable type for stacking context,
because it was allowed to be created by InlinePaintable and
PaintableBox. Now, when InlinePaintable type is gone, we can use more
specific PaintableBox type for a stacking context.
This commit is contained in:
Aliaksandr Kalenik 2024-11-18 16:05:22 +01:00 committed by Andreas Kling
commit 9f541c363d
Notes: github-actions[bot] 2024-11-18 19:08:27 +00:00
7 changed files with 103 additions and 120 deletions

View file

@ -146,13 +146,9 @@ public:
return TraversalDecision::Continue;
}
StackingContext* stacking_context() { return m_stacking_context; }
StackingContext const* stacking_context() const { return m_stacking_context; }
void set_stacking_context(NonnullOwnPtr<StackingContext>);
bool has_stacking_context() const;
StackingContext* enclosing_stacking_context();
void invalidate_stacking_context();
virtual void before_paint(PaintContext&, PaintPhase) const { }
virtual void after_paint(PaintContext&, PaintPhase) const { }
@ -251,8 +247,6 @@ private:
GC::Ref<Layout::Node const> m_layout_node;
Optional<GC::Ptr<PaintableBox>> mutable m_containing_block;
OwnPtr<StackingContext> m_stacking_context;
SelectionState m_selection_state { SelectionState::None };
bool m_positioned : 1 { false };