Re: Specificity of HTML

--- "L. David Baron" <dbaron@fas.harvard.edu> wrote:
> On Fri, 3 Mar 2000 10:22:47 -0800 (PST),
> =?iso-8859-1?q?Matthew=20Brealey?= (thelawnet@yahoo.com) wrote:
> > 
> > <blockquote cite="http://www.w3.org/TR/REC-CSS2cascade.html#q12">
> > 6.4.4 Precedence of non-CSS presentational hints
> > The UA may choose to honor presentational hints from other sources
> than
> > style sheets, for example the FONT element or the "align" attribute in
> > HTML. If so, the non-CSS presentational hints must be translated to
> the
> > corresponding CSS rules with specificity equal to zero. The rules are
> > assumed to be at the start of the author style sheet and may be
> overridden
> > by subsequent style sheet rules.
> > </blockquote>
> > 
> > This is badly and dangerously wrong.
> 
> It's exactly right, as far as I can tell, even after reading your
> message.  In fact, it's one of the most important parts of the CSS
> spec.  The transition from presentation hints to CSS depends on
> correct implementation of this section.

Indeed. However, it is dependent, not on overriding elements, but
attributes. The language of the sentence is wrong (suggesting that
elements are somehow given zero specificity), although the intention can
be divined from the paragraph.

> > The issue is not 'presentational hints' but presentational
> _attributes_.
> > It is not 'for example the FONT element or the "align" attribute', but
> the
> > attributes of FONT and the "align" attribute. The suggestion that FONT
> be
> > mapped to CSS with specificity of 0 makes no sense at all.
> 
> Unless I'm misunderstanding you, you seem to be complaining here about
> the language used in the paragraph, not what the paragraph means.

Yes. But if the language is wrong, people might misinterpret the
paragaraph.

> The spec doesn't say anything about elements being converted to CSS
> rules.  

It does: 'for example the FONT element'. This is properly an erratum
rather than a semantic change, but it is a dangerous error nonetheless.

> It says that the corresponding CSS rules should be created so
> that the non-presentational hints can be incorporated into the CSS
> formatting model rather than processed outside of the CSS model.  In
> this case such a rule would be:
> 
> <selector matching only that font element> {
>   color: red;
>   }
> 
> The element is not removed from the tree, if that's what you're trying
> to suggest.

No I am not. I'm saying that that's what the phrase implies, and that is
wrong.

> WebTV has implemented this part of the spec incorrectly.

Agreed.
 
> Are you saying that "for example the FONT element" should be changed to
> "for example the attributes of the FONT element"?  Or are you proposing
> a significant change?

The first one, and no it isn't a significant change.

=====
----------------------------------------------------------
From Matthew Brealey (http://members.tripod.co.uk/lawnet (for law)or http://members.tripod.co.uk/lawnet/WEBFRAME.HTM (for CSS))
__________________________________________________
Do You Yahoo!?
Talk to your friends online with Yahoo! Messenger.
http://im.yahoo.com

Received on Friday, 3 March 2000 13:48:50 UTC