<?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>256716</bug_id>
          
          <creation_ts>2023-05-12 10:02:25 -0700</creation_ts>
          <short_desc>DOMXPath- failing (fn-lang.html) due to U+212A handling</short_desc>
          <delta_ts>2025-05-22 10:41:30 -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>XML</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>CONFIGURATION CHANGED</resolution>
          
          <see_also>https://github.com/whatwg/dom/issues/1199</see_also>
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>BrowserCompat, InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Ahmad Saleem">ahmad.saleem792</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annevk</cc>
    
    <cc>ap</cc>
    
    <cc>cdumez</cc>
    
    <cc>darin</cc>
    
    <cc>mmaxfield</cc>
    
    <cc>rniwa</cc>
    
    <cc>webkit-bug-importer</cc>
    
    <cc>ysuzuki</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1955026</commentid>
    <comment_count>0</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2023-05-12 10:02:25 -0700</bug_when>
    <thetext>Hi Team,

While going through WPT test cases, came across one sub-test failure:

Test Case - https://wpt.fyi/results/domxpath/fn-lang.html?label=experimental&amp;label=master&amp;aligned

Link - http://wpt.live/domxpath/fn-lang.html

___________

Researching bit on when this was added and against which bugs, it seems to be U+212A handling issue either in CSS or DOM level.

Just raising, so we can fix it.

Thanks!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1955313</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2023-05-14 12:05:37 -0700</bug_when>
    <thetext>// U+212A should match to ASCII &apos;k&apos;.
// XPath 1.0 says:
// ... such that the attribute value is equal to the argument ignoring that suffix
// of the attribute value and ignoring case.
// XPath 3.1 says:
// ... true if and only if, based on a caseless default match as specified in
// section 3.13 of The Unicode Standard,
testFirstChild(&apos;lang(&quot;ko&quot;)&apos;, &apos;&lt;root&gt;&lt;match xml:lang=&quot;&amp;#x212A;o&quot;/&gt;&lt;/root&gt;&apos;);

-------

So this test says that U+212A KELVIN SIGN should match letter &quot;k&quot; in lang attribute, which seems weird, at least initially.

The Unicode Standard reference here is obsolete, but is almost certainly about &quot;caseless matching&quot; in https://www.unicode.org/versions/Unicode15.0.0/ch05.pdf. Which indeed has this behavior, but the rest of the Web platform does not AFAIK. Notably, even Chrome doesn&apos;t have this behavior for CSS selector matching.

I think that this is a bug in the standard, and Chrome is internally inconsistent, so we shouldn&apos;t be following it. CC&apos;ing some folks who&apos;ve done more recent work in this area to weigh in.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1955314</commentid>
    <comment_count>2</comment_count>
      <attachid>466349</attachid>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2023-05-14 12:05:56 -0700</bug_when>
    <thetext>Created attachment 466349
CSS selector test</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1955349</commentid>
    <comment_count>3</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-05-14 23:47:22 -0700</bug_when>
    <thetext>Looking at the source of the test it seems this was done based on an XPath 3.1 clarification, but indeed we use ASCII case-insensitive for language matching across the web platform. Let&apos;s change this test and add a clarification to DOM/HTML with regards to what kind of matching the XPath lang() function uses.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1956524</commentid>
    <comment_count>4</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-05-19 10:03:20 -0700</bug_when>
    <thetext>&lt;rdar://problem/109571692&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2024854</commentid>
    <comment_count>5</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2024-03-29 16:36:09 -0700</bug_when>
    <thetext>Modifying the test upstream in WPT - https://github.com/web-platform-tests/wpt/pull/45436</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>2119014</commentid>
    <comment_count>6</comment_count>
    <who name="Ahmad Saleem">ahmad.saleem792</who>
    <bug_when>2025-05-22 10:41:30 -0700</bug_when>
    <thetext>Syncing test here - https://github.com/WebKit/WebKit/pull/45768, so I don&apos;t think anything else to do here since we updated test upstream.

Marking this as `RESOLVED CONFIGURATION CHANGED`.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="0"
              isprivate="0"
          >
            <attachid>466349</attachid>
            <date>2023-05-14 12:05:56 -0700</date>
            <delta_ts>2023-05-14 12:05:56 -0700</delta_ts>
            <desc>CSS selector test</desc>
            <filename>test.html</filename>
            <type>text/html</type>
            <size>137</size>
            <attacher name="Alexey Proskuryakov">ap</attacher>
            
              <data encoding="base64">PHN0eWxlPgpkaXZbbGFuZz1rb10gewpjb2xvcjogZ3JlZW47Cn0KPC9zdHlsZT4KCjxkaXYgbGFu
Zz0i4oSqbyI+4oSqbyAod2l0aCBVKzIxMkEpPC9kaXY+CjxkaXYgbGFuZz0iS28iPktvPGRpdj4K
PGRpdiBsYW5nPSJrbyI+a288ZGl2Pgo=
</data>

          </attachment>
      

    </bug>

</bugzilla>