W3C home > Mailing lists > Public > www-style@w3.org > October 2010

RE: Positioned Layout proposal

From: Belov, Charles <Charles.Belov@sfmta.com>
Date: Mon, 18 Oct 2010 12:57:20 -0700
Message-ID: <E17F75B6E86AE842A57B4534F82D03769C30C5@MTAMAIL.muni.sfgov.org>
To: "www-style list" <www-style@w3.org>
Cc: "Tab Atkins Jr." <jackalmage@gmail.com>

Tab Atkins Jr. wrote on Monday, October 18, 2010 12:32 PM
> Since I've worked at Chrome, one of the things I've heard 
> developers complain about a lot is the weakness of absolute 
> positioning.  For example, our app devs commonly want to 
> position tooltips relative to arbitrary elements in a 
> contenteditable area.
> To fix this, I've written a personal draft of a new 
> Positioned Layout spec I'd like to see adopted by the group.  
> It's currently hosted on my blog: <http://www.xanthir.com/blog/b48H0>.

"When specifying which edge an element positions itself relative to,
it's possible to create cycles, where following the chain of references
from one element eventually leads back to the same element. For example,
a cycle is created in the following code:

#one {
  position-root-top: element(#two) bottom;
  top: 0;

#two {
  position-root-top: element(#one) bottom;
  top: 0;

Both of the elements are attempting to position their top edge against
the other element's bottom edge. Obviously, these cannot both be
satisfied at the same time. [[Define how to resolve cycles. I'll
probably just say that an arbitrary but well-defined reference is broken
(reference edge set to the relevant 'self' edge?), but I want to hear
more from people who know more about constraint systems first.]]"

I don't know anything about constraint systems, but I would follow the
CSS principle that the last-specified item rules.

That is, #two would be positioned relative to #one, and the
position-root-top would be ignored for #one to prevent the cycle.

Hope this helps,
Charles Belov
SFMTA Webmaster
Received on Monday, 18 October 2010 20:03:07 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:38:39 UTC