Bug 227073 - [URL] Prevent the pathname setter from erasing the path of path-only URLs
Summary: [URL] Prevent the pathname setter from erasing the path of path-only URLs
Status: RESOLVED DUPLICATE of bug 227820
Alias: None
Product: WebKit
Classification: Unclassified
Component: Platform (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
: 227341 (view as bug list)
Depends on:
Blocks:
 
Reported: 2021-06-16 08:45 PDT by Karl
Modified: 2021-08-30 15:28 PDT (History)
9 users (show)

See Also:


Attachments
Patch (5.80 KB, patch)
2021-06-24 00:20 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (6.36 KB, patch)
2021-06-24 10:47 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (10.03 KB, patch)
2021-06-24 15:30 PDT, Alex Christensen
thorton: review+
ews-feeder: commit-queue-
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Karl 2021-06-16 08:45:29 PDT
Given a URL, "foo:/hello/world?someQuery", which is path-only and hierarchical (cannot-be-a-base is false),
it is possible to set pathname to the empty string, resulting in "foo:?someQuery", which is non-hierarchical but not internally marked as such
(cannot-be-a-base is still false).

That means it is possible to perform actions which typically cannot be performed on non-hierarchical URLs, such as setting certain components or using them as base URLs.

Moreover, re-parsing the same URL "foo:?someQuery" correctly sets the cannot-be-a-base flag, meaning that idempotence is broken.

Issue: https://github.com/whatwg/url/issues/581
PR to update the URL Standard: https://github.com/whatwg/url/pull/582
Comment 1 Radar WebKit Bug Importer 2021-06-23 08:46:17 PDT
<rdar://problem/79667531>
Comment 2 Alex Christensen 2021-06-24 00:19:29 PDT
*** Bug 227341 has been marked as a duplicate of this bug. ***
Comment 3 Alex Christensen 2021-06-24 00:20:46 PDT
Created attachment 432137 [details]
Patch
Comment 4 EWS Watchlist 2021-06-24 00:21:42 PDT
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment 5 Alex Christensen 2021-06-24 00:27:36 PDT
Note to self: double check setting the pathname of "foo:///" to the empty string.
Comment 6 Alex Christensen 2021-06-24 10:47:26 PDT
Created attachment 432189 [details]
Patch
Comment 7 Alex Christensen 2021-06-24 15:30:46 PDT
Created attachment 432217 [details]
Patch
Comment 8 EWS 2021-08-30 15:24:34 PDT
Tools/Scripts/svn-apply failed to apply attachment 432217 [details] to trunk.
Please resolve the conflicts and upload a new patch.
Comment 9 Alex Christensen 2021-08-30 15:28:11 PDT
This was effectively done in http://trac.webkit.org/r279895

*** This bug has been marked as a duplicate of bug 227820 ***