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

Issue 646993 link

Starred by 7 users

Issue metadata

Status: WontFix
Owner:
Last visit > 30 days ago
Closed: Sep 2016
Cc:
Components:
EstimatedDays: ----
NextAction: ----
OS: Linux , Windows , Mac
Pri: 2
Type: Bug



Sign in to add a comment

[breaks the web] [bug] [v53] CSS3D preserve-3d breaks with opacity flattening

Reported by trusktr@gmail.com, Sep 14 2016

Issue description

UserAgent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/53.0.2785.89 Safari/537.36

Example URL:
http://codepen.io/jpanter/pen/PGqJOm?editors=1100

Steps to reproduce the problem:
1. Open that URL in Chrome 52 and toggle the opacity animation.
2. Open that URL in Chrome 53 and toggle the opacity animation.
3. Open that URL in Firefox and toggle the opacity animation.
4. Note that it works in Chrome 52 and Firefox, but is broken in Chrome 53.

What is the expected behavior?
The box should become transparent while NOT being flattened.

What went wrong?
The box was flattened.

The change that caused it is detailed at
https://googlechrome.github.io/samples/css-opacity-force-flattening
which in my opinion is a frustrating and bad change, and is a regression in 3D programming in the web.

I'm working on a 3D library, and this change breaks anything 3D that uses nested elements and opacity.

Does it occur on multiple sites: Yes

Is it a problem with a plugin? No 

Did this work before? N/A 

Does this work in other browsers? Yes 

Chrome version: 53.0.2785.89  Channel: n/a
OS Version: OS X 10.10.2
Flash Version: Shockwave Flash 22.0 r0

Please, let's not just suddenly break the 3D web. Let's not follow a spec just to follow a spec. We can rather change the spec. We should encourage the 3D future of the web rather than arbitrarily break it without notice, especially when VR is on the horizon.
 

Comment 1 by trusktr@gmail.com, Sep 14 2016

Did this work before? Yes, in Chrome 52.

Comment 2 by trusktr@gmail.com, Sep 14 2016

What I meant to say is: Let's not arbitrarily break the web just to suddenly follow a possibly-incorrect spec. The behavior was correct (in Chrome 52) as far as expectations go.

Firefox behaves the same as Chrome 52 in this regard, which strengthens the notion of our expectations as far as preserve-3d and opacity used together go.

Comment 3 by rtoy@chromium.org, Sep 14 2016

Components: -Blink Blink>CSS>3D
Status: Untriaged (was: Unconfirmed)

Comment 4 by trusktr@gmail.com, Sep 14 2016

I just tested that Safari 9 behaves the same as Chrome 52, and the codepen example works as expected.

This is (likely and unnecessarily) breaking 3D scenes that use opacity all around the web.

Comment 5 by trusktr@gmail.com, Sep 14 2016

Another reproduction:

- Without opacity (works): https://jsfiddle.net/4m5ubpmp/1
- With opacity (broken): https://jsfiddle.net/4m5ubpmp/2
Labels: M-55 OS-Linux OS-Windows
Owner: trchen@chromium.org
Status: Assigned (was: Untriaged)
Here is the narrow bisect result:
==================================
https://chromium.googlesource.com/chromium/src/+log/f28a9d144d6f6655b1775adef9e1239ae05c682b..dab7c8f09b323e70dbcd457963e84d35276e0cea

Good Build: 52.0.2743.60
Bad Build: 53.0.2785.89

trchen@, could you please look into this change (https://chromium.googlesource.com/chromium/src/+/696f27afa62eb426545c29cefe0b0b43feeafe94) ?

Thank you!

Comment 8 by trusktr@gmail.com, Sep 15 2016

@Chrishtr, this is "WontFix" because Chrome developers are simply (blindly?) following spec.

The spec is flawed.

Here's a public site that currently works in Firefox and Safari 9, but not Chrome 53: https://mightydevs.com

Note how in Chrome 53, the letters suddenly move into their correct positions when opacity reaches 1.0.

The solution to the problem would be to not use nested DOM, and fall back to the CSS3D before preserve-3d wherein we place all elements at the same level, then calculate world transforms and final opacities ourselves. This has a couple problems:

- We have to multiply opacities manually instead of the HTML engine.
- We have to multiply transforms manually instead of the HTML engine in order to determine final world transforms.
- Transforms and opacities are no longer cached by the HTML engine.
- It leads to ugly HTML markup where nothing is nested. Nesting elements and using preserve-3d brings about cleaner markup that matches with the structure of a 3D scene.
- Nested DOM makes 3D programming easier because transform caching is done by the HTML engine, not by end developers.

Chris, wouldn't you like for developers to write 3D scenes in the web (as far as DOM goes, not talking about WebGL which is a whole 'nother thing)? Doesn't it make sense to apply opacity to an object and for it not to become flat like paper?

Comment 9 by trusktr@gmail.com, Sep 15 2016

If it didn't make sense, then why was it done that way in all browsers? ...Because it makes sense not to flatten things!

Come on, just imagine a game engine which has a scene graph, and an opacity is applied to something in the scene. Does it make sense to flatten it?

No.

Therefore it doesn't make sense to follow the spec in this regard.
Hi, thanks for the feedback.

We are not blindly following the spec. We have thought carefully about several
potential impacts of the old and new behavior. There have been several recent discussions on www-style and public-fx about this issue. That is a good place to discuss it, rather than this bug.
Cc: trchen@chromium.org
 Issue 649267  has been merged into this issue.
Cc: sureshkumari@chromium.org
 Issue 652049  has been merged into this issue.

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

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

Comment 14 by trusktr@gmail.com, Jun 19 2017

I got an email from a fellow web developer:

----------------

Hi

I came across your several notes on Chrome's 53's changes that can
break blending of elements
(https://bugs.chromium.org/p/chromium/issues/detail?id=646993, status
"wontfix").


Did you ever work out a workaround?  It looks like google's not going to fix it.


I saw that some of the suggestions mention a workaround having to do
with separating things out, but it was not clear what that meant.

Here's a codepen that works beautifully in Safari, and wonky in Chrome
(it's just the the 3 axes of 3d space fading in and out):

https://codepen.io/anon/pen/bRgMKB

It looks like you are way more intimately familiar with this stuff,
and I was wondering if you were able to deal with it.

--------------------

Seems that the problem might be cause by these changes. 

I made one that works:

https://codepen.io/anon/pen/mwWdxj

In order to make the change, I had to un-nest the DOM structure (which in this case was not a complicated DOM structure, luckily).

However, it doesn't seem that opacity was applied to the .assembly elements, so I'm not sure what is causing the problem (which does seem like transform flattening).

Comment 15 by trusktr@gmail.com, Jun 19 2017

Besides un-nesting, I had to go and apply the parent .assembly transform to all the children, which was also cumbersome (imagine a more complicated DOM structure and the modifications required to apply opacity).

Sign in to add a comment