W3C home > Mailing lists > Public > www-archive@w3.org > April 2008

Errors in Acid3 test 46: media queries

From: L. David Baron <dbaron@dbaron.org>
Date: Wed, 9 Apr 2008 21:58:55 -0700
To: acid3feedback@webstandards.org
Cc: www-archive@w3.org
Message-ID: <20080410045855.GA27979@ridley.dbaron.org>

I have found what I believe are a number of errors in test 46 of
Acid3 ( http://acid3.acidtests.org/ ).

For four of the five errors, the issue is that the tests are correct
error handling tests for the 2002 candidate recommendation, but the
syntax used has become valid in the 2007 candidate recommendation,
and thus any implementation implementing the newer specification
will fail the tests.  In particular,
  # media_query: [only | not]? <media_type> [ and <expression> ]*
but http://www.w3.org/TR/css3-mediaqueries/#syntax has changed to
allow the media type to be omitted:
  # media_query: [[only | not]? <media_type> [ and <expression> ]*] 
  #  | <expression> [ and <expression> ]*
This means that tests (h), (l), (u) and (v) should fail in any
implementation implementing the newer specification.  These tests
are, in particular:
  #       style.appendChild(doc.createTextNode('@media (bogus), all { #h { text-transform: uppercase; } }'));
  #       style.appendChild(doc.createTextNode('@media all, (bogus) { #l { text-transform: uppercase; } }'));
  #       style.appendChild(doc.createTextNode('@media (min-color: 0) and (min-monochrome: 0) { #u { text-transform: uppercase; } }'));
  #       style.appendChild(doc.createTextNode('@media (min-color: 0), (min-monochrome: 0) { #v { text-transform: uppercase; } }'));
Given the Acid3 test's goal of testing specifications of a certain
age, I suggest removing the tests (thus allowing implementations to
implement the newer specification and still pass Acid3).  (Other
tests already there test related issues that did not change between
those versions of the specification.)

The fifth error is that I believe test (x):
  #       style.appendChild(doc.createTextNode('@media not all and (min-color: 0), not all and (min-monochrome: 0) { #x { text-transform: uppercase; } }')); // matches
is incorrect according to both versions of the specification, and
that Acid3 should in fact test that this rule does NOT match.  To
support this claim, I point to the following statements of the 2002
Candidate Recommendation (all of which remain, at least in
equivalent form, in the 2007 CR):

  # Most media features accept optional "min-" or "max-" prefixes to
  # express "greater or equal to" and "smaller or equal to"
  # constraints.

  # If the device is not a color device, the value will be 0.

  # If the device is not a monochrome device, the output device
  # value will be 0.

  # The presence of the keyword "not" at the beginning of the query
  # will negate the result. I.e., if the Media Query had been true
  # without the "not" keyword it will become false, and vice versa.

Together, these statements imply that one of the color and
monochrome features should have a value of 0, and the other should
have a value greater than zero (which is tested elsewhere, e.g., by
test (w)).  This means that both features should have a value
greater than or equal to zero, which means (min-color: 0) and
(min-monochrome: 0) are expressions that should *always be true* for
visual display types.  Given the definition of not, the rule with
selector #x should never be applied.  I think Acid3 should test this
(given how extensively it is already testing these two particular
media features).  This would mean that any implementations that
currently pass Acid3 would fail a fixed Acid3.


L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/
Received on Thursday, 10 April 2008 04:59:39 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wednesday, 7 November 2012 14:18:13 GMT