<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>186234</bug_id>
          
          <creation_ts>2018-06-02 06:56:59 -0700</creation_ts>
          <short_desc>Tag ID&apos;s can start with a number</short_desc>
          <delta_ts>2018-06-02 07:53:59 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>DOM</component>
          <version>Safari 11</version>
          <rep_platform>All</rep_platform>
          <op_sys>All</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>INVALID</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Blake McBride">blake1024</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>cdumez</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1429554</commentid>
    <comment_count>0</comment_count>
      <attachid>341846</attachid>
    <who name="Blake McBride">blake1024</who>
    <bug_when>2018-06-02 06:56:59 -0700</bug_when>
    <thetext>Created attachment 341846
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&apos;t work if a tag&apos;s ID is all numeric.  The current HTML spec states:  &quot;IDs can consist of just digits, start with a digit, start with an underscore, consist of just punctuation, etc.&quot;

See:  https://www.w3.org/TR/html5/dom.html#element-attrdef-global-id</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1429557</commentid>
    <comment_count>1</comment_count>
    <who name="Blake McBride">blake1024</who>
    <bug_when>2018-06-02 07:33:02 -0700</bug_when>
    <thetext>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&apos;t work.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1429559</commentid>
    <comment_count>2</comment_count>
    <who name="Blake McBride">blake1024</who>
    <bug_when>2018-06-02 07:53:16 -0700</bug_when>
    <thetext>I now see that \2 is not a &quot;2&quot;...  It should be #\32 22 as you can see in the examples of CSS escaping linked above.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>341846</attachid>
            <date>2018-06-02 06:56:59 -0700</date>
            <delta_ts>2018-06-02 06:56:59 -0700</delta_ts>
            <desc>Shows the problem</desc>
            <filename>test4.html</filename>
            <type>text/html</type>
            <size>372</size>
            <attacher name="Blake McBride">blake1024</attacher>
            
              <data encoding="base64">PCFET0NUWVBFIGh0bWw+CjxodG1sIGxhbmc9ImVuIj4KCjxoZWFkPgogIDxtZXRhIGNoYXJzZXQ9
IlVURi04Ij4KICA8bWV0YSBuYW1lPSJ2aWV3cG9ydCIgY29udGVudD0id2lkdGg9ZGV2aWNlLXdp
ZHRoLCBpbml0aWFsLXNjYWxlPTEsIHNocmluay10by1maXQ9bm8iPgogIDxzdHlsZT4KICAgICNh
YWEgewogICAgICAgIGJhY2tncm91bmQtY29sb3I6IHJlZDsKICAgIH0KICAgICMyMjIgewogICAg
ICAgIGJhY2tncm91bmQtY29sb3I6IGJsdWU7CiAgICB9CiAgPC9zdHlsZT4KCjwvaGVhZD4KPGJv
ZHk+CiAgCiAgPHNwYW4gaWQ9ImFhYSI+QUFBPC9zcGFuPgogIDxicj4KICA8c3BhbiBpZD0iMjIy
Ij5BQUE8L3NwYW4+Cgo8L2JvZHk+CjwvaHRtbD4K
</data>

          </attachment>
      

    </bug>

</bugzilla>