New issue
Advanced search Search tips
Note: Color blocks (like or ) mean that a user may not be available. Tooltip shows the reason.

Issue 612436 link

Starred by 2 users

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Jun 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: All
Pri: 2
Type: Bug-Regression



Sign in to add a comment

visibility:hidden applied to iframe or it's parent freezes transform animation inside of it

Reported by host.c...@gmail.com, May 17 2016

Issue description

Chrome Version       : 50.0.2661.102
OS Version: 10.0
URLs (if applicable) :http://hostile-d.github.io/css_visabiolity_behavior/
Other browsers tested:
  Add OK or FAIL after other browsers where you have tested this issue:
     Safari 5:
  Firefox 4.x:
     IE 7/8/9:

What steps will reproduce the problem?
1. Create iframe on page and put animated div inside of it(animated only with transform property).
2. Set visibility:hidden then visibility:visible to iframe or its parent;

What is the expected result?
Animation must resume according to specification.

What happens instead of that?
Animation stops.

But if hover animated div in Dev Tools its looks like animation is still working (you can see it in attached .gif).

UserAgentString: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/50.0.2661.102 Safari/537.36



 
2016-05-17_14-01-01.gif
391 KB View Download
css_visabiolity_behavior.zip
29.0 KB Download
Cc: rnimmagadda@chromium.org
Components: Blink>Animation
Labels: -Type-Bug -Pri-3 M-51 OS-Linux OS-Mac Pri-2 Type-Bug-Regression
Owner: wkorman@chromium.org
Status: Assigned (was: Unconfirmed)
====================================

Good Build:

50.0.2633.0    Base Position: 371964


Bad Build:

50.0.2634.0    Base Position: 372490

=====================================

Able to repro this issue on Windows 7 & Ubuntu Trusty (14.04) for the Google Chrome Stable Version - 50.0.2661.102

This is a regression issue broken in M50, below mentioned is the bisect info:

CHANGELOG URL: https://chromium.googlesource.com/chromium/src/+log/b908e01c1385dfe034c8a2a1f223ab1d4355ae81..030a20f905684130a995def26ce72d4783c846bd

Suspecting Commit: 510e13d1579b8fb895673358ac1a6594fbcadfe3

Review URL: https://codereview.chromium.org/1616183002

@wkorman: Could you please look into the issue, and if it has nothing to do with your changes and if possible please do assign it to the concerned owner.

Thank you.
Labels: -M-51 M-50
Components: -Blink>Animation Internals>Compositing>Animation
Labels: -OS-Linux -OS-Windows -OS-Mac OS-All
Confirmed that commit 510e13d1579b8fb895673358ac1a6594fbcadfe3 is where the regression started.
Unable to cleanly revert, this is affecting stable, please investigate.
I'm looking at this. Commenting out lines 770 - 773 in PaintLayerCompositor, added in http://crrev.com/1616183002, fixes the provided test case.
Cc: ajuma@chromium.org
Components: Blink>Paint
Note from ajuma@ on hypothesis: ...[possible that] animation framework needs to be told that the composited layer is going away, so it knows to either takeover the animation and/or try to add it back when the composited layer comes back. Element::detach calls restartAnimationOnCompositor to handle the case of layers going away because of display:none, maybe something similar is needed for visibility:hidden iframes.

Comment 6 by ajuma@chromium.org, May 25 2016

Cc: loyso@chromium.org
Components: Blink>Animation
A couple of notes from investigation:

The elements are never detached when the iframe is hidden. A side effect of http://crrev.com/1616183002 is that the composited layer mapping associated with the hidden iframe is removed, whereas previously they stayed around even though they weren't visible.

I also see PaintLayerCompositor::{attach,detach}AnimationTimeline. Prior to my change, after initial load, neither were called when the iframe was then hidden/shown. With my change, detachAnimationTimeline is still never called, but attachAnimationTimeline is now called when we re-allocate the CLM. In general I would have thought we'd want CLM existence to be paired with attach/detachAnimationTimeline calls.

I need to learn more about how animation operates, but it may be that it's trying to paint to a graphics layer that no longer exists, or that we need to fix the pairing of the attach/detachAnimationTimeline calls, or something else.
Test case (just saved off from original bug report) is attached, open visibility.html.
visibility.tar.gz
1013 bytes Download
Hacking a call to:

toElement(layer->layoutObject()->node())->elementAnimations()->restartAnimationOnCompositor()

when we allocate a new composited layer mapping such as here:

https://code.google.com/p/chromium/codesearch#chromium/src/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp&q=paintlayercompositor&sq=package:chromium&type=cs&l=484

fixes things, but often requires a mouse movement before animation begins painting again for some reason.

Comment 10 by loyso@chromium.org, May 26 2016

Components: -Blink>Animation
Removing Blink>Animation label since the bug is in the code which uses animations. The animation team members are in CC list.
Summary: visibility:hidden applied to iframe or it's parent freezes transform animation inside of it (was: visability:hidden applied to iframe or it's parent freezes transform animation inside of it)
Sent http://crrev.com/2010963003 for discussion.
Project Member

Comment 12 by bugdroid1@chromium.org, Jun 1 2016

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/851bbadbc2348dcf79851c9be1b766e4ce00a2ab

commit 851bbadbc2348dcf79851c9be1b766e4ce00a2ab
Author: wkorman <wkorman@chromium.org>
Date: Wed Jun 01 00:57:38 2016

Restart any animations when we allocate a composited layer.

As part of this, fix FrameView to note a compositing update is needed
when it is shown/hidden since it could gain/lose its composited layer
and, if shown/gained, then we want to immediately restart any
animations.

BUG= 612436 

Review-Url: https://codereview.chromium.org/2010963003
Cr-Commit-Position: refs/heads/master@{#397003}

[modify] https://crrev.com/851bbadbc2348dcf79851c9be1b766e4ce00a2ab/third_party/WebKit/Source/core/frame/FrameView.cpp
[modify] https://crrev.com/851bbadbc2348dcf79851c9be1b766e4ce00a2ab/third_party/WebKit/Source/core/layout/compositing/PaintLayerCompositor.cpp

Status: Fixed (was: Assigned)

Sign in to add a comment