<?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>259080</bug_id>
          
          <creation_ts>2023-07-10 15:43:22 -0700</creation_ts>
          <short_desc>URL pathname and search setter incorrectly strips trailing spaces</short_desc>
          <delta_ts>2023-07-26 09:23:29 -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>Platform</component>
          <version>Safari Technology Preview</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</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>
          
          
          <everconfirmed>1</everconfirmed>
          <reporter name="Luca Casonato">hello</reporter>
          <assigned_to name="Anne van Kesteren">annevk</assigned_to>
          <cc>achristensen</cc>
    
    <cc>annevk</cc>
    
    <cc>hello</cc>
    
    <cc>webkit-bug-importer</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1966066</commentid>
    <comment_count>0</comment_count>
    <who name="Luca Casonato">hello</who>
    <bug_when>2023-07-10 15:43:22 -0700</bug_when>
    <thetext>Test case:

```
const url = new URL(&apos;http://example.com/&apos;);
url.pathname = &apos;/ &apos;;
url.search = &apos;? &apos;;
url.hash = &apos;# &apos;;
console.log(url.href);
```

Implementations:

```
// whatwg-url@13.0.0
&quot;http://example.com/%20?%20#%20&quot; ✅

// Chrome 117.0.5881.0
&quot;http://example.com/%20?%20#%20&quot; ✅

// Firefox 114.0.2
&quot;http://example.com/%20?%20#%20&quot; ✅

// Safari TP 171
&quot;http://example.com/?#%20&quot; ❌

// Deno 1.35.0
&quot;http://example.com/?%20#%20&quot; ❌

// node@20.4.0
&quot;http://example.com/%20?%20#%20&quot; ✅
```

New tests in https://github.com/web-platform-tests/wpt/pull/40959</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1966902</commentid>
    <comment_count>1</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-07-15 11:18:30 -0700</bug_when>
    <thetext>One somewhat tricky aspect here is that our internal URL manipulation APIs are not very aligned with the public API, which make me worry we miss certain aspects, in particular around trimming an opaque path when query and fragment become null. I will attempt some refactoring to get them closer together, starting with bug 259245. Feel free to take this however. No promises. :-)</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1967123</commentid>
    <comment_count>2</comment_count>
    <who name="Radar WebKit Bug Importer">webkit-bug-importer</who>
    <bug_when>2023-07-17 15:44:16 -0700</bug_when>
    <thetext>&lt;rdar://problem/112433299&gt;</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1967758</commentid>
    <comment_count>3</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-07-23 01:52:58 -0700</bug_when>
    <thetext>Pull request: https://github.com/WebKit/WebKit/pull/16020</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1967856</commentid>
    <comment_count>4</comment_count>
    <who name="EWS">ews-feeder</who>
    <bug_when>2023-07-24 10:09:25 -0700</bug_when>
    <thetext>Committed 266252@main (cc626f31c374): &lt;https://commits.webkit.org/266252@main&gt;

Reviewed commits have been landed. Closing PR #16020 and removing active labels.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1968240</commentid>
    <comment_count>5</comment_count>
    <who name="Anne van Kesteren">annevk</who>
    <bug_when>2023-07-26 09:23:29 -0700</bug_when>
    <thetext>*** Bug 250004 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>