SVGForeignObjectPaintable.cpp 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839
  1. /*
  2. * Copyright (c) 2024, Aliaksandr Kalenik <kalenik.aliaksandr@gmail.com>
  3. *
  4. * SPDX-License-Identifier: BSD-2-Clause
  5. */
  6. #include <LibWeb/Painting/SVGForeignObjectPaintable.h>
  7. #include <LibWeb/SVG/SVGSVGElement.h>
  8. namespace Web::Painting {
  9. JS_DEFINE_ALLOCATOR(SVGForeignObjectPaintable);
  10. JS::NonnullGCPtr<SVGForeignObjectPaintable> SVGForeignObjectPaintable::create(Layout::SVGForeignObjectBox const& layout_box)
  11. {
  12. return layout_box.heap().allocate_without_realm<SVGForeignObjectPaintable>(layout_box);
  13. }
  14. SVGForeignObjectPaintable::SVGForeignObjectPaintable(Layout::SVGForeignObjectBox const& layout_box)
  15. : PaintableWithLines(layout_box)
  16. {
  17. }
  18. Layout::SVGForeignObjectBox const& SVGForeignObjectPaintable::layout_box() const
  19. {
  20. return static_cast<Layout::SVGForeignObjectBox const&>(layout_node());
  21. }
  22. TraversalDecision SVGForeignObjectPaintable::hit_test(CSSPixelPoint position, HitTestType type, Function<TraversalDecision(HitTestResult)> const& callback) const
  23. {
  24. return PaintableWithLines::hit_test(position, type, callback);
  25. }
  26. void SVGForeignObjectPaintable::paint(PaintContext& context, PaintPhase phase) const
  27. {
  28. PaintableWithLines::paint(context, phase);
  29. }
  30. }