Skip to content

Truly independent web browser

LibWeb: Make SVGAnimatedEnumeration reflect its content attribute

Andreas Kling4d053434192a
diff --git a/Libraries/LibWeb/SVG/AttributeNames.h b/Libraries/LibWeb/SVG/AttributeNames.h
index 26b531129d0..d61b62f7b46 100644
--- a/Libraries/LibWeb/SVG/AttributeNames.h
+++ b/Libraries/LibWeb/SVG/AttributeNames.h
@@ -62,6 +62,7 @@ namespace Web::SVG::AttributeNames {
__ENUMERATE_SVG_ATTRIBUTE(markerWidth, "markerWidth") \
__ENUMERATE_SVG_ATTRIBUTE(maskContentUnits, "maskContentUnits") \
__ENUMERATE_SVG_ATTRIBUTE(maskUnits, "maskUnits") \
+ __ENUMERATE_SVG_ATTRIBUTE(method, "method") \
__ENUMERATE_SVG_ATTRIBUTE(mode, "mode") \
__ENUMERATE_SVG_ATTRIBUTE(numOctaves, "numOctaves") \
__ENUMERATE_SVG_ATTRIBUTE(offset, "offset") \
@@ -96,6 +97,7 @@ namespace Web::SVG::AttributeNames {
__ENUMERATE_SVG_ATTRIBUTE(slope, "slope") \
__ENUMERATE_SVG_ATTRIBUTE(specularConstant, "specularConstant") \
__ENUMERATE_SVG_ATTRIBUTE(specularExponent, "specularExponent") \
+ __ENUMERATE_SVG_ATTRIBUTE(spacing, "spacing") \
__ENUMERATE_SVG_ATTRIBUTE(spreadMethod, "spreadMethod") \
__ENUMERATE_SVG_ATTRIBUTE(startOffset, "startOffset") \
__ENUMERATE_SVG_ATTRIBUTE(stdDeviation, "stdDeviation") \
diff --git a/Libraries/LibWeb/SVG/SVGAnimatedEnumeration.cpp b/Libraries/LibWeb/SVG/SVGAnimatedEnumeration.cpp
index 50dea89cb95..e60b2a416d3 100644
--- a/Libraries/LibWeb/SVG/SVGAnimatedEnumeration.cpp
+++ b/Libraries/LibWeb/SVG/SVGAnimatedEnumeration.cpp
@@ -6,54 +6,77 @@
#include <LibGC/Heap.h>
#include <LibWeb/SVG/SVGAnimatedEnumeration.h>
+#include <LibWeb/SVG/SVGElement.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::SVG {
GC_DEFINE_ALLOCATOR(SVGAnimatedEnumeration);
-GC::Ref<SVGAnimatedEnumeration> SVGAnimatedEnumeration::create(u16 value)
+GC::Ref<SVGAnimatedEnumeration> SVGAnimatedEnumeration::create(GC::Ref<SVGElement> element, Utf16FlyString reflected_attribute, ReadonlySpan<Keyword> keywords, u16 initial_value)
{
- return GC::Heap::the().allocate<SVGAnimatedEnumeration>(value);
+ return GC::Heap::the().allocate<SVGAnimatedEnumeration>(element, move(reflected_attribute), keywords, initial_value);
}
-SVGAnimatedEnumeration::SVGAnimatedEnumeration(u16 value)
- : m_value(value)
+SVGAnimatedEnumeration::SVGAnimatedEnumeration(GC::Ref<SVGElement> element, Utf16FlyString reflected_attribute, ReadonlySpan<Keyword> keywords, u16 initial_value)
+ : m_element(element)
+ , m_reflected_attribute(move(reflected_attribute))
+ , m_keywords(keywords)
+ , m_initial_value(initial_value)
{
}
SVGAnimatedEnumeration::~SVGAnimatedEnumeration() = default;
+void SVGAnimatedEnumeration::visit_edges(Cell::Visitor& visitor)
+{
+ Base::visit_edges(visitor);
+ visitor.visit(m_element);
+}
+
// https://svgwg.org/svg2-draft/types.html#__svg__SVGAnimatedEnumeration__baseVal
WebIDL::ExceptionOr<void> SVGAnimatedEnumeration::set_base_val(u16 base_val)
{
// 1. Let value be the value being assigned to baseVal.
auto value = base_val;
- // FIXME: 2. If value is 0 or is not the numeric type value for any value of the reflected attribute, then throw a
+ // 2. If value is 0 or is not the numeric type value for any value of the reflected attribute, then throw a
// TypeError.
- if (value == 0)
- return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, "invalid value for baseVal"_utf16 };
+ auto keyword = [&] -> Optional<StringView> {
+ if (value == 0)
+ return {};
+ for (auto const& mapping : m_keywords) {
+ if (mapping.value == value)
+ return mapping.keyword;
+ }
+ return {};
+ }();
+ if (!keyword.has_value())
+ return WebIDL::SimpleException { WebIDL::SimpleExceptionType::TypeError, "Invalid value for baseVal"_utf16 };
// FIXME: 3. Otherwise, if the reflecting IDL attribute is orientType and value is SVG_MARKER_ORIENT_ANGLE, then set the
// reflected attribute to the string "0".
- // FIXME: 4. Otherwise, value is the numeric type value for a specific, single keyword value for the reflected attribute.
+ // 4. Otherwise, value is the numeric type value for a specific, single keyword value for the reflected attribute.
// Set the reflected attribute to that value.
- m_value = value;
-
+ m_element->set_attribute_value(m_reflected_attribute, Utf16String::from_utf8(*keyword));
return {};
}
// https://svgwg.org/svg2-draft/types.html#__svg__SVGAnimatedEnumeration__baseVal
u16 SVGAnimatedEnumeration::base_or_anim_value() const
{
- // FIXME: 1. Let value be the value of the reflected attribute (using the attribute's initial value if it is not present or
+ // 1. Let value be the value of the reflected attribute (using the attribute's initial value if it is not present or
// invalid).
+ auto value = m_element->get_attribute_value(m_reflected_attribute);
- // FIXME: 2. Return the numeric type value for value, according to the reflecting IDL attribute's definition.
-
- return m_value;
+ // 2. Return the numeric type value for value, according to the reflecting IDL attribute's definition.
+ // NB: Keywords are matched case-sensitively, and any other value is invalid.
+ for (auto const& mapping : m_keywords) {
+ if (value.utf16_view() == mapping.keyword)
+ return mapping.value;
+ }
+ return m_initial_value;
}
}
diff --git a/Libraries/LibWeb/SVG/SVGAnimatedEnumeration.h b/Libraries/LibWeb/SVG/SVGAnimatedEnumeration.h
index 79b4c5fe6c0..240b6828fad 100644
--- a/Libraries/LibWeb/SVG/SVGAnimatedEnumeration.h
+++ b/Libraries/LibWeb/SVG/SVGAnimatedEnumeration.h
@@ -6,7 +6,11 @@
#pragma once
+#include <AK/Span.h>
+#include <AK/StringView.h>
+#include <AK/Utf16FlyString.h>
#include <LibWeb/Bindings/Wrappable.h>
+#include <LibWeb/Forward.h>
#include <LibWeb/WebIDL/ExceptionOr.h>
namespace Web::SVG {
@@ -17,7 +21,13 @@ class SVGAnimatedEnumeration final : public Bindings::GCAllocatedWrappable {
GC_DECLARE_ALLOCATOR(SVGAnimatedEnumeration);
public:
- [[nodiscard]] static GC::Ref<SVGAnimatedEnumeration> create(u16 value);
+ // A keyword of the reflected attribute, and the numeric type value it maps to.
+ struct Keyword {
+ StringView keyword;
+ u16 value;
+ };
+
+ [[nodiscard]] static GC::Ref<SVGAnimatedEnumeration> create(GC::Ref<SVGElement>, Utf16FlyString reflected_attribute, ReadonlySpan<Keyword> keywords, u16 initial_value);
virtual ~SVGAnimatedEnumeration() override;
u16 base_val() const { return base_or_anim_value(); }
@@ -26,11 +36,16 @@ public:
u16 anim_val() const { return base_or_anim_value(); }
private:
- SVGAnimatedEnumeration(u16 value);
+ SVGAnimatedEnumeration(GC::Ref<SVGElement>, Utf16FlyString reflected_attribute, ReadonlySpan<Keyword> keywords, u16 initial_value);
+
+ virtual void visit_edges(Cell::Visitor&) override;
u16 base_or_anim_value() const;
- u16 m_value;
+ GC::Ref<SVGElement> m_element;
+ Utf16FlyString m_reflected_attribute;
+ ReadonlySpan<Keyword> m_keywords;
+ u16 m_initial_value { 0 };
};
}
diff --git a/Libraries/LibWeb/SVG/SVGClipPathElement.cpp b/Libraries/LibWeb/SVG/SVGClipPathElement.cpp
index 0df5adebd5c..9c8a063c36e 100644
--- a/Libraries/LibWeb/SVG/SVGClipPathElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGClipPathElement.cpp
@@ -7,6 +7,7 @@
#include <LibWeb/CSS/ElementBoxKind.h>
#include <LibWeb/SVG/AttributeNames.h>
#include <LibWeb/SVG/SVGClipPathElement.h>
+#include <LibWeb/SVG/SVGUnitTypes.h>
namespace Web::SVG {
@@ -37,4 +38,10 @@ CSS::ElementBoxKind SVGClipPathElement::box_kind() const
return CSS::ElementBoxKind::NoBox;
}
+// https://drafts.fxtf.org/css-masking/#dom-svgclippathelement-clippathunits
+GC::Ref<SVGAnimatedEnumeration> SVGClipPathElement::clip_path_units_for_bindings()
+{
+ return svg_animated_enumeration_for_attribute(AttributeNames::clipPathUnits, svg_unit_type_keywords, to_underlying(SVGUnitType::UserSpaceOnUse));
+}
+
}
diff --git a/Libraries/LibWeb/SVG/SVGClipPathElement.h b/Libraries/LibWeb/SVG/SVGClipPathElement.h
index c0e7fb62df5..cc55aa7c3ed 100644
--- a/Libraries/LibWeb/SVG/SVGClipPathElement.h
+++ b/Libraries/LibWeb/SVG/SVGClipPathElement.h
@@ -36,6 +36,8 @@ public:
virtual CSS::ElementBoxKind box_kind() const override;
+ GC::Ref<SVGAnimatedEnumeration> clip_path_units_for_bindings();
+
private:
SVGClipPathElement(DOM::Document&, DOM::QualifiedName);
diff --git a/Libraries/LibWeb/SVG/SVGClipPathElement.idl b/Libraries/LibWeb/SVG/SVGClipPathElement.idl
index 3744cda26f5..9e8c8ed33d9 100644
--- a/Libraries/LibWeb/SVG/SVGClipPathElement.idl
+++ b/Libraries/LibWeb/SVG/SVGClipPathElement.idl
@@ -2,7 +2,7 @@
[Exposed=Window]
interface SVGClipPathElement : SVGElement {
- [FIXME] readonly attribute SVGAnimatedEnumeration clipPathUnits;
+ [ImplementedAs=clip_path_units_for_bindings] readonly attribute SVGAnimatedEnumeration clipPathUnits;
[FIXME] readonly attribute SVGAnimatedTransformList transform;
};
diff --git a/Libraries/LibWeb/SVG/SVGComponentTransferFunctionElement.cpp b/Libraries/LibWeb/SVG/SVGComponentTransferFunctionElement.cpp
index 22c60ded746..6aced3d838d 100644
--- a/Libraries/LibWeb/SVG/SVGComponentTransferFunctionElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGComponentTransferFunctionElement.cpp
@@ -39,10 +39,6 @@ void SVGComponentTransferFunctionElement::attribute_changed(Utf16FlyString const
{
Base::attribute_changed(name, old_value, value, namespace_);
- // FIXME: Support reflection instead of invalidating the enumeration.
- if (name == AttributeNames::type)
- m_type = {};
-
// FIXME: Support reflection instead of invalidating the list.
if (name == AttributeNames::tableValues)
m_table_values = {};
@@ -54,7 +50,6 @@ void SVGComponentTransferFunctionElement::attribute_changed(Utf16FlyString const
void SVGComponentTransferFunctionElement::visit_edges(Visitor& visitor)
{
Base::visit_edges(visitor);
- visitor.visit(m_type);
visitor.visit(m_table_values);
visitor.visit(m_slope);
visitor.visit(m_intercept);
@@ -67,9 +62,14 @@ void SVGComponentTransferFunctionElement::visit_edges(Visitor& visitor)
// https://drafts.fxtf.org/filter-effects-1/#element-attrdef-fecomponenttransfer-type
GC::Ref<SVGAnimatedEnumeration> SVGComponentTransferFunctionElement::type()
{
- if (!m_type)
- m_type = SVGAnimatedEnumeration::create(to_underlying(type_from_attribute()));
- return *m_type;
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "identity"sv, to_underlying(Type::Identity) },
+ SVGAnimatedEnumeration::Keyword { "table"sv, to_underlying(Type::Table) },
+ SVGAnimatedEnumeration::Keyword { "discrete"sv, to_underlying(Type::Discrete) },
+ SVGAnimatedEnumeration::Keyword { "linear"sv, to_underlying(Type::Linear) },
+ SVGAnimatedEnumeration::Keyword { "gamma"sv, to_underlying(Type::Gamma) },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::type, keywords, to_underlying(Type::Identity));
}
// https://www.w3.org/TR/filter-effects-1/#dom-svgcomponenttransferfunctionelement-tablevalues
diff --git a/Libraries/LibWeb/SVG/SVGComponentTransferFunctionElement.h b/Libraries/LibWeb/SVG/SVGComponentTransferFunctionElement.h
index 897e0c5434b..d79eae2151c 100644
--- a/Libraries/LibWeb/SVG/SVGComponentTransferFunctionElement.h
+++ b/Libraries/LibWeb/SVG/SVGComponentTransferFunctionElement.h
@@ -53,7 +53,6 @@ private:
Type type_from_attribute() const;
- GC::Ptr<SVGAnimatedEnumeration> m_type;
GC::Ptr<SVGAnimatedNumberList> m_table_values;
GC::Ptr<SVGAnimatedNumber> m_slope;
GC::Ptr<SVGAnimatedNumber> m_intercept;
diff --git a/Libraries/LibWeb/SVG/SVGElement.cpp b/Libraries/LibWeb/SVG/SVGElement.cpp
index 18275a8b700..48ce48b2485 100644
--- a/Libraries/LibWeb/SVG/SVGElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGElement.cpp
@@ -424,6 +424,7 @@ void SVGElement::visit_edges(Cell::Visitor& visitor)
Base::visit_edges(visitor);
visitor.visit(m_class_name_animated_string);
visitor.visit(m_reflected_attribute_cache);
+ visitor.visit(m_reflected_enumeration_cache);
}
void SVGElement::attribute_changed(Utf16FlyString const& local_name, Optional<Utf16String> const& old_value, Optional<Utf16String> const& value, Optional<Utf16FlyString> const& namespace_)
@@ -738,4 +739,11 @@ GC::Ref<SVGAnimatedLength> SVGElement::svg_animated_length_for_attribute(Utf16Fl
return animated_length;
}
+GC::Ref<SVGAnimatedEnumeration> SVGElement::svg_animated_enumeration_for_attribute(Utf16FlyString const& attribute_name, ReadonlySpan<SVGAnimatedEnumeration::Keyword> keywords, u16 initial_value)
+{
+ return m_reflected_enumeration_cache.ensure(attribute_name, [&] {
+ return SVGAnimatedEnumeration::create(*this, attribute_name, keywords, initial_value);
+ });
+}
+
}
diff --git a/Libraries/LibWeb/SVG/SVGElement.h b/Libraries/LibWeb/SVG/SVGElement.h
index 459b3448b1b..95e5742279f 100644
--- a/Libraries/LibWeb/SVG/SVGElement.h
+++ b/Libraries/LibWeb/SVG/SVGElement.h
@@ -11,6 +11,7 @@
#include <LibWeb/Export.h>
#include <LibWeb/HTML/GlobalEventHandlers.h>
#include <LibWeb/HTML/HTMLOrSVGOrMathMLElement.h>
+#include <LibWeb/SVG/SVGAnimatedEnumeration.h>
#include <LibWeb/SVG/SVGAnimatedLength.h>
#include <LibWeb/SVG/SVGAnimatedString.h>
#include <LibWeb/SVG/SVGLength.h>
@@ -58,6 +59,7 @@ public:
bool is_referenceable_in_display_none_subtree() const;
GC::Ref<SVGAnimatedLength> svg_animated_length_for_attribute(Utf16FlyString const&, SVGLength::Directionality, SVGLengthValue default_value);
+ GC::Ref<SVGAnimatedEnumeration> svg_animated_enumeration_for_attribute(Utf16FlyString const&, ReadonlySpan<SVGAnimatedEnumeration::Keyword>, u16 initial_value);
virtual bool is_presentational_hint(Utf16FlyString const&) const final override;
virtual void apply_presentational_hints(Vector<CSS::StyleProperty>&) const final override;
@@ -104,6 +106,7 @@ private:
// Many reflecting attributes are marked as SameObject so we cache the objects we create here.
HashMap<Utf16FlyString, GC::Ref<SVGAnimatedLength>> m_reflected_attribute_cache;
+ HashMap<Utf16FlyString, GC::Ref<SVGAnimatedEnumeration>> m_reflected_enumeration_cache;
// Elements whose layout subtrees contain a <mask>, <clipPath>, or <pattern> resource box built
// from this element. Their subtrees must be rebuilt when this element is removed, since resource
diff --git a/Libraries/LibWeb/SVG/SVGFEBlendElement.cpp b/Libraries/LibWeb/SVG/SVGFEBlendElement.cpp
index b347133f028..b15763a1c27 100644
--- a/Libraries/LibWeb/SVG/SVGFEBlendElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGFEBlendElement.cpp
@@ -100,9 +100,29 @@ Gfx::CompositingAndBlendingOperator SVGFEBlendElement::mode() const
return Painting::mix_blend_mode_to_compositing_and_blending_operator(m_mode.value_or(CSS::MixBlendMode::Normal));
}
-GC::Ref<SVGAnimatedEnumeration> SVGFEBlendElement::mode_for_bindings() const
+// https://drafts.fxtf.org/filter-effects/#dom-svgfeblendelement-mode
+GC::Ref<SVGAnimatedEnumeration> SVGFEBlendElement::mode_for_bindings()
{
- return SVGAnimatedEnumeration::create(to_underlying(mode()));
+ // NB: The mode attribute takes a <blend-mode>, which does not include plus-darker and plus-lighter.
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "normal"sv, SVG_FEBLEND_MODE_NORMAL },
+ SVGAnimatedEnumeration::Keyword { "multiply"sv, SVG_FEBLEND_MODE_MULTIPLY },
+ SVGAnimatedEnumeration::Keyword { "screen"sv, SVG_FEBLEND_MODE_SCREEN },
+ SVGAnimatedEnumeration::Keyword { "darken"sv, SVG_FEBLEND_MODE_DARKEN },
+ SVGAnimatedEnumeration::Keyword { "lighten"sv, SVG_FEBLEND_MODE_LIGHTEN },
+ SVGAnimatedEnumeration::Keyword { "overlay"sv, SVG_FEBLEND_MODE_OVERLAY },
+ SVGAnimatedEnumeration::Keyword { "color-dodge"sv, SVG_FEBLEND_MODE_COLOR_DODGE },
+ SVGAnimatedEnumeration::Keyword { "color-burn"sv, SVG_FEBLEND_MODE_COLOR_BURN },
+ SVGAnimatedEnumeration::Keyword { "hard-light"sv, SVG_FEBLEND_MODE_HARD_LIGHT },
+ SVGAnimatedEnumeration::Keyword { "soft-light"sv, SVG_FEBLEND_MODE_SOFT_LIGHT },
+ SVGAnimatedEnumeration::Keyword { "difference"sv, SVG_FEBLEND_MODE_DIFFERENCE },
+ SVGAnimatedEnumeration::Keyword { "exclusion"sv, SVG_FEBLEND_MODE_EXCLUSION },
+ SVGAnimatedEnumeration::Keyword { "hue"sv, SVG_FEBLEND_MODE_HUE },
+ SVGAnimatedEnumeration::Keyword { "saturation"sv, SVG_FEBLEND_MODE_SATURATION },
+ SVGAnimatedEnumeration::Keyword { "color"sv, SVG_FEBLEND_MODE_COLOR },
+ SVGAnimatedEnumeration::Keyword { "luminosity"sv, SVG_FEBLEND_MODE_LUMINOSITY },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::mode, keywords, SVG_FEBLEND_MODE_NORMAL);
}
}
diff --git a/Libraries/LibWeb/SVG/SVGFEBlendElement.h b/Libraries/LibWeb/SVG/SVGFEBlendElement.h
index 7bfe56befed..e88b3883961 100644
--- a/Libraries/LibWeb/SVG/SVGFEBlendElement.h
+++ b/Libraries/LibWeb/SVG/SVGFEBlendElement.h
@@ -21,13 +21,31 @@ class SVGFEBlendElement final
GC_DECLARE_ALLOCATOR(SVGFEBlendElement);
public:
+ static constexpr u16 SVG_FEBLEND_MODE_UNKNOWN = 0;
+ static constexpr u16 SVG_FEBLEND_MODE_NORMAL = 1;
+ static constexpr u16 SVG_FEBLEND_MODE_MULTIPLY = 2;
+ static constexpr u16 SVG_FEBLEND_MODE_SCREEN = 3;
+ static constexpr u16 SVG_FEBLEND_MODE_DARKEN = 4;
+ static constexpr u16 SVG_FEBLEND_MODE_LIGHTEN = 5;
+ static constexpr u16 SVG_FEBLEND_MODE_OVERLAY = 6;
+ static constexpr u16 SVG_FEBLEND_MODE_COLOR_DODGE = 7;
+ static constexpr u16 SVG_FEBLEND_MODE_COLOR_BURN = 8;
+ static constexpr u16 SVG_FEBLEND_MODE_HARD_LIGHT = 9;
+ static constexpr u16 SVG_FEBLEND_MODE_SOFT_LIGHT = 10;
+ static constexpr u16 SVG_FEBLEND_MODE_DIFFERENCE = 11;
+ static constexpr u16 SVG_FEBLEND_MODE_EXCLUSION = 12;
+ static constexpr u16 SVG_FEBLEND_MODE_HUE = 13;
+ static constexpr u16 SVG_FEBLEND_MODE_SATURATION = 14;
+ static constexpr u16 SVG_FEBLEND_MODE_COLOR = 15;
+ static constexpr u16 SVG_FEBLEND_MODE_LUMINOSITY = 16;
+
virtual ~SVGFEBlendElement() override = default;
GC::Ref<SVGAnimatedString> in1();
GC::Ref<SVGAnimatedString> in2();
Gfx::CompositingAndBlendingOperator mode() const;
- GC::Ref<SVGAnimatedEnumeration> mode_for_bindings() const;
+ GC::Ref<SVGAnimatedEnumeration> mode_for_bindings();
private:
SVGFEBlendElement(DOM::Document&, DOM::QualifiedName);
diff --git a/Libraries/LibWeb/SVG/SVGFEColorMatrixElement.cpp b/Libraries/LibWeb/SVG/SVGFEColorMatrixElement.cpp
index 89dd0aee6ce..8c727b36b96 100644
--- a/Libraries/LibWeb/SVG/SVGFEColorMatrixElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGFEColorMatrixElement.cpp
@@ -44,24 +44,16 @@ GC::Ref<SVGAnimatedString> SVGFEColorMatrixElement::in1()
return *m_in1;
}
-GC::Ref<SVGAnimatedEnumeration> SVGFEColorMatrixElement::type() const
+// https://drafts.fxtf.org/filter-effects/#dom-svgfecolormatrixelement-type
+GC::Ref<SVGAnimatedEnumeration> SVGFEColorMatrixElement::type()
{
- // https://www.w3.org/TR/filter-effects-1/#InterfaceSVGFEColorMatrixElement
- // Map the 'type' attribute to the IDL enumeration values.
- // Defaults to MATRIX when omitted.
- auto type_attribute = attribute(AttributeNames::type).value_or({});
-
- u16 enum_value = SVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_UNKNOWN;
- if (type_attribute.is_empty() || type_attribute.equals_ignoring_ascii_case("matrix"sv))
- enum_value = SVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_MATRIX;
- else if (type_attribute.equals_ignoring_ascii_case("saturate"sv))
- enum_value = SVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_SATURATE;
- else if (type_attribute.equals_ignoring_ascii_case("hueRotate"sv))
- enum_value = SVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_HUEROTATE;
- else if (type_attribute.equals_ignoring_ascii_case("luminanceToAlpha"sv))
- enum_value = SVGFEColorMatrixElement::SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA;
-
- return SVGAnimatedEnumeration::create(enum_value);
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "matrix"sv, SVG_FECOLORMATRIX_TYPE_MATRIX },
+ SVGAnimatedEnumeration::Keyword { "saturate"sv, SVG_FECOLORMATRIX_TYPE_SATURATE },
+ SVGAnimatedEnumeration::Keyword { "hueRotate"sv, SVG_FECOLORMATRIX_TYPE_HUEROTATE },
+ SVGAnimatedEnumeration::Keyword { "luminanceToAlpha"sv, SVG_FECOLORMATRIX_TYPE_LUMINANCETOALPHA },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::type, keywords, SVG_FECOLORMATRIX_TYPE_MATRIX);
}
GC::Ref<SVGAnimatedNumberList> SVGFEColorMatrixElement::values()
diff --git a/Libraries/LibWeb/SVG/SVGFEColorMatrixElement.h b/Libraries/LibWeb/SVG/SVGFEColorMatrixElement.h
index a4530f5425e..3d8a34249a2 100644
--- a/Libraries/LibWeb/SVG/SVGFEColorMatrixElement.h
+++ b/Libraries/LibWeb/SVG/SVGFEColorMatrixElement.h
@@ -30,7 +30,7 @@ public:
// IDL attributes
GC::Ref<SVGAnimatedString> in1();
- GC::Ref<SVGAnimatedEnumeration> type() const;
+ GC::Ref<SVGAnimatedEnumeration> type();
GC::Ref<SVGAnimatedNumberList> values();
private:
diff --git a/Libraries/LibWeb/SVG/SVGFECompositeElement.cpp b/Libraries/LibWeb/SVG/SVGFECompositeElement.cpp
index 3507c5105d4..c5bf3e2c49a 100644
--- a/Libraries/LibWeb/SVG/SVGFECompositeElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGFECompositeElement.cpp
@@ -118,9 +118,20 @@ SVGFECompositeElement::CompositingOperator SVGFECompositeElement::operator_() co
}
// https://drafts.fxtf.org/filter-effects/#element-attrdef-fecomposite-operator
-GC::Ref<SVGAnimatedEnumeration> SVGFECompositeElement::operator_for_bindings() const
+GC::Ref<SVGAnimatedEnumeration> SVGFECompositeElement::operator_for_bindings()
{
- return SVGAnimatedEnumeration::create(to_underlying(m_operator.value_or(CompositingOperator::Over)));
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "over"sv, to_underlying(CompositingOperator::Over) },
+ SVGAnimatedEnumeration::Keyword { "in"sv, to_underlying(CompositingOperator::In) },
+ SVGAnimatedEnumeration::Keyword { "out"sv, to_underlying(CompositingOperator::Out) },
+ SVGAnimatedEnumeration::Keyword { "atop"sv, to_underlying(CompositingOperator::Atop) },
+ SVGAnimatedEnumeration::Keyword { "xor"sv, to_underlying(CompositingOperator::Xor) },
+ SVGAnimatedEnumeration::Keyword { "arithmetic"sv, to_underlying(CompositingOperator::Arithmetic) },
+ // NB: "lighter" is a valid value that has no constant in the IDL, so its numeric type value is
+ // SVG_FECOMPOSITE_OPERATOR_UNKNOWN.
+ SVGAnimatedEnumeration::Keyword { "lighter"sv, to_underlying(CompositingOperator::Unknown) },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::operator_, keywords, to_underlying(CompositingOperator::Over));
}
}
diff --git a/Libraries/LibWeb/SVG/SVGFECompositeElement.h b/Libraries/LibWeb/SVG/SVGFECompositeElement.h
index c5404d04b49..8a53b60a597 100644
--- a/Libraries/LibWeb/SVG/SVGFECompositeElement.h
+++ b/Libraries/LibWeb/SVG/SVGFECompositeElement.h
@@ -41,7 +41,7 @@ public:
Lighter = 7,
};
SVGFECompositeElement::CompositingOperator operator_() const;
- GC::Ref<SVGAnimatedEnumeration> operator_for_bindings() const;
+ GC::Ref<SVGAnimatedEnumeration> operator_for_bindings();
private:
SVGFECompositeElement(DOM::Document&, DOM::QualifiedName);
diff --git a/Libraries/LibWeb/SVG/SVGFEDisplacementMapElement.cpp b/Libraries/LibWeb/SVG/SVGFEDisplacementMapElement.cpp
index b30705d7e72..2edfe794a62 100644
--- a/Libraries/LibWeb/SVG/SVGFEDisplacementMapElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGFEDisplacementMapElement.cpp
@@ -25,8 +25,6 @@ void SVGFEDisplacementMapElement::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_in1);
visitor.visit(m_in2);
visitor.visit(m_scale);
- visitor.visit(m_x_channel_selector);
- visitor.visit(m_y_channel_selector);
}
// https://drafts.csswg.org/filter-effects/#dom-svgfedisplacementmapelement-in1
@@ -56,38 +54,23 @@ GC::Ref<SVGAnimatedNumber> SVGFEDisplacementMapElement::scale()
return *m_scale;
}
-// https://drafts.csswg.org/filter-effects/#element-attrdef-fedisplacementmap-xchannelselector
-static SVGFEDisplacementMapElement::ChannelSelector parse_channel_selector(Utf16View value)
-{
- if (value == "R"sv)
- return SVGFEDisplacementMapElement::ChannelSelector::Red;
-
- if (value == "G"sv)
- return SVGFEDisplacementMapElement::ChannelSelector::Green;
-
- if (value == "B"sv)
- return SVGFEDisplacementMapElement::ChannelSelector::Blue;
-
- if (value == "A"sv)
- return SVGFEDisplacementMapElement::ChannelSelector::Alpha;
-
- return SVGFEDisplacementMapElement::ChannelSelector::Alpha;
-}
-
// https://drafts.csswg.org/filter-effects/#dom-svgfedisplacementmapelement-xchannelselector
-GC::Ref<SVGAnimatedEnumeration> SVGFEDisplacementMapElement::x_channel_selector() const
+static constexpr Array channel_selector_keywords {
+ SVGAnimatedEnumeration::Keyword { "R"sv, to_underlying(SVGFEDisplacementMapElement::ChannelSelector::Red) },
+ SVGAnimatedEnumeration::Keyword { "G"sv, to_underlying(SVGFEDisplacementMapElement::ChannelSelector::Green) },
+ SVGAnimatedEnumeration::Keyword { "B"sv, to_underlying(SVGFEDisplacementMapElement::ChannelSelector::Blue) },
+ SVGAnimatedEnumeration::Keyword { "A"sv, to_underlying(SVGFEDisplacementMapElement::ChannelSelector::Alpha) },
+};
+
+GC::Ref<SVGAnimatedEnumeration> SVGFEDisplacementMapElement::x_channel_selector()
{
- // FIXME: Support reflection, don't return a new object every time.
- auto x_channel_selector = parse_channel_selector(get_attribute_value(AttributeNames::xChannelSelector));
- return SVGAnimatedEnumeration::create(to_underlying(x_channel_selector));
+ return svg_animated_enumeration_for_attribute(AttributeNames::xChannelSelector, channel_selector_keywords, to_underlying(ChannelSelector::Alpha));
}
// https://drafts.csswg.org/filter-effects/#dom-svgfedisplacementmapelement-ychannelselector
-GC::Ref<SVGAnimatedEnumeration> SVGFEDisplacementMapElement::y_channel_selector() const
+GC::Ref<SVGAnimatedEnumeration> SVGFEDisplacementMapElement::y_channel_selector()
{
- // FIXME: Support reflection, don't return a new object every time.
- auto y_channel_selector = parse_channel_selector(get_attribute_value(AttributeNames::yChannelSelector));
- return SVGAnimatedEnumeration::create(to_underlying(y_channel_selector));
+ return svg_animated_enumeration_for_attribute(AttributeNames::yChannelSelector, channel_selector_keywords, to_underlying(ChannelSelector::Alpha));
}
}
diff --git a/Libraries/LibWeb/SVG/SVGFEDisplacementMapElement.h b/Libraries/LibWeb/SVG/SVGFEDisplacementMapElement.h
index a592e99c2fb..6d990641f8a 100644
--- a/Libraries/LibWeb/SVG/SVGFEDisplacementMapElement.h
+++ b/Libraries/LibWeb/SVG/SVGFEDisplacementMapElement.h
@@ -32,8 +32,8 @@ public:
GC::Ref<SVGAnimatedString> in1();
GC::Ref<SVGAnimatedString> in2();
GC::Ref<SVGAnimatedNumber> scale();
- GC::Ref<SVGAnimatedEnumeration> x_channel_selector() const;
- GC::Ref<SVGAnimatedEnumeration> y_channel_selector() const;
+ GC::Ref<SVGAnimatedEnumeration> x_channel_selector();
+ GC::Ref<SVGAnimatedEnumeration> y_channel_selector();
private:
SVGFEDisplacementMapElement(DOM::Document&, DOM::QualifiedName);
@@ -42,8 +42,6 @@ private:
GC::Ptr<SVGAnimatedString> m_in1;
GC::Ptr<SVGAnimatedString> m_in2;
GC::Ptr<SVGAnimatedNumber> m_scale;
- GC::Ptr<SVGAnimatedEnumeration> m_x_channel_selector;
- GC::Ptr<SVGAnimatedEnumeration> m_y_channel_selector;
};
}
diff --git a/Libraries/LibWeb/SVG/SVGFEGaussianBlurElement.cpp b/Libraries/LibWeb/SVG/SVGFEGaussianBlurElement.cpp
index 210a65c892f..83d0d5f36c1 100644
--- a/Libraries/LibWeb/SVG/SVGFEGaussianBlurElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGFEGaussianBlurElement.cpp
@@ -55,10 +55,15 @@ GC::Ref<SVGAnimatedNumber> SVGFEGaussianBlurElement::std_deviation_y()
return *m_std_deviation_y;
}
-GC::Ref<SVGAnimatedEnumeration> SVGFEGaussianBlurElement::edge_mode() const
+// https://drafts.fxtf.org/filter-effects/#dom-svgfegaussianblurelement-edgemode
+GC::Ref<SVGAnimatedEnumeration> SVGFEGaussianBlurElement::edge_mode()
{
- // FIXME: Resolve the actual value from AttributeNames::edgeMode.
- return SVGAnimatedEnumeration::create(0);
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "duplicate"sv, SVG_EDGEMODE_DUPLICATE },
+ SVGAnimatedEnumeration::Keyword { "wrap"sv, SVG_EDGEMODE_WRAP },
+ SVGAnimatedEnumeration::Keyword { "none"sv, SVG_EDGEMODE_NONE },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::edgeMode, keywords, SVG_EDGEMODE_NONE);
}
}
diff --git a/Libraries/LibWeb/SVG/SVGFEGaussianBlurElement.h b/Libraries/LibWeb/SVG/SVGFEGaussianBlurElement.h
index 111d588b178..226bb56bb09 100644
--- a/Libraries/LibWeb/SVG/SVGFEGaussianBlurElement.h
+++ b/Libraries/LibWeb/SVG/SVGFEGaussianBlurElement.h
@@ -19,12 +19,17 @@ class SVGFEGaussianBlurElement final
GC_DECLARE_ALLOCATOR(SVGFEGaussianBlurElement);
public:
+ static constexpr u16 SVG_EDGEMODE_UNKNOWN = 0;
+ static constexpr u16 SVG_EDGEMODE_DUPLICATE = 1;
+ static constexpr u16 SVG_EDGEMODE_WRAP = 2;
+ static constexpr u16 SVG_EDGEMODE_NONE = 3;
+
virtual ~SVGFEGaussianBlurElement() override = default;
GC::Ref<SVGAnimatedString> in1();
GC::Ref<SVGAnimatedNumber> std_deviation_x();
GC::Ref<SVGAnimatedNumber> std_deviation_y();
- GC::Ref<SVGAnimatedEnumeration> edge_mode() const;
+ GC::Ref<SVGAnimatedEnumeration> edge_mode();
private:
SVGFEGaussianBlurElement(DOM::Document&, DOM::QualifiedName);
diff --git a/Libraries/LibWeb/SVG/SVGFEMorphologyElement.cpp b/Libraries/LibWeb/SVG/SVGFEMorphologyElement.cpp
index a7564cac8db..524c31e3fc3 100644
--- a/Libraries/LibWeb/SVG/SVGFEMorphologyElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGFEMorphologyElement.cpp
@@ -52,9 +52,14 @@ GC::Ref<SVGAnimatedString> SVGFEMorphologyElement::in1()
return *m_in1;
}
+// https://drafts.fxtf.org/filter-effects/#dom-svgfemorphologyelement-operator
GC::Ref<SVGAnimatedEnumeration> SVGFEMorphologyElement::operator_for_bindings()
{
- return SVGAnimatedEnumeration::create(to_underlying(m_morphology_operator));
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "erode"sv, SVG_MORPHOLOGY_OPERATOR_ERODE },
+ SVGAnimatedEnumeration::Keyword { "dilate"sv, SVG_MORPHOLOGY_OPERATOR_DILATE },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::operator_, keywords, SVG_MORPHOLOGY_OPERATOR_ERODE);
}
GC::Ref<SVGAnimatedNumber> SVGFEMorphologyElement::radius_x()
diff --git a/Libraries/LibWeb/SVG/SVGFEMorphologyElement.h b/Libraries/LibWeb/SVG/SVGFEMorphologyElement.h
index c734bd26b7a..6381502932f 100644
--- a/Libraries/LibWeb/SVG/SVGFEMorphologyElement.h
+++ b/Libraries/LibWeb/SVG/SVGFEMorphologyElement.h
@@ -23,6 +23,10 @@ class SVGFEMorphologyElement final
GC_DECLARE_ALLOCATOR(SVGFEMorphologyElement);
public:
+ static constexpr u16 SVG_MORPHOLOGY_OPERATOR_UNKNOWN = 0;
+ static constexpr u16 SVG_MORPHOLOGY_OPERATOR_ERODE = 1;
+ static constexpr u16 SVG_MORPHOLOGY_OPERATOR_DILATE = 2;
+
virtual ~SVGFEMorphologyElement() override = default;
GC::Ref<SVGAnimatedString> in1();
diff --git a/Libraries/LibWeb/SVG/SVGFETurbulenceElement.cpp b/Libraries/LibWeb/SVG/SVGFETurbulenceElement.cpp
index 1ccda96317c..267837f6465 100644
--- a/Libraries/LibWeb/SVG/SVGFETurbulenceElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGFETurbulenceElement.cpp
@@ -24,8 +24,6 @@ void SVGFETurbulenceElement::visit_edges(Cell::Visitor& visitor)
visitor.visit(m_base_frequency_y);
visitor.visit(m_num_octaves);
visitor.visit(m_seed);
- visitor.visit(m_stitch_tiles);
- visitor.visit(m_type);
}
// https://drafts.csswg.org/filter-effects/#dom-svgfeturbulenceelement-basefrequencyx
@@ -66,44 +64,24 @@ GC::Ref<SVGAnimatedNumber> SVGFETurbulenceElement::seed()
return *m_seed;
}
-// https://drafts.csswg.org/filter-effects/#element-attrdef-feturbulence-stitchtiles
-static SVGFETurbulenceElement::StitchType parse_stitch_tiles(Utf16View value)
-{
- if (value == "stitch"sv)
- return SVGFETurbulenceElement::StitchType::Stitch;
-
- if (value == "noStitch"sv)
- return SVGFETurbulenceElement::StitchType::NoStitch;
-
- return SVGFETurbulenceElement::StitchType::NoStitch;
-}
-
// https://drafts.csswg.org/filter-effects/#element-attrdef-feturbulence-stitchtiles
GC::Ref<SVGAnimatedEnumeration> SVGFETurbulenceElement::stitch_tiles()
{
- // FIXME: Support reflection, don't return a new object every time.
- auto stitch_tiles = parse_stitch_tiles(get_attribute_value(AttributeNames::stitchTiles));
- return SVGAnimatedEnumeration::create(to_underlying(stitch_tiles));
-}
-
-// https://drafts.csswg.org/filter-effects/#element-attrdef-feturbulence-type
-static SVGFETurbulenceElement::TurbulenceType parse_turbulence_type(Utf16View value)
-{
- if (value == "turbulence"sv)
- return SVGFETurbulenceElement::TurbulenceType::Turbulence;
-
- if (value == "fractalNoise"sv)
- return SVGFETurbulenceElement::TurbulenceType::FractalNoise;
-
- return SVGFETurbulenceElement::TurbulenceType::Turbulence;
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "stitch"sv, to_underlying(StitchType::Stitch) },
+ SVGAnimatedEnumeration::Keyword { "noStitch"sv, to_underlying(StitchType::NoStitch) },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::stitchTiles, keywords, to_underlying(StitchType::NoStitch));
}
// https://drafts.csswg.org/filter-effects/#dom-svgfeturbulenceelement-type
GC::Ref<SVGAnimatedEnumeration> SVGFETurbulenceElement::type()
{
- // FIXME: Support reflection, don't return a new object every time.
- auto turbulence_type = parse_turbulence_type(get_attribute_value(AttributeNames::type));
- return SVGAnimatedEnumeration::create(to_underlying(turbulence_type));
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "fractalNoise"sv, to_underlying(TurbulenceType::FractalNoise) },
+ SVGAnimatedEnumeration::Keyword { "turbulence"sv, to_underlying(TurbulenceType::Turbulence) },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::type, keywords, to_underlying(TurbulenceType::Turbulence));
}
}
diff --git a/Libraries/LibWeb/SVG/SVGFETurbulenceElement.h b/Libraries/LibWeb/SVG/SVGFETurbulenceElement.h
index 409e46180b7..6317c384e82 100644
--- a/Libraries/LibWeb/SVG/SVGFETurbulenceElement.h
+++ b/Libraries/LibWeb/SVG/SVGFETurbulenceElement.h
@@ -53,8 +53,6 @@ private:
GC::Ptr<SVGAnimatedNumber> m_base_frequency_y;
GC::Ptr<SVGAnimatedInteger> m_num_octaves;
GC::Ptr<SVGAnimatedNumber> m_seed;
- GC::Ptr<SVGAnimatedEnumeration> m_stitch_tiles;
- GC::Ptr<SVGAnimatedEnumeration> m_type;
};
}
diff --git a/Libraries/LibWeb/SVG/SVGFilterElement.cpp b/Libraries/LibWeb/SVG/SVGFilterElement.cpp
index 2b895d99b73..0d0bcd9c0c9 100644
--- a/Libraries/LibWeb/SVG/SVGFilterElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGFilterElement.cpp
@@ -34,6 +34,7 @@
#include <LibWeb/SVG/SVGFEOffsetElement.h>
#include <LibWeb/SVG/SVGFETurbulenceElement.h>
#include <LibWeb/SVG/SVGFilterElement.h>
+#include <LibWeb/SVG/SVGUnitTypes.h>
namespace Web::SVG {
@@ -50,16 +51,6 @@ void SVGFilterElement::visit_edges(Cell::Visitor& visitor)
SVGURIReferenceMixin::visit_edges(visitor);
}
-void SVGFilterElement::attribute_changed(Utf16FlyString const& name, Optional<Utf16String> const& old_value, Optional<Utf16String> const& value, Optional<Utf16FlyString> const& namespace_)
-{
- Base::attribute_changed(name, old_value, value, namespace_);
-
- if (name == AttributeNames::filterUnits)
- m_filter_units = parse_units(value.value_or({}));
- else if (name == AttributeNames::primitiveUnits)
- m_primitive_units = parse_units(value.value_or({}));
-}
-
namespace {
// A view of a string's code units for the Rust graph builder, valid for as long as the string is.
@@ -260,15 +251,15 @@ void SVGFilterElement::push_primitives(void* sink, Gfx::IntSize dest_size)
}
// https://drafts.fxtf.org/filter-effects/#element-attrdef-filter-filterunits
-GC::Ref<SVGAnimatedEnumeration> SVGFilterElement::filter_units() const
+GC::Ref<SVGAnimatedEnumeration> SVGFilterElement::filter_units()
{
- return SVGAnimatedEnumeration::create(to_underlying(m_filter_units.value_or(SVGUnits::ObjectBoundingBox)));
+ return svg_animated_enumeration_for_attribute(AttributeNames::filterUnits, svg_unit_type_keywords, to_underlying(SVGUnitType::ObjectBoundingBox));
}
// https://drafts.fxtf.org/filter-effects/#element-attrdef-filter-primitiveunits
-GC::Ref<SVGAnimatedEnumeration> SVGFilterElement::primitive_units() const
+GC::Ref<SVGAnimatedEnumeration> SVGFilterElement::primitive_units()
{
- return SVGAnimatedEnumeration::create(to_underlying(m_primitive_units.value_or(SVGUnits::UserSpaceOnUse)));
+ return svg_animated_enumeration_for_attribute(AttributeNames::primitiveUnits, svg_unit_type_keywords, to_underlying(SVGUnitType::UserSpaceOnUse));
}
}
diff --git a/Libraries/LibWeb/SVG/SVGFilterElement.h b/Libraries/LibWeb/SVG/SVGFilterElement.h
index 291811f9ea0..612b1d09500 100644
--- a/Libraries/LibWeb/SVG/SVGFilterElement.h
+++ b/Libraries/LibWeb/SVG/SVGFilterElement.h
@@ -27,14 +27,12 @@ public:
virtual bool is_svg_filter_element() const final { return true; }
- virtual void attribute_changed(Utf16FlyString const& name, Optional<Utf16String> const& old_value, Optional<Utf16String> const& value, Optional<Utf16FlyString> const& namespace_) override;
-
// Hands every supported child primitive to the Rust primitive list behind `sink` as attribute
// facts, with the frame an feImage draws for the list to retain.
void push_primitives(void* sink, Gfx::IntSize dest_size);
- GC::Ref<SVGAnimatedEnumeration> filter_units() const;
- GC::Ref<SVGAnimatedEnumeration> primitive_units() const;
+ GC::Ref<SVGAnimatedEnumeration> filter_units();
+ GC::Ref<SVGAnimatedEnumeration> primitive_units();
// https://drafts.csswg.org/filter-effects-1#dom-svgfilterelement-x
REFLECT_ANIMATED_LENGTH_ATTRIBUTE(x, Horizontal, SVGLengthValue::percentage(-10));
@@ -51,9 +49,6 @@ public:
private:
SVGFilterElement(DOM::Document&, DOM::QualifiedName);
virtual void visit_edges(Cell::Visitor&) override;
-
- Optional<SVGUnits> m_filter_units {};
- Optional<SVGUnits> m_primitive_units {};
};
}
diff --git a/Libraries/LibWeb/SVG/SVGGradientElement.cpp b/Libraries/LibWeb/SVG/SVGGradientElement.cpp
index 8c349a9733f..79adb91e1ae 100644
--- a/Libraries/LibWeb/SVG/SVGGradientElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGGradientElement.cpp
@@ -10,6 +10,7 @@
#include <LibWeb/SVG/FragmentIdentifier.h>
#include <LibWeb/SVG/SVGGradientElement.h>
#include <LibWeb/SVG/SVGGraphicsElement.h>
+#include <LibWeb/SVG/SVGUnitTypes.h>
namespace Web::SVG {
@@ -156,4 +157,21 @@ void SVGGradientElement::visit_edges(Cell::Visitor& visitor)
SVGURIReferenceMixin::visit_edges(visitor);
}
+// https://svgwg.org/svg2-draft/pservers.html#__svg__SVGGradientElement__gradientUnits
+GC::Ref<SVGAnimatedEnumeration> SVGGradientElement::gradient_units_for_bindings()
+{
+ return svg_animated_enumeration_for_attribute(AttributeNames::gradientUnits, svg_unit_type_keywords, to_underlying(SVGUnitType::ObjectBoundingBox));
+}
+
+// https://svgwg.org/svg2-draft/pservers.html#__svg__SVGGradientElement__spreadMethod
+GC::Ref<SVGAnimatedEnumeration> SVGGradientElement::spread_method_for_bindings()
+{
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "pad"sv, SVG_SPREADMETHOD_PAD },
+ SVGAnimatedEnumeration::Keyword { "reflect"sv, SVG_SPREADMETHOD_REFLECT },
+ SVGAnimatedEnumeration::Keyword { "repeat"sv, SVG_SPREADMETHOD_REPEAT },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::spreadMethod, keywords, SVG_SPREADMETHOD_PAD);
+}
+
}
diff --git a/Libraries/LibWeb/SVG/SVGGradientElement.h b/Libraries/LibWeb/SVG/SVGGradientElement.h
index 728dbac48a0..40d142006c0 100644
--- a/Libraries/LibWeb/SVG/SVGGradientElement.h
+++ b/Libraries/LibWeb/SVG/SVGGradientElement.h
@@ -36,6 +36,14 @@ public:
Optional<Gfx::AffineTransform> gradient_transform() const;
+ static constexpr u16 SVG_SPREADMETHOD_UNKNOWN = 0;
+ static constexpr u16 SVG_SPREADMETHOD_PAD = 1;
+ static constexpr u16 SVG_SPREADMETHOD_REFLECT = 2;
+ static constexpr u16 SVG_SPREADMETHOD_REPEAT = 3;
+
+ GC::Ref<SVGAnimatedEnumeration> gradient_units_for_bindings();
+ GC::Ref<SVGAnimatedEnumeration> spread_method_for_bindings();
+
protected:
SVGGradientElement(DOM::Document&, DOM::QualifiedName);
diff --git a/Libraries/LibWeb/SVG/SVGGradientElement.idl b/Libraries/LibWeb/SVG/SVGGradientElement.idl
index ee7e9d18b82..07ef69e86d2 100644
--- a/Libraries/LibWeb/SVG/SVGGradientElement.idl
+++ b/Libraries/LibWeb/SVG/SVGGradientElement.idl
@@ -8,9 +8,9 @@ interface SVGGradientElement : SVGElement {
const unsigned short SVG_SPREADMETHOD_REFLECT = 2;
const unsigned short SVG_SPREADMETHOD_REPEAT = 3;
- [FIXME, SameObject] readonly attribute SVGAnimatedEnumeration gradientUnits;
+ [SameObject, ImplementedAs=gradient_units_for_bindings] readonly attribute SVGAnimatedEnumeration gradientUnits;
[FIXME, SameObject] readonly attribute SVGAnimatedTransformList gradientTransform;
- [FIXME, SameObject] readonly attribute SVGAnimatedEnumeration spreadMethod;
+ [SameObject, ImplementedAs=spread_method_for_bindings] readonly attribute SVGAnimatedEnumeration spreadMethod;
};
diff --git a/Libraries/LibWeb/SVG/SVGMaskElement.cpp b/Libraries/LibWeb/SVG/SVGMaskElement.cpp
index f9e20eeef3f..eb7349457ba 100644
--- a/Libraries/LibWeb/SVG/SVGMaskElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGMaskElement.cpp
@@ -10,6 +10,7 @@
#include <LibWeb/DOM/Document.h>
#include <LibWeb/SVG/AttributeNames.h>
#include <LibWeb/SVG/SVGMaskElement.h>
+#include <LibWeb/SVG/SVGUnitTypes.h>
namespace Web::SVG {
@@ -105,4 +106,16 @@ NumberPercentage SVGMaskElement::mask_height() const
return m_height.value_or(NumberPercentage::create_percentage(120));
}
+// https://drafts.fxtf.org/css-masking/#dom-svgmaskelement-maskunits
+GC::Ref<SVGAnimatedEnumeration> SVGMaskElement::mask_units_for_bindings()
+{
+ return svg_animated_enumeration_for_attribute(AttributeNames::maskUnits, svg_unit_type_keywords, to_underlying(SVGUnitType::ObjectBoundingBox));
+}
+
+// https://drafts.fxtf.org/css-masking/#dom-svgmaskelement-maskcontentunits
+GC::Ref<SVGAnimatedEnumeration> SVGMaskElement::mask_content_units_for_bindings()
+{
+ return svg_animated_enumeration_for_attribute(AttributeNames::maskContentUnits, svg_unit_type_keywords, to_underlying(SVGUnitType::UserSpaceOnUse));
+}
+
}
diff --git a/Libraries/LibWeb/SVG/SVGMaskElement.h b/Libraries/LibWeb/SVG/SVGMaskElement.h
index fbbcf5df077..f83a3998abf 100644
--- a/Libraries/LibWeb/SVG/SVGMaskElement.h
+++ b/Libraries/LibWeb/SVG/SVGMaskElement.h
@@ -42,6 +42,21 @@ public:
NumberPercentage mask_width() const;
NumberPercentage mask_height() const;
+ GC::Ref<SVGAnimatedEnumeration> mask_units_for_bindings();
+ GC::Ref<SVGAnimatedEnumeration> mask_content_units_for_bindings();
+
+ // https://drafts.fxtf.org/css-masking/#dom-svgmaskelement-x
+ REFLECT_ANIMATED_LENGTH_ATTRIBUTE(x, Horizontal, SVGLengthValue::percentage(-10));
+
+ // https://drafts.fxtf.org/css-masking/#dom-svgmaskelement-y
+ REFLECT_ANIMATED_LENGTH_ATTRIBUTE(y, Vertical, SVGLengthValue::percentage(-10));
+
+ // https://drafts.fxtf.org/css-masking/#dom-svgmaskelement-width
+ REFLECT_ANIMATED_LENGTH_ATTRIBUTE(width, Horizontal, SVGLengthValue::percentage(120));
+
+ // https://drafts.fxtf.org/css-masking/#dom-svgmaskelement-height
+ REFLECT_ANIMATED_LENGTH_ATTRIBUTE(height, Vertical, SVGLengthValue::percentage(120));
+
private:
SVGMaskElement(DOM::Document&, DOM::QualifiedName);
diff --git a/Libraries/LibWeb/SVG/SVGMaskElement.idl b/Libraries/LibWeb/SVG/SVGMaskElement.idl
index ba11d21f395..cea711b03f3 100644
--- a/Libraries/LibWeb/SVG/SVGMaskElement.idl
+++ b/Libraries/LibWeb/SVG/SVGMaskElement.idl
@@ -1,10 +1,10 @@
// https://drafts.fxtf.org/css-masking/#InterfaceSVGMaskElement
[Exposed=Window]
interface SVGMaskElement : SVGElement {
- [FIXME] readonly attribute SVGAnimatedEnumeration maskUnits;
- [FIXME] readonly attribute SVGAnimatedEnumeration maskContentUnits;
- [FIXME] readonly attribute SVGAnimatedLength x;
- [FIXME] readonly attribute SVGAnimatedLength y;
- [FIXME] readonly attribute SVGAnimatedLength width;
- [FIXME] readonly attribute SVGAnimatedLength height;
+ [ImplementedAs=mask_units_for_bindings] readonly attribute SVGAnimatedEnumeration maskUnits;
+ [ImplementedAs=mask_content_units_for_bindings] readonly attribute SVGAnimatedEnumeration maskContentUnits;
+ readonly attribute SVGAnimatedLength x;
+ readonly attribute SVGAnimatedLength y;
+ readonly attribute SVGAnimatedLength width;
+ readonly attribute SVGAnimatedLength height;
};
diff --git a/Libraries/LibWeb/SVG/SVGPatternElement.cpp b/Libraries/LibWeb/SVG/SVGPatternElement.cpp
index 3e796eaecf2..15f1d980037 100644
--- a/Libraries/LibWeb/SVG/SVGPatternElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGPatternElement.cpp
@@ -15,6 +15,7 @@
#include <LibWeb/SVG/FragmentIdentifier.h>
#include <LibWeb/SVG/SVGGraphicsElement.h>
#include <LibWeb/SVG/SVGPatternElement.h>
+#include <LibWeb/SVG/SVGUnitTypes.h>
namespace Web::SVG {
@@ -321,4 +322,16 @@ void SVGPatternElement::push_paint_server_description(void* sink, Layout::Node c
// Reflected length accessors are generated by SVGElement's reflection macro.
+// https://svgwg.org/svg2-draft/pservers.html#__svg__SVGPatternElement__patternUnits
+GC::Ref<SVGAnimatedEnumeration> SVGPatternElement::pattern_units_for_bindings()
+{
+ return svg_animated_enumeration_for_attribute(AttributeNames::patternUnits, svg_unit_type_keywords, to_underlying(SVGUnitType::ObjectBoundingBox));
+}
+
+// https://svgwg.org/svg2-draft/pservers.html#__svg__SVGPatternElement__patternContentUnits
+GC::Ref<SVGAnimatedEnumeration> SVGPatternElement::pattern_content_units_for_bindings()
+{
+ return svg_animated_enumeration_for_attribute(AttributeNames::patternContentUnits, svg_unit_type_keywords, to_underlying(SVGUnitType::UserSpaceOnUse));
+}
+
}
diff --git a/Libraries/LibWeb/SVG/SVGPatternElement.h b/Libraries/LibWeb/SVG/SVGPatternElement.h
index 65e5351f91f..ab04a24ae4d 100644
--- a/Libraries/LibWeb/SVG/SVGPatternElement.h
+++ b/Libraries/LibWeb/SVG/SVGPatternElement.h
@@ -51,6 +51,9 @@ public:
NumberPercentage pattern_width() const;
NumberPercentage pattern_height() const;
+ GC::Ref<SVGAnimatedEnumeration> pattern_units_for_bindings();
+ GC::Ref<SVGAnimatedEnumeration> pattern_content_units_for_bindings();
+
// https://w3c.github.io/svgwg/svg2-draft/pservers.html#__svg__SVGPatternElement__x
REFLECT_ANIMATED_LENGTH_ATTRIBUTE(x, Horizontal, SVGLengthValue::number(0));
diff --git a/Libraries/LibWeb/SVG/SVGPatternElement.idl b/Libraries/LibWeb/SVG/SVGPatternElement.idl
index ef222ff44d5..b27585667d0 100644
--- a/Libraries/LibWeb/SVG/SVGPatternElement.idl
+++ b/Libraries/LibWeb/SVG/SVGPatternElement.idl
@@ -1,8 +1,8 @@
// https://svgwg.org/svg2-draft/pservers.html#InterfaceSVGPatternElement
[Exposed=Window]
interface SVGPatternElement : SVGElement {
- [FIXME, SameObject] readonly attribute SVGAnimatedEnumeration patternUnits;
- [FIXME, SameObject] readonly attribute SVGAnimatedEnumeration patternContentUnits;
+ [SameObject, ImplementedAs=pattern_units_for_bindings] readonly attribute SVGAnimatedEnumeration patternUnits;
+ [SameObject, ImplementedAs=pattern_content_units_for_bindings] readonly attribute SVGAnimatedEnumeration patternContentUnits;
[FIXME, SameObject] readonly attribute SVGAnimatedTransformList patternTransform;
[SameObject] readonly attribute SVGAnimatedLength x;
[SameObject] readonly attribute SVGAnimatedLength y;
diff --git a/Libraries/LibWeb/SVG/SVGTextContentElement.cpp b/Libraries/LibWeb/SVG/SVGTextContentElement.cpp
index 581883683a7..b06e4966498 100644
--- a/Libraries/LibWeb/SVG/SVGTextContentElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGTextContentElement.cpp
@@ -180,4 +180,14 @@ WebIDL::ExceptionOr<GC::Ref<Geometry::DOMRect>> SVGTextContentElement::get_exten
return Geometry::DOMRect::create(rect);
}
+// https://svgwg.org/svg2-draft/text.html#__svg__SVGTextContentElement__lengthAdjust
+GC::Ref<SVGAnimatedEnumeration> SVGTextContentElement::length_adjust()
+{
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "spacing"sv, LENGTHADJUST_SPACING },
+ SVGAnimatedEnumeration::Keyword { "spacingAndGlyphs"sv, LENGTHADJUST_SPACINGANDGLYPHS },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::lengthAdjust, keywords, LENGTHADJUST_SPACING);
+}
+
}
diff --git a/Libraries/LibWeb/SVG/SVGTextContentElement.h b/Libraries/LibWeb/SVG/SVGTextContentElement.h
index 5cc0a1f225f..987377d2976 100644
--- a/Libraries/LibWeb/SVG/SVGTextContentElement.h
+++ b/Libraries/LibWeb/SVG/SVGTextContentElement.h
@@ -21,6 +21,12 @@ class SVGTextContentElement : public SVGGraphicsElement {
WEB_WRAPPABLE(SVGTextContentElement, SVGGraphicsElement);
public:
+ static constexpr u16 LENGTHADJUST_UNKNOWN = 0;
+ static constexpr u16 LENGTHADJUST_SPACING = 1;
+ static constexpr u16 LENGTHADJUST_SPACINGANDGLYPHS = 2;
+
+ GC::Ref<SVGAnimatedEnumeration> length_adjust();
+
WebIDL::ExceptionOr<WebIDL::Long> get_number_of_chars();
WebIDL::ExceptionOr<float> get_computed_text_length();
WebIDL::ExceptionOr<float> get_sub_string_length(WebIDL::UnsignedLong charnum, WebIDL::UnsignedLong nchars);
diff --git a/Libraries/LibWeb/SVG/SVGTextContentElement.idl b/Libraries/LibWeb/SVG/SVGTextContentElement.idl
index 576b2c9c1b3..7afa1434dcf 100644
--- a/Libraries/LibWeb/SVG/SVGTextContentElement.idl
+++ b/Libraries/LibWeb/SVG/SVGTextContentElement.idl
@@ -8,7 +8,7 @@ interface SVGTextContentElement : SVGGraphicsElement {
const unsigned short LENGTHADJUST_SPACINGANDGLYPHS = 2;
[FIXME, SameObject] readonly attribute SVGAnimatedLength textLength;
- [FIXME, SameObject] readonly attribute SVGAnimatedEnumeration lengthAdjust;
+ [SameObject] readonly attribute SVGAnimatedEnumeration lengthAdjust;
long getNumberOfChars();
float getComputedTextLength();
diff --git a/Libraries/LibWeb/SVG/SVGTextPathElement.cpp b/Libraries/LibWeb/SVG/SVGTextPathElement.cpp
index 769199b6a15..c8fd15f230d 100644
--- a/Libraries/LibWeb/SVG/SVGTextPathElement.cpp
+++ b/Libraries/LibWeb/SVG/SVGTextPathElement.cpp
@@ -45,4 +45,24 @@ CSS::ElementBoxKind SVGTextPathElement::box_kind() const
return CSS::ElementBoxKind::SvgTextPath;
}
-};
+// https://svgwg.org/svg2-draft/text.html#__svg__SVGTextPathElement__method
+GC::Ref<SVGAnimatedEnumeration> SVGTextPathElement::method()
+{
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "align"sv, TEXTPATH_METHODTYPE_ALIGN },
+ SVGAnimatedEnumeration::Keyword { "stretch"sv, TEXTPATH_METHODTYPE_STRETCH },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::method, keywords, TEXTPATH_METHODTYPE_ALIGN);
+}
+
+// https://svgwg.org/svg2-draft/text.html#__svg__SVGTextPathElement__spacing
+GC::Ref<SVGAnimatedEnumeration> SVGTextPathElement::spacing()
+{
+ static constexpr Array keywords {
+ SVGAnimatedEnumeration::Keyword { "auto"sv, TEXTPATH_SPACINGTYPE_AUTO },
+ SVGAnimatedEnumeration::Keyword { "exact"sv, TEXTPATH_SPACINGTYPE_EXACT },
+ };
+ return svg_animated_enumeration_for_attribute(AttributeNames::spacing, keywords, TEXTPATH_SPACINGTYPE_EXACT);
+}
+
+}
diff --git a/Libraries/LibWeb/SVG/SVGTextPathElement.h b/Libraries/LibWeb/SVG/SVGTextPathElement.h
index 516a3b58a65..cb380e5cc73 100644
--- a/Libraries/LibWeb/SVG/SVGTextPathElement.h
+++ b/Libraries/LibWeb/SVG/SVGTextPathElement.h
@@ -30,6 +30,17 @@ public:
// https://w3c.github.io/svgwg/svg2-draft/text.html#__svg__SVGTextPathElement__startOffset
REFLECT_ANIMATED_LENGTH_ATTRIBUTE_WITH_GETTER(startOffset, start_offset, Horizontal, SVGLengthValue::number(0));
+ static constexpr u16 TEXTPATH_METHODTYPE_UNKNOWN = 0;
+ static constexpr u16 TEXTPATH_METHODTYPE_ALIGN = 1;
+ static constexpr u16 TEXTPATH_METHODTYPE_STRETCH = 2;
+
+ static constexpr u16 TEXTPATH_SPACINGTYPE_UNKNOWN = 0;
+ static constexpr u16 TEXTPATH_SPACINGTYPE_AUTO = 1;
+ static constexpr u16 TEXTPATH_SPACINGTYPE_EXACT = 2;
+
+ GC::Ref<SVGAnimatedEnumeration> method();
+ GC::Ref<SVGAnimatedEnumeration> spacing();
+
protected:
SVGTextPathElement(DOM::Document&, DOM::QualifiedName);
virtual void visit_edges(Cell::Visitor&) override;
diff --git a/Libraries/LibWeb/SVG/SVGTextPathElement.idl b/Libraries/LibWeb/SVG/SVGTextPathElement.idl
index ebb39c16c93..7b171d05995 100644
--- a/Libraries/LibWeb/SVG/SVGTextPathElement.idl
+++ b/Libraries/LibWeb/SVG/SVGTextPathElement.idl
@@ -12,8 +12,8 @@ interface SVGTextPathElement : SVGTextContentElement {
const unsigned short TEXTPATH_SPACINGTYPE_EXACT = 2;
[SameObject] readonly attribute SVGAnimatedLength startOffset;
- [FIXME, SameObject] readonly attribute SVGAnimatedEnumeration method;
- [FIXME, SameObject] readonly attribute SVGAnimatedEnumeration spacing;
+ [SameObject] readonly attribute SVGAnimatedEnumeration method;
+ [SameObject] readonly attribute SVGAnimatedEnumeration spacing;
};
SVGTextPathElement includes SVGURIReference;
diff --git a/Libraries/LibWeb/SVG/SVGUnitTypes.h b/Libraries/LibWeb/SVG/SVGUnitTypes.h
index e81f92f4d73..9a7696c5e03 100644
--- a/Libraries/LibWeb/SVG/SVGUnitTypes.h
+++ b/Libraries/LibWeb/SVG/SVGUnitTypes.h
@@ -5,3 +5,22 @@
*/
#pragma once
+
+#include <AK/Array.h>
+#include <LibWeb/SVG/SVGAnimatedEnumeration.h>
+
+namespace Web::SVG {
+
+// https://svgwg.org/svg2-draft/types.html#InterfaceSVGUnitTypes
+enum class SVGUnitType : u16 {
+ Unknown = 0,
+ UserSpaceOnUse = 1,
+ ObjectBoundingBox = 2,
+};
+
+inline constexpr Array svg_unit_type_keywords {
+ SVGAnimatedEnumeration::Keyword { "userSpaceOnUse"sv, to_underlying(SVGUnitType::UserSpaceOnUse) },
+ SVGAnimatedEnumeration::Keyword { "objectBoundingBox"sv, to_underlying(SVGUnitType::ObjectBoundingBox) },
+};
+
+}
diff --git a/Tests/LibWeb/Text/expected/wpt-import/css/filter-effects/svgfeblendelement-mode-001.txt b/Tests/LibWeb/Text/expected/wpt-import/css/filter-effects/svgfeblendelement-mode-001.txt
index 786ef163f47..1803c5aa872 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/css/filter-effects/svgfeblendelement-mode-001.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/css/filter-effects/svgfeblendelement-mode-001.txt
@@ -2,8 +2,7 @@ Harness status: OK
Found 35 tests
-18 Pass
-17 Fail
+35 Pass
Pass SVGFEBlendElement.prototype.mode, getter, initial value
Pass SVGFEBlendElement.prototype.mode, getter, invalid value
Pass SVGFEBlendElement.prototype.mode, getter, numeric value for "normal"
@@ -22,20 +21,20 @@ Pass SVGFEBlendElement.prototype.mode, getter, numeric value for "hue"
Pass SVGFEBlendElement.prototype.mode, getter, numeric value for "saturation"
Pass SVGFEBlendElement.prototype.mode, getter, numeric value for "color"
Pass SVGFEBlendElement.prototype.mode, getter, numeric value for "luminosity"
-Fail SVGFEBlendElement.prototype.mode, setter, invalid value
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "normal"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "multiply"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "screen"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "darken"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "lighten"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "overlay"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "color-dodge"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "color-burn"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "hard-light"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "soft-light"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "difference"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "exclusion"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "hue"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "saturation"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "color"
-Fail SVGFEBlendElement.prototype.mode, setter, numeric value for "luminosity"
\ No newline at end of file
+Pass SVGFEBlendElement.prototype.mode, setter, invalid value
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "normal"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "multiply"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "screen"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "darken"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "lighten"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "overlay"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "color-dodge"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "color-burn"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "hard-light"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "soft-light"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "difference"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "exclusion"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "hue"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "saturation"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "color"
+Pass SVGFEBlendElement.prototype.mode, setter, numeric value for "luminosity"
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/svg/idlharness.window.txt b/Tests/LibWeb/Text/expected/wpt-import/svg/idlharness.window.txt
index e665b31e195..c8bbcbf2cb9 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/svg/idlharness.window.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/svg/idlharness.window.txt
@@ -2,8 +2,8 @@ Harness status: OK
Found 1780 tests
-1181 Pass
-599 Fail
+1203 Pass
+577 Fail
Pass idl_test setup
Pass idl_test validation
Pass Partial interface Document: original interface defined
@@ -288,10 +288,10 @@ Pass SVGAnimatedEnumeration interface: existence and properties of interface pro
Pass SVGAnimatedEnumeration interface: existence and properties of interface prototype object's @@unscopables property
Pass SVGAnimatedEnumeration interface: attribute baseVal
Pass SVGAnimatedEnumeration interface: attribute animVal
-Fail SVGAnimatedEnumeration must be primary interface of objects.text.lengthAdjust
-Fail Stringification of objects.text.lengthAdjust
-Fail SVGAnimatedEnumeration interface: objects.text.lengthAdjust must inherit property "baseVal" with the proper type
-Fail SVGAnimatedEnumeration interface: objects.text.lengthAdjust must inherit property "animVal" with the proper type
+Pass SVGAnimatedEnumeration must be primary interface of objects.text.lengthAdjust
+Pass Stringification of objects.text.lengthAdjust
+Pass SVGAnimatedEnumeration interface: objects.text.lengthAdjust must inherit property "baseVal" with the proper type
+Pass SVGAnimatedEnumeration interface: objects.text.lengthAdjust must inherit property "animVal" with the proper type
Pass SVGAnimatedInteger interface: existence and properties of interface object
Pass SVGAnimatedInteger interface object length
Pass SVGAnimatedInteger interface object name
@@ -1105,7 +1105,7 @@ Pass SVGTextContentElement interface: constant LENGTHADJUST_SPACING on interface
Pass SVGTextContentElement interface: constant LENGTHADJUST_SPACINGANDGLYPHS on interface object
Pass SVGTextContentElement interface: constant LENGTHADJUST_SPACINGANDGLYPHS on interface prototype object
Fail SVGTextContentElement interface: attribute textLength
-Fail SVGTextContentElement interface: attribute lengthAdjust
+Pass SVGTextContentElement interface: attribute lengthAdjust
Pass SVGTextContentElement interface: operation getNumberOfChars()
Pass SVGTextContentElement interface: operation getComputedTextLength()
Pass SVGTextContentElement interface: operation getSubStringLength(unsigned long, unsigned long)
@@ -1143,7 +1143,7 @@ Pass SVGTextContentElement interface: objects.text must inherit property "LENGTH
Pass SVGTextContentElement interface: objects.text must inherit property "LENGTHADJUST_SPACING" with the proper type
Pass SVGTextContentElement interface: objects.text must inherit property "LENGTHADJUST_SPACINGANDGLYPHS" with the proper type
Fail SVGTextContentElement interface: objects.text must inherit property "textLength" with the proper type
-Fail SVGTextContentElement interface: objects.text must inherit property "lengthAdjust" with the proper type
+Pass SVGTextContentElement interface: objects.text must inherit property "lengthAdjust" with the proper type
Pass SVGTextContentElement interface: objects.text must inherit property "getNumberOfChars()" with the proper type
Pass SVGTextContentElement interface: objects.text must inherit property "getComputedTextLength()" with the proper type
Pass SVGTextContentElement interface: objects.text must inherit property "getSubStringLength(unsigned long, unsigned long)" with the proper type
@@ -1189,7 +1189,7 @@ Pass SVGTextContentElement interface: objects.tspan must inherit property "LENGT
Pass SVGTextContentElement interface: objects.tspan must inherit property "LENGTHADJUST_SPACING" with the proper type
Pass SVGTextContentElement interface: objects.tspan must inherit property "LENGTHADJUST_SPACINGANDGLYPHS" with the proper type
Fail SVGTextContentElement interface: objects.tspan must inherit property "textLength" with the proper type
-Fail SVGTextContentElement interface: objects.tspan must inherit property "lengthAdjust" with the proper type
+Pass SVGTextContentElement interface: objects.tspan must inherit property "lengthAdjust" with the proper type
Pass SVGTextContentElement interface: objects.tspan must inherit property "getNumberOfChars()" with the proper type
Pass SVGTextContentElement interface: objects.tspan must inherit property "getComputedTextLength()" with the proper type
Pass SVGTextContentElement interface: objects.tspan must inherit property "getSubStringLength(unsigned long, unsigned long)" with the proper type
@@ -1237,8 +1237,8 @@ Pass SVGTextPathElement interface: constant TEXTPATH_SPACINGTYPE_AUTO on interfa
Pass SVGTextPathElement interface: constant TEXTPATH_SPACINGTYPE_EXACT on interface object
Pass SVGTextPathElement interface: constant TEXTPATH_SPACINGTYPE_EXACT on interface prototype object
Pass SVGTextPathElement interface: attribute startOffset
-Fail SVGTextPathElement interface: attribute method
-Fail SVGTextPathElement interface: attribute spacing
+Pass SVGTextPathElement interface: attribute method
+Pass SVGTextPathElement interface: attribute spacing
Pass SVGTextPathElement interface: attribute href
Pass SVGTextPathElement must be primary interface of objects.textPath
Pass Stringification of objects.textPath
@@ -1249,14 +1249,14 @@ Pass SVGTextPathElement interface: objects.textPath must inherit property "TEXTP
Pass SVGTextPathElement interface: objects.textPath must inherit property "TEXTPATH_SPACINGTYPE_AUTO" with the proper type
Pass SVGTextPathElement interface: objects.textPath must inherit property "TEXTPATH_SPACINGTYPE_EXACT" with the proper type
Pass SVGTextPathElement interface: objects.textPath must inherit property "startOffset" with the proper type
-Fail SVGTextPathElement interface: objects.textPath must inherit property "method" with the proper type
-Fail SVGTextPathElement interface: objects.textPath must inherit property "spacing" with the proper type
+Pass SVGTextPathElement interface: objects.textPath must inherit property "method" with the proper type
+Pass SVGTextPathElement interface: objects.textPath must inherit property "spacing" with the proper type
Pass SVGTextPathElement interface: objects.textPath must inherit property "href" with the proper type
Pass SVGTextContentElement interface: objects.textPath must inherit property "LENGTHADJUST_UNKNOWN" with the proper type
Pass SVGTextContentElement interface: objects.textPath must inherit property "LENGTHADJUST_SPACING" with the proper type
Pass SVGTextContentElement interface: objects.textPath must inherit property "LENGTHADJUST_SPACINGANDGLYPHS" with the proper type
Fail SVGTextContentElement interface: objects.textPath must inherit property "textLength" with the proper type
-Fail SVGTextContentElement interface: objects.textPath must inherit property "lengthAdjust" with the proper type
+Pass SVGTextContentElement interface: objects.textPath must inherit property "lengthAdjust" with the proper type
Pass SVGTextContentElement interface: objects.textPath must inherit property "getNumberOfChars()" with the proper type
Pass SVGTextContentElement interface: objects.textPath must inherit property "getComputedTextLength()" with the proper type
Pass SVGTextContentElement interface: objects.textPath must inherit property "getSubStringLength(unsigned long, unsigned long)" with the proper type
@@ -1420,9 +1420,9 @@ Pass SVGGradientElement interface: constant SVG_SPREADMETHOD_REFLECT on interfac
Pass SVGGradientElement interface: constant SVG_SPREADMETHOD_REFLECT on interface prototype object
Pass SVGGradientElement interface: constant SVG_SPREADMETHOD_REPEAT on interface object
Pass SVGGradientElement interface: constant SVG_SPREADMETHOD_REPEAT on interface prototype object
-Fail SVGGradientElement interface: attribute gradientUnits
+Pass SVGGradientElement interface: attribute gradientUnits
Fail SVGGradientElement interface: attribute gradientTransform
-Fail SVGGradientElement interface: attribute spreadMethod
+Pass SVGGradientElement interface: attribute spreadMethod
Pass SVGGradientElement interface: attribute href
Pass SVGLinearGradientElement interface: existence and properties of interface object
Pass SVGLinearGradientElement interface object length
@@ -1444,9 +1444,9 @@ Pass SVGGradientElement interface: objects.linearGradient must inherit property
Pass SVGGradientElement interface: objects.linearGradient must inherit property "SVG_SPREADMETHOD_PAD" with the proper type
Pass SVGGradientElement interface: objects.linearGradient must inherit property "SVG_SPREADMETHOD_REFLECT" with the proper type
Pass SVGGradientElement interface: objects.linearGradient must inherit property "SVG_SPREADMETHOD_REPEAT" with the proper type
-Fail SVGGradientElement interface: objects.linearGradient must inherit property "gradientUnits" with the proper type
+Pass SVGGradientElement interface: objects.linearGradient must inherit property "gradientUnits" with the proper type
Fail SVGGradientElement interface: objects.linearGradient must inherit property "gradientTransform" with the proper type
-Fail SVGGradientElement interface: objects.linearGradient must inherit property "spreadMethod" with the proper type
+Pass SVGGradientElement interface: objects.linearGradient must inherit property "spreadMethod" with the proper type
Pass SVGGradientElement interface: objects.linearGradient must inherit property "href" with the proper type
Pass SVGElement interface: objects.linearGradient must inherit property "className" with the proper type
Pass SVGElement interface: objects.linearGradient must inherit property "ownerSVGElement" with the proper type
@@ -1477,9 +1477,9 @@ Pass SVGGradientElement interface: objects.radialGradient must inherit property
Pass SVGGradientElement interface: objects.radialGradient must inherit property "SVG_SPREADMETHOD_PAD" with the proper type
Pass SVGGradientElement interface: objects.radialGradient must inherit property "SVG_SPREADMETHOD_REFLECT" with the proper type
Pass SVGGradientElement interface: objects.radialGradient must inherit property "SVG_SPREADMETHOD_REPEAT" with the proper type
-Fail SVGGradientElement interface: objects.radialGradient must inherit property "gradientUnits" with the proper type
+Pass SVGGradientElement interface: objects.radialGradient must inherit property "gradientUnits" with the proper type
Fail SVGGradientElement interface: objects.radialGradient must inherit property "gradientTransform" with the proper type
-Fail SVGGradientElement interface: objects.radialGradient must inherit property "spreadMethod" with the proper type
+Pass SVGGradientElement interface: objects.radialGradient must inherit property "spreadMethod" with the proper type
Pass SVGGradientElement interface: objects.radialGradient must inherit property "href" with the proper type
Pass SVGElement interface: objects.radialGradient must inherit property "className" with the proper type
Pass SVGElement interface: objects.radialGradient must inherit property "ownerSVGElement" with the proper type
@@ -1507,8 +1507,8 @@ Pass SVGPatternElement interface object name
Pass SVGPatternElement interface: existence and properties of interface prototype object
Pass SVGPatternElement interface: existence and properties of interface prototype object's "constructor" property
Pass SVGPatternElement interface: existence and properties of interface prototype object's @@unscopables property
-Fail SVGPatternElement interface: attribute patternUnits
-Fail SVGPatternElement interface: attribute patternContentUnits
+Pass SVGPatternElement interface: attribute patternUnits
+Pass SVGPatternElement interface: attribute patternContentUnits
Fail SVGPatternElement interface: attribute patternTransform
Pass SVGPatternElement interface: attribute x
Pass SVGPatternElement interface: attribute y
@@ -1519,8 +1519,8 @@ Fail SVGPatternElement interface: attribute preserveAspectRatio
Pass SVGPatternElement interface: attribute href
Pass SVGPatternElement must be primary interface of objects.pattern
Pass Stringification of objects.pattern
-Fail SVGPatternElement interface: objects.pattern must inherit property "patternUnits" with the proper type
-Fail SVGPatternElement interface: objects.pattern must inherit property "patternContentUnits" with the proper type
+Pass SVGPatternElement interface: objects.pattern must inherit property "patternUnits" with the proper type
+Pass SVGPatternElement interface: objects.pattern must inherit property "patternContentUnits" with the proper type
Fail SVGPatternElement interface: objects.pattern must inherit property "patternTransform" with the proper type
Pass SVGPatternElement interface: objects.pattern must inherit property "x" with the proper type
Pass SVGPatternElement interface: objects.pattern must inherit property "y" with the proper type
diff --git a/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedEnumeration-invalid-values.txt b/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedEnumeration-invalid-values.txt
index 473f4793c92..81bdb11a971 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedEnumeration-invalid-values.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedEnumeration-invalid-values.txt
@@ -2,57 +2,57 @@ Harness status: OK
Found 52 tests
-13 Pass
-39 Fail
-Fail SVGAnimatedEnumeration, invalid values, SVGClipPathElement.prototype.clipPathUnits (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGClipPathElement.prototype.clipPathUnits (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGComponentTransferFunctionElement.prototype.type (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGComponentTransferFunctionElement.prototype.type (content attribute is not rewritten)
+46 Pass
+6 Fail
+Pass SVGAnimatedEnumeration, invalid values, SVGClipPathElement.prototype.clipPathUnits (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGClipPathElement.prototype.clipPathUnits (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGComponentTransferFunctionElement.prototype.type (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGComponentTransferFunctionElement.prototype.type (content attribute is not rewritten)
Pass SVGAnimatedEnumeration, invalid values, SVGFEBlendElement.prototype.mode (empty string)
Pass SVGAnimatedEnumeration, invalid values, SVGFEBlendElement.prototype.mode (content attribute is not rewritten)
Pass SVGAnimatedEnumeration, invalid values, SVGFEColorMatrixElement.prototype.type (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGFEColorMatrixElement.prototype.type (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGFECompositeElement.prototype.operator (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGFECompositeElement.prototype.operator (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGFEColorMatrixElement.prototype.type (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGFECompositeElement.prototype.operator (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGFECompositeElement.prototype.operator (content attribute is not rewritten)
Fail SVGAnimatedEnumeration, invalid values, SVGFEConvolveMatrixElement.prototype.edgeMode (empty string)
Fail SVGAnimatedEnumeration, invalid values, SVGFEConvolveMatrixElement.prototype.edgeMode (content attribute is not rewritten)
Pass SVGAnimatedEnumeration, invalid values, SVGFEDisplacementMapElement.prototype.xChannelSelector (empty string)
Pass SVGAnimatedEnumeration, invalid values, SVGFEDisplacementMapElement.prototype.xChannelSelector (content attribute is not rewritten)
Pass SVGAnimatedEnumeration, invalid values, SVGFEDisplacementMapElement.prototype.yChannelSelector (empty string)
Pass SVGAnimatedEnumeration, invalid values, SVGFEDisplacementMapElement.prototype.yChannelSelector (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGFEGaussianBlurElement.prototype.edgeMode (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGFEGaussianBlurElement.prototype.edgeMode (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGFEMorphologyElement.prototype.operator (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGFEMorphologyElement.prototype.operator (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGFEGaussianBlurElement.prototype.edgeMode (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGFEGaussianBlurElement.prototype.edgeMode (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGFEMorphologyElement.prototype.operator (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGFEMorphologyElement.prototype.operator (content attribute is not rewritten)
Pass SVGAnimatedEnumeration, invalid values, SVGFETurbulenceElement.prototype.stitchTiles (empty string)
Pass SVGAnimatedEnumeration, invalid values, SVGFETurbulenceElement.prototype.stitchTiles (content attribute is not rewritten)
Pass SVGAnimatedEnumeration, invalid values, SVGFETurbulenceElement.prototype.type (empty string)
Pass SVGAnimatedEnumeration, invalid values, SVGFETurbulenceElement.prototype.type (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGFilterElement.prototype.filterUnits (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGFilterElement.prototype.filterUnits (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGFilterElement.prototype.filterUnits (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGFilterElement.prototype.filterUnits (content attribute is not rewritten)
Pass SVGAnimatedEnumeration, invalid values, SVGFilterElement.prototype.primitiveUnits (empty string)
Pass SVGAnimatedEnumeration, invalid values, SVGFilterElement.prototype.primitiveUnits (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGGradientElement.prototype.gradientUnits (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGGradientElement.prototype.gradientUnits (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGGradientElement.prototype.spreadMethod (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGGradientElement.prototype.spreadMethod (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGGradientElement.prototype.gradientUnits (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGGradientElement.prototype.gradientUnits (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGGradientElement.prototype.spreadMethod (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGGradientElement.prototype.spreadMethod (content attribute is not rewritten)
Fail SVGAnimatedEnumeration, invalid values, SVGMarkerElement.prototype.markerUnits (empty string)
Fail SVGAnimatedEnumeration, invalid values, SVGMarkerElement.prototype.markerUnits (content attribute is not rewritten)
Fail SVGAnimatedEnumeration, invalid values, SVGMarkerElement.prototype.orientType (empty string)
Fail SVGAnimatedEnumeration, invalid values, SVGMarkerElement.prototype.orientType (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGMaskElement.prototype.maskUnits (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGMaskElement.prototype.maskUnits (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGMaskElement.prototype.maskContentUnits (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGMaskElement.prototype.maskContentUnits (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGPatternElement.prototype.patternUnits (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGPatternElement.prototype.patternUnits (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGPatternElement.prototype.patternContentUnits (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGPatternElement.prototype.patternContentUnits (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGTextContentElement.prototype.lengthAdjust (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGTextContentElement.prototype.lengthAdjust (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGTextPathElement.prototype.method (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGTextPathElement.prototype.method (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGTextPathElement.prototype.spacing (empty string)
-Fail SVGAnimatedEnumeration, invalid values, SVGTextPathElement.prototype.spacing (content attribute is not rewritten)
-Fail SVGAnimatedEnumeration, invalid values, SVGFEBlendElement.prototype.mode (plus-darker is not a blend mode)
-Fail SVGAnimatedEnumeration, invalid values, SVGFEBlendElement.prototype.mode (plus-lighter is not a blend mode)
\ No newline at end of file
+Pass SVGAnimatedEnumeration, invalid values, SVGMaskElement.prototype.maskUnits (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGMaskElement.prototype.maskUnits (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGMaskElement.prototype.maskContentUnits (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGMaskElement.prototype.maskContentUnits (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGPatternElement.prototype.patternUnits (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGPatternElement.prototype.patternUnits (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGPatternElement.prototype.patternContentUnits (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGPatternElement.prototype.patternContentUnits (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGTextContentElement.prototype.lengthAdjust (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGTextContentElement.prototype.lengthAdjust (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGTextPathElement.prototype.method (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGTextPathElement.prototype.method (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGTextPathElement.prototype.spacing (empty string)
+Pass SVGAnimatedEnumeration, invalid values, SVGTextPathElement.prototype.spacing (content attribute is not rewritten)
+Pass SVGAnimatedEnumeration, invalid values, SVGFEBlendElement.prototype.mode (plus-darker is not a blend mode)
+Pass SVGAnimatedEnumeration, invalid values, SVGFEBlendElement.prototype.mode (plus-lighter is not a blend mode)
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedEnumeration-keywords.txt b/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedEnumeration-keywords.txt
index bc348434dc5..36cd180a191 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedEnumeration-keywords.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedEnumeration-keywords.txt
@@ -2,37 +2,37 @@ Harness status: OK
Found 32 tests
-12 Pass
-20 Fail
+28 Pass
+4 Fail
Pass SVGAnimatedEnumeration, keyword values, SVGComponentTransferFunctionElement.prototype.type (keywords)
-Fail SVGAnimatedEnumeration, keyword values, SVGComponentTransferFunctionElement.prototype.type (case-sensitive)
+Pass SVGAnimatedEnumeration, keyword values, SVGComponentTransferFunctionElement.prototype.type (case-sensitive)
Pass SVGAnimatedEnumeration, keyword values, SVGFEBlendElement.prototype.mode (keywords)
Pass SVGAnimatedEnumeration, keyword values, SVGFEBlendElement.prototype.mode (case-sensitive)
Pass SVGAnimatedEnumeration, keyword values, SVGFEColorMatrixElement.prototype.type (keywords)
-Fail SVGAnimatedEnumeration, keyword values, SVGFEColorMatrixElement.prototype.type (case-sensitive)
+Pass SVGAnimatedEnumeration, keyword values, SVGFEColorMatrixElement.prototype.type (case-sensitive)
Pass SVGAnimatedEnumeration, keyword values, SVGFECompositeElement.prototype.operator (keywords)
-Fail SVGAnimatedEnumeration, keyword values, SVGFECompositeElement.prototype.operator (case-sensitive)
+Pass SVGAnimatedEnumeration, keyword values, SVGFECompositeElement.prototype.operator (case-sensitive)
Fail SVGAnimatedEnumeration, keyword values, SVGFEConvolveMatrixElement.prototype.edgeMode (keywords)
Fail SVGAnimatedEnumeration, keyword values, SVGFEConvolveMatrixElement.prototype.edgeMode (case-sensitive)
Pass SVGAnimatedEnumeration, keyword values, SVGFEDisplacementMapElement.prototype.xChannelSelector (keywords)
Pass SVGAnimatedEnumeration, keyword values, SVGFEDisplacementMapElement.prototype.xChannelSelector (case-sensitive)
-Fail SVGAnimatedEnumeration, keyword values, SVGFEGaussianBlurElement.prototype.edgeMode (keywords)
-Fail SVGAnimatedEnumeration, keyword values, SVGFEGaussianBlurElement.prototype.edgeMode (case-sensitive)
+Pass SVGAnimatedEnumeration, keyword values, SVGFEGaussianBlurElement.prototype.edgeMode (keywords)
+Pass SVGAnimatedEnumeration, keyword values, SVGFEGaussianBlurElement.prototype.edgeMode (case-sensitive)
Pass SVGAnimatedEnumeration, keyword values, SVGFEMorphologyElement.prototype.operator (keywords)
-Fail SVGAnimatedEnumeration, keyword values, SVGFEMorphologyElement.prototype.operator (case-sensitive)
+Pass SVGAnimatedEnumeration, keyword values, SVGFEMorphologyElement.prototype.operator (case-sensitive)
Pass SVGAnimatedEnumeration, keyword values, SVGFETurbulenceElement.prototype.type (keywords)
Pass SVGAnimatedEnumeration, keyword values, SVGFETurbulenceElement.prototype.type (case-sensitive)
Pass SVGAnimatedEnumeration, keyword values, SVGFETurbulenceElement.prototype.stitchTiles (keywords)
Pass SVGAnimatedEnumeration, keyword values, SVGFETurbulenceElement.prototype.stitchTiles (case-sensitive)
-Fail SVGAnimatedEnumeration, keyword values, SVGGradientElement.prototype.spreadMethod (keywords)
-Fail SVGAnimatedEnumeration, keyword values, SVGGradientElement.prototype.spreadMethod (case-sensitive)
-Fail SVGAnimatedEnumeration, keyword values, SVGGradientElement.prototype.gradientUnits (keywords)
-Fail SVGAnimatedEnumeration, keyword values, SVGGradientElement.prototype.gradientUnits (case-sensitive)
+Pass SVGAnimatedEnumeration, keyword values, SVGGradientElement.prototype.spreadMethod (keywords)
+Pass SVGAnimatedEnumeration, keyword values, SVGGradientElement.prototype.spreadMethod (case-sensitive)
+Pass SVGAnimatedEnumeration, keyword values, SVGGradientElement.prototype.gradientUnits (keywords)
+Pass SVGAnimatedEnumeration, keyword values, SVGGradientElement.prototype.gradientUnits (case-sensitive)
Fail SVGAnimatedEnumeration, keyword values, SVGMarkerElement.prototype.markerUnits (keywords)
Fail SVGAnimatedEnumeration, keyword values, SVGMarkerElement.prototype.markerUnits (case-sensitive)
-Fail SVGAnimatedEnumeration, keyword values, SVGTextContentElement.prototype.lengthAdjust (keywords)
-Fail SVGAnimatedEnumeration, keyword values, SVGTextContentElement.prototype.lengthAdjust (case-sensitive)
-Fail SVGAnimatedEnumeration, keyword values, SVGTextPathElement.prototype.method (keywords)
-Fail SVGAnimatedEnumeration, keyword values, SVGTextPathElement.prototype.method (case-sensitive)
-Fail SVGAnimatedEnumeration, keyword values, SVGTextPathElement.prototype.spacing (keywords)
-Fail SVGAnimatedEnumeration, keyword values, SVGTextPathElement.prototype.spacing (case-sensitive)
\ No newline at end of file
+Pass SVGAnimatedEnumeration, keyword values, SVGTextContentElement.prototype.lengthAdjust (keywords)
+Pass SVGAnimatedEnumeration, keyword values, SVGTextContentElement.prototype.lengthAdjust (case-sensitive)
+Pass SVGAnimatedEnumeration, keyword values, SVGTextPathElement.prototype.method (keywords)
+Pass SVGAnimatedEnumeration, keyword values, SVGTextPathElement.prototype.method (case-sensitive)
+Pass SVGAnimatedEnumeration, keyword values, SVGTextPathElement.prototype.spacing (keywords)
+Pass SVGAnimatedEnumeration, keyword values, SVGTextPathElement.prototype.spacing (case-sensitive)
\ No newline at end of file
diff --git a/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedLength-initial-values.txt b/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedLength-initial-values.txt
index b4c007e1172..39da74ca2bb 100644
--- a/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedLength-initial-values.txt
+++ b/Tests/LibWeb/Text/expected/wpt-import/svg/types/scripted/SVGAnimatedLength-initial-values.txt
@@ -2,8 +2,8 @@ Harness status: OK
Found 130 tests
-112 Pass
-18 Fail
+120 Pass
+10 Fail
Pass SVGAnimatedLength, initial values, SVGCircleElement.prototype.cx (remove)
Pass SVGAnimatedLength, initial values, SVGCircleElement.prototype.cx (invalid value)
Pass SVGAnimatedLength, initial values, SVGCircleElement.prototype.cy (remove)
@@ -74,14 +74,14 @@ Fail SVGAnimatedLength, initial values, SVGMarkerElement.prototype.markerWidth (
Fail SVGAnimatedLength, initial values, SVGMarkerElement.prototype.markerWidth (invalid value)
Fail SVGAnimatedLength, initial values, SVGMarkerElement.prototype.markerHeight (remove)
Fail SVGAnimatedLength, initial values, SVGMarkerElement.prototype.markerHeight (invalid value)
-Fail SVGAnimatedLength, initial values, SVGMaskElement.prototype.x (remove)
-Fail SVGAnimatedLength, initial values, SVGMaskElement.prototype.x (invalid value)
-Fail SVGAnimatedLength, initial values, SVGMaskElement.prototype.y (remove)
-Fail SVGAnimatedLength, initial values, SVGMaskElement.prototype.y (invalid value)
-Fail SVGAnimatedLength, initial values, SVGMaskElement.prototype.width (remove)
-Fail SVGAnimatedLength, initial values, SVGMaskElement.prototype.width (invalid value)
-Fail SVGAnimatedLength, initial values, SVGMaskElement.prototype.height (remove)
-Fail SVGAnimatedLength, initial values, SVGMaskElement.prototype.height (invalid value)
+Pass SVGAnimatedLength, initial values, SVGMaskElement.prototype.x (remove)
+Pass SVGAnimatedLength, initial values, SVGMaskElement.prototype.x (invalid value)
+Pass SVGAnimatedLength, initial values, SVGMaskElement.prototype.y (remove)
+Pass SVGAnimatedLength, initial values, SVGMaskElement.prototype.y (invalid value)
+Pass SVGAnimatedLength, initial values, SVGMaskElement.prototype.width (remove)
+Pass SVGAnimatedLength, initial values, SVGMaskElement.prototype.width (invalid value)
+Pass SVGAnimatedLength, initial values, SVGMaskElement.prototype.height (remove)
+Pass SVGAnimatedLength, initial values, SVGMaskElement.prototype.height (invalid value)
Pass SVGAnimatedLength, initial values, SVGPatternElement.prototype.x (remove)
Pass SVGAnimatedLength, initial values, SVGPatternElement.prototype.x (invalid value)
Pass SVGAnimatedLength, initial values, SVGPatternElement.prototype.y (remove)