<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://www.w3.org/Bugs/Public/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4"
          urlbase="https://www.w3.org/Bugs/Public/"
          
          maintainer="sysbot+bugzilla@w3.org"
>

    <bug>
          <bug_id>154</bug_id>
          
          <creation_ts>2003-02-27 16:38:36 +0000</creation_ts>
          <short_desc>Warn for floated elements without intrinsic width</short_desc>
          <delta_ts>2009-02-04 15:05:36 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>CSSValidator</product>
          <component>CSS 1.0</component>
          <version>CSS Validator</version>
          <rep_platform>Other</rep_platform>
          <op_sys>other</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P5</priority>
          <bug_severity>enhancement</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Philippe Le Hegaret">plh</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>ot</cc>
          
          <qa_contact name="qa-dev tracking">www-validator-cvs</qa_contact>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>372</commentid>
    <comment_count>0</comment_count>
    <who name="Philippe Le Hegaret">plh</who>
    <bug_when>2003-02-27 16:38:36 +0000</bug_when>
    <thetext>One thing you&apos;ll need to fix is that floated elements must have a width
&gt; declared:
&gt; 
&gt;     &lt;http://www.w3.org/TR/REC-CSS2/visuren.html#floats&gt;
&gt; 
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;
}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>15877</commentid>
    <comment_count>1</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2007-07-19 09:11:29 +0000</bug_when>
    <thetext>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&apos;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?
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23421</commentid>
    <comment_count>2</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2009-02-03 20:04:25 +0000</bug_when>
    <thetext>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 )</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23450</commentid>
    <comment_count>3</comment_count>
      <attachid>624</attachid>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2009-02-04 14:50:21 +0000</bug_when>
    <thetext>Created attachment 624
test case</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>23451</commentid>
    <comment_count>4</comment_count>
    <who name="Olivier Thereaux">ot</who>
    <bug_when>2009-02-04 15:05:36 +0000</bug_when>
    <thetext>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 &lt;p&gt; but not the &lt;img&gt; selector, which has intrinsic width.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>624</attachid>
            <date>2009-02-04 14:50:21 +0000</date>
            <delta_ts>2009-02-04 14:50:21 +0000</delta_ts>
            <desc>test case</desc>
            <filename>floatnowidth.css</filename>
            <type>text/css</type>
            <size>191</size>
            <attacher name="Olivier Thereaux">ot</attacher>
            
              <data encoding="base64">LyogZm9yIGZsb2F0ZWQgZWxlbWVudHMgd2l0aCBubyBpbnRyaW5zaWMgd2lkdGgsIGlzc3VlIGEg
d2FybmluZyBpZiBubyB3aWR0aCBpcyBnaXZlbiAqLwovKiB0aGlzIHN0eWxlc2hlZXQgc2hvdWxk
IHZhbGlkYXRlIHdpdGggb25lIHdhcm5pbmcgKi8KaW1nCnsKICBmbG9hdDogcmlnaHQ7Cn0KCnAK
ewogIGZsb2F0OiByaWdodDsKfQo=
</data>

          </attachment>
      

    </bug>

</bugzilla>