script: Cancel animations for non-rendered nodes in script#44299
Conversation
|
🤖 Opened new upstream WPT pull request (web-platform-tests/wpt#59310) with upstreamable changes. |
a8925ff to
cb97362
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#59310). |
|
🔨 Triggering try run (#24559790066) for Linux (WPT) |
|
Test results for linux-wpt from try job (#24559790066): Flaky unexpected result (38)
Stable unexpected results that are known to be intermittent (17)
Stable unexpected results (1)
|
|
|
cb97362 to
0403bf6
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#59310). |
jdm
left a comment
There was a problem hiding this comment.
This makes sense, and I appreciate the new Node methods!
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#59310) title and body. |
0403bf6 to
89ba1a8
Compare
Instead of walking the entire fragment tree to find nodes for which animations and image animations need to be cancelled, this change moves that logic to `script`. Now, for each animating node the animation managers will explicitly ask `layout` if the node is being rendered (or delegating rendering in the case of CSS animations and transitions). The main goal here is a performance improvement, elimating roughly 1% of layout time from the profiler when running the `flexbox-deeply-nested-column-flow.html` test case. This will almost certainly be an even better improvement on more complex pages as we are no longer doing things once per fragment tree entry, but once per animating node. There is also a subtle behavior improvement here. Before nodes with `display: content` had their animations canceled, but now they are not. For instance, this test case now works properly: ```html <!DOCTYPE html> <style> @Keyframes anim { from { color: cyan } to { color: magenta } } div { display: contents; animation: anim 1s infinite alternate linear; } </style> ``` The new layout query will additionally be useful for other parts of script that need to answer the same "being rendered" or "delegates rendering to children" question. Signed-off-by: Martin Robinson <mrobinson@igalia.com>
89ba1a8 to
7c4e479
Compare
|
📝 Transplanted new upstreamable changes to existing upstream WPT pull request (web-platform-tests/wpt#59310). |
|
✍ Updated existing upstream WPT pull request (web-platform-tests/wpt#59310) title and body. |
Instead of walking the entire fragment tree to find nodes for which
animations and image animations need to be cancelled, this change moves
that logic to
script. Now, for each animating node the animationmanagers will explicitly ask
layoutif the node is being rendered (ordelegating rendering in the case of CSS animations and transitions).
The main goal here is a performance improvement, elimating roughly 1% of
layout time from the profiler when running the
flexbox-deeply-nested-column-flow.htmltest case. This will almostcertainly be an even better improvement on more complex pages as we are
no longer doing things once per fragment tree entry, but once per
animating node.
There is also a subtle behavior improvement here. Before nodes with
display: contentshad their animations canceled, but now they are not.For instance, this test case now works properly:
The new layout query will additionally be useful for other parts of
script that need to answer the same "being rendered" or "delegates
rendering to children" question.
Testing: This change adds a new test and gets one more subtest passing.