[cssom-1] Trim the name argument CSSStyleDeclaration.setProperty()
#11418
Labels
cssom-1
Current Work
CSSStyleDeclaration.setProperty()
#11418
This would also apply to
CSSStyleDeclaration.getPropertyValue()
, and possiblyCSSStyleValue.parse()
andCSSFontFeatureValuesMap.*()
.For
CSSStyleDeclaration
andCSSStyleValue
, whenname
is not a custom property name, it is normalized to lowercase. I feel like it should be trimmed too:style.setProperty(' /**/ color', 'green')
would be valid. It is currently invalid in all browsers (with or without the comment). There is no correspond test on WPT.Trimming whitespaces/comments is consistent with the CSS parser entry points (and algorithms). They are either ignored or trimmed in
value
(style.setProperty('color', ' /**/ green ')
is valid),CSSStyleSheet.insertRule()
,CSSStyleSheet.replace*()
,MediaList.appendMedium()
, etc.The text was updated successfully, but these errors were encountered: