W3C home > Mailing lists > Public > public-css-archive@w3.org > November 2018

Re: [csswg-drafts] Animation and opacity clamping (#3340)

From: Brian Birtles via GitHub <sysbot+gh@w3.org>
Date: Mon, 26 Nov 2018 00:38:09 +0000
To: public-css-archive@w3.org
Message-ID: <issue_comment.created-441488781-1543192688-sysbot+gh@w3.org>
As it currently stands, I believe the Firefox behavior is correct because, as Xidorn points out, animation is defined as operating on computed values and the clamping happens at computed value time.

Firefox does support negative computed opacity values and negative computed color values but it is only turned on for SMIL.

In future I believe we will want to allow out of range values in order to support [additive CSS](1594) (e.g. `opacity: -0.5 !add`) and [additive animation](https://drafts.csswg.org/web-animations-1/#effect-composition) (c.f. the proposed [animation-composition](https://drafts.csswg.org/css-animations-2/#animation-composition) property).

We could say that out of range computed values are only allowed in the presence of some additive operation and maintain the current Firefox behavior for existing content, or we could try to shift  clamping to happen at used value time as per SMIL, assuming that is Web-compatible.

For reference, the [SMIL](https://www.w3.org/TR/smil-animation/#AnimationSandwichModel) has the following recommendation in this area:

> Some attributes that support additive animation have a defined legal range for values (e.g., an opacity attribute may allow values between 0 and 1). In some cases, an animation function may yield out of range values. It is recommended that implementations clamp the results to the legal range as late as possible, before applying them to the presentation value. Ideally, the effect of all the animations active or frozen at a given point should be combined, before any clamping is performed. Although individual animation functions may yield out of range values, the combination of additive animations may still be legal. Clamping only the final result and not the effect of the individual animation functions provides support for these cases. Intermediate results may be clamped when necessary although this is not optimal.

GitHub Notification of comment by birtles
Please view or discuss this issue at https://github.com/w3c/csswg-drafts/issues/3340#issuecomment-441488781 using your GitHub account
Received on Monday, 26 November 2018 00:38:11 UTC

This archive was generated by hypermail 2.4.0 : Tuesday, 19 October 2021 01:30:59 UTC