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

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>98303</bug_id>
          
          <creation_ts>2012-10-03 14:36:16 -0700</creation_ts>
          <short_desc>Parsing of media queries: &apos;all and(color)&apos; should be invalid</short_desc>
          <delta_ts>2022-07-13 11:10:14 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc>http://dabblet.com/gist/3829879</bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Simon Sapin">simon-webkit</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>bfulgham</cc>
    
    <cc>karl+webkit</cc>
    
    <cc>simon-webkit</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>734047</commentid>
    <comment_count>0</comment_count>
    <who name="Simon Sapin">simon-webkit</who>
    <bug_when>2012-10-03 14:36:16 -0700</bug_when>
    <thetext>Example 20 of the Media Queries gives this invalid media query:

   @media all and(color) { … }

The lack of space in &apos;and(&apos; makes it tokenize as a FUNCTION, and thus the query should parse as invalid.

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

A test case:

    /* The body should not be red */
    @media all and(color) { body { background: red } }

Or see it in action: http://dabblet.com/gist/3829879

I have this bug in Chromium 22 on Archlinux x86_64, but smfr just confirmed on IRC that it had been fixed in Safari 6.0.1 but regressed in the current trunk.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>734049</commentid>
    <comment_count>1</comment_count>
    <who name="Simon Sapin">simon-webkit</who>
    <bug_when>2012-10-03 14:43:01 -0700</bug_when>
    <thetext>If the User-Agent string is to be trusted, my Chromium build uses WebKit 537.4.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>734060</commentid>
    <comment_count>2</comment_count>
      <attachid>166964</attachid>
    <who name="Simon Sapin">simon-webkit</who>
    <bug_when>2012-10-03 14:55:06 -0700</bug_when>
    <thetext>Created attachment 166964
Require some whitespace after &apos;and&apos; in a media query.

Sorry, untested patch. (I have yet to manage a build.) Other files might need to be changed, but this looks like the right area of the code.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>734127</commentid>
    <comment_count>3</comment_count>
    <who name="Simon Sapin">simon-webkit</who>
    <bug_when>2012-10-03 15:59:18 -0700</bug_when>
    <thetext>The patch is wrong, white space is not actually required. This is valid: &quot;all and/*wooo!*/(color)&quot;.
http://lists.w3.org/Archives/Public/www-style/2012Oct/0099.html</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1019269</commentid>
    <comment_count>4</comment_count>
    <who name="karl">karl+webkit</who>
    <bug_when>2014-06-29 19:28:24 -0700</bug_when>
    <thetext>David Baron in 
https://bugzilla.mozilla.org/show_bug.cgi?id=1031966#c7

&gt; The CSSWG has had multiple extensive discussions 
&gt; of this issue; in the last one we actually resolved 
&gt; to require the whitespace (i.e., disallow &quot;and/**/(&quot;):
&gt; 
&gt; http://lists.w3.org/Archives/Public/www-style/2013Jul/0082.html

And in 

&gt; MQ4 says, in http://dev.w3.org/csswg/mediaqueries/#mq-syntax :
&gt; 
&gt; Whitespace must be present between a &apos;)&apos; character and 
&gt; a not, and, or or keyword, and between a not, and, or 
&gt; or keyword and a &apos;(&apos; character.

The parsing of &quot;and(&quot; fails in Opera (blink), IE11, Chrome, and Firefox.
Safari (to the best of my knowledge is the only one to parse it).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1019271</commentid>
    <comment_count>5</comment_count>
    <who name="karl">karl+webkit</who>
    <bug_when>2014-06-29 19:43:51 -0700</bug_when>
    <thetext>Related to this bug https://bugs.webkit.org/show_bug.cgi?id=45017</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1883196</commentid>
    <comment_count>6</comment_count>
    <who name="Brent Fulgham">bfulgham</who>
    <bug_when>2022-07-13 11:10:14 -0700</bug_when>
    <thetext>Safari, Chrome, and Firefox all agree on rendering for this test case. I don&apos;t believe there is any remaining compatibility issue.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>166964</attachid>
            <date>2012-10-03 14:55:06 -0700</date>
            <delta_ts>2012-10-03 14:55:06 -0700</delta_ts>
            <desc>Require some whitespace after &apos;and&apos; in a media query.</desc>
            <filename>media_query_and_whitespace.patch</filename>
            <type>text/plain</type>
            <size>863</size>
            <attacher name="Simon Sapin">simon-webkit</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL1NvdXJjZS9XZWJDb3JlL2Nzcy9DU1NHcmFtbWFyLnkgYi9Tb3VyY2UvV2Vi
Q29yZS9jc3MvQ1NTR3JhbW1hci55CmluZGV4IDJiNDI3NGEuLmMzNTE0MGEgMTAwNjQ0Ci0tLSBh
L1NvdXJjZS9XZWJDb3JlL2Nzcy9DU1NHcmFtbWFyLnkKKysrIGIvU291cmNlL1dlYkNvcmUvY3Nz
L0NTU0dyYW1tYXIueQpAQCAtNTQ1LDcgKzU0NSw3IEBAIG1lZGlhX3F1ZXJ5X2V4cF9saXN0Ogog
ICAgICAgICAkJCA9IHBhcnNlci0+Y3JlYXRlRmxvYXRpbmdNZWRpYVF1ZXJ5RXhwTGlzdCgpOwog
ICAgICAgICAkJC0+YXBwZW5kKHBhcnNlci0+c2lua0Zsb2F0aW5nTWVkaWFRdW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