W3C home > Mailing lists > Public > www-style@w3.org > July 2004

Re: Percentage height meaurements.

From: Tantek Çelik <tantek@cs.stanford.edu>
Date: Thu, 01 Jul 2004 17:35:30 -0700
To: Boris Zbarsky <bzbarsky@MIT.EDU>
Cc: <www-style@w3.org>
Message-ID: <BD09FB8A.48F48%tantek@cs.stanford.edu>

On 5/27/04 7:03 PM, "Boris Zbarsky" <bzbarsky@MIT.EDU> wrote:

> Tantek Çelik wrote:
>>> Tantek, do you implement min/max-width/height for replaced elements as
>>> CSS2.1 describes it?  And also box-sizing as CSS3 UI describes it?
>> Yes as far as I remember (it has been a few years since I wrote the code).
> Ah.  The CSS2.1 section in question is definitely considerably newer than a
> few years old, I believe.

Yes, the CSS2.1 section is definitely newer than a few years old, and was
written partially in response to my implementation experience in MSN/Mac
where I wrote the code to behave in such a manner because it was the only
way that made sense for min/max-width/height on replaced elements (or
frankly any element with a notion of intrinsic width/height where the
width/height ratio has significance).

>>> If so, doesn't that lead to undesirable distortion of replaced elements,
>> I don't know, do you have an example that attempts to demonstrate this?
> Sure (well, not an example in HTML testcase form, but I could put such up if
> desired).

Please do.  For a long time time constraints have forced me to ignore
examples which are not posted somewhere as valid (X)HTML+CSS already.

> Following the algorithm for replaced elements in the CSS2.1 CR, the computed
> width and height are both 100px so that the aspect ratio is preserved, in the
> absence of box-sizing.  However with box-sizing the computed width and height
> are _still_ 100px (since the computed max-width is 100px, the computed
> max-height is auto, and no changes have been made to the CSS2.1 algorithm).
> Which means that the image is rendered 50px wide by 100px tall, changing the
> aspect ratio.

I can see how that might happen.  Would have to try an actual URL/example to
be sure.

> I believe this can be addressed with appropriate modifications to the CSS2.1
> algorithm  (which would need to be presented in the context of CSS3 UI, since
> that's where box-sizing is defined).

Yes, I could see that as well.

> I'm sorry I didn't present this example in the original mail; the problem was
> fresh on my mind because I'd been looking at the CSS2.1 algorithm in detail,
> and I didn't do a very good job of explaining it...

No prob.

>>> That's excellent news (though  the final determination will be made by the
>>> CSS2.1 test suite, once such a beast actually starts existing, of course).
>> Actually, the CSS3-UI test suite, once it starts existing, as you said.
> Yes, indeed.  "CSS2.1" was a think-o.
>> I believe that would result in you buying almost no second books by the vast
>> majority of authors of web books.
> That's very true.  Already has, in fact.  ;)

Well, at least <plug type="shameless">Check out "CSS: The Definitive Guide,
Second Edition"[1] by Eric Meyer and tech-edited by yours truly and Ian
Hickson</plug>, so you know exactly who to yell at if you find any errors.


Received on Thursday, 1 July 2004 20:35:02 UTC

This archive was generated by hypermail 2.3.1 : Monday, 2 May 2016 14:27:14 UTC