Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: b8a264c14a4a53ba960db617db37dd97496811fc
      
https://github.com/WebKit/WebKit/commit/b8a264c14a4a53ba960db617db37dd97496811fc
  Author: Antoine Quint <grao...@webkit.org>
  Date:   2024-03-22 (Fri, 22 Mar 2024)

  Changed paths:
    R 
LayoutTests/imported/blink/fast/css-generated-content/pseudo-animation-display-expected.txt
    R 
LayoutTests/imported/blink/fast/css-generated-content/pseudo-animation-display.html
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/display-none-dont-cancel-pseudo.tentative-expected.txt
    A 
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/display-none-dont-cancel-pseudo.tentative.html
    M Source/WebCore/rendering/style/RenderStyle.h
    M Source/WebCore/rendering/style/RenderStyleInlines.h
    M Source/WebCore/rendering/style/RenderStyleSetters.h
    M Source/WebCore/rendering/style/StyleMiscNonInheritedData.cpp
    M Source/WebCore/rendering/style/StyleMiscNonInheritedData.h
    M Source/WebCore/rendering/updating/RenderTreeUpdater.cpp
    M Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp
    M Source/WebCore/style/StyleTreeResolver.cpp
    M Source/WebCore/style/StyleUpdate.h

  Log Message:
  -----------
  [web-animations] 
imported/blink/fast/css-generated-content/pseudo-animation-display.html is a 
failure
https://bugs.webkit.org/show_bug.cgi?id=271375
rdar://125156782

Reviewed by Antti Koivisto.

Pseudo-elements represented by a `PseudoElement`, namely `::before` and 
`::after`, are torn down if
a `display: none` style is set. An exception to that rule is if such a 
pseudo-element is targeted
by a script-originated `Animation` object.

Now that the `display` property can be animated, it is possible that a 
`PseudoElement` is targeted
by an animation that will set `display: none`. So we now ensure that we no 
longer tear down such
`PseudoElement` objects.

To achieve this, first we move the `animationsAffectedDisplay` bit from 
`ElementUpdate` to `RenderStyle`,
renaming it as `hasDisplayAffectedByAnimations`, such that it is accessible 
throughout the style update
since pseudo-element style updates don't have access to the `ElementUpdate` 
yielded for that specific
pseudo-element, on the one yielded for their owner element.

Second, we also add a new static function 
`elementHasDisplayAnimationForPseudoId()` we we use within
`RenderTreeUpdater::GeneratedContent::updatePseudoElement()` to introduce 
another case where we don't
tear down `PseudoElement` objects if `display: none` is set: the case where 
such a pseudo-element is
targeted by an animation affecting the `display` property.

Finally, we can remove the now-outdated 
`imported/blink/fast/css-generated-content/pseudo-animation-display.html`
test and replace it with a new WPT test. That test is marked as tentative 
because I filed a CSS WG issue
(https://github.com/w3c/csswg-drafts/issues/10111) about whether the approach 
taken here is correct.

* 
LayoutTests/imported/blink/fast/css-generated-content/pseudo-animation-display-expected.txt:
 Removed.
* 
LayoutTests/imported/blink/fast/css-generated-content/pseudo-animation-display.html:
 Removed.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/display-none-dont-cancel-pseudo.tentative-expected.txt:
 Added.
* 
LayoutTests/imported/w3c/web-platform-tests/css/css-animations/display-none-dont-cancel-pseudo.tentative.html:
 Added.
* Source/WebCore/rendering/style/RenderStyle.h:
* Source/WebCore/rendering/style/RenderStyleInlines.h:
(WebCore::RenderStyle::hasDisplayAffectedByAnimations const):
* Source/WebCore/rendering/style/RenderStyleSetters.h:
(WebCore::RenderStyle::setHasDisplayAffectedByAnimations):
* Source/WebCore/rendering/style/StyleMiscNonInheritedData.cpp:
(WebCore::StyleMiscNonInheritedData::StyleMiscNonInheritedData):
(WebCore::StyleMiscNonInheritedData::operator== const):
* Source/WebCore/rendering/style/StyleMiscNonInheritedData.h:
* Source/WebCore/rendering/updating/RenderTreeUpdater.cpp:
(WebCore::RenderTreeUpdater::updateElementRenderer):
* Source/WebCore/rendering/updating/RenderTreeUpdaterGeneratedContent.cpp:
(WebCore::keyframeEffectStackForElementAndPseudoId):
(WebCore::elementIsTargetedByKeyframeEffectRequiringPseudoElement):
(WebCore::elementHasDisplayAnimationForPseudoId):
(WebCore::RenderTreeUpdater::GeneratedContent::updatePseudoElement):
* Source/WebCore/style/StyleTreeResolver.cpp:
(WebCore::Style::TreeResolver::createAnimatedElementUpdate):
* Source/WebCore/style/StyleUpdate.h:

Canonical link: https://commits.webkit.org/276568@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to