Skip to content

[css-properties-values-api] Rule validity doesn't match implementations #1098

Closed
@emilio

Description

@emilio

Implementations and tests blatantly disagree with the spec even in simple cases.

https://drafts.css-houdini.org/css-properties-values-api-1/#the-syntax-descriptor says:

The syntax descriptor is required for the @property rule to be valid; if it’s missing, the @property rule is invalid.

https://drafts.css-houdini.org/css-properties-values-api-1/#inherits-descriptor:

The inherits descriptor is required for the @property rule to be valid; if it’s missing, the @property rule is invalid.

https://drafts.css-houdini.org/css-properties-values-api-1/#initial-value-descriptor:

If the value of the syntax descriptor is the universal syntax definition, then the initial-value descriptor is optional. If omitted, the initial value of the property is the guaranteed-invalid value.

Otherwise, if the value of the syntax descriptor is not the universal syntax definition, the following conditions must be met for the @property rule to be valid:

If the above conditions are not met, the @property rule is invalid.

Yet both Blink (and WebKit probably by copying whatever Blink implemented) disagree with it in trivial cases. E.g. this logs 0 per spec, but 1 in WebKit and Blink.

This is annoying because this affects a lot of interop 2023 tests. We have a implementation of this and as I was reviewing this to potentially enable it I found that all the tests are just broken.

Am I missing something? "rule is invalid" only has one meaning in my book, which is that the whole rule should be dropped, just like an @font-face and the

Unknown descriptors are invalid and ignored, but do not invalidate the @property rule.

Makes me think that the spec agrees with my interpretation on what "validity" means here.

I think this is ultimately a spec bug, as in w3c/csswg-drafts#1682 it was decided to be consistent for @counter-style and @font-face.

cc @tabatkins @lilles @andruud

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