W3C home > Mailing lists > Public > www-style@w3.org > January 2012

Re: [css3-text] <spacing-limit> incompatible with calc due to different treatment of lengths and %s

From: Stephen Zilles <szilles@adobe.com>
Date: Thu, 5 Jan 2012 20:58:25 -0800
To: "jackalmage@gmail.com" <jackalmage@gmail.com>, "fantasai.lists@inkedblade.net" <fantasai.lists@inkedblade.net>
CC: "www-style@w3.org" <www-style@w3.org>
Message-ID: <a22f8ae7-2016-4d72-b90c-7538fd53892d@blur>
Tab,
Apologies for a top post

I do not see your problem. To me 150% is equivalent to 1.5ch. So, 1.5ch+150% is equivalent to 1.5ch+1.5ch. That is, both values return a length and lengths add. Why do you think this does not make sense?

Steve Z

Sent from my Motorola ATRIX™ 4G on AT&T


-----Original message-----
From: "Tab Atkins Jr." <jackalmage@gmail.com>
To: fantasai <fantasai.lists@inkedblade.net>
Cc: "www-style@w3.org" <www-style@w3.org>
Sent: Thu, Jan 5, 2012 20:34:48 GMT+00:00
Subject: Re: [css3-text] incompatible with calc due to different treatment of lengths and %s

On Thu, Jan 5, 2012 at 12:19 PM, fantasai <fantasai.lists@inkedblade.net> wrote:
> On 01/05/2012 02:28 PM, Tab Atkins Jr. wrote:
>> The<spacing-limit>  type defined for 'word-spacing' in Text 3
>> <http://dev.w3.org/csswg/css3-text/#spacing-limit>  assigns
>> substantially different meanings to percentages and lengths - the
>> former sets the word spacing to the given value, while the latter
>> *increments* the word spacing by the given value.
>>
>> If calc() is used here and mixes %s and lengths, like "calc(50% +
>> 1ch)", what does this mean?  If I'm reading correctly, I think this
>> would result in a<length>  equal to 1ch + half the default word
>> spacing, making the total word spacing equal to 1ch + 150% the
>> default.  Is this intended?
>
>
> I expected it to mean "half the word spacing plus 1ch". But you're saying
> that doesn't make sense...

Yes, it resolves to a *length* equal to half the word spacing plus
1ch.  That gives a total word spacing of 1.5 times the default word
spacing plus 1ch, since lengths are added to the default word-spacing.


>> If so, this seems suboptimal, as it's then impossible to, say, use
>> calc() to set the word-spacing to a particular length.  (I had
>> expected "calc(0% + 1ch)" to kinda work like that.)  Perhaps we can
>> alter word-spacing to accept both a percentage and a length, and
>> combine their effects?
>
> word-spacing takes up to three values, so that wouldn't be parseable.

Oh, darn, I missed that.  Is it possible to change <spacing-limit> at
this point, perhaps to a grammar like:

<spacing-piece> = normal | [ <length> || <percentage> ]
<spacing-limit> = <spacing-piece> [ [min <spacing-piece>] || [max
<spacing-piece>] ]?

The first piece is the optimal size.  If min or max clauses are
omitted, they're the same as the optimal size.

~TJ

Received on Friday, 6 January 2012 04:58:57 GMT

This archive was generated by hypermail 2.3.1 : Tuesday, 26 March 2013 17:20:48 GMT