Title: [292561] trunk/Source/WebCore
- Revision
- 292561
- Author
- [email protected]
- Date
- 2022-04-07 13:32:29 -0700 (Thu, 07 Apr 2022)
Log Message
[web-animations] REGRESSION (r287881): loading performance for diply.com regressed
https://bugs.webkit.org/show_bug.cgi?id=238931
rdar://91190007
Reviewed by Simon Fraser.
We only need to resolve effects in the stack if they are targeting the property we are
considering for the creation, update or removal of a CSS Transition.
* style/Styleable.cpp:
(WebCore::updateCSSTransitionsForStyleableAndProperty):
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (292560 => 292561)
--- trunk/Source/WebCore/ChangeLog 2022-04-07 20:28:42 UTC (rev 292560)
+++ trunk/Source/WebCore/ChangeLog 2022-04-07 20:32:29 UTC (rev 292561)
@@ -1,3 +1,17 @@
+2022-04-07 Antoine Quint <[email protected]>
+
+ [web-animations] REGRESSION (r287881): loading performance for diply.com regressed
+ https://bugs.webkit.org/show_bug.cgi?id=238931
+ rdar://91190007
+
+ Reviewed by Simon Fraser.
+
+ We only need to resolve effects in the stack if they are targeting the property we are
+ considering for the creation, update or removal of a CSS Transition.
+
+ * style/Styleable.cpp:
+ (WebCore::updateCSSTransitionsForStyleableAndProperty):
+
2022-04-07 Gabriel Nava Marino <[email protected]>
Iterate over copy of animated properties in WebCore::WebAnimation::commitStyles
Modified: trunk/Source/WebCore/style/Styleable.cpp (292560 => 292561)
--- trunk/Source/WebCore/style/Styleable.cpp 2022-04-07 20:28:42 UTC (rev 292560)
+++ trunk/Source/WebCore/style/Styleable.cpp 2022-04-07 20:32:29 UTC (rev 292561)
@@ -442,6 +442,14 @@
}
}
+ auto effectTargetsProperty = [property](KeyframeEffect& effect) {
+ if (effect.animatedProperties().contains(property))
+ return true;
+ if (auto* transition = dynamicDowncast<CSSTransition>(effect.animation()))
+ return transition->property() == property;
+ return false;
+ };
+
// https://drafts.csswg.org/css-transitions-1/#before-change-style
// Define the before-change style as the computed values of all properties on the element as of the previous style change event, except with
// any styles derived from declarative animations such as CSS Transitions, CSS Animations, and SMIL Animations updated to the current time.
@@ -450,6 +458,8 @@
auto style = RenderStyle::clone(*lastStyleChangeEventStyle);
if (auto* keyframeEffectStack = styleable.keyframeEffectStack()) {
for (const auto& effect : keyframeEffectStack->sortedEffects()) {
+ if (!effectTargetsProperty(*effect))
+ continue;
auto* effectAnimation = effect->animation();
bool shouldUseTimelineTimeAtCreation = is<CSSTransition>(effectAnimation) && (!effectAnimation->startTime() || *effectAnimation->startTime() == styleable.element.document().timeline().currentTime());
effectAnimation->resolve(style, { nullptr }, shouldUseTimelineTimeAtCreation ? downcast<CSSTransition>(*effectAnimation).timelineTimeAtCreation() : std::nullopt);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes