<?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>81752</bug_id>
          
          <creation_ts>2012-03-21 03:36:08 -0700</creation_ts>
          <short_desc>Selectors should be ASCII case-insensitive in HTML</short_desc>
          <delta_ts>2022-07-24 13:43:01 -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>CSS</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          
          <bug_file_loc>http://software.hixie.ch/utilities/js/live-dom-viewer/saved/1307</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="Anne van Kesteren">annevk</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ahmad.saleem792</cc>
    
    <cc>ap</cc>
    
    <cc>bfulgham</cc>
    
    <cc>ian</cc>
    
    <cc>Ms2ger</cc>
    
    <cc>rniwa</cc>
    
    <cc>simon.fraser</cc>
    
    <cc>tabatkins</cc>
    
    <cc>zalan</cc>
    
    <cc>zcorpan</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>583957</commentid>
    <comment_count>0</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2012-03-21 03:36:08 -0700</bug_when>
    <thetext>Currently WebKit treats Selectors as Unicode case-insensitive, just like the HTML parser they should be ASCII case-insensitive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>584261</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-21 10:03:09 -0700</bug_when>
    <thetext>This sounds just wrong. Why would ASCII and non-ASCII be different here? Event if WebKit disagrees with every other browser out there, it&apos;s still not clear whether we should change this.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>584518</commentid>
    <comment_count>2</comment_count>
    <who name="Tab Atkins">tabatkins</who>
    <bug_when>2012-03-21 12:49:09 -0700</bug_when>
    <thetext>The Selectors spec says that case-sensitivity is defined by the host language.  HTML says that it&apos;s ASCII case-insensitive only.  This matches Gecko.

We should make this change.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>584620</commentid>
    <comment_count>3</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-21 14:07:53 -0700</bug_when>
    <thetext>So &quot;AAA&quot; is case insensitive and &quot;ААА&quot; is case sensitive? Does this make any sense outside of spec writing universe?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>584655</commentid>
    <comment_count>4</comment_count>
    <who name="Tab Atkins">tabatkins</who>
    <bug_when>2012-03-21 15:02:19 -0700</bug_when>
    <thetext>You are making an appeal to logic.  You must be new to the HTML parser.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>584665</commentid>
    <comment_count>5</comment_count>
    <who name="Ian &apos;Hixie&apos; Hickson">ian</who>
    <bug_when>2012-03-21 15:08:52 -0700</bug_when>
    <thetext>In the HTML parser, we&apos;re ASCII case-insensitive (and not Unicode case-insensitive) so that you can do the logic using only ASCII-range single-byte manipulation.

It doesn&apos;t make sense for a selector for element &quot;А&quot; to match an element &quot;a&quot; because those elements are different everywhere else too (in XML, where it&apos;s case-sensitive, and in HTML, where they&apos;re not collapsed to one either).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>584706</commentid>
    <comment_count>6</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-21 15:36:53 -0700</bug_when>
    <thetext>Right. I was talking about class names though - ultimately, these need to be matched according to expectations of the person writing them in their natural language. Doing case-insensitive comparison for ASCII sets the expectation.

Perhaps the bug is more specific than what I read into it. A test case would have been helpful.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>586169</commentid>
    <comment_count>7</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2012-03-23 01:37:10 -0700</bug_when>
    <thetext>I included a link. And class names are case-sensitive.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>586366</commentid>
    <comment_count>8</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-23 08:50:52 -0700</bug_when>
    <thetext>&gt;And class names are case-sensitive.

Like this?

&lt;style&gt; .foo { color: green } &lt;/style&gt;
&lt;p class=&quot;FOO&quot;&gt;It&apos;s green in WebKit and Mozilla&lt;/a&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>586379</commentid>
    <comment_count>9</comment_count>
    <who name="Ms2ger (he/him; ⌚ UTC+1/+2)">Ms2ger</who>
    <bug_when>2012-03-23 09:06:15 -0700</bug_when>
    <thetext>&lt;!DOCTYPE html&gt;
&lt;style&gt; .foo { color: green } &lt;/style&gt;
&lt;p class=&quot;FOO&quot;&gt;It&apos;s black in WebKit, Mozilla and Opera&lt;/a&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>586404</commentid>
    <comment_count>10</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-23 09:30:26 -0700</bug_when>
    <thetext>Looks like we now agree that &quot;should be ASCII case-insensitive&quot; is not the correct behavior.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>586419</commentid>
    <comment_count>11</comment_count>
    <who name="Ms2ger (he/him; ⌚ UTC+1/+2)">Ms2ger</who>
    <bug_when>2012-03-23 09:34:22 -0700</bug_when>
    <thetext>We don&apos;t. Look carefully, and test in standards mode.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>586431</commentid>
    <comment_count>12</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-23 09:41:33 -0700</bug_when>
    <thetext>You do realize that your example shows case sensitive matching in standards mode, not ASCII case insensitive, don&apos;t you?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>586434</commentid>
    <comment_count>13</comment_count>
    <who name="Ms2ger (he/him; ⌚ UTC+1/+2)">Ms2ger</who>
    <bug_when>2012-03-23 09:45:05 -0700</bug_when>
    <thetext>You realize I pointed out your comment #8 didn&apos;t make sense?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>586448</commentid>
    <comment_count>14</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-03-23 10:06:53 -0700</bug_when>
    <thetext>Neither quirks nor standards mode behaves in the way bug title says. Comment 8 demonstrates half of that, which should make sense to most.

Is there anything constructive you want us to do via this bug, or is it all about snarky comments?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1157658</commentid>
    <comment_count>15</comment_count>
    <who name="Simon Pieters (:zcorpan)">zcorpan</who>
    <bug_when>2016-01-22 05:29:22 -0800</bug_when>
    <thetext>&lt;!DOCTYPE html&gt;
&lt;style&gt;
p { color:red }
[data-Å] { color:green }
[data-å] { color:green }
&lt;/style&gt;
&lt;p data-Å&gt;This should be green.
&lt;p data-å&gt;This should be green.

This is a simple interop bug. Please fix. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1886385</commentid>
    <comment_count>16</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2022-07-24 11:35:27 -0700</bug_when>
    <thetext>From the URL test case - Safari 15.6 on macOS 12.5 is matching all other browsers (Chrome Canary 106 and Firefox Nightly 104) and similarly from the simple inter-op bug mentioned in Comment 15 (changed into JSFiddle - https://jsfiddle.net/wk7xsjc1/show), Safari matches with all other browsers.

Is it something more needed here or since all browsers are matching, we can consider this as &quot;RESOLVED CONFIGURATION CHANGED&quot; (if it was fixed along the way)? Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1886403</commentid>
    <comment_count>17</comment_count>
    <who name="Ryosuke Niwa">rniwa</who>
    <bug_when>2022-07-24 13:43:01 -0700</bug_when>
    <thetext>I&apos;m sure we fixed this a long time ago.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>