Dojo.query does not recognise escaped colon characters for CSS selector
Reported by: |
guest |
Owned by: |
alex |
Priority:
|
high
|
Milestone:
|
|
Component:
|
Query
|
Version:
|
0.9
|
Keywords:
|
|
Cc:
|
|
Blocked By:
|
|
Blocking:
|
|
CSS 3 spec insists that ids and other names containing colons may be specified by using : to represent a literal colon character within the name - this is not supported by the dojo query parser, which everywhere detects colon characters for the pseudo-element selector literally by simply looking for index of ":".
http://www.w3.org/TR/css3-selectors/#downlevel
For example, the following selector #gallery:::gallery-thumbs::: should detect an element with an id of gallery:::gallery-thumbs::: but it does not.
The escaped usage *does* seem to be supported by the browsers I investigated - for example a CSS rule of #my:id {color: green} sucessfully applied to <h3 id="my:id">My heading</h3>. IDs containing colons are very frequently generated in the rendered markup from various server-side frameworks such as JSF and RSF.
Change History (6)
Owner: |
changed from anonymous to alex
|
Component: |
General →
Core
|
Resolution: |
→ fixed
|
Status: |
new →
closed
|
this is mildly problematic given that the selectors need to be represented as JS strings, so any backslash is going to be double-backslashed in order to represent the selector accurately. e.g., this:
#my:id
is represented in a dojo.query call as:dojo.query("#my\:id")
meaning that what you see isn't what you get. As a result, I'm not sure we should fix this bug. What does everyone else think?