Skip to content

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

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
nt1m opened this issue Aug 7, 2024 · 5 comments
Closed

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

nt1m opened this issue Aug 7, 2024 · 5 comments
Labels
css-view-transitions-2 View Transitions; New feature requests

Comments

@nt1m
Copy link
Member

nt1m commented Aug 7, 2024

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
Copy link
Member Author

nt1m commented Aug 7, 2024

cc @tuankiet65

@nt1m
Copy link
Member Author

nt1m commented Aug 7, 2024

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)

@nt1m nt1m added the Agenda+ label Aug 7, 2024
@nt1m nt1m changed the title [css-view-transitions-2] Consider throwing in the DOM APIs when invalid types are specified [css-view-transitions-2] How are invalid types validated? Aug 7, 2024
@noamr
Copy link
Collaborator

noamr commented Aug 7, 2024

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.

@noamr noamr added the css-view-transitions-2 View Transitions; New feature requests label Aug 19, 2024
@astearns astearns moved this to TPAC/FTF agenda items in CSSWG Agenda TPAC 2024 Sep 13, 2024
@astearns astearns moved this from TPAC/FTF agenda items to Regular agenda items in CSSWG Agenda TPAC 2024 Sep 13, 2024
@astearns astearns moved this from Regular agenda items to Friday afternoon in CSSWG Agenda TPAC 2024 Sep 16, 2024
@noamr
Copy link
Collaborator

noamr commented Nov 6, 2024

I can't attend the APAC meeting, but proposing to leave the wording as is, as per previous resolution.

@css-meeting-bot
Copy link
Member

The CSS Working Group just discussed [css-view-transitions-2] How are invalid types validated?, and agreed to the following:

  • RESOLVED: close no change
The full IRC log of that discussion <TabAtkins> vmpstr: in VT we have a notion of "types" you can specify
<TabAtkins> vmpstr: there are some type names that are invalid, like "none" or anything with "-ua-*"
<TabAtkins> vmpstr: Tim asked how these are validated in the JS APi, and suggested throwing a syntax error
<TabAtkins> vmpstr: previously we resolved not to do validation in the script api
<TabAtkins> vmpstr: we just use what the author specified, but ignore the invalid bits
<TabAtkins> vmpstr: a silent filtering
<TabAtkins> vmpstr: we'd like to maintain that
<TabAtkins> vmpstr: also, the @view-transition supports types, and Noam's comment is that if there are invalid types, the pref is for the whole block to be invalid, otherwise it can cause unexpected transitions to happen
<fantasai> sounds reasonable to me
<TabAtkins> vmpstr: So I think we'd like close-no-change, tho it's not entirely clear to me that @view-transition reflects fully what I said above. But the script API side, at least, reflects what I said
<TabAtkins> astearns: In my reading of Tim's post, it sounds like he's fine as long as it's defined.
<TabAtkins> vmpstr: I have the same reading
<TabAtkins> fantasai: I checked with Tim and he's ok with resolving
<TabAtkins> astearns: so proposed resolution is close no change, it's already handled
<TabAtkins> RESOLVED: close no change

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
css-view-transitions-2 View Transitions; New feature requests
Projects
Status: Regular agenda items
Development

No branches or pull requests

3 participants