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

On Monday 2009-03-09 17:47 -0700, Sylvain Galineau wrote:
> Shouldn't the statements below be reversed i.e.
> 
> p { color: green; }
> p, [1badAttr] { color: red; }

Correct.  (Oops.)

> 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.

-David

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

Received on Tuesday, 10 March 2009 00:59:26 UTC