W3C home > Mailing lists > Public > public-fx@w3.org > July to September 2016

Re: [css-transforms] CSS3D breaks with opacity flattening

From: Rik Cabanier <cabanier@gmail.com>
Date: Mon, 19 Sep 2016 15:58:12 +0100
Message-ID: <CAGN7qDDL0M1Poa1i0teODXLfwpgfejqJVHU-GvSrKs6Z2FPEEw@mail.gmail.com>
To: Amelia Bellamy-Royds <amelia.bellamy.royds@gmail.com>
Cc: Nexii Malthus <nexiim@gmail.com>, Matt Woodrow <mwoodrow@mozilla.com>, "Tab Atkins Jr." <jackalmage@gmail.com>, "/#!/JoePea" <trusktr@gmail.com>, Chris Harrelson <chrishtr@google.com>, Simon Fraser <simon.fraser@apple.com>, "public-fx@w3.org" <public-fx@w3.org>
On Mon, Sep 19, 2016 at 3:48 PM, Amelia Bellamy-Royds <
amelia.bellamy.royds@gmail.com> wrote:

> Changing how opacity works is not an option.  It is a group property, not
> an inherited one.  It takes the rendered and composited group, and adjusts
> alpha.  For its original purpose in 2D SVG, this is essential.  You can
> create an image from many different shapes, one for each color, and have it
> fade in and out as a whole, without revealing the underlying layering.
> Would it be possible to instead add a different property (say, "alpha"),
> which *is* inheritable, not group, and adjusts the alpha of every paint
> operation by that factor?  It would be similar to applying opacity to leaf
> nodes, but you could set it once on the group and have it inherit. It would
> also have to apply to each background, text, etc., separately, so that
> container elements with a mix of child content plus their own
> background/text wouldn't end up compounding the transparency of their
> children.

That doesn't sound very useful because it means that each painting
operation will alpha blend/interact with what came before.
I can't think of a scenario where you'd want that. Can you provide an

> For any child element that you *wanted* to treat as a flattened layer,
> you would set alpha=1 and opacity=*alpha-factor* (possibly using CSS
> variables to keep track of what your alpha factor is).
> Those of you who know more than me about how compositing is implemented,
> does this sound feasible?
> Otherwise, my best recommendation to people who want the 3D opacity effect
> is to use CSS variables to set your alpha factor on your group, and then
> use opacity:var(--alpha) on any (flat) layer that actually includes painted
> content.
> Unfortunately, however, for now that means not being able to use CSS
> animations/transitions or web animation to transition alpha.  We're still
> waiting for typed CSS custom properties that can be interpolated.
> ~ABR
Received on Monday, 19 September 2016 14:58:45 UTC

This archive was generated by hypermail 2.4.0 : Friday, 17 January 2020 19:49:57 UTC