Re: Initial Value

Felix Miata wrote:
>>   font-size: medium;
>>   font-size: 70%;
> 
> From the 15.8 language, that means to me first make medium, then apply
> 70% to the computed value of medium, in the same fashion that {font:
> menu; font-size: 130%;} would be computed.

font:menu; font-size: 130%; should give you the menu font in a size that's 130% 
of the parent.

Again, please look at the:

   Percentages:  	refer to parent element's font size

line at http://www.w3.org/TR/CSS21/fonts.html#font-size-props

> "All font-related properties are first reset to their initial values"
> takes "medium" from the UA.

Ah, I see.  OK.  But then this |medium| specified value is overridden by the 70% 
specified value (which comes later in the cascade and has the same specificity, 
so wins out).

> The absolute-size, the first possible value defined in the spec for
> font-size, "medium" is not subject to inheritance from any ancestor but
> the UA, so the size that otherwise would be inherited (from the
> percentages section of the font-size spec) must be disregarded.

That section is never disregarded; it's the only section that says what should 
be done with a percentage value.  What made you think it's disregarded?

> Then 70%, the explicit setting in the rule must be applied to medium,

No.  The 70% is applied to the parent font size.  Again, the behavior should be 
exactly identical to writing out, longhand:

   font-size: medium;
   font-size: 70%;

as I said in my first reply.

Consider, as a similar exercise, the following rule:

   p {
     font-size: 50%;
     font-size: 50%;
   }

by your reasoning, that would have to have a font-size that's 25% of the parent...

> How can the actual existing language in the 2.1 spec not allow this
> alternate interpretation to the one obviously being used by Gecko?

How can it allow it?

> If the latter interpretation is intended to be the only possible
> interpretation, then it needs better language. It shouldn't say "...
> reset ... then...". It should say reset only those values not explicit
> in the rule.

No, resetting all the values gives the same behavior and is generally simpler to 
consider.  To me it sounds like you have a fundamental misunderstanding of how 
the cascade works and how specified, computed, and used values differ...

> The way the language reads now, .two is easily interpreted
> to mean reset to medium first, then apply 70% to medium.

Again, in CSS2.1 percentages are ALWAYS converted to computed or used values per 
the "Percentages:" line in the relevant property definition.  This is clearly 
stated at http://www.w3.org/TR/CSS21/syndata.html#percentage-units

-Boris

Received on Wednesday, 1 June 2005 04:31:07 UTC