RESOLVED CONFIGURATION CHANGED 212637
getClientBoundingRect values sometimes wrong at end of CSS transition
https://bugs.webkit.org/show_bug.cgi?id=212637
Summary getClientBoundingRect values sometimes wrong at end of CSS transition
ian
Reported 2020-06-02 08:33:05 PDT
Created attachment 400824 [details] Repro On the last frame of a css transition of transform, the values of getClientBoundingBox are _sometimes_ the same as the values that would be returned at the beginning of the transition. Once the transition-end event is fired, the values will snap back to the final values. The behavior is intermittent but not difficult to produce (every five or so transitions). When using getClientBoundingBox to pin an element to another transforming one, this leads to visual pops/glitches in Safari. The attached example reproduces in Safari 13.1 and STP 107, macOS 10.15.4, 2017 mbp. I can not reproduce the issue in Chrome 83.0.4103.61 or FF 76.0.1 For what it's worth, I've also noticed the same behavior in window.getComputedStyles(el).transform, where at the end the transition, the value is the starting value, but then snaps to the correct ending value. While using getClientBoundingBox in an animation is not ideal, it (and getComputedStyles) is the only way I know of to get a correct coordinate in a separate element that's transitioning its transform.
Attachments
Repro (1.80 KB, text/html)
2020-06-02 08:33 PDT, ian
no flags
Image of issue. (325.76 KB, image/png)
2020-06-02 08:33 PDT, ian
no flags
Test using "left" and "top" properties (2.10 KB, text/html)
2020-07-31 07:09 PDT, Antoine Quint
no flags
Test using "transform" property (2.00 KB, text/html)
2020-07-31 07:09 PDT, Antoine Quint
no flags
ian
Comment 1 2020-06-02 08:33:54 PDT
Created attachment 400826 [details] Image of issue.
ian
Comment 2 2020-06-02 08:45:57 PDT
Correction! : In my original post I meant "getBoundingClientRect" not "getClientBoundingBox"
Radar WebKit Bug Importer
Comment 3 2020-06-02 18:35:14 PDT
Antoine Quint
Comment 4 2020-07-31 07:08:45 PDT
Just like bug 212640, this does not happen when transitioning "left" and "top" but does happen when transitioning "transform". These two issues are likely duplicates.
Antoine Quint
Comment 5 2020-07-31 07:09:27 PDT
Created attachment 405689 [details] Test using "left" and "top" properties
Antoine Quint
Comment 6 2020-07-31 07:09:40 PDT
Created attachment 405690 [details] Test using "transform" property
Antoine Quint
Comment 7 2023-05-10 12:09:37 PDT
I believe this no longer reproduces with shipping Safari. Ian, if you feel I'm mistaken, please reopen the bug, but the logged values all seem to animate linearly now.
Note You need to log in before you can comment on or make changes to this bug.