Bug 235045 - [Cocoa] Inspector Extensions: tabIconURLs with custom scheme URLs are incorrectly loaded
Summary: [Cocoa] Inspector Extensions: tabIconURLs with custom scheme URLs are incorre...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Web Inspector (show other bugs)
Version: WebKit Nightly Build
Hardware: All All
: P2 Normal
Assignee: BJ Burg
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-01-10 12:48 PST by BJ Burg
Modified: 2022-01-11 13:58 PST (History)
8 users (show)

See Also:


Attachments
Patch v1.0 (14.25 KB, patch)
2022-01-10 12:52 PST, BJ Burg
no flags Details | Formatted Diff | Diff
Patch v1.1 (2.19 KB, patch)
2022-01-10 14:41 PST, BJ Burg
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description BJ Burg 2022-01-10 12:48:23 PST
It looks like the conversion from NSURL -> API::URL -> WTF::URL -> WTF::String -> JSValue is not going as expected.

Since we don't examine or modify the URL, it suffices to convert it to NSURL -> WTF::String -> JSValue.
Comment 1 Radar WebKit Bug Importer 2022-01-10 12:48:48 PST
<rdar://problem/87357027>
Comment 2 BJ Burg 2022-01-10 12:52:59 PST
Created attachment 448788 [details]
Patch v1.0
Comment 3 Devin Rousso 2022-01-10 13:32:21 PST
(In reply to BJ Burg from comment #0)
> It looks like the conversion from NSURL -> API::URL -> WTF::URL -> WTF::String -> JSValue is not going as expected.
This seems like a bug, no?  Or is this expected?
Comment 4 BJ Burg 2022-01-10 14:41:00 PST
Created attachment 448802 [details]
Patch v1.1
Comment 5 Darin Adler 2022-01-10 15:04:18 PST
Comment on attachment 448802 [details]
Patch v1.1

Looks good.

Please note that using the URL class’s relative URL resolution doesn’t necessarily handle all the edge cases correctly and functions like Document::completeURL end up having to add special cases. So please think further on that point, for things like empty string.
Comment 6 BJ Burg 2022-01-11 13:50:47 PST
(In reply to Darin Adler from comment #5)
> Comment on attachment 448802 [details]
> Patch v1.1
> 
> Looks good.
> 
> Please note that using the URL class’s relative URL resolution doesn’t
> necessarily handle all the edge cases correctly and functions like
> Document::completeURL end up having to add special cases. So please think
> further on that point, for things like empty string.

Good point. In this case the code that provides the NSURL via ensures that the URL is non-nil and is not the empty string.
Comment 7 BJ Burg 2022-01-11 13:51:15 PST
Comment on attachment 448802 [details]
Patch v1.1

ios-wk2 and wincairo failures look to be infrastructure issues.
Comment 8 EWS 2022-01-11 13:58:25 PST
Committed r287895 (245933@main): <https://commits.webkit.org/245933@main>

All reviewed patches have been landed. Closing bug and clearing flags on attachment 448802 [details].