RESOLVED FIXED Bug 279012
Transitioning Unregistered Custom Properties cause a transition loop
https://bugs.webkit.org/show_bug.cgi?id=279012
Summary Transitioning Unregistered Custom Properties cause a transition loop
Bramus
Reported 2024-09-02 03:51:04 PDT
(This bug was discovered while building `@bramus/style-observer`, a library that responds to changes in computed styles. For this it relies on CSS Transitions and `transition-behavior: allow-discrete`. See https://brm.us/style-observer for details about this library.) Transitioning Unregistered Custom Properties cause a transition loop - Demo: https://allow-discrete-bugs.netlify.app/safari/unregistered-loop/ – the custom properties `--variable1` and `--variable2` are not registered. - Expected behavior: When clicking the `--variable1` or `--variable2` buttons, the output should change and the transition should have triggered only once. - Actual Behavior: While the output does change, the transition is repeatedly triggered. You can verify this by checking the console, which logs `"_handleUpdate"` on `transitionstart` Tested in Safari Technology Preview 202
Attachments
Antoine Quint
Comment 1 2024-09-02 07:06:37 PDT
Hi Bramus, thanks for the report. I'll probably get to it myself eventually, but could you perhaps make a reduction that does not involve any third-party script? It could help reduce the complexity and help identifying the source of the bug. Thank you.
Jake Archibald
Comment 2 2024-09-02 07:20:25 PDT
Jake Archibald
Comment 3 2024-09-02 07:21:35 PDT
Expected: A single transitionstart event for the single style change. Actual: transitionstart appears to fire every frame thereafter.
Antoine Quint
Comment 4 2024-09-02 10:11:52 PDT
That's excellent, thank you.
Antoine Quint
Comment 5 2024-09-02 10:21:18 PDT
We enter this clause in `updateCSSTransitionsForStyleableAndProperty` for each style resolution: // 4. Otherwise, implementations must cancel the running transition and start a new transition whose: I haven't worked out what is failing to take us here.
Antoine Quint
Comment 6 2024-09-02 10:26:23 PDT
Presumably it's the propertyInStyleMatchesValueForTransitionInMap() call which returns false but it should return true.
Antoine Quint
Comment 7 2024-09-02 10:30:08 PDT
CSSPropertyAnimation::propertiesEqual() returns falses with none of the if statements in the custom property variant being hit. I assume this is because this is an unregistered property and we don't know how to compare values.
Jake Archibald
Comment 8 2024-09-02 10:36:33 PDT
I believe the bug also happens if the property is registered as "*". Maybe even <custom-ident> too.
Bramus
Comment 9 2024-09-02 10:40:11 PDT
(In reply to Jake Archibald from comment #8) > I believe the bug also happens if the property is registered as "*". Maybe > even <custom-ident> too. Yes, that would be https://bugs.webkit.org/show_bug.cgi?id=279013 It happens for `"*"` but not for `"<custom-ident>"`, though.
Antoine Quint
Comment 10 2024-09-03 02:30:05 PDT
*** Bug 279013 has been marked as a duplicate of this bug. ***
Antoine Quint
Comment 11 2024-09-03 06:00:12 PDT
Antoine Quint
Comment 12 2024-09-03 06:03:24 PDT
Submitted web-platform-tests pull request: https://github.com/web-platform-tests/wpt/pull/47939
EWS
Comment 13 2024-09-03 10:10:38 PDT
Committed 283099@main (7f45cbdcfbf5): <https://commits.webkit.org/283099@main> Reviewed commits have been landed. Closing PR #33061 and removing active labels.
Radar WebKit Bug Importer
Comment 14 2024-09-03 10:11:15 PDT
Jake Archibald
Comment 15 2024-09-03 11:16:05 PDT
Thank you for fixing this so quickly!
Antoine Quint
Comment 16 2024-09-04 00:04:54 PDT
Thanks for filing with a simple test case, that's a lot of the work towards a fix already done :)
Note You need to log in before you can comment on or make changes to this bug.