Bug 217170 - Copy host from base file URL
Summary: Copy host from base file URL
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
Keywords: InRadar
Depends on:
Reported: 2020-10-01 03:00 PDT by Anne van Kesteren
Modified: 2020-10-02 14:00 PDT (History)
9 users (show)

See Also:

Patch (36.87 KB, patch)
2020-10-01 15:23 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (40.14 KB, patch)
2020-10-01 16:37 PDT, Alex Christensen
beidson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Anne van Kesteren 2020-10-01 03:00:46 PDT
See https://github.com/whatwg/url/pull/544 and new tests at https://github.com/web-platform-tests/wpt/pull/25716.

Safari does not copy the host from the base URL for file URLs.
Comment 1 Alex Christensen 2020-10-01 15:23:51 PDT
Created attachment 410276 [details]
Comment 2 EWS Watchlist 2020-10-01 15:24:36 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 3 Alex Christensen 2020-10-01 16:37:33 PDT
Created attachment 410281 [details]
Comment 4 Alex Christensen 2020-10-01 23:13:45 PDT
Comment on attachment 410281 [details]

View in context: https://bugs.webkit.org/attachment.cgi?id=410281&action=review

> Source/WTF/wtf/URLParser.cpp:1563
> +                    copyURLPartsUntil(base, URLPart::SchemeEnd, c, nonUTF8QueryEncoding);

Note: this code does not have a corresponding case that copies until URLPart::PortEnd because we are transitioning to State::FileHost and we don't want to copy the host of the base URL here.  The other cases do if there is one.
Comment 5 Alex Christensen 2020-10-02 13:59:23 PDT
Comment 6 Radar WebKit Bug Importer 2020-10-02 14:00:25 PDT