<?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>258603</bug_id>
          
          <creation_ts>2023-06-27 22:40:19 -0700</creation_ts>
          <short_desc>Harmonize the hosts/domain name testing in Quirks</short_desc>
          <delta_ts>2024-01-16 23:53:52 -0800</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>New Bugs</component>
          <version>Safari 17</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>NEW</bug_status>
          <resolution></resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          <dependson>267623</dependson>
    
    <dependson>260938</dependson>
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Karl Dubost">karlcow</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1963945</commentid>
    <comment_count>0</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-06-27 22:40:19 -0700</bug_when>
    <thetext>Currently the Quirks.cpp file has a couple of different ways of testing for the domain name of a site where the Quirk should apply. 
https://github.com/WebKit/WebKit/blame/main/Source/WebCore/page/Quirks.cpp

This is probably due to layer of history. 
It would probably be better to choose a &quot;better&quot;/more recent way of doing things. 

top domain equality
   equalLettersIgnoringASCIICase(host, domain)
   host == domain

partial_domain end
   host.endsWithIgnoringASCIICase(partial_domain)
   host.endsWith(partial_domain)

partial_domain start
   startsWithLettersIgnoringASCIICase(host, domain)
   host.toString()).startsWith(partial_domain)


There is also 
   topPrivatelyControlledDomain(host.toString()).startsWith(&quot;expedia.&quot;_s))


The recommended way is probably to use
   class WebCore::RegistrableDomain and its methods

see
https://github.com/WebKit/WebKit/blob/main/Source/WebCore/platform/RegistrableDomain.h
https://github.com/WebKit/WebKit/blob/main/Tools/TestWebKitAPI/Tests/WebCore/RegistrableDomain.cpp</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1963946</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-06-27 22:40:31 -0700</bug_when>
    <thetext>&lt;rdar://problem/111433802&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1990441</commentid>
    <comment_count>2</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-11-06 21:41:41 -0800</bug_when>
    <thetext>How do we improve this a bit more. 
In Bug 260938 isDomain() was created
but probably, there is a need for more generic functions.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>