Re: Re: min-width:auto and max-width:auto proposal / was overflow:none

>> min-width: auto if width set to value other than 'auto'
>>    exactly as like min-width has no value set.

>This rule causes your proposal not to satisfy one of the major use cases
>met by my proposal.  ('intrinsic' and 'min-intrinsic' must be defined in
>a way that is not affected by the 'width' property of the styled
>element, only by the *width properties of its descendants.)

min-width:auto is not a direct equivalent of width: intrinsic.

I agree with you that 'auto' definition is not deterministic.
Let it be min-width: intrinsic then.  Does not really matter.

If we will use 'intrinsic' keyword then my idea is slightly different:
computed intrinsic value depends on where this 'intrinsic' appears.
If in min-width then it means min possible width, if in width then width
will be eqal to some optimal 'native' value, if in max-width then max (max
optimal) value (if any).

See:
div {
   width:100px;
   min-width:intrinsic ;
/* computed-block-width = max(100px, min-intrinsic),
content will never overflow */
}

div {
   width:auto;
   min-width:intrinsic;
/* div itself will not overflow. Its min-width will be
computed as max of min-widths of its children.
So its content will never overflow */
}


And about max-width:intrinsic.

Let's think about this table.
<TABLE border=1><TR>
<TD>one two three</TD>
</TR></TABLE>

as about  <DIV>one two three</DIV>

setting max-width:intrinsic for this div will allow mimic that table
behavior.
[I've repeated discussion here:
http://lists.w3.org/Archives/Public/www-style/2003Mar/0109.html]

About floaters, <BR> and paragraph max-width:intrinsic.

To compute max-intrinsic width of a paragraph set its width to 'unlimited',
align it to the left and run computation of its content width. Rightmost
occupied point (on a pixel grid) of its rightmost element + one (pixel) will
be its max width.
One tricky point here: All width values in its children having % could be 1)
interpreted as just zeroes at this stage or 2) interpreted as 'undefined'
and the whole max-intrinsic width will be computed to 'undefined' (not set
or unknown)

I mean it is just enough to define algorithm used in computation of table
cells for that. It is well known and already implemented in any UA.

Andrew Fedoniouk.
http://terrainformatica.com


----- Original Message ----- 
From: "L. David Baron" <dbaron@dbaron.org>
To: <www-style@w3.org>
Sent: Monday, May 31, 2004 2:58 PM
Subject: Re: min-width:auto and max-width:auto proposal / was overflow:none

On Monday 2004-05-31 14:32 -0700, Andrew Fedoniouk wrote:
> min-width: auto if width set to value other than 'auto'
>    exactly as like min-width has no value set.

This rule causes your proposal not to satisfy one of the major use cases
met by my proposal.  ('intrinsic' and 'min-intrinsic' must be defined in
a way that is not affected by the 'width' property of the styled
element, only by the *width properties of its descendants.)

> intrinsic-max-width for a <P> means its maximum width (min width needed to
> show the paragraph as one line)

It's nowhere near that simple in the presence of 'float' and 'clear'.
(I've been working on a more detailed description of how 'intrinsic' and
'min-intrinsic' would be defined.)

> Same rule apply to heights.

Are heights really that easy?  Percentage sizing (especially of replaced
elements with one dimension 'auto') may be problematic, as can various
combinations of 'float' and 'clear'.

> Motivations:
> Above-stated will allow to model current HTML layouts for e.g. images,
> tables, etc.
> without need to introduce 'intrinsic' and 'min-intrinsic' values, (C)
David
> Baron.

I don't like adding more 'auto' values -- 'auto' should be avoided when
possible since it's basically meaningless.  'auto' is often used for
things that have to switch their behavior based on other things (e.g.,
whether element is replaced or non-replaced).

I'd prefer adding keywords that do what they mean and then, if needed,
defining 'auto' values in terms of them (e.g., defining 'width: auto' in
terms of 'width: shrink-wrap' [1] and 'width: fit' [2] depending on other
properties).

> (actually there should be one more value - max-intrinsic then)

What's the difference between 'intrinsic' and 'max-intrinsic'?

> It seems that Internet Explorer is using: min-width:auto for any element
in
> its default stylesheet.

This would only be true if you fix the flaw I point out in my first
comment above.

> All UA's behave as TABLE { max-width:auto } set and in effect.
> To see what I mean load following:
> <TABLE border=1><TR>
> <TD>one two three</TD><TD>four five six</TD>
> </TR></TABLE>
> and try to resize UA's view.
> This table seems as it has width:auto, max-width:auto, min-width:auto set.

Tables are somewhat special because they have to simultaneously satisfy
potentially incompatible constraints from multiple sources in order to
make the grid line up.

Also, if the flaw I pointed out in my first comment were fixed, this
would again no longer be true.

> All UA's behave currently as { min-height:auto; max-height:auto } set and
in
> effect for any element.

Eh?  How is this different from saying the default value of 'height' is
'auto'?  Again, this wouldn't be true if the proposal were corrected to
fix the flaw pointed out in my first comment.

-David

[1] http://lists.w3.org/Archives/Public/www-style/2003Mar/0109.html
[2] fit to the containing block, i.e., what 'width: auto' now does
  for non-replaced non-positioned non-floating blocks

-- 
L. David Baron                                <URL: http://dbaron.org/ >

Received on Monday, 31 May 2004 19:34:40 UTC