List Info

Thread: [cs




[cs
user name
2007-03-31 12:30:30
The 'font' shorthand in css3-fonts resets two properties,
'font-size-adjust' and 'font-stretch' to their initial
values even
though they cannot be specified using the shorthand.  It
says [1]:
  # All font-related properties are first reset to their
initial
  # values, including those listed in the preceding
paragraph plus
  # 'font-stretch' and 'font-size-adjust'. Then, those
properties
  # that are given explicit values in the 'font' shorthand
are set
  # to those values. For a definition of allowed and initial
values,
  # see the previously defined properties. For reasons of
backwards
  # compatibility, it is not possible to set 'font-stretch'
and
  # 'font-size-adjust' to other than their initial values
using the
  # 'font' shorthand property; instead, set the individual
  # properties.
This paragraph comes straight from CSS2 [2], but both of
the
properties in question were dropped in CSS2.1.

What happens to these unspecifiable properties when the
shorthand is
given the 'inherit' value?  Do they get their initial values
or do
they get 'inherit'?  I tend to think they should get
'inherit'.

But a literal reading of the spec suggests that it isn't
even
formally defined what happens when a shorthand property is
set to
'inherit'.  This should be considered an issue in one of the
other
drafts that defines the 'inherit' value, css3-syntax [3],
css3-values [4], or css3-cascade [5].  I think something
needs to
specify that 'inherit' on a shorthand property either:
 * sets to 'inherit' all the properties that are considered
   specified by specifying the shorthand (my preference),
or
 * sets to 'inherit' all the properties for which values can
be
   given in the shorthand.
The same issue applies to 'initial'.  It probably even
applies to
CSS2.1.

(I tend to think this is a more general issue.  In Mozilla
we have
the problem in two places, since we've implemented
background-origin
and background-clip from css3-background as
-moz-background-origin
and -moz-background-clip [6], but we haven't implemented
the
extensions to the background shorthand yet [7].  And I think
there
may be some other places where we've created shorthands that
can't
specify all the properties they reset.)

-David

[1] http://www.w3.org/TR/2002/WD-css3-fonts-20020802
/#font-shorthand
[2] http://www.w3.org/TR/1998/REC-CSS2-19980512
/fonts.html#font-shorthand
[3] http://www.w3.org/TR/2003/WD-css3-syntax-20030813/#ini
tial
[4] http://www.w3.org/TR/2006/WD-css3-values-20060919/#ke
ywords
[5] http://www.w3.org/TR/2005/WD-css3-cascade-2005121
5/#inheritance
[6] http://www.w3.org/TR/2005/WD-css3-back
ground-20050216/#the-background-clip
    http://www.w3.org/TR/2005/WD-css3-ba
ckground-20050216/#the-background-origin
[7] http://www.w3.org/TR/2005/WD-css3-backgroun
d-20050216/#the-background

-- 
L. David Baron                                <URL: http://dbaron.org/ >
           Technical Lead, Layout & CSS, Mozilla
Corporation
[1]

about | contact  Other archives ( Real Estate discussion Medical topics )