ladybird/Libraries/LibWeb/SVG/SVGTextPositioningElement.idl
Jelle Raaijmakers 2c5beeabe3 LibWeb: Improve support for SVG text positioning attributes
Previously, we only supported very basic numbers and a single level of
text positioning support in the `x`, `y`, `dx` and `dy` attributes in
`<text>` and `<tspan>` SVG elements.

This improves our support for them in the following ways:

  * Any `length-percentage` or `number` type value is accepted;
  * Nested `<text>` and `<tspan>` use the 'current text position'
    concept to determine where the next text run should go;
  * We expose the attributes' values through the API.

Though we still do not support:

  * Applying the `rotate` attribute;
  * Applying transformations on a per-character basis.
  * Proper horizontal and vertical glyph advancing (we just use the path
    bounding box for now).
2025-11-20 23:15:24 +01:00

13 lines
592 B
Text

#import <SVG/SVGAnimatedLengthList.idl>
#import <SVG/SVGAnimatedNumberList.idl>
#import <SVG/SVGTextContentElement.idl>
// https://svgwg.org/svg2-draft/text.html#InterfaceSVGTextPositioningElement
[Exposed=Window]
interface SVGTextPositioningElement : SVGTextContentElement {
[SameObject] readonly attribute SVGAnimatedLengthList x;
[SameObject] readonly attribute SVGAnimatedLengthList y;
[SameObject] readonly attribute SVGAnimatedLengthList dx;
[SameObject] readonly attribute SVGAnimatedLengthList dy;
[SameObject] readonly attribute SVGAnimatedNumberList rotate;
};