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
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.
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.