Skip to content

[css-syntax-3] Should a declaration value be consumed as a <declaration-value>? #11315

Open
@cdoublev

Description

@cdoublev

In consume a declaration, it is currently consumed as a (unrestricted) list of component values.

But in the current version of Chrome and FF (at least), it seems to be consumed as a <declaration-value>:

<style>
  style {
    color: var(--color) url(bad url);
    color: var(--color) );
    color: var(--color) !;
  }
</style>
<script>
  document.styleSheets[0].cssRules[0].cssText; // style {}
</script>

I could not say whether CSS2 also considered these declarations as invalid.

CSS Syntax 3 is less restrictive, which can change the declared value:

<p style="color: green; color: var(--opacity) url(bad url);">
  black per spec,
  otherwise green
</p>

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