W3C home > Mailing lists > Public > public-css-testsuite@w3.org > December 2008

Re: CSS Namespaces Module Test Suite

From: Anne van Kesteren <annevk@opera.com>
Date: Mon, 29 Dec 2008 16:24:21 +0100
To: fantasai <fantasai.lists@inkedblade.net>
Cc: public-css-testsuite@w3.org
Message-ID: <op.umxjplo164w2qv@annevk-t60.oslo.opera.com>

On Mon, 13 Oct 2008 13:53:16 +0200, fantasai
<fantasai.lists@inkedblade.net> wrote:
> Thanks, Anne. Here are my comments:

Thank you:

   http://dev.w3.org/CSS/css3-namespace-test-suite/


> s/line/sentence/g;

Done.


> Also, you need to add
>    - tests that introduce various whitespace and comment patterns

Done (basic tests, syntax-012.xml).


>    - tests for parsing failures within the @namespace rule (to make
>      sure the failure is detected, causes the rule to be ignored, and
>      doesn't affect anything outside the scope of the "ignore" behavior
>      for @rules).

Done (syntax-013.xml, one test requires scripting). (Actually managed to  
find a bug here in at least Opera and Firefox. The @namespace rule in the  
style sheet '@namespace x "test' gets dropped rather than fixed up per the  
rules in CSS 2.1 section 4.2.)


>    - tests for @namespace followed by an invalid @rule (both invalid
>      rules with known @keywords and rules with unknown @keywords)

Done (syntax-014.xml).


> http://dev.w3.org/CSS/css3-namespace-test-suite/src/prefix-001.xml
>
>    - Swap the order of the namespace declarations so that "x" wins
>      in case the UA is mapping both declarations to the same prefix.
>      (In this case neither background color will appear. Or you could
>      add a test
>        { background: red }
>      rule to make it red in such a case.)
>    - Add a rule
>        FOO|test { background: red; }
>      which tests an unbound prefix with the same case-insensitive
>      mapping as the correct bound prefix.

Done.


> http://dev.w3.org/CSS/css3-namespace-test-suite/src/prefix-002.xml
> http://dev.w3.org/CSS/css3-namespace-test-suite/src/prefix-003.xml
>
>    - These two have the same title. Please add something to the title
>      to distinguish the two tests for when they are indexed in a TOC.

Done.


> http://dev.w3.org/CSS/css3-namespace-test-suite/src/prefix-005.xml
>
>    - Put a rel="author" line for bz instead of a comment.
>    - I don't think "empty string default namespace" is an appropriate
>      title here. It's also a duplicate of the previous title. Please
>      choose something appropriately unique and descriptive.

Done.


> http://dev.w3.org/CSS/css3-namespace-test-suite/src/scope-001.xml
>
>    - I would title this 'scope <style>' to be more precise

Done.


> http://dev.w3.org/CSS/css3-namespace-test-suite/src/scope-002.xml
>
>    - Shift the test { background: lime } up into a separate <style>
>    - Add an @namespace w declaration to the <style> with the @import
>      and a
>        w|test { background:red}
>      rule to the scope.css style sheet
>    - Add another @import with another external style sheet and add
>      y and z declarations/selectors to test crossing sibling @imports.

Done, except that I did not add a z declaration/selector because that
seemed unnecessary.


> http://dev.w3.org/CSS/css3-namespace-test-suite/src/syntax-001.xml
>
>    - This should perhaps be @namespace "string".

Named it case-insensitivity instead.


>    - You also should have corresponding tests with 'string' and url().
>      For url() syntax you need to test all three of double-quoted,
>      single-quoted, and unquoted url() syntax.

Done. The new tests are now in syntax-005.xml.


> http://dev.w3.org/CSS/css3-namespace-test-suite/src/syntax-002.xml
>
>    - Add a backslash before the 'p' and the 'N' in @NAmespace.
>    - Unicode-escape the A with six digits plus a space.

Done.


> http://dev.w3.org/CSS/css3-namespace-test-suite/src/syntax-003.xml
>
>    - The title should mention that this is a default namespace
>      declaration.
>    - Add corresponding tests with 'string' and "string".

Done, also added url() and url('').


> http://dev.w3.org/CSS/css3-namespace-test-suite/src/syntax-005.xml
> http://dev.w3.org/CSS/css3-namespace-test-suite/src/syntax-006.xml
>
>    - Apart from the escaped r, it seems -006 is merely a more complex
>      form of -005, i.e. aside from the escape -005's test is a subset
>      of -006. Was that the intent, or am I missing something here?
>      Because if so, I would suggest removing -005, it doesn't seem
>      necessary.

-005 is now a new test.


> http://dev.w3.org/CSS/css3-namespace-test-suite/src/syntax-007.xml
>
>    - This test is effectively the same as one with the @charset rule
>      replaced by @foo;, because @charset is not valid there. You need
>      to rewrite this test to use an external style sheet and place
>      the @charset rule at the start of the style sheet.

Done.


> http://dev.w3.org/CSS/css3-namespace-test-suite/src/syntax-008.xml
>
>    - You should also test prefixes that start with an escaped
>      character that is not otherwise allowed in an identifier.
>    - You need to test escapes in both the @namespace declaration
>      and in the selector (but the escaping should not match).
>    - I'd mention escaping in the title since that's mainly what's
>      being tested here.

Done.


On Mon, 13 Oct 2008 14:34:43 +0200, fantasai
<fantasai.lists@inkedblade.net> wrote:
> Other tests needed:
>
>    "A URI string parsed from the URI syntax must be treated as a
>     literal string: as with the STRING syntax, no URI-specific
>     normalization is applied."
>
>    So a couple good tests here would be
>      - comparing http://... in the source with HTTP://..., in the style
>        sheet
>      - comparing .com in the source with .COM in the style sheet
>      - comparing a straight URL with one that has URI (%) escapes in it
>

Done (syntax-011.xml).


>    "All strings—including the empty string and strings representing
>     invalid URIs—are valid namespace names in @namespace declarations."
>
>    This can't be tested by matching because XML namespaces must be URIs,
>    but it can be tested by not-matching: overwriting a matching  
> @namespace
>    declaration with a non-matching one that has invalid URI characters
>    in it (like "<>" or something).

The XML specification seems rather vague on whether that is an authoring
or user agent requirement. Seems like a bug in XML. (I think user agents
accept any string as namespace from some adhoc testing which meets my
expectations.)


>    "If a namespace prefix or default namespace is declared more than
>    once only the last declaration shall be used."
>
>    Multiple declarations probably deserves its own explicit test.

Done (syntax-010.xml).


>    "The prefix of a qualified name may be omitted to indicate that the
>    name belongs to no namespace, i.e. that the namespace name part of
>    the expanded name has no value."
>
>    Need a test for this one as well.

Done (prefix-006.xml).


>    "To form a qualified name in CSS syntax, a namespace prefix that
>    has been declared within scope is prepended to a local name (such
>    as an element or attribute name), separated by a "vertical bar"
>    (|, U+007C)."
>
>    Should have a test that makes sure an escaped | is not recognized
>    as the namespace prefix separator.

Done (syntax-009.xml).


-- 
Anne van Kesteren
<http://annevankesteren.nl/>
<http://www.opera.com/>
Received on Monday, 29 December 2008 15:25:19 GMT

This archive was generated by hypermail 2.2.0+W3C-0.50 : Monday, 20 September 2010 17:51:57 GMT