W3C home > Mailing lists > Public > www-style@w3.org > January 2008

Re: CSS2.1: computed value of z-index

From: Robert O'Callahan <robert@ocallahan.org>
Date: Thu, 3 Jan 2008 11:54:47 +1300
Message-ID: <11e306600801021454y13a4747bod31319359e86f853@mail.gmail.com>
To: "David Hyatt" <hyatt@apple.com>
Cc: "Maciej Stachowiak" <mjs@apple.com>, www-style@w3.org
On Jan 3, 2008 11:41 AM, David Hyatt <hyatt@apple.com> wrote:

>
> On Jan 2, 2008, at 4:31 PM, Robert O'Callahan wrote:
>
> > Why don't we just make z-index applicable to everything, with a non-
> > auto z-index inducing a stacking context? That would be really easy
> > for us to implement. Right now we actually have to have code to
> > explicitly disable z-index for non-positioned elements.
>
> I do not believe we can do this as it would introduce major
> compatibility issues.  Many sites specify z-index on objects where it
> does not apply, and if we suddenly honored it, the sites would break.
> I know this from fixing bugs where we used to apply z-index
> incorrectly to unpositioned elements.  They do this even in strict mode.
>

OK, that's good to know.


> I think z-index should be honored for an object that introduces a
> stacking context (this would include opacity and positioned elements
> in CSS3 so far) and should be considered auto otherwise.  Note that
> WebKit is the only engine (I believe) that respects z-index on
> elements with opacity < 1.  It's ambiguous right now (IMO) whether or
> not WebKit is correct, but I think the behavior makes sense.
>

I actually think it's kind of confusing for authors to be told "z-index will
apply if and only if any of these N other properties have certain values"
where the value of N keeps growing. If we can't set N to 0 because of
compatibility reasons, keeping N=1 is simpler.

Rob
-- 
"He was pierced for our transgressions, he was crushed for our iniquities;
the punishment that brought us peace was upon him, and by his wounds we are
healed. We all, like sheep, have gone astray, each of us has turned to his
own way; and the LORD has laid on him the iniquity of us all." [Isaiah
53:5-6]
Received on Wednesday, 2 January 2008 22:54:52 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 27 April 2009 13:54:57 GMT