Skip to content

[cssom] shorthand not representing the values of list in its grammar? #1843

@waldbaerkoch

Description

@waldbaerkoch

6.7.2. 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:

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' 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', 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', and then in step 5 terminates if the parsing returns null.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions