This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 16265 - Define transition for "z-index: auto"
Summary: Define transition for "z-index: auto"
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: Transitions (show other bugs)
Version: unspecified
Hardware: All All
: P2 enhancement
Target Milestone: ---
Assignee: Dean Jackson
QA Contact: public-css-bugzilla
Depends on:
Blocks: 15844
  Show dependency treegraph
Reported: 2012-03-07 20:13 UTC by Aryeh Gregor
Modified: 2015-02-11 00:28 UTC (History)
4 users (show)

See Also:


Description Aryeh Gregor 2012-03-07 20:13:18 UTC
The spec says z-index is transitioned as an integer.  So what happens if it's "auto"?  Testing seems to indicate that IE10 Developer Preview and Firefox 13.0a1 jump straight to auto without trying to interpolate.  Chrome 19 dev and Opera Next 12.00 alpha both transition to 0.  When the value would round down to 0, Opera seems to leave it at 0 until the transition is done, when it switches to auto.  Chrome seems to leave it at 1.  The Chrome/Opera behavior makes more sense, and I suggest we spec something like it.  E.g.:

1) If the transition is from 0 to auto or vice versa, it jumps directly with no transition, same as properties with discrete values.

2) If the transition is from auto to a nonzero number, the computed value immediately becomes 0, then transitions from there to the new value.

3) If the transition is from a nonzero number to auto, the computed value transitions to 0, then becomes auto after the transition is done.

The details of when exactly it switches between 0 and auto are debatable, but this seems good enough to me.  We should spec something, anyway.

(This is a subset of bug 15844, but it's much simpler than the general case, where lengths are the big problem.  I think this should be resolved even if bug 15844 is pushed off.)
Comment 1 L. David Baron (Mozilla) 2015-02-11 00:28:04 UTC
Saying that it's transitioned as an integer implies that it transitions only when both values are an integer:

   Values are animatable when both the from and the to values of the property have the type described. (When a composite type such as "length, percentage, or calc" is listed, this means that both values must fit into that composite type.) When multiple types are listed in the form "either A or B", both values must be of the same type to be interpolable.


It's not clear to me if the Chrome/Opera behavior is actually intentional, or the same WebKit-based 'auto' bug, or if trying to make the behavior here better is worth a special case.