Re: [CSSWG] Release Candidate for CSS Namespaces Test Suite

I'll look into this in more detail at some later point, but some thoughts  
below for now.

On Tue, 29 Sep 2009 03:42:13 +0200, Leif Halvard Silli  
<xn--mlform-iua@målform.no> wrote:
> selector of the following rules gets ignored (since Firefox/Opera think  
> the preceding selector is invalid):
>
>   *|[foo], bar{} *|.foo, bar{} *|#foo, bar{} *|:first-child, bar{}
>
>   Webkit and Chrome do not have the same error.

It's not an error.


> 3. Class selector tests are missing
>    CSS 2.1 says [http://w3.org/TR/CSS21/selector#class-html]:
>
>   "UAs may apply selectors using the period (.) notation in XML  
> documents if the UA has namespace specific knowledge that allows it to  
> determine which attribute is the "class" attribute for the respective  
> namespace."
>
>   With the advent of SVG in HTML 5, I suppose test cases for .class  
> selectors would be welcome.

This has nothing to do with the @namespace construct.


> 4. @namespace syntax erros
>
>   The @namespace error handling test  
> [http://w3.org/Style/CSS/Test/CSS3/Namespace/current/syntax-013] only  
> tests for error /after/ "@namespace". I discovered that Webkit seemed to  
> accept this:  "*@namespace". Hence I propose adding a test that makes  
> sure UAs ignore such and similar rules.

That makes sense.


> 5. The XMLNS namespace, is it necessary to declare it?

Yes. There's nothing in the CSS namespaces draft that suggests it is  
special. CSS namespaces are independent of XML namespaces.


> 6. The XML namespace, is it necessary to declare it via @namespace?

Yes.


> 7. Testing whether UAs invalidate the entire rule if it contains  
> undeclared prefixes
>
>    According to Selectors Level 3,  a type selector, a universal  
> selector or an attribute selector with an undeclared namespace prefix,  
> becomes an invalid selector. And thus, even if there are other, correct  
> selectors in the same rule, the entire rule must be treated as invalid.  
> Example:
>
>     undeclaredNS|*, element{/*the entire rule gets ignored*/}
>
>   However, the test suite does not contain any tests which checks  
> whether UAs _do_ invalidate the entire style rule. And, as a matter of  
> fact, I discovered that Webkit - which I at first thought had better CSS  
> namespace support than Firefox and Opera - does not invalidate such  
> rules ... Se my test pages - point 8.

We should add this, agreed.


> 8. My own tests: Selector validity test
>
>   I have created an XHTML page – and a text/html "representation" of the  
> same page – that solely and only tests what namespace selectors UAs  
> consider as valid - the test are the basis for most of what I've said in  
> this e-mail:
>
>     http://m%E5lform.no/testing/css-namespaces-html
>     http://m%E5lform.no/testing/css-namespaces-xhtml

You mean

   http://m%C3%A5lform.no/testing/css-namespaces-html
   http://m%C3%A5lform.no/testing/css-namespaces-xhtml

It would be nice if they could be made more in the style of the current  
test suite. In addition, the errors pointed out need to be fixed.


> 9. text/html namespace tests!

Since HTML5 is far away and it is not strictly needed I'd rather avoid  
testing this for now and assume it will work down the road given that the  
DOM model is identical.


> 10. Positive tests.
>
>   I also suggest that the test suite is updated with more "positive"  
> tests that are related to actual and common use cases, such SVG, XML,  
> RDFa etc. The suite is currently dominated by many edge cases now, I  
> think. Had the tests been more geared towards testing the W3 registered  
> namespaces, then I believe that, for instance, the XMLNS namespace issue  
> and the XML namespace issue that I describe in point 6 and 7 above,  
> would have been discovered.

They are not considered issues. (Though the inconsistencies in  
implementations are.) Feel free to contribute "positive" tests.


> 11. I offer my own test page to the test suite.

Cool, can you make them more like the existing tests?


> [1] http://www.w3.org/Style/CSS/Test/CSS3/Namespace/current/
> [2] http://lists.w3.org/Archives/Public/public-css-testsuite/2009Feb/0016


-- 
Anne van Kesteren
http://annevankesteren.nl/

Received on Tuesday, 29 September 2009 12:51:24 UTC