This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 762 - Style attributes are ignored unless Content-Style-Type is specified
Summary: Style attributes are ignored unless Content-Style-Type is specified
Status: NEW
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: Other (show other bugs)
Version: CSS Validator
Hardware: Other other
: P4 normal
Target Milestone: ---
Assignee: Olivier Thereaux
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2004-05-29 18:23 UTC by Bj
Modified: 2007-08-20 10:49 UTC (History)
1 user (show)

See Also:


Attachments

Description Bj 2004-05-29 18:23:55 UTC
From http://jigsaw.w3.org/css-validator/BUGS.html

''
I have found something, maybe already known, The HTML validator and the CSS 
validator can't detect this file is wrong : 

http://www.la-grange.net/2002/04/03-styleatt-wo-meta 

This file has a style attribute style="color: green; border: solid red;" but no 
metaname specifying the default stylesheet language. So by definition, the file 
is not a valid one : 

HTML 4.01 says in the chapter "Style Sheets in HTML documents (14.2.1)": 

"Documents that include elements that set the style attribute but which don't 
define a default style sheet language are incorrect." 

2002-04-03 The HTML validator says the file is valid. 

2002-04-03 The CSS validator does not find any style and says there are no 
errors. 
''

(see also http://www.w3.org/mid/40c6ab00.477995270@smtp.bjoern.hoehrmann.de)
Comment 1 Olivier Thereaux 2004-10-06 01:43:34 UTC
Which validator should really notice this? 

Ideally both, the markup validator saying "this is wrong" (but we know it can't look into such details), 
the CSS validator saying "I found style not declared as CSS, ignoring". 
Comment 2 Bj 2005-09-07 02:09:00 UTC
The Markup Validator, but that's not really the concern here, not finding the 
style sheet is incorrect since text/css must be assumes if no C-S-T is 
specified.
Comment 3 Olivier Thereaux 2007-07-17 06:09:35 UTC
I don't think that the presence or absence of Content-Style-Type has anything to do with the fact that the CSS validator is not finding the content of style="" attributes.

This page:
http://www.la-grange.net/2002/04/03-styleatt-w-meta.html

has 	<meta http-equiv="Content-Style-Type" content="text/css" />
and <p style="color: green; border: solid red;">
and yet the validator says "no stylesheet found".

I suspect the bug really is "the value of style attributes in HTML documents are not checked".
Comment 4 PatomaS 2007-08-20 10:45:42 UTC
Hi

Well there are few occasions where the rules are that clear as in http://www.w3.org/TR/html4/present/styles.html#h-14.2.1, so it really should be fixed.

I think there are three logical options:
1. You can make the validator start working as the rule says.
2. You keep the validator as it is working now, but add some kind of message about the right sintasx, at least a tip.
3. You change the rule.

Of course the easiest way is to keep things as they are now, but it is not the right way to do it.

Also it will be a good idea to notify software makers to comply with this recommendation, but, well, this is obviously hard and time consuming.

Bye
Comment 5 PatomaS 2007-08-20 10:49:07 UTC
I think the summary should be changed to something like:
Validator ignores error related to missing Content-Style-Type and the severity should be at least "major" since it is an obvious contradiction with the rule.