Bug 189990 - [Web Animations] Ensure renderers with accelerated animations have layers
Summary: [Web Animations] Ensure renderers with accelerated animations have layers
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Animations (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Antoine Quint
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-09-26 02:53 PDT by Antoine Quint
Modified: 2018-10-01 10:44 PDT (History)
6 users (show)

See Also:


Attachments
Patch (8.61 KB, patch)
2018-09-26 03:07 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff
Archive of layout-test-results from ews106 for mac-sierra-wk2 (3.23 MB, application/zip)
2018-09-26 04:12 PDT, EWS Watchlist
no flags Details
Archive of layout-test-results from ews100 for mac-sierra (2.49 MB, application/zip)
2018-09-26 04:15 PDT, EWS Watchlist
no flags Details
Patch (8.57 KB, patch)
2018-09-26 04:32 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (7.12 KB, patch)
2018-09-27 06:09 PDT, Antoine Quint
no flags Details | Formatted Diff | Diff
Patch (10.19 KB, patch)
2018-10-01 08:05 PDT, Antoine Quint
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Antoine Quint 2018-09-26 02:53:53 PDT
[Web Animations] Ensure renderers with accelerated animations have layers
Comment 1 Antoine Quint 2018-09-26 03:00:12 PDT
We have done some work already in https://bugs.webkit.org/show_bug.cgi?id=189784 to prevent never-ending calls to DocumentTimeline::updateAnimations(). This was due to the change made for https://bugs.webkit.org/show_bug.cgi?id=186930 where we queued calls to updateAnimations() in KeyframeEffectReadOnly::applyPendingAcceleratedActions() while we were waiting for a renderer with a layer backing for a given animation target. Instead of doing this, we ought to ensure renderers always have a layer when they have an accelerated animation applied.
Comment 2 Radar WebKit Bug Importer 2018-09-26 03:00:49 PDT
<rdar://problem/44791222>
Comment 3 Antoine Quint 2018-09-26 03:07:36 PDT
Created attachment 350852 [details]
Patch
Comment 4 EWS Watchlist 2018-09-26 04:12:55 PDT
Comment on attachment 350852 [details]
Patch

Attachment 350852 [details] did not pass mac-wk2-ews (mac-wk2):
Output: https://webkit-queues.webkit.org/results/9354714

New failing tests:
transforms/3d/general/perspective-non-layer.html
fast/table/overflow-table-collapsed-borders-section-self-painting-layer-painting.html
fast/transforms/transform-on-inline.html
fast/reflections/inline-crash.html
fast/table/overflow-table-collapsed-borders-section-self-painting-layer-table-self-painting-layer.html
Comment 5 EWS Watchlist 2018-09-26 04:12:56 PDT
Created attachment 350853 [details]
Archive of layout-test-results from ews106 for mac-sierra-wk2

The attached test failures were seen while running run-webkit-tests on the mac-wk2-ews.
Bot: ews106  Port: mac-sierra-wk2  Platform: Mac OS X 10.12.6
Comment 6 EWS Watchlist 2018-09-26 04:15:37 PDT
Comment on attachment 350852 [details]
Patch

Attachment 350852 [details] did not pass mac-ews (mac):
Output: https://webkit-queues.webkit.org/results/9354760

New failing tests:
transforms/3d/general/perspective-non-layer.html
fast/table/overflow-table-collapsed-borders-section-self-painting-layer-painting.html
fast/transforms/transform-on-inline.html
fast/reflections/inline-crash.html
fast/table/overflow-table-collapsed-borders-section-self-painting-layer-table-self-painting-layer.html
Comment 7 EWS Watchlist 2018-09-26 04:15:39 PDT
Created attachment 350854 [details]
Archive of layout-test-results from ews100 for mac-sierra

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews100  Port: mac-sierra  Platform: Mac OS X 10.12.6
Comment 8 Antoine Quint 2018-09-26 04:32:00 PDT
Created attachment 350856 [details]
Patch
Comment 9 zalan 2018-09-26 07:25:50 PDT
Comment on attachment 350856 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=350856&action=review

> Source/WebCore/rendering/RenderBoxModelObject.cpp:2697
> +            return timeline->runningAnimationsForElementAreAllAccelerated(*node);

I hope this function is not going to show up in traces.
Comment 10 Antoine Quint 2018-09-26 07:34:18 PDT
Committed r236501: <https://trac.webkit.org/changeset/236501>
Comment 11 Simon Fraser (smfr) 2018-09-26 11:33:38 PDT
Comment on attachment 350856 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=350856&action=review

> Source/WebCore/rendering/RenderBox.h:57
>          return isDocumentElementRenderer() || isPositioned() || createsGroup() || hasClipPath() || hasOverflowClip()
>              || hasTransformRelatedProperty() || hasHiddenBackface() || hasReflection() || style().specifiesColumns()
> -            || !style().hasAutoZIndex();
> +            || !style().hasAutoZIndex() || hasRunningAcceleratedAnimations();
>      }

This is pretty hot code. I'm worried about perf impact.

> Source/WebCore/rendering/RenderInline.h:123
> +    bool requiresLayer() const override { return isInFlowPositioned() || createsGroup() || hasClipPath() || willChangeCreatesStackingContext() || hasRunningAcceleratedAnimations(); }

This is pretty hot code. I'm worried about perf impact.
Comment 12 Antoine Quint 2018-09-26 12:31:48 PDT
I suppose we could set a flag on the RenderBoxModelObject to indicate that an accelerated animation is in progress as the accelerated actions are updated on the KeyframeEffectReadOnly. Then it would just be a bit to read on the RenderBoxModelObject.
Comment 13 Simon Fraser (smfr) 2018-09-26 12:56:24 PDT
We used to have a bit on the style, and removed it. I think for a time we also used to have a bit on renderers, and that was removed too (I can't find the patches).
Comment 14 Antoine Quint 2018-09-26 13:03:45 PDT
(In reply to Simon Fraser (smfr) from comment #13)
> We used to have a bit on the style, and removed it. I think for a time we
> also used to have a bit on renderers, and that was removed too (I can't find
> the patches).

Do you have a preference between the two?
Comment 15 Antoine Quint 2018-09-27 06:09:34 PDT
Reopening to attach new patch.
Comment 16 Antoine Quint 2018-09-27 06:09:36 PDT
Created attachment 350956 [details]
Patch
Comment 17 zalan 2018-09-27 10:10:16 PDT
Comment on attachment 350956 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=350956&action=review

> Source/WebCore/rendering/RenderBoxModelObject.h:333
> +    bool m_hasRunningAcceleratedAnimations { false };

smfr, what's our current (memory)policy about adding bitfield like members to RenderObject subclasses? Should this be part of RenderObject's boolean bitfield (or even rare data)?
Comment 18 Antoine Quint 2018-10-01 08:05:58 PDT
Created attachment 351247 [details]
Patch
Comment 19 Antoine Quint 2018-10-01 10:44:46 PDT
Committed r236670: <https://trac.webkit.org/changeset/236670>