<?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>140174</bug_id>
          
          <creation_ts>2015-01-06 21:13:51 -0800</creation_ts>
          <short_desc>DOM URL pathname setter double encodes entities</short_desc>
          <delta_ts>2020-06-28 05:23:10 -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>DOM</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Mac</rep_platform>
          <op_sys>OS X 10.10</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></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="Joshua Peek">josh</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>annevk</cc>
    
    <cc>ap</cc>
    
    <cc>aroben</cc>
    
    <cc>rbuis</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1059320</commentid>
    <comment_count>0</comment_count>
      <attachid>244139</attachid>
    <who name="Joshua Peek">josh</who>
    <bug_when>2015-01-06 21:13:51 -0800</bug_when>
    <thetext>Created attachment 244139
URL pathname test

The URL pathname setter incorrectly re-encodes the target value before setting it as the pathname attribute. The getter always correctly returns the undecoded pathname.

  var url = new URL(&quot;http://example.com/&quot;)
  url.pathname = &quot;foo%20bar&quot;
  url.pathname // &quot;/foo%2520bar&quot;
  url.href // &quot;http://example.com/foo%2520bar&quot;

This breaks the ability to reset pathname with the value from its getter.

  var url = new URL(&quot;http://example.com/foo%20bar&quot;)
  url.pathname // &quot;/foo%20bar&quot;
  url.pathname = url.pathname + &quot;/123&quot;
  url.pathname // &quot;/foo%2520bar/123&quot;

I don&apos;t think the pathname setter is correctly performing the &quot;Basic URL parse&quot; step in https://url.spec.whatwg.org/#dom-urlutils-pathname</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1666862</commentid>
    <comment_count>1</comment_count>
    <who name="Rob Buis">rbuis</who>
    <bug_when>2020-06-28 05:23:10 -0700</bug_when>
    <thetext>This is fixed these days.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>244139</attachid>
            <date>2015-01-06 21:13:51 -0800</date>
            <delta_ts>2015-01-06 21:13:51 -0800</delta_ts>
            <desc>URL pathname test</desc>
            <filename>tests.patch</filename>
            <type>text/plain</type>
            <size>679</size>
            <attacher name="Joshua Peek">josh</attacher>
            
              <data encoding="base64">SW5kZXg6IExheW91dFRlc3RzL2Zhc3QvZG9tL0RPTVVSTC9zZXQtaHJlZi1hdHRyaWJ1dGUtcGF0
aG5hbWUuaHRtbAo9PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09PT09
PT09PT09PT09PT09PT09PT09PT09Ci0tLSBMYXlvdXRUZXN0cy9mYXN0L2RvbS9ET01VUkwvc2V0
LWhyZWYtYXR0cmlidXRlLXBhdGhuYW1lLmh0bWwJKHJldmlzaW9uIDE3ODAxOSkKKysrIExheW91
dFRlc3RzL2Zhc3QvZG9tL0RPTVVSTC9zZXQtaHJlZi1hdHRyaWJ1dGUtcGF0aG5hbWUuaHRtbAko
d29ya2luZyBjb3B5KQpAQCAtNzcsNiArNzcsMTEgQEAgYS5ocmVmID0gInRlbDorMTgwMC01NTUt
MTIxMiI7CiBhLnBhdGhuYW1lID0gInRoZS1wYXRoIjsKIHNob3VsZEJlKCJhLmhyZWYiLCAiJ3Rl
bDorMTgwMC01NTUtMTIxMiciKTsKIAorZGVidWcoIlNldCBwYXRobmFtZSB0byBhbiBlbmNvZGVk
IHBhdGgiKTsKK2EuaHJlZiA9ICJodHRwczovL3d3dy5teWRvbWFpbi5jb20vIjsKK2EucGF0aG5h
bWUgPSAiL3BhdGglMjBuYW1lIjsKK3Nob3VsZEJlKCJhLmhyZWYiLCAiJ2h0dHBzOi8vd3d3Lm15
ZG9tYWluLmNvbS9wYXRoJTIwbmFtZSciKTsKKwogPC9zY3JpcHQ+CiA8c2NyaXB0IHNyYz0iLi4v
Li4vLi4vcmVzb3VyY2VzL2pzLXRlc3QtcG9zdC5qcyI+PC9zY3JpcHQ+CiA8L2JvZHk+Cg==
</data>

          </attachment>
      

    </bug>

</bugzilla>