W3C home > Mailing lists > Public > public-css-archive@w3.org > October 2017

[csswg-drafts] [cssom] shorthand not representing the values of list in its grammar?

From: Johannes Koch via GitHub <sysbot+gh@w3.org>
Date: Mon, 02 Oct 2017 08:06:30 +0000
To: public-css-archive@w3.org
Message-ID: <issues.opened-262008560-1506931577-sysbot+gh@w3.org>
waldbaerkoch has just created a new issue for https://github.com/w3c/csswg-drafts:

== [cssom] shorthand not representing the values of list in its grammar? ==
6.7.2. [Serializing CSS Values](https://drafts.csswg.org/cssom/#serializing-css-values)
Step 1.2:
> If shorthand cannot represent the values of list in its grammar, return the empty string and terminate these steps.

This step is invoked if the procedure is called with a list of longhand declarations:
* step [3.2.5](https://drafts.csswg.org/cssom/#ref-for-serialize-a-css-value) of ['serialize a CSS declaration block'](https://drafts.csswg.org/cssom/#serialize-a-css-declaration-block)
* step [1.2.3](https://drafts.csswg.org/cssom/#ref-for-serialize-a-css-value%E2%91%A1) of [`getPropertyValue(property)`](https://drafts.csswg.org/cssom/#dom-cssstyledeclaration-getpropertyvalue)

In which situation can the shorthand not represent the values of list in its grammar? That sounds like a declaration passed to this procedure can have an invalid value. As I read the procedures for manipulating a CSSStyleDeclaration the values are always checked against spec:
* setting `cssText`: in step 3 calls ['parse a CSS declaration block'](https://drafts.csswg.org/cssom/#parse-a-css-declaration-block) which parses "_declaration_ according to the appropriate CSS specifications, dropping parts that are said to be ignored".
* `setProperty(property, value, priority)`: in step 5 calls ['parse a CSS value'](https://drafts.csswg.org/cssom/#parse-a-css-value), which matches "_list_ against the grammar for the property _property_ in the CSS specification", and then in step 6 terminates if the parsing returns null.
* `setPropertyValue(property, value)`: in step 4 calls ['parse a CSS value'](https://drafts.csswg.org/cssom/#parse-a-css-value), and then in step 5 terminates if the parsing returns null.

Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/1843 using your GitHub account
Received on Monday, 2 October 2017 08:06:20 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 5 July 2022 06:41:19 UTC