Bug 223728 - WKContentRuleList first-party should include other subdomains of the current registrable domain
Summary: WKContentRuleList first-party should include other subdomains of the current ...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Alex Christensen
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2021-03-24 20:57 PDT by Alex Christensen
Modified: 2021-03-25 08:30 PDT (History)
5 users (show)

See Also:


Attachments
Patch (5.73 KB, patch)
2021-03-24 20:57 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff
Patch (5.64 KB, patch)
2021-03-25 08:04 PDT, Alex Christensen
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Christensen 2021-03-24 20:57:07 PDT
WKContentRuleList first-party should include other subdomains of the current registrable domain
Comment 1 Alex Christensen 2021-03-24 20:57:32 PDT
Created attachment 424215 [details]
Patch
Comment 2 Alex Christensen 2021-03-24 20:57:35 PDT
<rdar://problem/71912579>
Comment 3 John Wilander 2021-03-24 21:28:26 PDT
Comment on attachment 424215 [details]
Patch

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

r=me with a requested change.

> Source/WebCore/loader/ResourceLoadInfo.cpp:131
> +    return RegistrableDomain(mainDocumentURL) != RegistrableDomain(resourceURL);

You should be able to use RegistrableDomain::matches(const URL& url) here which is faster than creating two RegistrableDomain objects.
Comment 4 Alex Christensen 2021-03-25 08:04:28 PDT
Created attachment 424244 [details]
Patch
Comment 5 John Wilander 2021-03-25 08:15:01 PDT
Comment on attachment 424244 [details]
Patch

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

> Source/WebCore/loader/ResourceLoadInfo.cpp:129
> +    return !RegistrableDomain(mainDocumentURL).matches(resourceURL);

I would have kept the comparison of the two hosts. Something like return !(mainHost == otherHost || RD(mainURL).matches(otherURL)).
Comment 6 EWS 2021-03-25 08:30:38 PDT
Committed r275035: <https://commits.webkit.org/r275035>

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