mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 20:57:35 +00:00
LibWeb: Add SVGDefsElement
* Similarly to clipPath, this doesn't need to get rendered, so return no LayoutNode.
This commit is contained in:
parent
55e9192886
commit
bd90498332
8 changed files with 62 additions and 0 deletions
|
@ -269,6 +269,8 @@
|
||||||
#include <LibWeb/Bindings/SVGCircleElementPrototype.h>
|
#include <LibWeb/Bindings/SVGCircleElementPrototype.h>
|
||||||
#include <LibWeb/Bindings/SVGClipPathElementConstructor.h>
|
#include <LibWeb/Bindings/SVGClipPathElementConstructor.h>
|
||||||
#include <LibWeb/Bindings/SVGClipPathElementPrototype.h>
|
#include <LibWeb/Bindings/SVGClipPathElementPrototype.h>
|
||||||
|
#include <LibWeb/Bindings/SVGDefsElementConstructor.h>
|
||||||
|
#include <LibWeb/Bindings/SVGDefsElementPrototype.h>
|
||||||
#include <LibWeb/Bindings/SVGElementConstructor.h>
|
#include <LibWeb/Bindings/SVGElementConstructor.h>
|
||||||
#include <LibWeb/Bindings/SVGElementPrototype.h>
|
#include <LibWeb/Bindings/SVGElementPrototype.h>
|
||||||
#include <LibWeb/Bindings/SVGEllipseElementConstructor.h>
|
#include <LibWeb/Bindings/SVGEllipseElementConstructor.h>
|
||||||
|
@ -487,6 +489,7 @@
|
||||||
ADD_WINDOW_OBJECT_INTERFACE(SVGElement) \
|
ADD_WINDOW_OBJECT_INTERFACE(SVGElement) \
|
||||||
ADD_WINDOW_OBJECT_INTERFACE(SVGCircleElement) \
|
ADD_WINDOW_OBJECT_INTERFACE(SVGCircleElement) \
|
||||||
ADD_WINDOW_OBJECT_INTERFACE(SVGClipPathElement) \
|
ADD_WINDOW_OBJECT_INTERFACE(SVGClipPathElement) \
|
||||||
|
ADD_WINDOW_OBJECT_INTERFACE(SVGDefsElement) \
|
||||||
ADD_WINDOW_OBJECT_INTERFACE(SVGEllipseElement) \
|
ADD_WINDOW_OBJECT_INTERFACE(SVGEllipseElement) \
|
||||||
ADD_WINDOW_OBJECT_INTERFACE(SVGGeometryElement) \
|
ADD_WINDOW_OBJECT_INTERFACE(SVGGeometryElement) \
|
||||||
ADD_WINDOW_OBJECT_INTERFACE(SVGGraphicsElement) \
|
ADD_WINDOW_OBJECT_INTERFACE(SVGGraphicsElement) \
|
||||||
|
|
|
@ -318,6 +318,7 @@ set(SOURCES
|
||||||
SVG/AttributeParser.cpp
|
SVG/AttributeParser.cpp
|
||||||
SVG/SVGAnimatedLength.cpp
|
SVG/SVGAnimatedLength.cpp
|
||||||
SVG/SVGClipPathElement.cpp
|
SVG/SVGClipPathElement.cpp
|
||||||
|
SVG/SVGDefsElement.cpp
|
||||||
SVG/SVGElement.cpp
|
SVG/SVGElement.cpp
|
||||||
SVG/SVGElement.cpp
|
SVG/SVGElement.cpp
|
||||||
SVG/SVGGElement.cpp
|
SVG/SVGGElement.cpp
|
||||||
|
@ -584,6 +585,7 @@ libweb_js_wrapper(RequestIdleCallback/IdleDeadline)
|
||||||
libweb_js_wrapper(ResizeObserver/ResizeObserver)
|
libweb_js_wrapper(ResizeObserver/ResizeObserver)
|
||||||
libweb_js_wrapper(SVG/SVGAnimatedLength)
|
libweb_js_wrapper(SVG/SVGAnimatedLength)
|
||||||
libweb_js_wrapper(SVG/SVGClipPathElement)
|
libweb_js_wrapper(SVG/SVGClipPathElement)
|
||||||
|
libweb_js_wrapper(SVG/SVGDefsElement)
|
||||||
libweb_js_wrapper(SVG/SVGElement)
|
libweb_js_wrapper(SVG/SVGElement)
|
||||||
libweb_js_wrapper(SVG/SVGGeometryElement)
|
libweb_js_wrapper(SVG/SVGGeometryElement)
|
||||||
libweb_js_wrapper(SVG/SVGGraphicsElement)
|
libweb_js_wrapper(SVG/SVGGraphicsElement)
|
||||||
|
|
|
@ -78,6 +78,7 @@
|
||||||
#include <LibWeb/HTML/HTMLVideoElement.h>
|
#include <LibWeb/HTML/HTMLVideoElement.h>
|
||||||
#include <LibWeb/SVG/SVGCircleElement.h>
|
#include <LibWeb/SVG/SVGCircleElement.h>
|
||||||
#include <LibWeb/SVG/SVGClipPathElement.h>
|
#include <LibWeb/SVG/SVGClipPathElement.h>
|
||||||
|
#include <LibWeb/SVG/SVGDefsElement.h>
|
||||||
#include <LibWeb/SVG/SVGEllipseElement.h>
|
#include <LibWeb/SVG/SVGEllipseElement.h>
|
||||||
#include <LibWeb/SVG/SVGGElement.h>
|
#include <LibWeb/SVG/SVGGElement.h>
|
||||||
#include <LibWeb/SVG/SVGLineElement.h>
|
#include <LibWeb/SVG/SVGLineElement.h>
|
||||||
|
@ -266,6 +267,8 @@ NonnullRefPtr<Element> create_element(Document& document, FlyString local_name,
|
||||||
return adopt_ref(*new SVG::SVGClipPathElement(document, move(qualified_name)));
|
return adopt_ref(*new SVG::SVGClipPathElement(document, move(qualified_name)));
|
||||||
if (lowercase_tag_name == SVG::TagNames::circle)
|
if (lowercase_tag_name == SVG::TagNames::circle)
|
||||||
return adopt_ref(*new SVG::SVGCircleElement(document, move(qualified_name)));
|
return adopt_ref(*new SVG::SVGCircleElement(document, move(qualified_name)));
|
||||||
|
if (lowercase_tag_name.equals_ignoring_case(SVG::TagNames::defs))
|
||||||
|
return adopt_ref(*new SVG::SVGDefsElement(document, move(qualified_name)));
|
||||||
if (lowercase_tag_name == SVG::TagNames::ellipse)
|
if (lowercase_tag_name == SVG::TagNames::ellipse)
|
||||||
return adopt_ref(*new SVG::SVGEllipseElement(document, move(qualified_name)));
|
return adopt_ref(*new SVG::SVGEllipseElement(document, move(qualified_name)));
|
||||||
if (lowercase_tag_name == SVG::TagNames::line)
|
if (lowercase_tag_name == SVG::TagNames::line)
|
||||||
|
|
|
@ -297,6 +297,7 @@ namespace Web::SVG {
|
||||||
class SVGAnimatedLength;
|
class SVGAnimatedLength;
|
||||||
class SVGCircleElement;
|
class SVGCircleElement;
|
||||||
class SVGClipPathElement;
|
class SVGClipPathElement;
|
||||||
|
class SVGDefsElement;
|
||||||
class SVGElement;
|
class SVGElement;
|
||||||
class SVGEllipseElement;
|
class SVGEllipseElement;
|
||||||
class SVGGeometryElement;
|
class SVGGeometryElement;
|
||||||
|
@ -523,6 +524,7 @@ class SubmitEventWrapper;
|
||||||
class SubtleCryptoWrapper;
|
class SubtleCryptoWrapper;
|
||||||
class SVGAnimatedLengthWrapper;
|
class SVGAnimatedLengthWrapper;
|
||||||
class SVGCircleElementWrapper;
|
class SVGCircleElementWrapper;
|
||||||
|
class SVGDefsElementWrapper;
|
||||||
class SVGClipPathElementWrapper;
|
class SVGClipPathElementWrapper;
|
||||||
class SVGElementWrapper;
|
class SVGElementWrapper;
|
||||||
class SVGEllipseElementWrapper;
|
class SVGEllipseElementWrapper;
|
||||||
|
|
25
Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp
Normal file
25
Userland/Libraries/LibWeb/SVG/SVGDefsElement.cpp
Normal file
|
@ -0,0 +1,25 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022, Simon Danner <danner.simon@gmail.com>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#include <LibWeb/SVG/SVGDefsElement.h>
|
||||||
|
|
||||||
|
namespace Web::SVG {
|
||||||
|
|
||||||
|
SVGDefsElement::SVGDefsElement(DOM::Document& document, DOM::QualifiedName qualified_name)
|
||||||
|
: SVGGraphicsElement(document, move(qualified_name))
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
SVGDefsElement::~SVGDefsElement()
|
||||||
|
{
|
||||||
|
}
|
||||||
|
|
||||||
|
RefPtr<Layout::Node> SVGDefsElement::create_layout_node(NonnullRefPtr<CSS::StyleProperties>)
|
||||||
|
{
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
23
Userland/Libraries/LibWeb/SVG/SVGDefsElement.h
Normal file
23
Userland/Libraries/LibWeb/SVG/SVGDefsElement.h
Normal file
|
@ -0,0 +1,23 @@
|
||||||
|
/*
|
||||||
|
* Copyright (c) 2022, Simon Danner <danner.simon@gmail.com>
|
||||||
|
*
|
||||||
|
* SPDX-License-Identifier: BSD-2-Clause
|
||||||
|
*/
|
||||||
|
|
||||||
|
#pragma once
|
||||||
|
|
||||||
|
#include <LibWeb/SVG/SVGGraphicsElement.h>
|
||||||
|
|
||||||
|
namespace Web::SVG {
|
||||||
|
|
||||||
|
class SVGDefsElement final : public SVGGraphicsElement {
|
||||||
|
public:
|
||||||
|
using WrapperType = Bindings::SVGDefsElementWrapper;
|
||||||
|
|
||||||
|
SVGDefsElement(DOM::Document&, DOM::QualifiedName);
|
||||||
|
virtual ~SVGDefsElement();
|
||||||
|
|
||||||
|
virtual RefPtr<Layout::Node> create_layout_node(NonnullRefPtr<CSS::StyleProperties>) override;
|
||||||
|
};
|
||||||
|
|
||||||
|
}
|
3
Userland/Libraries/LibWeb/SVG/SVGDefsElement.idl
Normal file
3
Userland/Libraries/LibWeb/SVG/SVGDefsElement.idl
Normal file
|
@ -0,0 +1,3 @@
|
||||||
|
[Exposed=Window]
|
||||||
|
interface SVGDefsElement : SVGGraphicsElement {
|
||||||
|
};
|
|
@ -25,6 +25,7 @@ namespace Web::SVG::TagNames {
|
||||||
#define ENUMERATE_SVG_TAGS \
|
#define ENUMERATE_SVG_TAGS \
|
||||||
ENUMERATE_SVG_GRAPHICS_TAGS \
|
ENUMERATE_SVG_GRAPHICS_TAGS \
|
||||||
__ENUMERATE_SVG_TAG(clipPath) \
|
__ENUMERATE_SVG_TAG(clipPath) \
|
||||||
|
__ENUMERATE_SVG_TAG(defs) \
|
||||||
__ENUMERATE_SVG_TAG(desc) \
|
__ENUMERATE_SVG_TAG(desc) \
|
||||||
__ENUMERATE_SVG_TAG(foreignObject) \
|
__ENUMERATE_SVG_TAG(foreignObject) \
|
||||||
__ENUMERATE_SVG_TAG(script) \
|
__ENUMERATE_SVG_TAG(script) \
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue