<?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>9463</bug_id>
          
          <creation_ts>2010-04-09 10:01:34 +0000</creation_ts>
          <short_desc>Parsing error of @media in CSS2 (should discard invalid statements and resume at the next one)</short_desc>
          <delta_ts>2011-10-31 14:34:47 +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>Parser</component>
          <version>CSS Validator</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc>http://jigsaw.w3.org/css-validator/validator?text=%40media+handheld%2C+only+screen+and+%28color%29+{+body+{+color%3Ablue%3B+}+}</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>media</keywords>
          <priority>P2</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Alexandre Alapetite">alexandre</reporter>
          <assigned_to name="This bug has no owner yet - up for the taking">dave.null</assigned_to>
          <cc>ylafon</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>34700</commentid>
    <comment_count>0</comment_count>
    <who name="Alexandre Alapetite">alexandre</who>
    <bug_when>2010-04-09 10:01:34 +0000</bug_when>
    <thetext>Hello,
This bug is a CSS2 parsing error, and has a little relation to CSS3 media-queries.

An @media rule specifies the target media types (separated by commas) of a set of statements (delimited by curly braces). Invalid statements must be ignored.
http://www.w3.org/TR/CSS21/media.html#at-media-rule

@media statement1, statement2, statement3 { ... }

Currently the CSS validator will wrongly discard the whole @media rule if one of the statements is invalid, for instance a statement like &quot;this is an error&quot; containing multiple spaces (side note: this is used by CSS3).

== Example ==

@media handheld, only screen and (color)
{
	body
	{
		color:blue;
	}
}

We know that the statement &quot;only screen and (color)&quot; is invalid in CSS2 and should be discarded, but the other statement &quot;handheld&quot; is valid in CSS2 and should be kept.

The CSS Validator returns:

1	unrecognized media only
1	Parse Error screen and (color) { body { color:blue; } } 
@media handheld

The modified CSS stylesheet returned by the validator is invalid, and does not contain the body of @media handheld { ... }

Please note that the example is taken from CSS3 to be relevant, but as far as CSS2 is concerned, it should work just like &quot;@media handheld, some invalid statement, another invalid statement { ... }&quot;.

== See also ==

CSS3 media-queries:
http://www.w3.org/TR/css3-mediaqueries/#error-handling

Best regards,
Alexandre
http://alexandre.alapetite.fr</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>59295</commentid>
    <comment_count>1</comment_count>
    <who name="Yves Lafon">ylafon</who>
    <bug_when>2011-10-31 14:34:47 +0000</bug_when>
    <thetext>From CSS2:
&lt;&lt;
@media and @import rules with unknown media types (that are nonetheless valid identifiers) are treated as if the unknown media types are not present. If an @media/@import rule contains a malformed media type (not an identifier) then the statement is invalid. 
&gt;&gt;
In that case, &apos;only screen and (color)&apos; is not a valid identifier.
However, the bug still stands for &apos;@media print, foo&apos; as erors should be reported but validation should continue.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>