Bug 104981 - Element is displayed behind a composited layer when clipping is used on a previous element
Summary: Element is displayed behind a composited layer when clipping is used on a pre...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alexandru Chiculita
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-12-13 17:44 PST by Alexandru Chiculita
Modified: 2013-01-12 09:12 PST (History)
7 users (show)

See Also:


Attachments
test case (828 bytes, text/html)
2012-12-13 17:44 PST, Alexandru Chiculita
no flags Details
Patch V1 (45.05 KB, patch)
2013-01-03 15:15 PST, Alexandru Chiculita
no flags Details | Formatted Diff | Diff
Patch V2 (45.80 KB, patch)
2013-01-03 15:19 PST, Alexandru Chiculita
buildbot: commit-queue-
Details | Formatted Diff | Diff
Patch V3 (35.13 KB, patch)
2013-01-09 16:57 PST, Alexandru Chiculita
webkit.review.bot: commit-queue-
Details | Formatted Diff | Diff
Patch V4 (44.16 KB, patch)
2013-01-11 12:55 PST, Alexandru Chiculita
no flags Details | Formatted Diff | Diff
Patch V5 (44.00 KB, patch)
2013-01-11 13:22 PST, Alexandru Chiculita
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alexandru Chiculita 2012-12-13 17:44:53 PST
Created attachment 179385 [details]
test case

Look at the attached test case. "Layer3" needs to be displayed on top of everything else, but instead it is displayed behind. The element needs to be promoted to composited layer, but it is not.

The problem is in RenderLayerCompositor::computeCompositingRequirements at the following line:

> // We're done processing an element that clips. The container can keep testing overlap.
> compositingState.m_testingOverlap = true;

The problem is that there's another animation behind it that requested to skip testing for overlaps, but the overflow:hidden element that comes right in the middle will reset the flag and will force the top-most element incorrectly check for overlaps again.
Comment 1 Simon Fraser (smfr) 2012-12-13 18:19:45 PST
Resizing the window at the right time fixes it.

