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

> Oh! So your idea is that a :max-width() pseudo would, regardless of
> where in the selector it appears, match based on the nearest viewport
> element of the selector's subject?

Not exactly. I'm just saying that if the layout of the element hasn't been calculated in a previous pass, the pseudo-class doesn't match. And the condition to which the layout of the target element has been computed in a previous pass is that it should be the nearest parent viewport of the element to be matched, or an ancestor.

So :min-width() consider the width of the element it's applied on, but only if the width of the element is known. If it's not, the pseudo-class do not match.

The only downside of this approach is that the elements that :min-width can match on depends on the final element to be matched. If you have three nested divs, and the middle one is a local viewport, then ":min-width(...) > div" will match no element while ":min-width(...) > div > div" will match the third div. It does however make sense because that third div lays in another layout sub-tree but it can be counter-intuitive at the beginning. 		 	   		  

Received on Friday, 22 March 2013 00:36:14 UTC