ladybird/Libraries/LibWeb/CSS/CSS.idl
Sam Atkins 82f5be871a LibWeb: Generate the "Numeric Factory" OM methods on the CSS namespace
Generating boilerplate is nice! This also has the bonus that we're more
correct: I included all the units listed in the spec before,
(see https://drafts.css-houdini.org/css-typed-om-1/#numeric-factory )
but we're supposed to exactly include ones for the units we support:

> If an implementation supports additional CSS units that do not have a
  corresponding method in the above list, but that do correspond to one
  of the existing CSSNumericType values, it must additionally support
  such a method, named after the unit in its defined canonical casing,
  using the generic behavior defined above.

> If an implementation does not support a given unit, it must not
  implement its corresponding method from the list above.

Now, our factory functions will exactly match the units we support.

The changed test result is partly the order being different, and partly
that the container-query units are no longer included as we don't
actually support them.
2025-09-11 17:06:44 +01:00

24 lines
768 B
Text

#import <CSS/CSSUnitValue.idl>
#import <CSS/GeneratedCSSNumericFactoryMethods.idl>
dictionary PropertyDefinition {
required CSSOMString name;
CSSOMString syntax = "*";
required boolean inherits;
CSSOMString initialValue;
};
// https://www.w3.org/TR/cssom-1/#namespacedef-css
[Exposed=Window]
namespace CSS {
CSSOMString escape(CSSOMString ident);
boolean supports(CSSOMString property, CSSOMString value);
boolean supports(CSSOMString conditionText);
// https://www.w3.org/TR/css-properties-values-api-1/#dom-css-registerproperty
undefined registerProperty(PropertyDefinition definition);
// https://drafts.css-houdini.org/css-typed-om-1/#numeric-factory
// NB: Generated by GenerateCSSNumericFactoryMethods.cpp
};