-
Notifications
You must be signed in to change notification settings - Fork 719
[css-view-transitions-1] Should mix-blend-mode be a part of the ua opacity animation? #8924
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
Comments
I think mix-blend-mode should be animatable. I suspect what happened is that the reformatting of ”Animatable” to “Animation type” didn't catch the compositing spec because it's in the FXTF repo, and it's really supposed to be “discrete”. |
So the idea here is that if authors override the default animation on old/new images, we want it to automatically override the blending as well? Because use of the blend-mode is tightly coupled with the opacity animation. Adding up the pixels on the 2 images works because they precisely overlap each other and their opacity (based on the fade animation) adds up to 1. This thought process sounds good but it would be better if this could be setup in a way that this also removes |
I also don't know if it's possible to select based on the specified css value of a descendant (I don't think it is?) I think isolation rendering cost in this case should be something that a user-agent can optimize. Since we'd have a normal blending mode, so there would be no other trigger for compositing, so isolation can also be decomposited. Is that right? |
That's a good question. Blend(A, Blend (B, C)) = Blend(Blend(A,B), C) Thank you @ccameron-chromium for walking me through the math! In that case, I'm good with this proposal. Just to summarize:
Open to suggestions to set up this CSS such that |
This seems like a sensible solution to me. |
+1 on the approach, as it hinders authors less. |
Would it make sense to fold the blend mode into the first animation? I.e.
Then there's fewer UA animations hanging around... not sure if that's more or less helpful to authors, but I wanted to ask. :) |
I'm good with the suggestion above as well. I don't think authors will notice the difference, but maybe it better documents that blending is tightly coupled with the cross-fade. |
The CSS Working Group just discussed
The full IRC log of that discussion |
Welp, I started a spec change for this and realized that using a single keyframe runs into an issue with animations which have only one of old/new images. The setup in the spec for opacity animations is as follows:
So we gotta go back to doing the suggestion in the first comment. The behaviour is the same as intended by this resolution, just that the exact syntax has changed. I put up a PR to avoid ambiguity about what's being proposed: #9000. |
This is somewhat related to ISSUE 4 in the spec. We currently specify mix-blend-mode conditionally if we have a crossfade.
This, however, has unintended and sometimes surprising effects for developers trying to customize old/new animations. @argyleink had an example where the old content did a slide out to the left and new content did a slide in from the left: the overlap between the two contents did not "look right", since the expectation is to see a normal blend mode.
My suggestion is to consider putting mix-blend-mode to be a part of the UA animation instead, maybe something like
and adding that into the animation-name for ua generated css. As an aside, mix-blend-mode is not animatable, but would need to be at least discretely animatable for this to work.
It's a bit of a hack, but I worry that having mix-blend-mode that is added for pairs automatically may cause more developer pain.
Any thoughts?
The text was updated successfully, but these errors were encountered: