<?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>16796</bug_id>
          
          <creation_ts>2008-01-09 00:16:25 -0800</creation_ts>
          <short_desc>Acid3 failure due to media queries</short_desc>
          <delta_ts>2008-01-14 01:01:12 -0800</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>Mac</rep_platform>
          <op_sys>OS X 10.4</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Eric Seidel (no email)">eric</reporter>
          <assigned_to name="Eric Seidel (no email)">eric</assigned_to>
          <cc>ian</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>66639</commentid>
    <comment_count>0</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-09 00:16:25 -0800</bug_when>
    <thetext>Test 46: FAIL (expected none, got: uppercase - case e failed)

    function () {
      // test 46: media queries
      var doc = getTestDocument();
      var style = doc.createElement(&apos;style&apos;);
      style.setAttribute(&apos;type&apos;, &apos;text/css&apos;);
      style.appendChild(doc.createTextNode(&apos;@media all and (min-color: 0) { #a { text-transform: uppercase; } }&apos;));                         // matches
      style.appendChild(doc.createTextNode(&apos;@media not all and (min-color: 0) { #b { text-transform: uppercase; } }&apos;));
      style.appendChild(doc.createTextNode(&apos;@media only all and (min-color: 0) { #c { text-transform: uppercase; } }&apos;));                    // matches
      style.appendChild(doc.createTextNode(&apos;@media all and (bogus) { #d { text-transform: uppercase; } }&apos;));
      style.appendChild(doc.createTextNode(&apos;@media not all and (bogus) { #e { text-transform: uppercase; } }&apos;));
      style.appendChild(doc.createTextNode(&apos;@media only all and (bogus) { #f { text-transform: uppercase; } }&apos;));
      style.appendChild(doc.createTextNode(&apos;@media all and color { #g { text-transform: uppercase; } }&apos;));
      style.appendChild(doc.createTextNode(&apos;@media all and min-color: 0 { #h { text-transform: uppercase; } }&apos;));
      style.appendChild(doc.createTextNode(&apos;@media all, all and color { #i { text-transform: uppercase; } }&apos;));                             // matches
      style.appendChild(doc.createTextNode(&apos;@media all, all and min-color: 0 { #j { text-transform: uppercase; } }&apos;));                      // matches
      style.appendChild(doc.createTextNode(&apos;@media all and min-color: 0, all { #k { text-transform: uppercase; } }&apos;));                      // matches
      style.appendChild(doc.createTextNode(&apos;@media (min-color: 0) and (min-monochrome: 0) { #l { text-transform: uppercase; } }&apos;));         // matches
      // the next four assume that the window is bigger than 1em by 1em at the time the test is run
      style.appendChild(doc.createTextNode(&apos;@media all and (min-height: 1em) and (min-width: 1em) { #m { text-transform: uppercase; } }&apos;)); // matches
      style.appendChild(doc.createTextNode(&apos;@media all and (max-height: 1em) and (min-width: 1em) { #n { text-transform: uppercase; } }&apos;));
      style.appendChild(doc.createTextNode(&apos;@media all and (min-height: 1em) and (max-width: 1em) { #o { text-transform: uppercase; } }&apos;));
      style.appendChild(doc.createTextNode(&apos;@media all and (max-height: 1em) and (max-width: 1em) { #p { text-transform: uppercase; } }&apos;));
      doc.getElementsByTagName(&apos;head&apos;)[0].appendChild(style);
      var names = [&apos;a&apos;, &apos;b&apos;, &apos;c&apos;, &apos;d&apos;, &apos;e&apos;, &apos;f&apos;, &apos;g&apos;, &apos;h&apos;, &apos;i&apos;, &apos;j&apos;, &apos;k&apos;, &apos;l&apos;, &apos;m&apos;, &apos;n&apos;, &apos;o&apos;, &apos;p&apos;];
      for (var i in names) {
        var p = doc.createElement(&apos;p&apos;);
        p.id = names[i];
        doc.body.appendChild(p);
      }
      var check = function (c, e) {
        var p = doc.getElementById(c);
        assertEquals(doc.defaultView.getComputedStyle(p, &apos;&apos;).textTransform, e ? &apos;uppercase&apos; : &apos;none&apos;, &quot;case &quot; + c + &quot; failed&quot;);
      }
      check(&apos;a&apos;, true);
      check(&apos;b&apos;, false);
      check(&apos;c&apos;, true);
      check(&apos;d&apos;, false);
      check(&apos;e&apos;, false);
      check(&apos;f&apos;, false);
      check(&apos;g&apos;, false);
      check(&apos;h&apos;, false);
      check(&apos;i&apos;, true);
      check(&apos;j&apos;, true);
      check(&apos;k&apos;, true);
      check(&apos;l&apos;, true);
      check(&apos;m&apos;, true);
      check(&apos;n&apos;, false);
      check(&apos;o&apos;, false);
      check(&apos;p&apos;, false);
      return 3;
    },</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66845</commentid>
    <comment_count>1</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-10 16:52:39 -0800</bug_when>
    <thetext>Looking at this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66857</commentid>
    <comment_count>2</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-10 18:56:51 -0800</bug_when>
    <thetext>It looks like these ones are all invalid CSS:
style.appendChild(doc.createTextNode(&apos;@media all, all and color { #i { text-transform: uppercase; } }&apos;));                             // matches
style.appendChild(doc.createTextNode(&apos;@media all, all and min-color: 0 { #j { text-transform: uppercase; } }&apos;));                      // matches
style.appendChild(doc.createTextNode(&apos;@media all and min-color: 0, all { #k { text-transform: uppercase; } }&apos;));                      // matches

They&apos;re missing (), when changed to:

style.appendChild(doc.createTextNode(&apos;@media all, all and (color) { #i { text-transform: uppercase; } }&apos;));                             // matches
style.appendChild(doc.createTextNode(&apos;@media all, all and (min-color: 0) { #j { text-transform: uppercase; } }&apos;));                      // matches
style.appendChild(doc.createTextNode(&apos;@media all and (min-color: 0), all { #k { text-transform: uppercase; } }&apos;));                      // matches

They work in Safari.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66860</commentid>
    <comment_count>3</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-10 19:21:03 -0800</bug_when>
    <thetext>Looks like test &apos;e&apos; is also wrong:

The comma expresses a logical OR, while the &quot;and&quot; keyword expresses a logical AND. There is also a logical NOT in the syntax:
&lt;link rel=&quot;stylesheet&quot; media=&quot;not screen and (color)&quot; 
  href=&quot;http://www.example.com/color&quot; /&gt;
The presence of the keyword &quot;not&quot; at the beginning of the query will negate the result. I.e., if the Media Query had been true without the &quot;not&quot; keyword it will become false, and vice versa. User agents that only support media types (as described in HTML4) will not recognize the &quot;not&quot; keyword and the associated style sheet is therefore not applied.

Thus the &apos;not&apos; at the beginning of the query applies to the whole query result.  all (true) and bogus (false) == false (not)-&gt; true.  Thus &apos;e&apos; should match.
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66861</commentid>
    <comment_count>4</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-10 19:22:40 -0800</bug_when>
    <thetext>The last failure is due to bug 16832.  I&apos;ll see if I can&apos;t fix bug 16832 while we wait for Ian&apos;s reply. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66864</commentid>
    <comment_count>5</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-10 19:48:49 -0800</bug_when>
    <thetext>And the last one falls...

Looks like:
style.appendChild(doc.createTextNode(&apos;@media (min-color: 0) and (min-monochrome: 0) { #l { text-transform: uppercase; } }&apos;));         // matches

is an invalid test too.  According to the spec:

The &quot;monochrome&quot; media feature describes the number of bits per pixel in a monochrome frame buffer. If the device is not a monochrome device, the output device value will be 0. For example, here are two ways to express that a style sheet applies to all monochrome devices:
@media all and (monochrome) { ... }
@media all and (min-monochrome: 1) { ... }
For example, express that a style sheet applies to monochrome devices with more than 2 bits per pixels:
@media all and (min-monochrome: 2) { ... }


I would interpret &quot;min-monochrome: 0&quot; to mean &quot;a monochrome device with at least 0 bits of color data per pixel&quot;.  Since a device should never be both color and monochrome, the query will always be false.

Thus, I think we can close this bug as INVALID, since I now believe each case was actually an error in the Acid3 test.  I&apos;m certain there are issues with our @media support, but these are not they. :)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>66866</commentid>
    <comment_count>6</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2008-01-10 20:06:27 -0800</bug_when>
    <thetext>My interpretation was that syntax errors would just cause that part of the media query to be ignored, and not the rest of it. I&apos;ll investigate further.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67091</commentid>
    <comment_count>7</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2008-01-12 22:35:46 -0800</bug_when>
    <thetext>I have investigated further and fixed the test. There are now 26 subsubtests in that subtest of the test.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>67195</commentid>
    <comment_count>8</comment_count>
    <who name="Eric Seidel (no email)">eric</who>
    <bug_when>2008-01-14 01:01:12 -0800</bug_when>
    <thetext>After a few more rounds of back and forth, the test was fixed and WebKit now passes the @media subtest w/ no code changes! :)</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>