W3C home > Mailing lists > Public > www-style@w3.org > March 2013

RE: The :min-width/:max-width pseudo-classes

From: François REMY <francois.remy.dev@outlook.com>
Date: Fri, 22 Mar 2013 10:48:07 +0100
Message-ID: <DUB002-W1422D530135D43578F75597A5D40@phx.gbl>
To: Tab Atkins Jr. <jackalmage@gmail.com>, Elliott Sprehn <esprehn@gmail.com>
CC: "www-style@w3.org" <www-style@w3.org>
> From what I can tell, François' idea is this:
>
> 1. Initially mark every element as not being laid out.
> 2. All instances of the :max-width() pseudoclass evaluate as false initially.
> 3. As you lay out the page, mark elements as being laid out. Skip
> over the contents of viewport elements.
> 4. When the page has been laid out, check all the :max-width()
> selectors. If any of them now depend on elements that have been
> resolved, *and* their subjects are elements that have *not* resolved,
> check their truth values and apply the contained rules accordingly.
> 5. Return to step 3, resolving layout for the children of viewport
> elements that were skipped over before. Stop when every element in
> the page has been laid out.

It seems like a valid algorithm to reproduce the behavior I had in mind.


> Pretty sure it's guaranteed not to be cyclic, due to the way step 4
> works - you get a DAG of dependencies from it.

It is certainly not cyclic, and since the DOM is a finite tree we can even say that the maximum number of passes would be at most equal to the depth of the tree if every element in one of the critical paths are viewports.


> > I'd love to hear thoughts from other implementors. :)
>
> Me too!
>
> ~TJ
> 		 	   		  
Received on Friday, 22 March 2013 09:48:35 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:21:07 GMT