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 17511 - Add comment to clarify simple_selector production in G.1
Summary: Add comment to clarify simple_selector production in G.1
Status: NEW
Alias: None
Product: CSS
Classification: Unclassified
Component: CSS Level 2 (show other bugs)
Version: unspecified
Hardware: All Windows 3.1
: P2 normal
Target Milestone: ---
Assignee: Bert Bos
QA Contact: public-css-bugzilla
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-06-16 12:22 UTC by Anton P
Modified: 2012-12-04 00:51 UTC (History)
0 users

See Also:


Attachments

Description Anton P 2012-06-16 12:22:29 UTC
Reported by Kang-Hao (Kenny) Lu

G.1 defines the simple_selector production as follows:

  # simple_selector
  #   : element_name [ HASH | class | attrib | pseudo ]*
  #   | [ HASH | class | attrib | pseudo ]+
  #   ;

This fails to alert the reader to the fact that the ID selector has constraints.  This is in contrast to

  # /*
  #  * There is a constraint on the color that it must
  #  * have either 3 or 6 hex-digits (i.e., [0-9a-fA-F])
  #  * after the "#"; e.g., "#000" is OK, but "#abcd" is not.
  #  */
  # hexcolor
  #   : HASH S*
  #   ;

where contraints are noted.


Conversation begins:
Bug description:
http://lists.w3.org/Archives/Public/www-style/2012May/0770.html
Comment 1 Anton P 2012-06-16 12:25:25 UTC
Kang-Hao (Kenny) Lu proposes adding a comment as follows:

  | /*
  |  * There is a constraint on the ID selector that the part after
  |  * "#" should match an IDENT; e.g., "#abc" is OK, but "#1st" is not.
  |  */
  | simple_selector
  | [...]

http://lists.w3.org/Archives/Public/www-style/2012May/0770.html

Tab Atkins Jr. agrees, provided that it's web-compatible; else he proposes changing the validity of ID selectors to match UA behaviour.

http://lists.w3.org/Archives/Public/www-style/2012May/0873.html