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

@ -35,6 +35,11 @@ public:
virtual void paint(PaintContext&, PaintPhase) const override;
StackingContext* stacking_context() { return m_stacking_context; }
StackingContext const* stacking_context() const { return m_stacking_context; }
void set_stacking_context(NonnullOwnPtr<StackingContext>);
void invalidate_stacking_context();
virtual Optional<CSSPixelRect> get_masking_area() const;
virtual Optional<Gfx::Bitmap::MaskKind> get_mask_type() const { return {}; }
virtual RefPtr<Gfx::ImmutableBitmap> calculate_mask(PaintContext&, CSSPixelRect const&) const { return {}; }
@ -276,6 +281,8 @@ private:
virtual DispatchEventOfSameName handle_mouseup(Badge<EventHandler>, CSSPixelPoint, unsigned button, unsigned modifiers) override;
virtual DispatchEventOfSameName handle_mousemove(Badge<EventHandler>, CSSPixelPoint, unsigned buttons, unsigned modifiers) override;
OwnPtr<StackingContext> m_stacking_context;
Optional<OverflowData> m_overflow_data;
CSSPixelPoint m_offset;