ladybird/Userland/Libraries/LibWeb/Layout/SVGClipBox.h
MacDue c1b5fe61d1 LibWeb: Lay out SVG <clipPath> uses
This uses the same trick as done for masks in #23554. Each use of an
SVG `<clipPath>` becomes it's own layout subtree rooted at it's user.
This allows each use have it's own layout (which allows supporting
features such as `clipPathUnits`).
2024-03-29 21:59:56 +01:00

29 lines
790 B
C++

/*
* Copyright (c) 2024, MacDue <macdue@dueutil.tech>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/Layout/SVGBox.h>
#include <LibWeb/SVG/SVGClipPathElement.h>
#include <LibWeb/SVG/SVGElement.h>
namespace Web::Layout {
class SVGClipBox : public SVGBox {
JS_CELL(SVGClipBox, SVGBox);
public:
SVGClipBox(DOM::Document&, SVG::SVGClipPathElement&, NonnullRefPtr<CSS::StyleProperties>);
virtual ~SVGClipBox() override = default;
SVG::SVGClipPathElement& dom_node() { return verify_cast<SVG::SVGClipPathElement>(SVGBox::dom_node()); }
SVG::SVGClipPathElement const& dom_node() const { return verify_cast<SVG::SVGClipPathElement>(SVGBox::dom_node()); }
virtual JS::GCPtr<Painting::Paintable> create_paintable() const override;
};
}