diff --git a/Libraries/LibWeb/SVG/SVGUnitTypes.h b/Libraries/LibWeb/SVG/SVGUnitTypes.h new file mode 100644 index 0000000000..e81f92f4d7 --- /dev/null +++ b/Libraries/LibWeb/SVG/SVGUnitTypes.h @@ -0,0 +1,7 @@ +/* + * Copyright (c) 2025, Jelle Raaijmakers + * + * SPDX-License-Identifier: BSD-2-Clause + */ + +#pragma once diff --git a/Libraries/LibWeb/SVG/SVGUnitTypes.idl b/Libraries/LibWeb/SVG/SVGUnitTypes.idl new file mode 100644 index 0000000000..84c4f63193 --- /dev/null +++ b/Libraries/LibWeb/SVG/SVGUnitTypes.idl @@ -0,0 +1,8 @@ +// https://svgwg.org/svg2-draft/types.html#InterfaceSVGUnitTypes +[Exposed=Window] +interface SVGUnitTypes { + // Unit Types + const unsigned short SVG_UNIT_TYPE_UNKNOWN = 0; + const unsigned short SVG_UNIT_TYPE_USERSPACEONUSE = 1; + const unsigned short SVG_UNIT_TYPE_OBJECTBOUNDINGBOX = 2; +}; diff --git a/Libraries/LibWeb/idl_files.cmake b/Libraries/LibWeb/idl_files.cmake index c761079557..8ed64d053b 100644 --- a/Libraries/LibWeb/idl_files.cmake +++ b/Libraries/LibWeb/idl_files.cmake @@ -372,6 +372,7 @@ libweb_js_bindings(SVG/SVGTitleElement) libweb_js_bindings(SVG/SVGTransform) libweb_js_bindings(SVG/SVGTransformList) libweb_js_bindings(SVG/SVGTSpanElement) +libweb_js_bindings(SVG/SVGUnitTypes) libweb_js_bindings(SVG/SVGUseElement) libweb_js_bindings(SVG/SVGViewElement) libweb_js_bindings(Selection/Selection) diff --git a/Tests/LibWeb/Text/expected/all-window-properties.txt b/Tests/LibWeb/Text/expected/all-window-properties.txt index f4d2f21d88..80a03263a4 100644 --- a/Tests/LibWeb/Text/expected/all-window-properties.txt +++ b/Tests/LibWeb/Text/expected/all-window-properties.txt @@ -377,6 +377,7 @@ SVGTextPositioningElement SVGTitleElement SVGTransform SVGTransformList +SVGUnitTypes SVGUseElement SVGViewElement Screen 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 ff14d655dc..485957b702 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 1781 tests -958 Pass -823 Fail +970 Pass +811 Fail Pass idl_test setup Pass idl_test validation Pass Partial interface Document: original interface defined @@ -386,18 +386,18 @@ Fail SVGAnimatedLengthList must be primary interface of objects.text.x Fail Stringification of objects.text.x Fail SVGAnimatedLengthList interface: objects.text.x must inherit property "baseVal" with the proper type Fail SVGAnimatedLengthList interface: objects.text.x must inherit property "animVal" with the proper type -Fail SVGUnitTypes interface: existence and properties of interface object -Fail SVGUnitTypes interface object length -Fail SVGUnitTypes interface object name -Fail SVGUnitTypes interface: existence and properties of interface prototype object -Fail SVGUnitTypes interface: existence and properties of interface prototype object's "constructor" property -Fail SVGUnitTypes interface: existence and properties of interface prototype object's @@unscopables property -Fail SVGUnitTypes interface: constant SVG_UNIT_TYPE_UNKNOWN on interface object -Fail SVGUnitTypes interface: constant SVG_UNIT_TYPE_UNKNOWN on interface prototype object -Fail SVGUnitTypes interface: constant SVG_UNIT_TYPE_USERSPACEONUSE on interface object -Fail SVGUnitTypes interface: constant SVG_UNIT_TYPE_USERSPACEONUSE on interface prototype object -Fail SVGUnitTypes interface: constant SVG_UNIT_TYPE_OBJECTBOUNDINGBOX on interface object -Fail SVGUnitTypes interface: constant SVG_UNIT_TYPE_OBJECTBOUNDINGBOX on interface prototype object +Pass SVGUnitTypes interface: existence and properties of interface object +Pass SVGUnitTypes interface object length +Pass SVGUnitTypes interface object name +Pass SVGUnitTypes interface: existence and properties of interface prototype object +Pass SVGUnitTypes interface: existence and properties of interface prototype object's "constructor" property +Pass SVGUnitTypes interface: existence and properties of interface prototype object's @@unscopables property +Pass SVGUnitTypes interface: constant SVG_UNIT_TYPE_UNKNOWN on interface object +Pass SVGUnitTypes interface: constant SVG_UNIT_TYPE_UNKNOWN on interface prototype object +Pass SVGUnitTypes interface: constant SVG_UNIT_TYPE_USERSPACEONUSE on interface object +Pass SVGUnitTypes interface: constant SVG_UNIT_TYPE_USERSPACEONUSE on interface prototype object +Pass SVGUnitTypes interface: constant SVG_UNIT_TYPE_OBJECTBOUNDINGBOX on interface object +Pass SVGUnitTypes interface: constant SVG_UNIT_TYPE_OBJECTBOUNDINGBOX on interface prototype object Pass SVGSVGElement interface: existence and properties of interface object Pass SVGSVGElement interface object length Pass SVGSVGElement interface object name