microsoft / TypeScript-DOM-lib-generator

Tool for generating dom related TypeScript and JavaScript library files
Apache License 2.0
616 stars 417 forks source link

CSSStyleDeclaration misses dashed attributes #1672

Open jelhan opened 8 months ago

jelhan commented 8 months ago

CSSStyleDeclaration has two attributes for each CSS property. A dashed and a camelCase representation. The CSSStyleDeclaration interface only contains the camelCase representation currently.

partial interface CSSStyleDeclaration {
  [CEReactions] attribute [LegacyNullToEmptyString] CSSOMString _dashed_attribute;
};

The dashed attribute attribute, on getting, must return the result of invoking getPropertyValue() with the argument being dashed attribute.

Setting the dashed attribute attribute must invoke setProperty() with the first argument being dashed attribute, as second argument the given value, and no third argument. Any exceptions thrown must be re-thrown.

For example, for the font-size property there would be a font-size IDL attribute. In JavaScript, the property can be accessed as follows, assuming element is an HTML element:

element.style['font-size'];

https://www.w3.org/TR/cssom-1/#dom-cssstyledeclaration-getpropertyvalue

Please find a demonstration of this issue here: Playground Link