2024-04-25 20:21:12 +02:00
|
|
|
/*
|
|
|
|
* Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
|
|
|
|
*
|
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include <LibWeb/Painting/SVGForeignObjectPaintable.h>
|
|
|
|
#include <LibWeb/SVG/SVGSVGElement.h>
|
|
|
|
|
|
|
|
namespace Web::Painting {
|
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC_DEFINE_ALLOCATOR(SVGForeignObjectPaintable);
|
2024-04-25 20:21:12 +02:00
|
|
|
|
2024-11-15 04:01:23 +13:00
|
|
|
GC::Ref<SVGForeignObjectPaintable> SVGForeignObjectPaintable::create(Layout::SVGForeignObjectBox const& layout_box)
|
2024-04-25 20:21:12 +02:00
|
|
|
{
|
2024-11-14 06:13:46 +13:00
|
|
|
return layout_box.heap().allocate<SVGForeignObjectPaintable>(layout_box);
|
2024-04-25 20:21:12 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
SVGForeignObjectPaintable::SVGForeignObjectPaintable(Layout::SVGForeignObjectBox const& layout_box)
|
|
|
|
: PaintableWithLines(layout_box)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
Layout::SVGForeignObjectBox const& SVGForeignObjectPaintable::layout_box() const
|
|
|
|
{
|
|
|
|
return static_cast<Layout::SVGForeignObjectBox const&>(layout_node());
|
|
|
|
}
|
|
|
|
|
|
|
|
TraversalDecision SVGForeignObjectPaintable::hit_test(CSSPixelPoint position, HitTestType type, Function<TraversalDecision(HitTestResult)> const& callback) const
|
|
|
|
{
|
|
|
|
return PaintableWithLines::hit_test(position, type, callback);
|
|
|
|
}
|
|
|
|
|
2025-07-31 23:07:26 +02:00
|
|
|
void SVGForeignObjectPaintable::paint(DisplayListRecordingContext& context, PaintPhase phase) const
|
2024-04-25 20:21:12 +02:00
|
|
|
{
|
2025-07-03 10:53:01 +01:00
|
|
|
if (!is_visible())
|
|
|
|
return;
|
|
|
|
|
2024-04-25 20:21:12 +02:00
|
|
|
PaintableWithLines::paint(context, phase);
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|