Errors in Acid3 test 46: media queries

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,
http://www.w3.org/TR/2002/CR-css3-mediaqueries-20020708/#syntax
says:
  # 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.
  --http://www.w3.org/TR/2002/CR-css3-mediaqueries-20020708/#media1

  # If the device is not a color device, the value will be 0.
  --http://www.w3.org/TR/2002/CR-css3-mediaqueries-20020708/#color

  # If the device is not a monochrome device, the output device
  # value will be 0.
  --http://www.w3.org/TR/2002/CR-css3-mediaqueries-20020708/#monochrome

  # 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.
  --http://www.w3.org/TR/2002/CR-css3-mediaqueries-20020708/#media0

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.

-David

-- 
L. David Baron                                 http://dbaron.org/
Mozilla Corporation                       http://www.mozilla.com/

Received on Thursday, 10 April 2008 04:59:39 UTC