Skip to content

Commit 041645c

Browse files
committed
[css-variables] Forbid var-* properties from showing up as attributes on CSSStyleDeclaration.
1 parent 029fd3f commit 041645c

2 files changed

Lines changed: 18 additions & 0 deletions

File tree

css-variables/Overview.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -751,6 +751,15 @@ <h3 id=the-cssstyledeclaration-interface><span class=secno>4.1. </span>
751751
}
752752
</pre>
753753

754+
<p> While the CSSStyleDeclaration interface normally contains attributes
755+
that are camel-cased name variants of all CSS properties (and sometimes
756+
also attributes for their canonical names), it must not contain any such
757+
attributes for custom properties. The camel-case trick does not work, as
758+
custom property names are case-sensitive, and there are potentially an
759+
infinity of custom properties, which is incompatible with the normal
760+
behavior of exposing every property whether it was set in the
761+
corresponding declaration block or not.
762+
754763
<h4 id=serializing-custom-props><span class=secno>4.1.1. </span>
755764
Serializing Custom Properties</h4>
756765

css-variables/Overview.src.html

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -545,6 +545,15 @@ <h3 id='the-cssstyledeclaration-interface'>
545545
}
546546
</pre>
547547

548+
While the CSSStyleDeclaration interface normally contains attributes that are camel-cased name variants of all CSS properties
549+
(and sometimes also attributes for their canonical names),
550+
it must not contain any such attributes for custom properties.
551+
The camel-case trick does not work,
552+
as custom property names are case-sensitive,
553+
and there are potentially an infinity of custom properties,
554+
which is incompatible with the normal behavior of exposing every property
555+
whether it was set in the corresponding declaration block or not.
556+
548557

549558

550559
<h4 id='serializing-custom-props'>

0 commit comments

Comments
 (0)