<?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>260337</bug_id>
          
          <creation_ts>2023-08-17 01:57:47 -0700</creation_ts>
          <short_desc>new URL(&quot;file:///path&quot;).origin returns &quot;file://&quot; instead of &quot;null&quot;</short_desc>
          <delta_ts>2023-08-18 04:02:05 -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>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>BrowserCompat, InRadar, WPTImpact</keywords>
          <priority>P2</priority>
          <bug_severity>Normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          <blocked>128023</blocked>
          <everconfirmed>1</everconfirmed>
          <reporter name="Karl Dubost">karlcow</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annevk</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1971770</commentid>
    <comment_count>0</comment_count>
    <who name="Karl Dubost">karlcow</who>
    <bug_when>2023-08-17 01:57:47 -0700</bug_when>
    <thetext>Some of the fails in these series of tests. 
https://wpt.fyi/results/url?label=master&amp;label=experimental&amp;aligned&amp;q=safari%3Afail%20chrome%3Afail%20firefox%3Apass



In Safari and Chrome

new URL(&quot;blob:file://host/path&quot;).origin 
   &quot;file://&quot;
new URL(&quot;file://host/path&quot;).origin 
   &quot;file://&quot;
new URL(&quot;file:///path&quot;).origin 
   &quot;file://&quot;

in Firefox

new URL(&quot;blob:file://host/path&quot;).origin
    &quot;null&quot;
new URL(&quot;file://host/path&quot;).origin
    &quot;null&quot;
new URL(&quot;file:///path&quot;).origin
    &quot;null&quot;

Example
https://wpt.fyi/results/url/a-element-origin.html
FAIL message: assert_equals: origin expected &quot;null&quot; but got &quot;file://&quot;

Cf
https://url.spec.whatwg.org/#special-scheme
https://url.spec.whatwg.org/#concept-url-scheme
https://url.spec.whatwg.org/#origin

The specs says for the file scheme

&gt; Unfortunate as it is, this is left as an exercise to the reader. 
&gt; When in doubt, return a new opaque origin.


which seems to imply to return null. 

but this sentence is probably not necessary and confusing:
&quot; Unfortunate as it is, this is left as an exercise to the reader. &quot;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1971771</commentid>
    <comment_count>1</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-08-17 01:57:54 -0700</bug_when>
    <thetext>&lt;rdar://problem/114015467&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1972010</commentid>
    <comment_count>2</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-08-18 03:03:55 -0700</bug_when>
    <thetext>I&apos;m changing the tests in https://github.com/web-platform-tests/wpt/pull/41158 which would resolve the WPTImpact. I also don&apos;t think there&apos;s BrowserCompat here as at least Chromium does the same thing.

We might still want to fix this though. Returning &quot;file://&quot; is not exactly helpful. Might have to be done at the point where we actually serialize the origin though to not upset origin comparisons and such.</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>