1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-20 11:45:06 +00:00
serenity/Userland/Libraries/LibWeb/SVG/SVGLength.idl
Timothy Flynn ebf3829f1c LibWeb: Begin implementing the SVGLength type
There are a few unimplemented features for this type:

1. The value setter should throw a DOMException if it is invoked on an
   SVGLength that was declared readonly in another IDL file.

2. SVG::AttributeParser does not parse unit types when it parses lengths
   so all SVGLength will have an "unknown" unit for now.

3. Due to (2), methods which convert between units are unimplemented.
2022-03-21 21:04:39 +01:00

24 lines
1 KiB
Text

interface SVGLength {
const unsigned short SVG_LENGTHTYPE_UNKNOWN = 0;
const unsigned short SVG_LENGTHTYPE_NUMBER = 1;
const unsigned short SVG_LENGTHTYPE_PERCENTAGE = 2;
const unsigned short SVG_LENGTHTYPE_EMS = 3;
const unsigned short SVG_LENGTHTYPE_EXS = 4;
const unsigned short SVG_LENGTHTYPE_PX = 5;
const unsigned short SVG_LENGTHTYPE_CM = 6;
const unsigned short SVG_LENGTHTYPE_MM = 7;
const unsigned short SVG_LENGTHTYPE_IN = 8;
const unsigned short SVG_LENGTHTYPE_PT = 9;
const unsigned short SVG_LENGTHTYPE_PC = 10;
readonly attribute unsigned short unitType;
// FIXME: Support setraises().
attribute float value; // setraises(DOMException);
// attribute float valueInSpecifiedUnits setraises(DOMException);
// attribute DOMString valueAsString setraises(DOMException);
// void newValueSpecifiedUnits(in unsigned short unitType, in float valueInSpecifiedUnits) raises(DOMException);
// void convertToSpecifiedUnits(in unsigned short unitType) raises(DOMException);
};