diff options
Diffstat (limited to 'Userland/Libraries/LibWeb/Painting')
28 files changed, 48 insertions, 44 deletions
diff --git a/Userland/Libraries/LibWeb/Painting/ButtonPaintable.cpp b/Userland/Libraries/LibWeb/Painting/ButtonPaintable.cpp index ed21c6db0b..87c343ca83 100644 --- a/Userland/Libraries/LibWeb/Painting/ButtonPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/ButtonPaintable.cpp @@ -10,9 +10,9 @@ namespace Web::Painting { -NonnullOwnPtr<ButtonPaintable> ButtonPaintable::create(Layout::ButtonBox const& layout_box) +NonnullRefPtr<ButtonPaintable> ButtonPaintable::create(Layout::ButtonBox const& layout_box) { - return adopt_own(*new ButtonPaintable(layout_box)); + return adopt_ref(*new ButtonPaintable(layout_box)); } ButtonPaintable::ButtonPaintable(Layout::ButtonBox const& layout_box) diff --git a/Userland/Libraries/LibWeb/Painting/ButtonPaintable.h b/Userland/Libraries/LibWeb/Painting/ButtonPaintable.h index 724ebeb02c..421f82896d 100644 --- a/Userland/Libraries/LibWeb/Painting/ButtonPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/ButtonPaintable.h @@ -13,7 +13,7 @@ namespace Web::Painting { class ButtonPaintable final : public PaintableBox { public: - static NonnullOwnPtr<ButtonPaintable> create(Layout::ButtonBox const&); + static NonnullRefPtr<ButtonPaintable> create(Layout::ButtonBox const&); virtual void paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/CanvasPaintable.cpp b/Userland/Libraries/LibWeb/Painting/CanvasPaintable.cpp index ff4311bca9..3ce31c55e9 100644 --- a/Userland/Libraries/LibWeb/Painting/CanvasPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/CanvasPaintable.cpp @@ -8,9 +8,9 @@ namespace Web::Painting { -NonnullOwnPtr<CanvasPaintable> CanvasPaintable::create(Layout::CanvasBox const& layout_box) +NonnullRefPtr<CanvasPaintable> CanvasPaintable::create(Layout::CanvasBox const& layout_box) { - return adopt_own(*new CanvasPaintable(layout_box)); + return adopt_ref(*new CanvasPaintable(layout_box)); } CanvasPaintable::CanvasPaintable(Layout::CanvasBox const& layout_box) diff --git a/Userland/Libraries/LibWeb/Painting/CanvasPaintable.h b/Userland/Libraries/LibWeb/Painting/CanvasPaintable.h index d8669d0948..67df38c5de 100644 --- a/Userland/Libraries/LibWeb/Painting/CanvasPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/CanvasPaintable.h @@ -13,7 +13,7 @@ namespace Web::Painting { class CanvasPaintable final : public PaintableBox { public: - static NonnullOwnPtr<CanvasPaintable> create(Layout::CanvasBox const&); + static NonnullRefPtr<CanvasPaintable> create(Layout::CanvasBox const&); virtual void paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/CheckBoxPaintable.cpp b/Userland/Libraries/LibWeb/Painting/CheckBoxPaintable.cpp index 7ae96f64e5..fdfacfffd3 100644 --- a/Userland/Libraries/LibWeb/Painting/CheckBoxPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/CheckBoxPaintable.cpp @@ -11,9 +11,9 @@ namespace Web::Painting { -NonnullOwnPtr<CheckBoxPaintable> CheckBoxPaintable::create(Layout::CheckBox const& layout_box) +NonnullRefPtr<CheckBoxPaintable> CheckBoxPaintable::create(Layout::CheckBox const& layout_box) { - return adopt_own(*new CheckBoxPaintable(layout_box)); + return adopt_ref(*new CheckBoxPaintable(layout_box)); } CheckBoxPaintable::CheckBoxPaintable(Layout::CheckBox const& layout_box) diff --git a/Userland/Libraries/LibWeb/Painting/CheckBoxPaintable.h b/Userland/Libraries/LibWeb/Painting/CheckBoxPaintable.h index 2f063bb538..f12b514f1b 100644 --- a/Userland/Libraries/LibWeb/Painting/CheckBoxPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/CheckBoxPaintable.h @@ -13,7 +13,7 @@ namespace Web::Painting { class CheckBoxPaintable final : public PaintableBox { public: - static NonnullOwnPtr<CheckBoxPaintable> create(Layout::CheckBox const&); + static NonnullRefPtr<CheckBoxPaintable> create(Layout::CheckBox const&); virtual void paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp b/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp index f94815432f..659d0445ff 100644 --- a/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/ImagePaintable.cpp @@ -11,9 +11,9 @@ namespace Web::Painting { -NonnullOwnPtr<ImagePaintable> ImagePaintable::create(Layout::ImageBox const& layout_box) +NonnullRefPtr<ImagePaintable> ImagePaintable::create(Layout::ImageBox const& layout_box) { - return adopt_own(*new ImagePaintable(layout_box)); + return adopt_ref(*new ImagePaintable(layout_box)); } ImagePaintable::ImagePaintable(Layout::ImageBox const& layout_box) diff --git a/Userland/Libraries/LibWeb/Painting/ImagePaintable.h b/Userland/Libraries/LibWeb/Painting/ImagePaintable.h index 3b73679831..693d5f8bff 100644 --- a/Userland/Libraries/LibWeb/Painting/ImagePaintable.h +++ b/Userland/Libraries/LibWeb/Painting/ImagePaintable.h @@ -13,7 +13,7 @@ namespace Web::Painting { class ImagePaintable final : public PaintableBox { public: - static NonnullOwnPtr<ImagePaintable> create(Layout::ImageBox const&); + static NonnullRefPtr<ImagePaintable> create(Layout::ImageBox const&); virtual void paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/InlinePaintable.cpp b/Userland/Libraries/LibWeb/Painting/InlinePaintable.cpp index b40c033d2f..0ac55593d3 100644 --- a/Userland/Libraries/LibWeb/Painting/InlinePaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/InlinePaintable.cpp @@ -14,9 +14,9 @@ namespace Web::Painting { -NonnullOwnPtr<InlinePaintable> InlinePaintable::create(Layout::InlineNode const& layout_node) +NonnullRefPtr<InlinePaintable> InlinePaintable::create(Layout::InlineNode const& layout_node) { - return adopt_own(*new InlinePaintable(layout_node)); + return adopt_ref(*new InlinePaintable(layout_node)); } InlinePaintable::InlinePaintable(Layout::InlineNode const& layout_node) diff --git a/Userland/Libraries/LibWeb/Painting/InlinePaintable.h b/Userland/Libraries/LibWeb/Painting/InlinePaintable.h index ddeb74d403..f4ea54c30e 100644 --- a/Userland/Libraries/LibWeb/Painting/InlinePaintable.h +++ b/Userland/Libraries/LibWeb/Painting/InlinePaintable.h @@ -13,7 +13,7 @@ namespace Web::Painting { class InlinePaintable final : public Paintable { public: - static NonnullOwnPtr<InlinePaintable> create(Layout::InlineNode const&); + static NonnullRefPtr<InlinePaintable> create(Layout::InlineNode const&); virtual void paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/MarkerPaintable.cpp b/Userland/Libraries/LibWeb/Painting/MarkerPaintable.cpp index 2493c210f2..a1831429fd 100644 --- a/Userland/Libraries/LibWeb/Painting/MarkerPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/MarkerPaintable.cpp @@ -10,9 +10,9 @@ namespace Web::Painting { -NonnullOwnPtr<MarkerPaintable> MarkerPaintable::create(Layout::ListItemMarkerBox const& layout_box) +NonnullRefPtr<MarkerPaintable> MarkerPaintable::create(Layout::ListItemMarkerBox const& layout_box) { - return adopt_own(*new MarkerPaintable(layout_box)); + return adopt_ref(*new MarkerPaintable(layout_box)); } MarkerPaintable::MarkerPaintable(Layout::ListItemMarkerBox const& layout_box) diff --git a/Userland/Libraries/LibWeb/Painting/MarkerPaintable.h b/Userland/Libraries/LibWeb/Painting/MarkerPaintable.h index f0551c6b7a..011366d0ec 100644 --- a/Userland/Libraries/LibWeb/Painting/MarkerPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/MarkerPaintable.h @@ -13,7 +13,7 @@ namespace Web::Painting { class MarkerPaintable final : public PaintableBox { public: - static NonnullOwnPtr<MarkerPaintable> create(Layout::ListItemMarkerBox const&); + static NonnullRefPtr<MarkerPaintable> create(Layout::ListItemMarkerBox const&); virtual void paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp b/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp index a932bd36db..f5217887cf 100644 --- a/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.cpp @@ -12,9 +12,9 @@ namespace Web::Painting { -NonnullOwnPtr<NestedBrowsingContextPaintable> NestedBrowsingContextPaintable::create(Layout::FrameBox const& layout_box) +NonnullRefPtr<NestedBrowsingContextPaintable> NestedBrowsingContextPaintable::create(Layout::FrameBox const& layout_box) { - return adopt_own(*new NestedBrowsingContextPaintable(layout_box)); + return adopt_ref(*new NestedBrowsingContextPaintable(layout_box)); } NestedBrowsingContextPaintable::NestedBrowsingContextPaintable(Layout::FrameBox const& layout_box) diff --git a/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.h b/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.h index 4b4b46bba7..32fd33525d 100644 --- a/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/NestedBrowsingContextPaintable.h @@ -13,7 +13,7 @@ namespace Web::Painting { class NestedBrowsingContextPaintable final : public PaintableBox { public: - static NonnullOwnPtr<NestedBrowsingContextPaintable> create(Layout::FrameBox const&); + static NonnullRefPtr<NestedBrowsingContextPaintable> create(Layout::FrameBox const&); virtual void paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.cpp b/Userland/Libraries/LibWeb/Painting/Paintable.cpp index dd2b2c176b..2e9eda8f9c 100644 --- a/Userland/Libraries/LibWeb/Painting/Paintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/Paintable.cpp @@ -13,9 +13,9 @@ namespace Web::Painting { -NonnullOwnPtr<PaintableBox> PaintableBox::create(Layout::Box const& layout_box) +NonnullRefPtr<PaintableBox> PaintableBox::create(Layout::Box const& layout_box) { - return adopt_own(*new PaintableBox(layout_box)); + return adopt_ref(*new PaintableBox(layout_box)); } PaintableBox::PaintableBox(Layout::Box const& layout_box) diff --git a/Userland/Libraries/LibWeb/Painting/Paintable.h b/Userland/Libraries/LibWeb/Painting/Paintable.h index e81e0ad5c0..c632bd2601 100644 --- a/Userland/Libraries/LibWeb/Painting/Paintable.h +++ b/Userland/Libraries/LibWeb/Painting/Paintable.h @@ -14,7 +14,7 @@ namespace Web::Painting { -class Paintable { +class Paintable : public RefCounted<Paintable> { AK_MAKE_NONMOVABLE(Paintable); AK_MAKE_NONCOPYABLE(Paintable); @@ -40,7 +40,7 @@ private: class PaintableBox : public Paintable { public: - static NonnullOwnPtr<PaintableBox> create(Layout::Box const&); + static NonnullRefPtr<PaintableBox> create(Layout::Box const&); virtual ~PaintableBox(); virtual void paint(PaintContext&, PaintPhase) const override; @@ -154,9 +154,9 @@ private: class PaintableWithLines : public PaintableBox { public: - static NonnullOwnPtr<PaintableWithLines> create(Layout::BlockContainer const& block_container) + static NonnullRefPtr<PaintableWithLines> create(Layout::BlockContainer const& block_container) { - return adopt_own(*new PaintableWithLines(block_container)); + return adopt_ref(*new PaintableWithLines(block_container)); } virtual ~PaintableWithLines() override; diff --git a/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp b/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp index 266a4ee864..ee5d223e9a 100644 --- a/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/ProgressPaintable.cpp @@ -9,9 +9,9 @@ namespace Web::Painting { -NonnullOwnPtr<ProgressPaintable> ProgressPaintable::create(Layout::Progress const& layout_box) +NonnullRefPtr<ProgressPaintable> ProgressPaintable::create(Layout::Progress const& layout_box) { - return adopt_own(*new ProgressPaintable(layout_box)); + return adopt_ref(*new ProgressPaintable(layout_box)); } ProgressPaintable::ProgressPaintable(Layout::Progress const& layout_box) diff --git a/Userland/Libraries/LibWeb/Painting/ProgressPaintable.h b/Userland/Libraries/LibWeb/Painting/ProgressPaintable.h index 122f5436ba..7e488a19cc 100644 --- a/Userland/Libraries/LibWeb/Painting/ProgressPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/ProgressPaintable.h @@ -13,7 +13,7 @@ namespace Web::Painting { class ProgressPaintable final : public PaintableBox { public: - static NonnullOwnPtr<ProgressPaintable> create(Layout::Progress const&); + static NonnullRefPtr<ProgressPaintable> create(Layout::Progress const&); virtual void paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/RadioButtonPaintable.cpp b/Userland/Libraries/LibWeb/Painting/RadioButtonPaintable.cpp index 6feb8b9141..4e424e7a60 100644 --- a/Userland/Libraries/LibWeb/Painting/RadioButtonPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/RadioButtonPaintable.cpp @@ -11,9 +11,9 @@ namespace Web::Painting { -NonnullOwnPtr<RadioButtonPaintable> RadioButtonPaintable::create(Layout::RadioButton const& layout_box) +NonnullRefPtr<RadioButtonPaintable> RadioButtonPaintable::create(Layout::RadioButton const& layout_box) { - return adopt_own(*new RadioButtonPaintable(layout_box)); + return adopt_ref(*new RadioButtonPaintable(layout_box)); } RadioButtonPaintable::RadioButtonPaintable(Layout::RadioButton const& layout_box) diff --git a/Userland/Libraries/LibWeb/Painting/RadioButtonPaintable.h b/Userland/Libraries/LibWeb/Painting/RadioButtonPaintable.h index acd7f4eff0..274fb9069f 100644 --- a/Userland/Libraries/LibWeb/Painting/RadioButtonPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/RadioButtonPaintable.h @@ -13,7 +13,7 @@ namespace Web::Painting { class RadioButtonPaintable final : public PaintableBox { public: - static NonnullOwnPtr<RadioButtonPaintable> create(Layout::RadioButton const&); + static NonnullRefPtr<RadioButtonPaintable> create(Layout::RadioButton const&); virtual void paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp b/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp index 258cf0c6d0..e55a1056f4 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.cpp @@ -11,9 +11,9 @@ namespace Web::Painting { -NonnullOwnPtr<SVGGeometryPaintable> SVGGeometryPaintable::create(Layout::SVGGeometryBox const& layout_box) +NonnullRefPtr<SVGGeometryPaintable> SVGGeometryPaintable::create(Layout::SVGGeometryBox const& layout_box) { - return adopt_own(*new SVGGeometryPaintable(layout_box)); + return adopt_ref(*new SVGGeometryPaintable(layout_box)); } SVGGeometryPaintable::SVGGeometryPaintable(Layout::SVGGeometryBox const& layout_box) diff --git a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.h b/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.h index 4ae8d553a4..c39b8453ed 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/SVGGeometryPaintable.h @@ -13,7 +13,7 @@ namespace Web::Painting { class SVGGeometryPaintable : public SVGGraphicsPaintable { public: - static NonnullOwnPtr<SVGGeometryPaintable> create(Layout::SVGGeometryBox const&); + static NonnullRefPtr<SVGGeometryPaintable> create(Layout::SVGGeometryBox const&); virtual void paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.h b/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.h index dffdec0b5f..56b1a2e488 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/SVGGraphicsPaintable.h @@ -13,8 +13,6 @@ namespace Web::Painting { class SVGGraphicsPaintable : public SVGPaintable { public: - static NonnullOwnPtr<SVGGraphicsPaintable> create(Layout::SVGGraphicsBox const&); - virtual void before_children_paint(PaintContext&, PaintPhase) const override; Layout::SVGGraphicsBox const& layout_box() const; diff --git a/Userland/Libraries/LibWeb/Painting/SVGPaintable.h b/Userland/Libraries/LibWeb/Painting/SVGPaintable.h index f235b0c0ab..d1a2250bd8 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/SVGPaintable.h @@ -13,8 +13,6 @@ namespace Web::Painting { class SVGPaintable : public PaintableBox { public: - static NonnullOwnPtr<SVGPaintable> create(Layout::SVGBox const&); - virtual void before_children_paint(PaintContext&, PaintPhase) const override; virtual void after_children_paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp b/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp index 0478d62cda..3302d06e08 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.cpp @@ -9,6 +9,11 @@ namespace Web::Painting { +NonnullRefPtr<SVGSVGPaintable> SVGSVGPaintable::create(Layout::SVGSVGBox const& layout_box) +{ + return adopt_ref(*new SVGSVGPaintable(layout_box)); +} + SVGSVGPaintable::SVGSVGPaintable(Layout::SVGSVGBox const& layout_box) : SVGGraphicsPaintable(layout_box) { diff --git a/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.h b/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.h index 1bd784d0ce..f6043464f9 100644 --- a/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/SVGSVGPaintable.h @@ -13,7 +13,7 @@ namespace Web::Painting { class SVGSVGPaintable : public SVGGraphicsPaintable { public: - static NonnullOwnPtr<SVGSVGPaintable> create(Layout::SVGSVGBox const&); + static NonnullRefPtr<SVGSVGPaintable> create(Layout::SVGSVGBox const&); virtual void before_children_paint(PaintContext&, PaintPhase) const override; virtual void after_children_paint(PaintContext&, PaintPhase) const override; diff --git a/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp b/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp index 69db64ffdc..00bf0f9978 100644 --- a/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp +++ b/Userland/Libraries/LibWeb/Painting/TextPaintable.cpp @@ -4,13 +4,16 @@ * SPDX-License-Identifier: BSD-2-Clause */ +#include <LibWeb/HTML/BrowsingContext.h> +#include <LibWeb/Layout/Label.h> +#include <LibWeb/Page/EventHandler.h> #include <LibWeb/Painting/TextPaintable.h> namespace Web::Painting { -NonnullOwnPtr<TextPaintable> TextPaintable::create(Layout::TextNode const& layout_node) +NonnullRefPtr<TextPaintable> TextPaintable::create(Layout::TextNode const& layout_node) { - return adopt_own(*new TextPaintable(layout_node)); + return adopt_ref(*new TextPaintable(layout_node)); } TextPaintable::TextPaintable(Layout::TextNode const& layout_node) diff --git a/Userland/Libraries/LibWeb/Painting/TextPaintable.h b/Userland/Libraries/LibWeb/Painting/TextPaintable.h index 88137191b9..3ef3deff31 100644 --- a/Userland/Libraries/LibWeb/Painting/TextPaintable.h +++ b/Userland/Libraries/LibWeb/Painting/TextPaintable.h @@ -12,7 +12,7 @@ namespace Web::Painting { class TextPaintable : public Paintable { public: - static NonnullOwnPtr<TextPaintable> create(Layout::TextNode const&); + static NonnullRefPtr<TextPaintable> create(Layout::TextNode const&); Layout::TextNode const& layout_node() const { return static_cast<Layout::TextNode const&>(Paintable::layout_node()); } |