This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
One thing you'll need to fix is that floated elements must have a width > declared: > > <http://www.w3.org/TR/REC-CSS2/visuren.html#floats> > elements with intrinsic width include: html, img, input, textarea, select, and object. so the following should NOT create a warning: img { float: right; } for non-replaced elements (i.e. elements with no intrinsic width), could we please issue a warning if no width is given? for example, the following paragraph rule set SHOULD create a missing width warning: p { float: right; }
Related discussion: http://lists.w3.org/Archives/Public/www-validator-css/2007Jul/0016.html «The problem I see is that the css validator is not tied to HTML. How do we know if img is the html's img tag or something else? We could issue warnings only if we know that a CSS is linked from an HTML document» Fair question, although we do know that the main usage of CSS is to style HTML and SVG, and that could remain a decent assumption. Do we still have a list of html elements?
I somewhat miraculously managed to add the warning for the general case, but have not yet found how/where I can determine which element selector is applicable. Any pointer? For reference, the code is in http://dev.w3.org/cvsweb/2002/css-validator/org/w3c/css/properties/css1/Css1Style.java (look for findConflicts )
Created attachment 624 [details] test case
http://lists.w3.org/Archives/Public/www-validator-cvs/2009Feb/0050.html seems to have done the trick - the test case validates with a single warning for the <p> but not the <img> selector, which has intrinsic width.