mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-06-03 17:02:56 +00:00
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`).
This commit is contained in:
parent
0a061a6a63
commit
c1b5fe61d1
Notes:
sideshowbarker
2024-07-17 08:13:43 +09:00
Author: https://github.com/MacDue
Commit: c1b5fe61d1
Pull-request: https://github.com/SerenityOS/serenity/pull/23736
Issue: https://github.com/SerenityOS/serenity/issues/19648
Issue: https://github.com/SerenityOS/serenity/issues/23006
Reviewed-by: https://github.com/nico
11 changed files with 192 additions and 35 deletions
|
@ -5,6 +5,7 @@
|
|||
*/
|
||||
|
||||
#include <LibWeb/Bindings/Intrinsics.h>
|
||||
#include <LibWeb/SVG/AttributeNames.h>
|
||||
#include <LibWeb/SVG/SVGClipPathElement.h>
|
||||
|
||||
namespace Web::SVG {
|
||||
|
@ -26,8 +27,16 @@ void SVGClipPathElement::initialize(JS::Realm& realm)
|
|||
WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGClipPathElement);
|
||||
}
|
||||
|
||||
void SVGClipPathElement::attribute_changed(FlyString const& name, Optional<String> const& value)
|
||||
{
|
||||
SVGElement::attribute_changed(name, value);
|
||||
if (name == AttributeNames::clipPathUnits)
|
||||
m_clip_path_units = AttributeParser::parse_units(value.value_or(String {}));
|
||||
}
|
||||
|
||||
JS::GCPtr<Layout::Node> SVGClipPathElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties>)
|
||||
{
|
||||
// Clip paths are handled as a special case in the TreeBuilder.
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue