Re: CSS3 Values and Units: Some proposals

On Thu, Mar 18, 2010 at 7:32 AM, Markus Ernst <derernst@gmx.ch> wrote:
> I see, my concrete solution suggestions do not seem to be practicable. Anyway the problem is real - really basic things like making 2 columns extend to the same height need a lot of trickery. That does not seem to be a satisfactory for CSS as a whole. As the same thing is easy to achieve with a table layout, I assume that suitable algorithms would not be impossible.

Indeed, this sort of control is very necessary, but I'm still
skeptical that we need it in a general form that is easy to produce a
circular dependency with.  Tables work because they are restricted in
form.  Similarly, Template layouts are somewhat restricted in how they
must work (in much the same way - a Template layout is nearly the same
thing as a table layout using row and column spans).

What precisely are your use-cases?  Anything related to overall page
structure (my commonest requirement for equal-height or equal-width or
whatnot) can be done really easily by Template, or with a little bit
of trickery by Table (the latter has the advantage of existing).  Do
you have specific examples of setups within a page that need matched
heights or widths that can't be easily handled by using the table-*
display types?  (I have some that I've collected over my last few
projects, which I'll write up in a bit).

> Maybe it could work when I replace the max() function by an adjust() function without arguments. It just covers the selector(s) applied to the rule:
>
> #contents, #navigation {
>  height:adjust();
>  min-height:100%;
> }
> label.aligned {
>  width:adjust();
> }
>
> The algorithm for adjust() then would have to look something like:
> - If the rule applies to less than 2 elements, ignore the declaration.

So is this rule somehow aware of of the outer selector that defines
the ruleset it is in?

> - Compute the width resp. height of every element covered by the rule.
> - If recursion occurs, break, ignore the declaration, throw an error.
> - After the values of all elements could be computed successfully, apply the highest value to every element.

What happens when adjusting the height of all the elements causes the
maximum height of other elements to change?  Is this ignored for a
simple deterministic solution?  Or do we iterate and hope to
stabilize?

~TJ

Received on Thursday, 18 March 2010 15:03:56 UTC