LibWeb: Add SVGFEFunc{A,B,G,R}Element

This commit is contained in:
Jelle Raaijmakers 2025-11-05 17:05:26 +01:00 committed by Jelle Raaijmakers
parent db321cb74f
commit 70e98e72a8
Notes: github-actions[bot] 2025-11-09 00:23:49 +00:00
18 changed files with 268 additions and 0 deletions

View file

@ -0,0 +1,25 @@
/*
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/SVGFEFuncAElementPrototype.h>
#include <LibWeb/SVG/SVGFEFuncAElement.h>
namespace Web::SVG {
GC_DEFINE_ALLOCATOR(SVGFEFuncAElement);
SVGFEFuncAElement::SVGFEFuncAElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: SVGComponentTransferFunctionElement(document, qualified_name)
{
}
void SVGFEFuncAElement::initialize(JS::Realm& realm)
{
WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGFEFuncAElement);
Base::initialize(realm);
}
}

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/SVG/SVGComponentTransferFunctionElement.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::SVG {
// https://www.w3.org/TR/filter-effects-1/#InterfaceSVGFEFuncAElement
class SVGFEFuncAElement final : public SVGComponentTransferFunctionElement {
WEB_PLATFORM_OBJECT(SVGFEFuncAElement, SVGComponentTransferFunctionElement);
GC_DECLARE_ALLOCATOR(SVGFEFuncAElement);
public:
virtual ~SVGFEFuncAElement() override = default;
private:
SVGFEFuncAElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -0,0 +1,6 @@
#import <SVG/SVGComponentTransferFunctionElement.idl>
// https://www.w3.org/TR/filter-effects-1/#InterfaceSVGFEFuncAElement
[Exposed=Window]
interface SVGFEFuncAElement : SVGComponentTransferFunctionElement {
};

View file

@ -0,0 +1,25 @@
/*
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/SVGFEFuncBElementPrototype.h>
#include <LibWeb/SVG/SVGFEFuncBElement.h>
namespace Web::SVG {
GC_DEFINE_ALLOCATOR(SVGFEFuncBElement);
SVGFEFuncBElement::SVGFEFuncBElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: SVGComponentTransferFunctionElement(document, qualified_name)
{
}
void SVGFEFuncBElement::initialize(JS::Realm& realm)
{
WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGFEFuncBElement);
Base::initialize(realm);
}
}

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/SVG/SVGComponentTransferFunctionElement.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::SVG {
// https://www.w3.org/TR/filter-effects-1/#InterfaceSVGFEFuncBElement
class SVGFEFuncBElement final : public SVGComponentTransferFunctionElement {
WEB_PLATFORM_OBJECT(SVGFEFuncBElement, SVGComponentTransferFunctionElement);
GC_DECLARE_ALLOCATOR(SVGFEFuncBElement);
public:
virtual ~SVGFEFuncBElement() override = default;
private:
SVGFEFuncBElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -0,0 +1,6 @@
#import <SVG/SVGComponentTransferFunctionElement.idl>
// https://www.w3.org/TR/filter-effects-1/#InterfaceSVGFEFuncBElement
[Exposed=Window]
interface SVGFEFuncBElement : SVGComponentTransferFunctionElement {
};

View file

@ -0,0 +1,25 @@
/*
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/SVGFEFuncGElementPrototype.h>
#include <LibWeb/SVG/SVGFEFuncGElement.h>
namespace Web::SVG {
GC_DEFINE_ALLOCATOR(SVGFEFuncGElement);
SVGFEFuncGElement::SVGFEFuncGElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: SVGComponentTransferFunctionElement(document, qualified_name)
{
}
void SVGFEFuncGElement::initialize(JS::Realm& realm)
{
WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGFEFuncGElement);
Base::initialize(realm);
}
}

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/SVG/SVGComponentTransferFunctionElement.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::SVG {
// https://www.w3.org/TR/filter-effects-1/#InterfaceSVGFEFuncGElement
class SVGFEFuncGElement final : public SVGComponentTransferFunctionElement {
WEB_PLATFORM_OBJECT(SVGFEFuncGElement, SVGComponentTransferFunctionElement);
GC_DECLARE_ALLOCATOR(SVGFEFuncGElement);
public:
virtual ~SVGFEFuncGElement() override = default;
private:
SVGFEFuncGElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -0,0 +1,6 @@
#import <SVG/SVGComponentTransferFunctionElement.idl>
// https://www.w3.org/TR/filter-effects-1/#InterfaceSVGFEFuncGElement
[Exposed=Window]
interface SVGFEFuncGElement : SVGComponentTransferFunctionElement {
};

View file

@ -0,0 +1,25 @@
/*
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include <LibWeb/Bindings/SVGFEFuncRElementPrototype.h>
#include <LibWeb/SVG/SVGFEFuncRElement.h>
namespace Web::SVG {
GC_DEFINE_ALLOCATOR(SVGFEFuncRElement);
SVGFEFuncRElement::SVGFEFuncRElement(DOM::Document& document, DOM::QualifiedName qualified_name)
: SVGComponentTransferFunctionElement(document, qualified_name)
{
}
void SVGFEFuncRElement::initialize(JS::Realm& realm)
{
WEB_SET_PROTOTYPE_FOR_INTERFACE(SVGFEFuncRElement);
Base::initialize(realm);
}
}

View file

@ -0,0 +1,28 @@
/*
* Copyright (c) 2025, Jelle Raaijmakers <jelle@ladybird.org>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibWeb/SVG/SVGComponentTransferFunctionElement.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::SVG {
// https://www.w3.org/TR/filter-effects-1/#InterfaceSVGFEFuncRElement
class SVGFEFuncRElement final : public SVGComponentTransferFunctionElement {
WEB_PLATFORM_OBJECT(SVGFEFuncRElement, SVGComponentTransferFunctionElement);
GC_DECLARE_ALLOCATOR(SVGFEFuncRElement);
public:
virtual ~SVGFEFuncRElement() override = default;
private:
SVGFEFuncRElement(DOM::Document&, DOM::QualifiedName);
virtual void initialize(JS::Realm&) override;
};
}

View file

@ -0,0 +1,6 @@
#import <SVG/SVGComponentTransferFunctionElement.idl>
// https://www.w3.org/TR/filter-effects-1/#InterfaceSVGFEFuncRElement
[Exposed=Window]
interface SVGFEFuncRElement : SVGComponentTransferFunctionElement {
};

View file

@ -22,6 +22,10 @@ namespace Web::SVG::TagNames {
__ENUMERATE_SVG_TAG(feComponentTransfer) \
__ENUMERATE_SVG_TAG(feComposite) \
__ENUMERATE_SVG_TAG(feFlood) \
__ENUMERATE_SVG_TAG(feFuncA) \
__ENUMERATE_SVG_TAG(feFuncB) \
__ENUMERATE_SVG_TAG(feFuncG) \
__ENUMERATE_SVG_TAG(feFuncR) \
__ENUMERATE_SVG_TAG(feGaussianBlur) \
__ENUMERATE_SVG_TAG(feImage) \
__ENUMERATE_SVG_TAG(feMerge) \