This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.

Bug 5622 - Selector with attribute test; whitespace before ] reported as invalid
Summary: Selector with attribute test; whitespace before ] reported as invalid
Status: RESOLVED FIXED
Alias: None
Product: CSSValidator
Classification: Unclassified
Component: CSS 2.1 (show other bugs)
Version: CSS Validator
Hardware: PC Windows NT
: P2 normal
Target Milestone: ---
Assignee: This bug has no owner yet - up for the taking
QA Contact: qa-dev tracking
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2008-04-03 20:30 UTC by CecilWard
Modified: 2009-02-18 07:05 UTC (History)
0 users

See Also:


Attachments

Description CecilWard 2008-04-03 20:30:24 UTC
The following CSS fragment is incorrectly reported as invalid. (under selected grammar=css2.1)

test case 1:

[attr=val ] {}


(note: whitespace before ] ).

Other tests with whitespace inserted in other possible positions show correct behaviour.


The following test cases all fail similarly

test case 2:

[attr~=val ] {}


test case 3:

[attr|=val ] {}

etc for other operators


====

Notes: This bug is confined to the (attr OP ident) cases. The case of (attr OP string) is not affected. (See test case 4 below.)



Suggest adding additional test cases:

test case 4:

[attr = "val" ] {}

test case 4 is correctly reported as valid.


--
test case 5:

[attr=val/**/] {}

test case 5 is correctly reported as valid.
--

test case 6:

[attr ] {}

(attribute existence test, whitespace before ]) test case 6 is correctly reported as valid.
Comment 1 Yves Lafon 2009-02-18 07:05:07 UTC
The grammar of attrib() was indeed wrong (in the validator), catching <S> only for <STRING> and not <IDENT>.
Fixed now on http://qa-dev.w3.org:8001/css-validator/