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

Issue 663650 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Last visit > 30 days ago
Closed: Nov 2016
Cc:
Components:
EstimatedDays: ----
NextAction: 2016-11-24
OS: Linux , Windows , Mac
Pri: 1
Type: Bug-Regression



Sign in to add a comment

CSS 3D z ordering breaks when using overflow:hidden in combination with position:absolute

Reported by david.bi...@viaprinto.de, Nov 9 2016

Issue description

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

Steps to reproduce the problem:
1. Open the example index.html in your browser

What is the expected behavior?
The sloth image should overlap the cat image.

What went wrong?
The cat image (which is embedded into a div which is positioned behind in 3D space) overlaps the rest of the 3D "scene".

If you either remove position:absolute from the .image class or overflow:hidden from the .page class, the problem disappears.

Did this work before? Yes Chrome 53

Does this work in other browsers? Yes

Chrome version: 54.0.2840.87  Channel: stable
OS Version: 10.0
Flash Version: Shockwave Flash 23.0 r0

Works fine in Firefox and Edge.
 
css3d-bug.zip
722 KB Download
css3d-bug-chrome.PNG
120 KB View Download
Components: -Blink>CSS Blink>Paint
Components: -Blink>Paint Blink>CSS>CSS3D Blink>Compositing
Labels: Needs-Bisect
NextAction: 2016-11-24
Status: Untriaged (was: Unconfirmed)
Confirmed. Bisect please.
Cc: kkaluri@chromium.org
Labels: -Needs-Bisect hasbisect-per-revision M-56 OS-Linux OS-Mac
Owner: jaydasika@chromium.org
Status: Assigned (was: Untriaged)
Able to reproduce this issue on windows 10, Ubuntu 14.04 and Mac 10.11.6 on chrome stable version 54.0.2840.87 
Issue is broken in M53. 

Bisect Info:
===========

Good build : 53.0.2773.0,  Revision Range(400610)
Bad build  : 53.0.2776.0,  Revision Range(401299)

After executing the per-revision-bisect script, i got the following CL's between good and bad build versions
===========================================
https://chromium.googlesource.com/chromium/src/+log/118f252384aeeebffdfd18654c13e2dc8fb82386..c20fd8c81e0174fca68bcdf8db4da70342daf3b0

The suspecting Change Log is :
-----------
https://chromium.googlesource.com/chromium/src/+/89f7b5aa70aefa623f67b4adf8964308aadc9b82

From the above CL suspecting the below change
---------------------------
https://codereview.chromium.org/2084233002


jaydasika@- Could you please look into this issue, if it's related to your change?  if not could you please help us to reassign this issue to the right owner.

Cc: jaydasika@chromium.org chrishtr@chromium.org
Owner: trchen@chromium.org
https://codereview.chromium.org/2084233002 is changing tests only. So, it's not the cause for this bug.

I re-bisected and got this change log :
https://chromium.googlesource.com/chromium/src/+log/1d02ad2ac9c51df49c1402ec8deefeed66c25130..696f27afa62eb426545c29cefe0b0b43feeafe94
Labels: -Pri-2 Pri-1
Tien-Ren please fix for M57.

Comment 6 by trchen@chromium.org, Nov 16 2016

Aye aye, sir!

This behavior involves the "3D context penetration" loophole in the spec. It is inherently ill-defined. Though I do have a spec proposal in mind that will plug the loophole in a sane way.

It is triggered by my CL in a very subtle way. Before my CL, the used value of z-index is determined before computing used value of transform-style, so the .page elements get forced stacking context, despite transform-style is ultimately resolved to flat due to overflow:hidden.

---

Hey David, thank you for reporting! Your minimized test case is extremely useful for diagnosing this issue.

As I mentioned above, your test case triggered an ill-defined behavior in the spec. I agree we should fix the spec and implement that in Chromium, but you might want to know what's wrong with the spec and how to work around it.

1. ".page { transform-style:preserve-3d; }" may be ignored, because in W3C ED overflow:hidden forces transform-style:flat. A few vendors implemented it, a few vendors didn't, I'd suggest avoid this if you want to ensure portability.

2. Avoid having positioned elements with z-index:auto. This creates the infamous case of "my containing block is not my stacking parent", which by itself, is totally fine and well supported by vendors. However combined with 3D context, the spec ill-defined how a descendant element inherits 3D context, and actual behavior is very inconsistent across vendors. Adding ".page { z-index:0; }" ensures best portability.
Why would https://chromium.googlesource.com/chromium/src/+/696f27afa62eb426545c29cefe0b0b43feeafe94 break the testcase in this bug if it doesn't use opacity < 1?

Comment 8 by trchen@chromium.org, Nov 18 2016

Subtleties in how used value of transform-style is adjusted. :/

https://codereview.chromium.org/2065233002/diff/60001/third_party/WebKit/Source/core/style/ComputedStyle.h

Added a function usedTransformStyle3D() that will always reflect current value of grouping properties.

Before my CL, z-index adjustment is done before transform-style is adjusted, thus will z-index will be forced 0 because of computed transform-style:preserve-3d, while the actual used value is transform-style:flat (adjusted by overflow:hidden).

This bug is actually quite complicated. Involves many subtleties in spec interaction and implementation bugs.
Just to update still able to reproduce the issue on windows 7 using chrome latest dev 56.0.2924.3 and canary 57.0.2929.0
Project Member

Comment 10 by bugdroid1@chromium.org, Nov 30 2016

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

commit 413965df09a5ffbcdfa37f82c273af2fdf659654
Author: trchen <trchen@chromium.org>
Date: Wed Nov 30 22:11:04 2016

Forces stacking context for computed value of transform-style:preserve-3d

This CL reverts the behavior change due to a side effect of r401197.
Prior to r401197, the used value of z-index is adjusted prior to resolving
the used value of transform-style. i.e. adjusted using the computed value.

According to the current spec, overflow other than 'visible' should force
the used value of transform-style:flat even if the computed value was
'preserve-3d'. The spec is unclear about how to resolve z-index in this case.

BUG= 663650 

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

[modify] https://crrev.com/413965df09a5ffbcdfa37f82c273af2fdf659654/third_party/WebKit/Source/core/style/ComputedStyle.cpp
[modify] https://crrev.com/413965df09a5ffbcdfa37f82c273af2fdf659654/third_party/WebKit/Source/core/style/ComputedStyleTest.cpp

Status: Fixed (was: Assigned)

Comment 12 by suzyh@chromium.org, Mar 24 2017

Components: -Blink>CSS>CSS3D Blink>Compositing>Transform3D

Sign in to add a comment