Bug 186234 - Tag ID's can start with a number
Summary: Tag ID's can start with a number
Status: RESOLVED INVALID
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: Safari 11
Hardware: All All
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2018-06-02 06:56 PDT by Blake McBride
Modified: 2018-06-02 07:53 PDT (History)
1 user (show)

See Also:


Attachments
Shows the problem (372 bytes, text/html)
2018-06-02 06:56 PDT, Blake McBride
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Blake McBride 2018-06-02 06:56:59 PDT
Created attachment 341846 [details]
Shows the problem

Steps to reproduce:

Run the attached script.


Actual results:

Displayed:
AAA in red
AAA no color


Expected results:

AAA in red
AAA in blue

Safari doesn't work if a tag's ID is all numeric.  The current HTML spec states:  "IDs can consist of just digits, start with a digit, start with an underscore, consist of just punctuation, etc."

See:  https://www.w3.org/TR/html5/dom.html#element-attrdef-global-id
Comment 1 Blake McBride 2018-06-02 07:33:02 PDT
HTML specification is not applicable to CSS selectors. Per the CSS specification: an all-numeric id should be escaped, see https://www.w3.org/International/questions/qa-escapes#css_identifiers

However, if you change the CSS selector to #\222 it still doesn't work.
Comment 2 Blake McBride 2018-06-02 07:53:16 PDT
I now see that \2 is not a "2"...  It should be #\32 22 as you can see in the examples of CSS escaping linked above.