[webkit-dev] Your opinion on a CSS proposal

Rob Burns robburns1 at mac.com
Tue Jun 5 22:32:51 PDT 2007


On Jun 6, 2007, at 12:01 AM, Windy Road wrote:

> On 06/06/07, Wesley Moore <wjmoore at gmail.com> wrote:
>> Overlooking for the moment the problem Dave H raised, what would the
>> rendering engine be aiming to do with the text when font-size was
>> auto? I assume this is to make the resolution independent example
>> you've made easier to implement, how does it help that?
>
> Just say you wanted a RI (resolution independent) web page with a body
> width of 62.5em, which comprises of a main column which is takes up
> 80% and a secondary column which takes up the remaining 20%.  The hope
> is font-size: auto, would allow you to use the following CSS
>
> body {
>  width: 62.5em;
>  font-size: auto;
> }
>
> #main-column {
>  width: 80%;
> }
>
> #secondary-column {
>  width: 20%;
> }
>
> Such a page would look identical on a 640px wide browser as a 1900px
> wide browser in every aspect, except that the font would be much more
> detailed in the 1900px wide browser.
>
> While the demonstration shows this is achievable with Javascript,
> there is quite a lot of 'scaffolding' to hold it all together.  Also,
> I feel it is something that belongs more in the realms of CSS than
> Javascript (you know, the whole separation of responsibilities).
>
> I'll also admit that font-size auto does not address how to request
> the server to deliver a correctly scaled version of an image, video or
> similar.

I think its an interesting idea. However, perhaps it would be better  
to have an additional property that wouldn't conflict with the font- 
size property. Something like font-size-transform (to avoid conflict  
with font-size-adjust though this could still cause author  
confusion). In this way, the width and height in the box model could  
continue to bet set relative to font-size (an important part of  
resolution independent CSS). However, there could be a font-size- 
transform that scaled the font-size relative to the enclosing content  
box after the other properties are determined. That's just a reaction  
off the top of my head.

Take care,
Rob



More information about the webkit-dev mailing list