mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-10-04 07:09:41 +00:00
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`).
23 lines
567 B
C++
23 lines
567 B
C++
/*
|
|
* Copyright (c) 2024, MacDue <macdue@dueutil.tech>
|
|
*
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
|
*/
|
|
|
|
#include <LibWeb/Layout/SVGClipBox.h>
|
|
#include <LibWeb/Painting/SVGClipPaintable.h>
|
|
#include <LibWeb/Painting/StackingContext.h>
|
|
|
|
namespace Web::Layout {
|
|
|
|
SVGClipBox::SVGClipBox(DOM::Document& document, SVG::SVGClipPathElement& element, NonnullRefPtr<CSS::StyleProperties> properties)
|
|
: SVGBox(document, element, properties)
|
|
{
|
|
}
|
|
|
|
JS::GCPtr<Painting::Paintable> SVGClipBox::create_paintable() const
|
|
{
|
|
return Painting::SVGClipPaintable::create(*this);
|
|
}
|
|
|
|
}
|