W3C

Comments on  XHTML From the CSS Working Group

W3C Note 01 Feb 2000

This version:
http://www.w3.org/TR/1999/NOTE-CSS-20000201
Latest version:
Previous version:
Authors:
Christopher Alva Brichford (cbrichfo@adobe.com)

Abstract

This note contains comments to the XHTML group about XHTML 1.0 from the CSS working group.

Status of this document

The document is currently a draft.  This document is not stable and should not be referenced as a normative or informative reference.

Formatting Model

A program that renders XHTML creates a tree known as the document tree.  Each node of the document tree corresponds to either a XHTML element in the source or content from the source.  When the document tree is rendered, the various properties of the content must be resolved at each node in the document tree.  For instance if there is some bold text in the document, then in the document tree there will be a node corresponding to the B element in the source.  For each node in the document tree that is a descendant of that node, the layout engine must know to make the text bold.  Therefore the properties and the semantics of the properties available to the layout engine are essential to properly rendering the document.  A set of available properties and their semantics is known as a formatting model.  If the formatting model is changed then the result of the layout engine could vary.  If it is not desirable for many different browsers to render the same content with different results, then it is expedient to standardize the formatting model.

XHTML should describe its formatting model in a very precise manner.  It should also choose a formatting model that is as close as possible to that of the major shipping browsers.  Great care has been taken to ensure that the CSS formatting model can easily express as much of the formatting model of the major browsers as possible.  Therefore we believe that if XHTML uses the CSS formatting model, it will be possible for multiple browsers to render a document in the same way.

The formatting model of a browser does not have to be implemented in a style sheet.  The formatting model can be expressed directly in the executable code.  Even in this case it should be possible to have multiple browsers render a document in the same way if they are using the same formatting model.  Thus if support of style sheets is going to be optional in XHTML then a formatting model must be precisely described if multiple browsers are to render the same content in the same way.  Further more it would be convenient if XHTML simply referenced the formatting model used by CSS and XSL when describing the semantics of its various elements.

Style Attribute

It is desirable to put the style attribute in the style module and not in the legacy module.  In most cases the style attribute is beneficial and user agents should be encouraged to support it.

Here are just a few of the reasons.
  1. Performance. In some applications the style attribute is essential to achieving acceptable performance.
  2. Computed values. The style attribute can be used by authoring tools and user agents to store computed property values.
  3. Copy and Paste of styled markup. These computed property values allow for author tools to efficiently implement copy and paste of styled markup in end user browsing and authoring tools in a manner which ensures that the user perceived styling fidelity of the source is kept.
  4. Easier to author scripts. It is easier for scripts to manipulate the style attribute of a particular element than to manipulate the style sheet object, though both may be able to achieve the same result.

Media Attribute

The definition of the media attribute conflicts with CSS @media rule.  The differences between the two are:

  1. The media attribute is case sensitive in XHTML, but the CSS @media rule is case insensitive.  Since it is not likely that anyone would introduce a medium called "PRINT" that is different than "print",  case sensitivity is unnecessary and confusing.

  2. XHTML users agents are required to silently ignore unknown text in the media attribute, but users agents are required to ignore the entire @media rule if there is any unknown text in the rule.  By requiring the user agent to ignore the entire media attribute when it contains unknown text it is possible for the authort to specify multiple links, some of which will be completely ignored by earlier XHTML user agents; though recognized by later XHTML user agents.  If the media attribute is parsed as described in the XHTML specification then all XHTML user agents will recognize all links, which does not allow the author to target later XHTML user agents with different style sheets that take advantage of new features.

We feel that the algorithm for parsing the media attribute and the @media rule should be the same.