Hm, maybe we need to push/pop the m_testingOverlap state.
Comment 2 Alexandru Chiculita 2013-01-03 15:15:42 PST
Created attachment 181230 [details]
Patch V1
Comment 3 Alexandru Chiculita 2013-01-03 15:18:35 PST
(In reply to comment #1)
> Resizing the window at the right time fixes it.
> 
> Hm, maybe we need to push/pop the m_testingOverlap state.

Yeah, resizing at the right time will compute the layer overlaps in the middle of the animation. I will add two other bugs: 
1. try to approximate the animation bounding box for easy cases. 
2. try to use the clip-rectangle when the clipping-container is not creating a stacking context.
Comment 4 Alexandru Chiculita 2013-01-03 15:19:34 PST
Created attachment 181232 [details]
Patch V2

This time with git diff --binary
Comment 5 Simon Fraser (smfr) 2013-01-03 15:25:51 PST
Comment on attachment 181232 [details]
Patch V2

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

> Source/WebCore/ChangeLog:30
> +        Also, part of this patch I've removed the check for 3D transforms that were forcing the following layers to become composited, much like
> +        the animations are.

Can you do this in a separate patch? I'm concerned that this has possibly change a bunch of testcases so that they no longer test what they were designed for.
Comment 6 Alexandru Chiculita 2013-01-03 16:38:29 PST
(In reply to comment #5)
> (From update of attachment 181232 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=181232&action=review
> 
> > Source/WebCore/ChangeLog:30
> > +        Also, part of this patch I've removed the check for 3D transforms that were forcing the following layers to become composited, much like
> > +        the animations are.
> 
> Can you do this in a separate patch? I'm concerned that this has possibly change a bunch of testcases so that they no longer test what they were designed for.

Sure, will do.
Comment 7 Build Bot 2013-01-03 17:15:43 PST
Comment on attachment 181232 [details]
Patch V2

Attachment 181232 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15647883

New failing tests:
css3/filters/filtered-compositing-descendant.html
Comment 8 Build Bot 2013-01-03 17:31:21 PST
Comment on attachment 181232 [details]
Patch V2

Attachment 181232 [details] did not pass mac-ews (mac):
Output: http://queues.webkit.org/results/15649837

New failing tests:
css3/filters/filtered-compositing-descendant.html
fast/sub-pixel/sub-pixel-iframe-copy-on-scroll.html
fast/sub-pixel/sub-pixel-accumulates-to-layers.html
fast/sub-pixel/transformed-iframe-copy-on-scroll.html
Comment 9 WebKit Review Bot 2013-01-03 19:32:06 PST
Comment on attachment 181232 [details]
Patch V2

Attachment 181232 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15691003

New failing tests:
platform/chromium/virtual/softwarecompositing/layer-creation/overlap-animation-container.html
compositing/layer-creation/overlap-animation-clipping.html
platform/chromium/virtual/softwarecompositing/layer-creation/overlap-animation-clipping.html
compositing/geometry/ancestor-overflow-change.html
compositing/overflow/clip-descendents.html
css3/filters/filtered-compositing-descendant.html
compositing/layer-creation/overlap-animation-container.html
platform/chromium/virtual/gpu/compositedscrolling/overflow/clip-descendents.html
platform/chromium/virtual/softwarecompositing/geometry/ancestor-overflow-change.html
platform/chromium/virtual/softwarecompositing/overflow/clip-descendents.html
Comment 10 Alexandru Chiculita 2013-01-09 16:57:19 PST
Created attachment 182015 [details]
Patch V3

Removed the 3d transforms check. Note that this is triggering some more layers in some cases, when it didn't before. That's because 3d transforms are treated more like animations and there were tests that reproduced the same case like the one with the clipping rectangle, but with 3d transforms instead of animations. I will fix that in a following patch.
Comment 11 Simon Fraser (smfr) 2013-01-09 17:14:00 PST
Comment on attachment 182015 [details]
Patch V3

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

> LayoutTests/ChangeLog:18
> +        * compositing/layer-creation/overlap-transforms-expected.txt: Removed.
> +        * compositing/layer-creation/overlap-transforms.html: Removed.

Why was this removed?
Comment 12 Alexandru Chiculita 2013-01-09 18:26:37 PST
(In reply to comment #11)
> (From update of attachment 182015 [details])
> View in context: https://bugs.webkit.org/attachment.cgi?id=182015&action=review
> 
> > LayoutTests/ChangeLog:18
> > +        * compositing/layer-creation/overlap-transforms-expected.txt: Removed.
> > +        * compositing/layer-creation/overlap-transforms.html: Removed.
> 
> Why was this removed?

Those tests were related to the 3d transforms check that I've now added back. I will post another patch to remove that check and include those two tests.
Comment 13 WebKit Review Bot 2013-01-09 19:03:29 PST
Comment on attachment 182015 [details]
Patch V3

Attachment 182015 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15763773

New failing tests:
platform/chromium/virtual/softwarecompositing/layer-creation/overlap-animation-container.html
compositing/layer-creation/overlap-animation-clipping.html
platform/chromium/virtual/softwarecompositing/layer-creation/overlap-animation-clipping.html
compositing/overflow/clip-descendents.html
compositing/layer-creation/overlap-animation-container.html
platform/chromium/virtual/gpu/compositedscrolling/overflow/clip-descendents.html
platform/chromium/virtual/softwarecompositing/overflow/clip-descendents.html
Comment 14 WebKit Review Bot 2013-01-09 19:44:49 PST
Comment on attachment 182015 [details]
Patch V3

Attachment 182015 [details] did not pass chromium-ews (chromium-xvfb):
Output: http://queues.webkit.org/results/15759790

New failing tests:
platform/chromium/virtual/softwarecompositing/layer-creation/overlap-animation-container.html
compositing/layer-creation/overlap-animation-clipping.html
platform/chromium/virtual/softwarecompositing/layer-creation/overlap-animation-clipping.html
compositing/overflow/clip-descendents.html
compositing/layer-creation/overlap-animation-container.html
platform/chromium/virtual/gpu/compositedscrolling/overflow/clip-descendents.html
platform/chromium/virtual/softwarecompositing/overflow/clip-descendents.html
Comment 15 Alexandru Chiculita 2013-01-10 15:51:48 PST
(In reply to comment #12)
> (In reply to comment #11)
> > (From update of attachment 182015 [details] [details])
> > View in context: https://bugs.webkit.org/attachment.cgi?id=182015&action=review
> > 
> > > LayoutTests/ChangeLog:18
> > > +        * compositing/layer-creation/overlap-transforms-expected.txt: Removed.
> > > +        * compositing/layer-creation/overlap-transforms.html: Removed.
> > 
> > Why was this removed?
> 
> Those tests were related to the 3d transforms check that I've now added back. I will post another patch to remove that check and include those two tests.

By future patch I mean, in a separate bug.
Comment 16 Alexandru Chiculita 2013-01-11 12:55:09 PST
Created attachment 182398 [details]
Patch V4

Added the old test back, sorry about the misunderstanding. I thought you are asking about the other two tests that I had initially added in the first patch. I didn't realize I've actually removed an old test file too, so that generated some confusion on my side.

Also fixed the chromium test failures. It happened because of the text displayed on the page (in the "#layers" element). It had different line-heights across platforms, so it ended up having slightly different numbers in the output. I fixed it by hiding the "layers" element before it takes the "layers-snapshot".
Comment 17 Alexandru Chiculita 2013-01-11 13:22:20 PST
Created attachment 182404 [details]
Patch V5

Rebased the patch.
Comment 18 WebKit Review Bot 2013-01-11 14:06:50 PST
Comment on attachment 182404 [details]
Patch V5

Clearing flags on attachment: 182404

Committed r139493: <http://trac.webkit.org/changeset/139493>
Comment 19 WebKit Review Bot 2013-01-11 14:06:55 PST
All reviewed patches have been landed.  Closing bug.