W3C home > Mailing lists > Public > public-css-testsuite@w3.org > March 2009

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

From: L. David Baron <dbaron@dbaron.org>
Date: Mon, 9 Mar 2009 17:58:40 -0700
To: Sylvain Galineau <sylvaing@microsoft.com>
Cc: "public-css-testsuite@w3.org" <public-css-testsuite@w3.org>
Message-ID: <20090310005840.GA11551@pickering.dbaron.org>
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 GMT

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