[webkit-changes] [WebKit/WebKit] 319ecb: :empty selector with animation not working properly

Antoine Quint noreply at github.com
Fri Mar 8 04:22:17 PST 2024


  Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 319ecb9c28e377b3bd11e6cbd878008f84e87bb7
      https://github.com/WebKit/WebKit/commit/319ecb9c28e377b3bd11e6cbd878008f84e87bb7
  Author: Antoine Quint <graouts at webkit.org>
  Date:   2024-03-08 (Fri, 08 Mar 2024)

  Changed paths:
    A LayoutTests/imported/w3c/web-platform-tests/css/css-animations/empty-pseudo-class-with-animation-expected.txt
    A LayoutTests/imported/w3c/web-platform-tests/css/css-animations/empty-pseudo-class-with-animation.html
    M Source/WebCore/style/StyleTreeResolver.cpp

  Log Message:
  -----------
  :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



To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications


More information about the webkit-changes mailing list