RE: attribute-value-selector-004.xht not well formed

> From: L. David Baron [mailto:dbaron@dbaron.org]
> > However, the only way to verify that the red rule is not applied
> > to [1badAttr] is to have markup with that attribute in the page.
> > We can certainly assume that if color:red not applied to p then
> > it's not applied to [1badAttr] i.e. that the user agent handles
> > selector error recovery properly for all the selectors in the
> > group. The original testcase does not make that assumption. It may
> > be conservative but it would also reveal a bad bug that the
> > alternative wouldn't.
> 
> But we really want to test that the entire rule is dropped at the
> CSS level, since that's what the spec requires.  So that's a
> stronger test than testing that just the one selector doesn't match.
> The thing we're trying to test here is that the selector is treated
> as invalid CSS syntax, not that it doesn't match a certain thing.
> 
> Testing with invalid markup can also pose complications when the
> user agents "fix" the invalid markup in various ways.


Point well taken on fix-ups. However, we are talking here about an attribute. I agree with your main point i.e. we want to test that the entire rule is dropped. The best way to do that would be to use :

<p 1badAttr="">This should be green</p>

At which point we know the entire rule was dropped. Your proposal assumes that if p is not red then the other selector in the statement was also dropped. In other words, that the user agent's error handling is valid. But isn't that what we're trying to test ?

Received on Tuesday, 10 March 2009 02:44:27 UTC