-
Notifications
You must be signed in to change notification settings - Fork 667
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
[css-transitions-2] Put discrete transitions behind new syntax for compatibility #8857
Comments
Thanks for raising the issue! I voted for #2, but wanted to clarify one thing. With option 2, both of these would work, and would be equivalent, correct?
|
Both would work, and in practice they're equivalent (because opacity is never discrete) but syntactically they're different. They would expand to something like this: .version1 {
transition-property-name: display, overlay, opacity;
transition-property-duration: 0.2s 0.2s 0.2s;
transition-property-mode: discrete; /* auto-extends discrete */
}
.version2 {
transition-property-name: display, overlay, opacity;
transition-property-mode: discrete, discrete, continuous;
transition-property-duration: 0.2s 0.2s 0.2s;
} Happy to here other options for |
What happens for interpolatable values? Would the transition also be turned into a discrete one or would the keyword be ignored in that case? If the transition is also made discrete, then I'd suggest an Why should Also, authors should be encouraged to specify the names for the properties they want to transition instead falling back to Sebastian |
They'd function as normal. The (If you want "discrete" transitions on interpolable values, provide a linear() timing function yourself.) |
Fourth option: Add a
Benefits:
Downsides:
(Not sure if it's a good idea or not, just wanted to throw it out there.) |
Now that we are planning to add a new opt-in syntax for CSSTransitionDiscrete, this patch disables CSSTransitionDiscrete and undoes the WPT changes. The affected WPTs are interop23 tracked so the other browsers would like them to be updated ASAP. This was asked for here: #39871 CSSTransitionDiscrete opt in syntax: w3c/csswg-drafts#8857 Change-Id: If28b7e9fc4fc0d6dc851e35007fd7614a9b497a0
That's a good point, it would just be another @fantasai I've added your suggestion above as option 4. I am still leaning towards 2 myself as I feel like it is more natural to associate with the specified transition but it's good to have options 🙂 |
One question about option 2, currently it looks like the other property lists are repeated rather than last-value extended when the list is too short. Seems like naively we'd just do the same for |
Now that we are planning to add a new opt-in syntax for CSSTransitionDiscrete, this patch disables CSSTransitionDiscrete and undoes the WPT changes. The affected WPTs are interop23 tracked so the other browsers would like them to be updated ASAP. This was asked for here: #39871 CSSTransitionDiscrete opt in syntax: w3c/csswg-drafts#8857 Change-Id: If28b7e9fc4fc0d6dc851e35007fd7614a9b497a0
Now that we are planning to add a new opt-in syntax for CSSTransitionDiscrete, the test changes which I made for CSSTransitionDiscrete will not eventually stick. Since these tests are interop23 tracked, the other browsers would like them to be updated ASAP. I thought about also disabling the CSSTransitionDiscrete flag, which would make this patch a lot cleaner, but that would break demos and stuff people are working on so I decided against it. This was asked for here: #39871 CSSTransitionDiscrete opt in syntax: w3c/csswg-drafts#8857 Change-Id: If28b7e9fc4fc0d6dc851e35007fd7614a9b497a0
Now that we are planning to add a new opt-in syntax for CSSTransitionDiscrete, the test changes which I made for CSSTransitionDiscrete will not eventually stick. Since these tests are interop23 tracked, the other browsers would like them to be updated ASAP. I thought about also disabling the CSSTransitionDiscrete flag, which would make this patch a lot cleaner, but that would break demos and stuff people are working on so I decided against it. This was asked for here: #39871 CSSTransitionDiscrete opt in syntax: w3c/csswg-drafts#8857 Change-Id: If28b7e9fc4fc0d6dc851e35007fd7614a9b497a0
Now that we are planning to add a new opt-in syntax for CSSTransitionDiscrete, the test changes which I made for CSSTransitionDiscrete will not eventually stick. Since these tests are interop23 tracked, the other browsers would like them to be updated ASAP. I thought about also disabling the CSSTransitionDiscrete flag, which would make this patch a lot cleaner, but that would break demos and stuff people are working on so I decided against it. This was asked for here: #39871 CSSTransitionDiscrete opt in syntax: w3c/csswg-drafts#8857 Change-Id: If28b7e9fc4fc0d6dc851e35007fd7614a9b497a0
Proposed resolution: Go with option 2 above, adding a transition longhand for specifying whether the transition should allow discrete interpolation. This will follow the same convention as the other transition longhands where the list is repeated if shorter than the transition-property list. Given this is in reference to the animation-type) it's probably worth sharing some of the terminology. Possible property names:
Possible property values:
I think my preference would be |
Now that we are planning to add a new opt-in syntax for CSSTransitionDiscrete, the test changes which I made for CSSTransitionDiscrete will not eventually stick. Since these tests are interop23 tracked, the other browsers would like them to be updated ASAP. I thought about also disabling the CSSTransitionDiscrete flag, which would make this patch a lot cleaner, but that would break demos and stuff people are working on so I decided against it. This was asked for here: #39871 CSSTransitionDiscrete opt in syntax: w3c/csswg-drafts#8857 Change-Id: If28b7e9fc4fc0d6dc851e35007fd7614a9b497a0
Now that we are planning to add a new opt-in syntax for CSSTransitionDiscrete, the test changes which I made for CSSTransitionDiscrete will not eventually stick. Since these tests are interop23 tracked, the other browsers would like them to be updated ASAP. I thought about also disabling the CSSTransitionDiscrete flag, which would make this patch a lot cleaner, but that would break demos and stuff people are working on so I decided against it. This was asked for here: #39871 CSSTransitionDiscrete opt in syntax: w3c/csswg-drafts#8857 Change-Id: If28b7e9fc4fc0d6dc851e35007fd7614a9b497a0
Now that we are planning to add a new opt-in syntax for CSSTransitionDiscrete, the test changes which I made for CSSTransitionDiscrete will not eventually stick. Since these tests are interop23 tracked, the other browsers would like them to be updated ASAP. I thought about also disabling the CSSTransitionDiscrete flag, which would make this patch a lot cleaner, but that would break demos and stuff people are working on so I decided against it. This was asked for here: #39871 CSSTransitionDiscrete opt in syntax: w3c/csswg-drafts#8857 Change-Id: If28b7e9fc4fc0d6dc851e35007fd7614a9b497a0
Alternative naming (for option 2), which I think is maybe a bit more clear? (mode/type/etc is pretty vague)
where
|
The CSS Working Group just discussed
The full IRC log of that discussion<dael> flackr: When we were trying to ship support for discrete transitions one common case overlloked is common properties that are sometimes discrete and sometimes continuous.<dael> flackr: This has broken a few sites as shown in issue. Think we need a new syntax to opt in to discrete transitions <dael> flackr: A bunch of proposals in the issue <dael> flackr: Two with most support are having a long hand transition property similar to duration and easing that spec per transition if it should start on discrete property changes <dael> flackr: Other is option 4 from fantasai having a separate property that's a switch for if you do discrete transitions <dael> fantasai: That prop would have allow/don't allow/all for these properties and it cascades independently. <dael> fantasai: I'm not saying it's better, but a different approach <dael> flackr: Two ways of looking. Yours is better for site-wide switch, other is better for property by property. <dael> flackr: In both you can say you want discrete everywhere. Harder to specify in option 2 <dael> Rossen_: If I'm reading the emoji vote, 6 for #2 and 4 for #1? <dael> flackr: To be fair, #4 was added later <dael> Rossen_: Should we be discounting #1? It's a smaller population <dael> fantasai: I think that option 2 was better than 1. It should come down to 2 vs 4. We could do both <dael> fantasai: Initial value of the transition mode is an auto value that looks up another property <dael> flackr: Maybe consider one as a starting point and we could add the other? <dael> fantasai: One thing that makes it trick is if we think it could be both have to think about how to name them <dael> Rossen_: Can we live with 2 or 4 only? <dael> flackr: and fantasai Yeah <Rossen_> q? <Rossen_> ack fantasai <dael> fantasai: Tricky is what is the pattern of use and what will be easier to use in most cases. You can mostly do most of it with either <dael> flackr: Either let you global opt in. Option 2 if you don't want all you have to go transition by transition. Option 4 is by property <dael> fantasai: I think option 2 is better. It's more powerful <dael> flackr: More configurable. And more consistant with other transition longhards <dael> fantasai: Agree <dael> Rossen_: 4 is additive? <dael> fantasai: Could add if we want to <dael> Rossen_: Sounds like fantasai you're leaning toward #2? <dael> fantasai: Yeah <dael> Rossen_: I think we have a clear winner <dael> Rossen_: Want to hear from the rest of folks on the call <dael> smfr: Does this make a non-discrete animating prop animate in discrete way? <dael> flackr: No <dael> flackr: Some properties are sometimes discete. Their discrete interpolations star with this <dael> smfr: Transition list was opacity and display are you forced to supply a value for opacity if you want discrete on display? <dael> flackr: No downside to discrete on opacity <dael> smfr: Could be confusing for author <dael> flackr: It is auto expanding list <dael> smfr: Could also expect discrete on opacity to split to by 50% <dael> flackr: That's why I had a bunch of options on names. I proposed animatable <dael> fantasai: Non-animatable properties are quite exceptional I don't think should name based on that <dael> flackr: It's what the spec says so suggested that <dael> fantasai: True, but most people don't read spec. Need to think about best way to suggest this to authors <dael> flackr: Maybe 'all' is value to include discrete <dael> fantasai: Thinking transition-discrete: all|none|magic value that says if it's discrete you can animate and if it's not it doesn't animate. That way you can throw it on your site and transition discrete properties <dael> fantasai: If you're not using the all you can set it on whole site and no effect <dael> smfr: High level comment, discrete is probably hard for non-native speakers. <dael> fantasai: Yeah. not sure what else. transition-non-interoperable <dael> flackr: I think we're good with option 2 <dael> fantasai: Yeah, need to figure out what to call it and values <dael> Rossen_: Let's take a decision and bikeshed name on the issue <dael> Rossen_: Objections to pick option 2 with name to be bikeshed <dael> RESOLVED: Pick option 2 with name to be bikeshed <dael> fantasai: Do we want a magic value that says transition this property only if it is discrete or interorable. Don't transition if it's a property that has an indiscrete <dael> flackr: Could be UI default since possibly not breaking <dael> fantasai: Yeah <fantasai> s/UI/UA/ <fantasai> s/Yeah/Yeah, could be/ <dael> Rossen_: Do we need to resolve on something? <dael> fantasai: Question is do we add the value or not <dael> flackr: And what would we call it? <dael> fantasai: 'magic' for now. bikeshed later <dael> flackr: If this was not initial value I'd say it's additive <dael> fantasai: But it could be initial value <dael> Rossen_: I think we can work this out on the issue <dael> Rossen_: And hear more from bramus, tab, brian, and other folks who have been engaged <dael> flackr: Sounds reasonable |
Now that we are planning to add a new opt-in syntax for CSSTransitionDiscrete, the test changes which I made for CSSTransitionDiscrete will not eventually stick. Since these tests are interop23 tracked, the other browsers would like them to be updated ASAP. I thought about also disabling the CSSTransitionDiscrete flag, which would make this patch a lot cleaner, but that would break demos and stuff people are working on so I decided against it. This was asked for here: #39871 CSSTransitionDiscrete opt in syntax: w3c/csswg-drafts#8857 Change-Id: If28b7e9fc4fc0d6dc851e35007fd7614a9b497a0
It sounds like we have these potential property names:
Property values:
|
This is being discussed here: w3c/csswg-drafts#8857 The name and values of the property are still under discussion. This patch does not implement the transition shorthand integration, I'm going to do that next. Bug: 1453112 Change-Id: I808cf6bc090ca0f99229eb4a9d9c3c28ccf22afc
…orthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73
…orthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73
…orthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73
…orthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73
…orthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73
…orthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73
…orthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73
…orthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4679218 Reviewed-by: David Baron <dbaron@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Auto-Submit: Joey Arhar <jarhar@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176392}
…orthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4679218 Reviewed-by: David Baron <dbaron@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Auto-Submit: Joey Arhar <jarhar@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176392}
…-behavior This patch also renames the "discrete" value to "allow-discrete" This was resolved in the csswg: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I9b9aad124376d5e7bf532d891b7a0e25b651ce2d
…-behavior This patch also renames the "discrete" value to "allow-discrete" This was resolved in the csswg: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I9b9aad124376d5e7bf532d891b7a0e25b651ce2d
…-behavior This patch also renames the "discrete" value to "allow-discrete" This was resolved in the csswg: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I9b9aad124376d5e7bf532d891b7a0e25b651ce2d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4718633 Reviewed-by: David Baron <dbaron@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176694}
…-behavior This patch also renames the "discrete" value to "allow-discrete" This was resolved in the csswg: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I9b9aad124376d5e7bf532d891b7a0e25b651ce2d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4718633 Reviewed-by: David Baron <dbaron@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176694}
…-behavior This patch also renames the "discrete" value to "allow-discrete" This was resolved in the csswg: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I9b9aad124376d5e7bf532d891b7a0e25b651ce2d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4718633 Reviewed-by: David Baron <dbaron@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176694}
…imation-type to transition shorthand, a=testonly Automatic update from web-platform-tests CSSTransitionDiscrete: add transition-animation-type to transition shorthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4679218 Reviewed-by: David Baron <dbaron@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Auto-Submit: Joey Arhar <jarhar@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176392} -- wpt-commits: 777bad789677c93a78ac65101d618d2c9e4ac998 wpt-pr: 40975
…imation-type to transition shorthand, a=testonly Automatic update from web-platform-tests CSSTransitionDiscrete: add transition-animation-type to transition shorthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4679218 Reviewed-by: David Baron <dbaron@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Auto-Submit: Joey Arhar <jarhar@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176392} -- wpt-commits: 777bad789677c93a78ac65101d618d2c9e4ac998 wpt-pr: 40975
…-animation-type to transition-behavior, a=testonly Automatic update from web-platform-tests CSSTransitionDiscrete: Rename transition-animation-type to transition-behavior This patch also renames the "discrete" value to "allow-discrete" This was resolved in the csswg: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I9b9aad124376d5e7bf532d891b7a0e25b651ce2d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4718633 Reviewed-by: David Baron <dbaron@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176694} -- wpt-commits: d4c199f7f994faa4b63c61afea89c936e770509e wpt-pr: 41228
…-animation-type to transition-behavior, a=testonly Automatic update from web-platform-tests CSSTransitionDiscrete: Rename transition-animation-type to transition-behavior This patch also renames the "discrete" value to "allow-discrete" This was resolved in the csswg: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I9b9aad124376d5e7bf532d891b7a0e25b651ce2d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4718633 Reviewed-by: David Baron <dbaron@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176694} -- wpt-commits: d4c199f7f994faa4b63c61afea89c936e770509e wpt-pr: 41228
…orthand This patch implements the proposed transition shorthand for transition-animation-type: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I2f15592de8d9b74be864bd0e0c0eec9d2de77b73 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4679218 Reviewed-by: David Baron <dbaron@chromium.org> Commit-Queue: David Baron <dbaron@chromium.org> Auto-Submit: Joey Arhar <jarhar@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176392}
…-behavior This patch also renames the "discrete" value to "allow-discrete" This was resolved in the csswg: w3c/csswg-drafts#8857 (comment) Bug: 1453112 Change-Id: I9b9aad124376d5e7bf532d891b7a0e25b651ce2d Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/4718633 Reviewed-by: David Baron <dbaron@chromium.org> Commit-Queue: Joey Arhar <jarhar@chromium.org> Cr-Commit-Position: refs/heads/main@{#1176694}
The specification ultimately chose to add I would like to know if the CSS author sets |
Problem
@josepharhar implemented #4441 and discovered some compat issues. While it seems to be true that developers don't set up transitions on properties that only have discrete values, there are many cases where developers have transitions set up on properties which sometimes have discrete values. E.g. going to/from
auto
currently results in a discrete interpolation. This means that changes to/from auto currently do not start transitions but with transitions of discrete properties they now do.Note: We want to support smooth interpolation to/from auto (See #626). If/when we add this, if it just starts intepolating to/from auto and thus starting transitions we would run into the same set of compat issues.
Example issues
@josepharhar looked through 30 affected sites and found 3 regressions:
stackoverflow.com
With discrete transitions for width and height on page load the orange text doesn’t show up for a frame or two:
hpe.com
With discrete transitions for max-height, the accordions at the bottom don’t slide closed but instead suddenly close with a delay after clicking:
fender.com
With discrete transitions for top, the menu bar at the top of the page doesn’t stick to the top of the page but instead teleports to the top after a delay when scrolling:
Solutions
From what we have seen so far, the compat issues are only for properties which currently sometimes have interpolable transitions (e.g. length properties which are interpolable when specified but not when
auto
). This means that technically the only transitions which need to be avoided may be these. However, it seems ergonomically awkward to make the developer need to think about whether the property is sometimes interpolable and sometimes not. As such, I think we should come up with a new syntax for opting in to discrete transitions. A side benefit, is that explicitly specifying discrete also provides a way to opt in to discrete transitions onall
without needing a keyword like discrete-too.For comparison, the code necessary to animate out a dialog (animating display and overlay discretely, and opacity) is shown.
Some options (vote for all that you think would be reasonable):
discrete
keyword before each<single-transition-property>
in the transition-property list.'<single-transition-property>' = discrete? all | <custom-ident>
. With this change you would need to add discrete before each property you wanted to start discrete transitions on, e.g.transition: discrete display 0.2s, discrete overlay 0.2s, opacity 0.2s
transition-property-mode
which is an auto-extended list. This means that you can specify per property whether it should transition discretely or you can specifytransition-property-mode: discrete
and it will auto-extend and transition all specified properties discretely. e.g.transition: display 0.2s, overlay 0.2s, opacity 0.2s; transition-property-mode: discrete;
(the discrete is a list that can be specified per property but is auto-extended).discrete
keyword optional keyword which applies to the whole transition-property-list.transition-property = none | discrete? <single-transition-property>#
. With this, you would opt in to all specified properties transitioning discretely but wouldn't be able to choose per property. e.g.transition: discrete display 0.2s, overlay 0.2s, opacity 0.2s
(the discrete applies to the entire list in this case)transition-discrete
property specifying which css properties should allow discrete transitions. E.g.transition-discrete: all;
all properties,transition-discrete: none; /* initial value */
,transition-discrete: border-style outline-style text-decoration-style;
. This is similar to 3 in that it decouples the discrete properties from the transitions list which may or may not be desirable, but unlike 3 allows choosing specific lists of properties. See [css-transitions-2] Put discrete transitions behind new syntax for compatibility #8857 (comment)As mentioned above, if we eventually support non-discrete animation to/from
auto
, we will have the same compat issues if they work with the existing syntax. As such, we should consider whether any of the above syntaxes (or some other not-yet presented option) could be extended for this auto case. E.g. maybetransition-property-mode: used-value
?The text was updated successfully, but these errors were encountered: