[webkit-dev] RenderLayer::isStackingContext() confusion

Shawn Singh shawnsingh at chromium.org
Wed Apr 3 12:48:36 PDT 2013


Background:

According to CSS 2.1 spec, an element becomes a stacking context when:
  - it is positioned  (relative, absolute, or fixed)
  - and it has a non-auto z-index

Spec also mentions that there's room for expanding this definition; the
examples I know about are fixed-position elements and elements with
transforms.


Questions:

The implementation of RenderLayer::isStackingContext() looks fishy.  It
only checks for a non-auto z-index.  It does not check for the positioning
style of the layer.  There is no indication that it checks for any more
recent special cases such as fixed-position or transforms.

Is this function name a misnomer?  should it actually be renamed to
hasNonAutoZIndex() ?

If the additional criteria is not being checked inside this helper
function, then where is it?  I see some code in collectLayers that looks
vaguely similar to checking whether an element is positioned, but what
about all the other uses of isStackingContext everywhere?

Thanks!
Shawn
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-dev/attachments/20130403/5dbbfc5c/attachment.html>


More information about the webkit-dev mailing list