Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
:empty selector with animation not working properly
https://bugs.webkit.org/show_bug.cgi?id=269051 rdar://122838142 Reviewed by Antti Koivisto. If an element is targeted by an animation, it may cause style updates with an `AnimationOnly` resolution type. When `Style::TreeResolver::resolveElement()` is called for that element, `resetStyleRelations()` is called on that element first under `Style::TreeResolver::resolveComposedTree()` while iterating through the composed tree. If an `:empty` pseudo-class rule matches that element, that call to `resetStyleRelations()` will remove the `StyleAffectedByEmpty` flag on that element, but it will not be recomputed under `resolveElement()` because when `styleForStyleable()` is called the `AnimationOnly` resolution type will mean that we clone the cached last style resolution style to return the `ResolvedStyle` value, clear of any relations. We now avoid calling `resetStyleRelations()` if the resolution type is `AnimationOnly`, ensuring that relations are preserved throughout animation updates. * LayoutTests/imported/w3c/web-platform-tests/css/css-animations/empty-pseudo-class-with-animation-expected.txt: Added. * LayoutTests/imported/w3c/web-platform-tests/css/css-animations/empty-pseudo-class-with-animation.html: Added. * Source/WebCore/style/StyleTreeResolver.cpp: (WebCore::Style::TreeResolver::resolveComposedTree): Canonical link: https://commits.webkit.org/275832@main
- Loading branch information