1
0
Fork 0
mirror of https://github.com/LadybirdBrowser/ladybird.git synced 2025-06-10 18:10:56 +09:00

LibWeb: Add an initial implementation of SVG <radialGradient>

This follows on from the SVG linear gradients. It supports the same
features (xlink:href, gradientUnits, gradientTransform).

With this commit I have now implemented all web gradients :^)

(Though we are still missing a few parameters for SVG gradients,
e.g. spreadMethod).
This commit is contained in:
MacDue 2023-05-02 23:11:58 +01:00 committed by Andreas Kling
parent 2826bd2b45
commit 9b652842e4
Notes: sideshowbarker 2024-07-16 23:03:06 +09:00
6 changed files with 289 additions and 0 deletions

View file

@ -92,6 +92,7 @@
#include <LibWeb/SVG/SVGPathElement.h>
#include <LibWeb/SVG/SVGPolygonElement.h>
#include <LibWeb/SVG/SVGPolylineElement.h>
#include <LibWeb/SVG/SVGRadialGradientElement.h>
#include <LibWeb/SVG/SVGRectElement.h>
#include <LibWeb/SVG/SVGSVGElement.h>
#include <LibWeb/SVG/SVGStopElement.h>
@ -441,6 +442,8 @@ static WebIDL::ExceptionOr<JS::GCPtr<SVG::SVGElement>> create_svg_element(JS::Re
return MUST_OR_THROW_OOM(realm.heap().allocate<SVG::SVGPolygonElement>(realm, document, move(qualified_name)));
if (local_name == SVG::TagNames::polyline)
return MUST_OR_THROW_OOM(realm.heap().allocate<SVG::SVGPolylineElement>(realm, document, move(qualified_name)));
if (local_name == SVG::TagNames::radialGradient)
return MUST_OR_THROW_OOM(realm.heap().allocate<SVG::SVGRadialGradientElement>(realm, document, move(qualified_name)));
if (local_name == SVG::TagNames::rect)
return MUST_OR_THROW_OOM(realm.heap().allocate<SVG::SVGRectElement>(realm, document, move(qualified_name)));
if (local_name == SVG::TagNames::g)