Re: [csswg-drafts] [css-view-transitions-2] Data type for types in script APIs (#10114)

> @emilio brought up that because we want types to be readonly on the CSSViewTransitionRule, it shouldn't be a DOMTokenList. Filing this issue to clarify the data type across all script APIs.
> 
> * `startViewTransition` has a `types` param which is currently sequence.
> * `CSSViewTransitionRule` has a `types` param which is currently DOMTokenList.
> * `ViewTransition` has a `types` param which is DOMTokenList.
> 
> The `ViewTransition` is the only one that needs to me mutable. @noamr

We can't use `DOMTokenList` because it's tied to an element+attribute.
For `ViewTransition.types`, he closest equivalent would be a [CustomStateSet](https://html.spec.whatwg.org/multipage/custom-elements.html#customstateset). Proposing to have a `ViewTransitionStateSet` that's `setlike` (almost identical to `CustomStateSet`).
We should decide if this set can hold and reflect invalid values (non-idents, `none`, `-ua-*`). Proposing that it's more useful if it can't reflect invalid values.

For `CSSViewTransitionRule.types`, I think we should have a `readonly setlike`, like [`GPUSupportedFeatures`](https://gpuweb.github.io/gpuweb/#gpusupportedfeatures).


-- 
GitHub Notification of comment by noamr
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/10114#issuecomment-2014640941 using your GitHub account


-- 
Sent via github-notify-ml as configured in https://github.com/w3c/github-notify-ml-config

Received on Friday, 22 March 2024 08:56:24 UTC