mirror of
https://github.com/servo/servo
synced 2026-04-25 17:15:48 +02:00
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: contents` 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.
Testing: This change adds a new test and gets one more subtest passing.
Signed-off-by: Martin Robinson <mrobinson@igalia.com>
13 lines
505 B
INI
Vendored
13 lines
505 B
INI
Vendored
[display-none-dont-cancel.tentative.html]
|
|
[display:none animating to display:inline should be inline for the whole animation.]
|
|
expected: FAIL
|
|
|
|
[A CSS variable of display:none animating to display:inline should be inline for the whole animation.]
|
|
expected: FAIL
|
|
|
|
[Animating from display:none to display:none should not cancel the animation.]
|
|
expected: FAIL
|
|
|
|
[Animating from display:none to display:none with an intermediate variable should not cancel the animation.]
|
|
expected: FAIL
|