Repository navigation
layout: Prevent animations from producing invalid color values - #46016
Conversation
|
🔨 Triggering try run (#28259069736) for Linux (WPT) |
0dfc45b to
c35f314
Compare
|
|
c35f314 to
7d5fff5
Compare
|
🔨 Triggering try run (#28260223256) for Linux (WPT) |
Loirooriol
left a comment
There was a problem hiding this comment.
Update Stylo to a version that fixes an issue with interpolation of values in reversed transitions.
I don't think a reversed transition is possible, do you mean reversed animations?
Also, please link to the Stylo PR, presumably servo/stylo#403, though that seems more about a duration of 0 than being reversed.
This change adds a WPT crash test.
You forgot git add
| debug_assert!( | ||
| !style_color.color.alpha.is_nan(), | ||
| "NaN alpha: {:?}, ALPHA_IS_NONE: {}", | ||
| style_color.color, | ||
| style_color.color.flags.contains(ColorFlags::ALPHA_IS_NONE) | ||
| ); |
There was a problem hiding this comment.
Seems quite arbitrary to add this here, I would put it inside fn rgba() to cover all callers
There was a problem hiding this comment.
Apologies. This was a bit of debugging output that I neglected to remove.
|
Test results for linux-wpt from try job (#28260223256): Flaky unexpected result (27)
Stable unexpected results that are known to be intermittent (54)
Stable unexpected results (610)
|
|
|
cfb7c11 to
f87e2c7
Compare
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#60931) with upstreamable changes. |
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#60931). |
| <style> | ||
| :root { | ||
| animation: keyframes 1s normal; | ||
| transition-duration: 1ms; |
There was a problem hiding this comment.
Maybe a bit more explicit like transition: border-right 1ms;?
There was a problem hiding this comment.
Makes sense. I've done this.
| :root { | ||
| animation: keyframes 1s normal; | ||
| transition-duration: 1ms; | ||
| border-left: 1em solid rgb(100, 0, 0); |
There was a problem hiding this comment.
It doesn't seem like it, but I think it actually is. I wasn't able to minimize this test case any further after quite a bit of trying.
There was a problem hiding this comment.
Crashed for me without it, but fine
There was a problem hiding this comment.
Okay. I've have been able so simplify the style a little now. We now animate the entire border from solid to inset. I still haven't figured out why this bug triggers only when setting the left border and animating the right, so I suspect that there is a deeper issue with transitions in the Servo animation code.
There was a problem hiding this comment.
Crashed for me without it, but fine
Interesting. I wasn't able to do it on two separate machines (Linux and macOS).
f87e2c7 to
60f35ba
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#60931). |
60f35ba to
77af84c
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#60931). |
a8ad325 to
ff1a708
Compare
|
🔨 Triggering try run (#28285368777) for Linux (WPT) |
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#60931). |
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#60931) title and body. |
|
Test results for linux-wpt from try job (#28285368777): Flaky unexpected result (53)
Stable unexpected results that are known to be intermittent (22)
|
|
✨ Try run (#28285368777) succeeded. |
Loirooriol
left a comment
There was a problem hiding this comment.
Can you clarify the "reversed transitions"? Unlike animations, there is no transition-direction: reverse, and the testcase doesn't seem to reverse anything either.
ff1a708 to
7775dc2
Compare
Makes sense. I've updated the PR description to indicate that this is due to transition interruption and linked to the specification text. |
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#60931). |
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#60931) title and body. |
This commits makes two changes to prevent animations from producing invalid color values (defense in depth): 1. Update Stylo to a version that fixing an issue with interpolation of values in interrupted transitions that are reversing[^1]. 2. Prevents the creation of WebRender color values with alpha that is out of range. Signed-off-by: Martin Robinson <[email protected]> [^1]: https://www.w3.org/TR/css-transitions-1/#reversing
7775dc2 to
94fd2a9
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#60931). |
|
⛔ Failed to properly merge the upstream pull request (web-platform-tests/wpt#60931). Please address any CI issues and try to merge manually. |
Transitions can sometimes have 0 duration when the transition reversing shortening factor is also calculated to be 0. When that happens, we should always use 1.0 for the progress when calculating the value for the transition. This avoid division by zero. Servo PR: servo/servo#46016 Signed-off-by: Martin Robinson <[email protected]>
Transitions can sometimes have 0 duration when the transition reversing shortening factor is also calculated to be 0. When that happens, we should always use 1.0 for the progress when calculating the value for the transition. This avoid division by zero. Servo PR: servo/servo#46016 Signed-off-by: Martin Robinson <[email protected]>
This commits makes two changes to prevent animations from producing
invalid color values (defense in depth):
values in interrupted transitions that are reversing1.
out of range.
Stylo PR: servo/stylo#403
Testing: This change adds a WPT crash test.
Fixes: #45945
Footnotes
https://www.w3.org/TR/css-transitions-1/#reversing ↩