CSS animation on a children node of a parent element with visibility:hidden, opacity: 0 raises CPU
Categories
(Core :: Layout, enhancement)
Tracking
()
Performance Impact | medium |
People
(Reporter: karlcow, Unassigned)
References
()
Details
(Keywords: perf:resource-use)
As reported on webcompat
There are invisible animations in the media player making the browser using a lot of CPU even after the video has ended. The issue doesn't reproduce in Chromium. I'm reporting it here instead of Bugzilla because the site shouldn't have such hidden animations anyway.
- Go to https://old.reddit.com/r/dataisbeautiful/comments/cxuah9/usage_share_of_internet_browsers_1996_2019_oc/
- Stop the video
- Check the CPU
Actual:
CPU is high
Expected:
CPU is low, nothing is visibly moving on the page.
And that's basically the issue. There are 4 animations in the page constantly running.
Their parent element is set with visibility: hidden
and opacity: 0
, instead of display:none
. It has the impact that they constantly run and make the CPU high. I don't know if there is a way to optimize this without creating secondary issue.
setting [qf] for performance.
Chrome maintains a low CPU.
Comment 1•5 years ago
|
||
This is a case that we don't properly detect the element in question is in visibility:hidden tree. Without debugging I have no idea why.
Updated•5 years ago
|
Updated•5 years ago
|
Comment 2•5 years ago
|
||
Can somebody try with the latest nightly? Emilio fixed the case where animation in opacity:0 subtree in bug 1427033.
Reporter | ||
Comment 4•5 years ago
|
||
- 78.0a1 (2020-05-07) (64-bit) CPU is low
- 75.0 (64-bit) CPU is low
so no crazy changes for this specific page.
https://old.reddit.com/r/dataisbeautiful/comments/cxuah9/usage_share_of_internet_browsers_1996_2019_oc/
So this is fixed on this page, but not sure why.
Comment 5•5 years ago
|
||
Thank you Karl! Then I am pretty sure bug 1427033 fixed this. :)
Updated•3 years ago
|
Updated•3 years ago
|
Description
•