w3c / csswg-drafts

CSS Working Group Editor Drafts
https://drafts.csswg.org/
Other
4.43k stars 656 forks source link

[css-view-transitions-2] How are invalid types validated? #10706

Open nt1m opened 1 month ago

nt1m commented 1 month ago

Apparently there are invalid types (see #9534):

type can accept any idents, except 'none' or '-ua-' prefixes

I would suggest throwing a TypeError or a SyntaxError when these are used in DOM APIs (notably the setters).

cc @noamr @khushalsagar @vmpstr @bokand

nt1m commented 1 month ago

cc @tuankiet65

nt1m commented 1 month ago

Aside from the DOM APIs, should the use of invalid names in the types descriptor of @view-transition make the declaration invalid?

(I personally think it should, for clarity)

noamr commented 1 month ago

See this resolution

We specifically allowed invalid types in the setlike setters, to be consistent with CustomStateSet where the set can include and reflect invalid values, but they're not selectable in JS.

I think this validation should be in @view-transition { types } and in :active-view-transition-type(), not sure it needs to be in CSSOM.

I think it's important that it would make the whole at rule invalid, otherwise an at rule with invalid types would trigger a transition as if it has no types.