W3C home > Mailing lists > Public > public-html@w3.org > April 2008

ISSUE-40 (style-attr-vs-css): Definition of the style attribute in HTML 5 [HTML 5 spec]

From: HTML Issue Tracking Issue Tracker <sysbot+tracker@w3.org>
Date: Fri, 4 Apr 2008 06:36:58 +0000 (GMT)
To: public-html@w3.org
Message-Id: <20080404063658.749E56B63E@tibor.w3.org>

ISSUE-40 (style-attr-vs-css): Definition of the style attribute in HTML 5 [HTML 5 spec]

http://www.w3.org/html/wg/tracker/issues/

Raised by: Michael(tm) Smith
On product: HTML 5 spec

http://lists.w3.org/Archives/Public/public-html/2008Mar/0260.html

 From: Daniel Glazman <daniel.glazman@disruptive-innovations.com> 
 Date: Fri, 28 Mar 2008 02:06:20 +0100
 Message-ID: <47EC448C.4020303@disruptive-innovations.com> 
 To: "public-html@w3.org" <public-html@w3.org> 
 Cc: "www-style@w3.org" <www-style@w3.org> 
 

Dear HTML WG,

The CSS WG has found today an incompatibility problem between the HTML4
and the HTML5 definitions of the style attribute.

Excerpt from HTML 4.01 spec [1]:

   For example, for CSS2 inline style, use the declaration block
   syntax described in section 4.1.8 (without curly brace delimiters).

Excerpt from HTML 5 spec [2]:

   The style  attribute, if specified, must contain only a list of zero
   or more semicolon-separated (;) CSS declarations.

This change has an implication on the error handling supposed to occur
during the parsing of the contents of the attibute. An example is the
following one :

   style="color:lime; (; color:red"

HTML 5 will make the element red, because HTML 5 explicitely splits
the contents of the attribute at semicolons.
The error handler looking for the matching closing parenthesis does not
find it at all, the () pair on the stack is closed finding the semicolon
ending the declaration.
In HTML 4, the style attribute holding the contents of a CSS block, the
error handler will look for the matching closing parenthesis as required
by CSS 2.1 until the end of the attribute's content. The element will
then be lime.

The CSS WG would like the definition of the style attribute in
HTML 5 to go back to the phrasing of HTML 4, entirely leaving the
definition of that attribute's value to the stylesheet's language
and error handling. We don't think HTML 5 should define the contents
of the style attribute in deeper details than what HTML 4 does,
and in particular should not specify how individual stylistic data
are separated inside the value of the style attribute.

Thanks.

[1] 
http://www.w3.org/TR/1999/REC-html401-19991224/present/styles.html#adef-style
[2] http://www.w3.org/html/wg/html5/#style0

</Daniel>, CSS WG co-chair
Received on Friday, 4 April 2008 06:38:38 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 9 May 2012 00:16:14 GMT