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

> 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 UTC