Bug 92791

Summary: Reduce the side-effects of animations turning off overlap testing
Product: WebKit Reporter: Simon Fraser (smfr) <simon.fraser>
Component: Layout and RenderingAssignee: Simon Fraser (smfr) <simon.fraser>
Severity: Normal CC: bdakin, commit-queue, dino, dstockwell, esprehn+autocc, glenn, kondapallykalyan, simon.fraser, thorton, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Description Flags
Patch dino: review+, commit-queue: commit-queue-

Description Simon Fraser (smfr) 2012-07-31 14:16:52 PDT
Some pages have elements that go into and out of compositing layers when animations/transitions on unrelated elements run, because we turn off overlap testing if we see an accelerated transform animation. This unwanted switching into/out of compositing layers can cause flashing in some cases. We should try to avoid it.

One site that shows this is http://t.aol.com with an iPad user agent.
Comment 1 Radar WebKit Bug Importer 2012-07-31 14:17:12 PDT
Comment 2 Simon Fraser (smfr) 2015-03-15 11:11:43 PDT
Created attachment 248680 [details]
Comment 3 Dean Jackson 2015-03-15 15:34:22 PDT
Comment on attachment 248680 [details]

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

> Source/WebCore/page/animation/AnimationBase.cpp:742
> +                TransformationMatrix::Decomposed2Type toDecomp;
> +                transform.decompose2(toDecomp);
> +                // Any rotation prevents us from using a simple start/end rect union.
> +                if (toDecomp.angle)
> +                    return false;

Is this the only case? I wonder if a matrix animation to/from a skew would show up with a rotation component.
Comment 4 WebKit Commit Bot 2015-03-15 15:38:26 PDT
Comment on attachment 248680 [details]

Rejecting attachment 248680 [details] from commit-queue.

Failed to run "['/Volumes/Data/EWS/WebKit/Tools/Scripts/webkit-patch', '--status-host=webkit-queues.appspot.com', '--bot-id=webkit-cq-02', 'apply-attachment', '--no-update', '--non-interactive', 248680, '--port=mac']" exit_code: 2 cwd: /Volumes/Data/EWS/WebKit

Last 500 characters of output:
patching file LayoutTests/compositing/layer-creation/translate-scale-transition-overlap.html
patching file LayoutTests/compositing/layer-creation/translate-transition-overlap-expected.txt
patching file LayoutTests/compositing/layer-creation/translate-transition-overlap.html

Failed to run "[u'/Volumes/Data/EWS/WebKit/Tools/Scripts/svn-apply', '--force', '--reviewer', u'Dean Jackson']" exit_code: 1 cwd: /Volumes/Data/EWS/WebKit

Full output: http://webkit-queues.appspot.com/results/6138387316604928
Comment 5 Simon Fraser (smfr) 2015-03-15 16:08:41 PDT
Comment 6 Alexey Proskuryakov 2015-03-15 22:22:06 PDT
This made animations/animation-on-inline-crash.html assert on all debug bots:

Thread 0 Crashed:: Dispatch queue: com.apple.main-thread
0   com.apple.JavaScriptCore      	0x0000000106efb56a WTFCrashWithSecurityImplication + 42 (Assertions.cpp:335)
1   com.apple.WebCore             	0x000000010b19b5a1 WTF::match_constness<WebCore::RenderElement, WebCore::RenderBox>::type& WTF::downcast<WebCore::RenderBox, WebCore::RenderElement>(WebCore::RenderElement&) + 65 (TypeCasts.h:80)
2   com.apple.WebCore             	0x000000010c0f9065 WebCore::KeyframeAnimation::computeExtentOfTransformAnimation(WebCore::LayoutRect&) const + 117 (KeyframeAnimation.cpp:206)
3   com.apple.WebCore             	0x000000010afc5b78 WebCore::CompositeAnimation::computeExtentOfTransformAnimation(WebCore::LayoutRect&) const + 264 (CompositeAnimation.cpp:417)
4   com.apple.WebCore             	0x000000010ad9797b WebCore::AnimationControllerPrivate::computeExtentOfAnimation(WebCore::RenderElement&, WebCore::LayoutRect&) const + 235 (AnimationController.cpp:429)
5   com.apple.WebCore             	0x000000010ad98372 WebCore::AnimationController::computeExtentOfAnimation(WebCore::RenderElement&, WebCore::LayoutRect&) const + 98 (AnimationController.cpp:597)
Comment 7 Simon Fraser (smfr) 2015-03-15 22:32:37 PDT
Assertion fixed in https://trac.webkit.org/r181521