W3C home > Mailing lists > Public > www-style@w3.org > September 2005

css3 absolute positioning and containing blocks question/suggestion

From: Jacob Floyd <techgurufloyd@gmail.com>
Date: Tue, 20 Sep 2005 17:53:26 -0600
Message-ID: <4afbebfe05092016531a3d1716@mail.gmail.com>
To: www-style@w3.org

Hello!
CSS3 is a great improvement from 2.1. I am excited, in particular, for
the selectors, pseudo-elements, as well as the generated content
module. Move-to will be very useful in laying out a page, but to use
it the CSS author must be sure that the element (s)he wishes to move
is before where he wants to put it, which causes a dependency on
structural mark-up.

As far as I can see (and after a quick search through the mailing list
archive) there are no methods for simply changing which block should
be used as the containing block. CSS2.1 says
(http://www.w3.org/TR/CSS21/visudet.html#containing-block-details) "If
the element has 'position: absolute', the containing block is
established by the nearest ancestor with a 'position' of 'absolute',
'relative' or 'fixed'..." I believe allowing an author to set an
'absolute-containing-block' or something similar would be extremely
beneficial.

What this does for the author:
Allows absolute positioning based on a different element (say the
direct parent, useful in cases such as CSS based menus as well as
general layout.)

What this means to user-agents:
User-agents, would not "move" the element, as in 'move-to' but would
base the position of the current element, and all of that elements
descendants on the element defined in  'absolute-containing-block'.
I'm not sure if there are any other reprecussions, for the user-agent,
but I believe this would allow the user-agent to progressively show
the document as it loads it, because absolutely positioned objects
don't cause re-flow, they are just put on top.

To make sure that the user-agent doesn't place the
absolutely-positioned element under the absolute-containing-block I
think the z-index, when none is defined, should default to the
absolute-containing-block's z-index +1 or something similar.

If this has already been suggested, great! Please point me to where I
can read the discussion, as I did not see anything quite like it in
the archives. Otherwise, I hope to see this incorporated (if it, or
something similar) isn't already in either the positioning module, or
the advanced layout module, As I think it would fit in either module,
but fit better in positioning.

Thanks!
Jacob
Received on Wednesday, 21 September 2005 00:36:39 GMT

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