Bug 223728

Summary: WKContentRuleList first-party should include other subdomains of the current registrable domain
Product: WebKit Reporter: Alex Christensen <achristensen>
Component: New BugsAssignee: Alex Christensen <achristensen>
Status: RESOLVED FIXED    
Severity: Normal CC: cdumez, ews-watchlist, japhet, webkit-bug-importer, wilander
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
none
Patch none

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].