Bug 229204

Summary: PCM: Allow measurement of links in nested, cross-site iframes
Product: WebKit Reporter: Pranay Prabhat <pranay.prabhat>
Component: WebKit Misc.Assignee: John Wilander <wilander>
Status: RESOLVED FIXED    
Severity: Normal CC: achristensen, cdumez, changseok, esprehn+autocc, ews-watchlist, gyuyoung.kim, webkit-bug-importer, wilander
Priority: P2 Keywords: InRadar
Version: Safari 14   
Hardware: All   
OS: All   
Attachments:
Description Flags
Patch
none
Patch
none
Patch none

Pranay Prabhat
Reported 2021-08-17 14:43:04 PDT
https://github.com/privacycg/private-click-measurement/issues/7 has highlighted the needs but for majority of publishers , ads are rendered in a secondary domain usually rendered by Google Ad Manager. PCM's click based anchor tags within secondary domain need to be propagated to publisher context in order to register the click for conversion reporting.
Attachments
Patch (10.25 KB, patch)
2021-10-04 15:21 PDT, John Wilander
no flags
Patch (10.14 KB, patch)
2021-10-04 16:38 PDT, John Wilander
no flags
Patch (10.29 KB, patch)
2021-10-05 07:58 PDT, John Wilander
no flags
Radar WebKit Bug Importer
Comment 1 2021-08-24 14:44:54 PDT
John Wilander
Comment 2 2021-10-04 15:21:04 PDT
Alex Christensen
Comment 3 2021-10-04 15:28:29 PDT
Comment on attachment 440110 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440110&action=review > Source/WebCore/html/HTMLAnchorElement.cpp:446 > + if (frame->isMainFrame()) > + mainDocumentRegistrableDomain = RegistrableDomain { document().url() }; > + else if (auto mainDocument = frame->mainFrame().document()) > + mainDocumentRegistrableDomain = RegistrableDomain { mainDocument->url() }; I think you can simplify this because Frame::mainFrame() returns itself if it's the main frame.
John Wilander
Comment 4 2021-10-04 15:35:04 PDT
(In reply to Alex Christensen from comment #3) > Comment on attachment 440110 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=440110&action=review > > > Source/WebCore/html/HTMLAnchorElement.cpp:446 > > + if (frame->isMainFrame()) > > + mainDocumentRegistrableDomain = RegistrableDomain { document().url() }; > > + else if (auto mainDocument = frame->mainFrame().document()) > > + mainDocumentRegistrableDomain = RegistrableDomain { mainDocument->url() }; > > I think you can simplify this because Frame::mainFrame() returns itself if > it's the main frame. Thanks! Will fix before landing.
Chris Dumez
Comment 5 2021-10-04 15:36:16 PDT
Comment on attachment 440110 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=440110&action=review >>> Source/WebCore/html/HTMLAnchorElement.cpp:446 >>> + mainDocumentRegistrableDomain = RegistrableDomain { mainDocument->url() }; >> >> I think you can simplify this because Frame::mainFrame() returns itself if it's the main frame. > > Thanks! Will fix before landing. You don't even need frames, document().topDocument().url()
John Wilander
Comment 6 2021-10-04 16:26:03 PDT
(In reply to Chris Dumez from comment #5) > Comment on attachment 440110 [details] > Patch > > View in context: > https://bugs.webkit.org/attachment.cgi?id=440110&action=review > > >>> Source/WebCore/html/HTMLAnchorElement.cpp:446 > >>> + mainDocumentRegistrableDomain = RegistrableDomain { mainDocument->url() }; > >> > >> I think you can simplify this because Frame::mainFrame() returns itself if it's the main frame. > > > > Thanks! Will fix before landing. > > You don't even need frames, document().topDocument().url() I looked at the implementation of topDocument() and this part has me worried about potential misuse vectors: if (backForwardCacheState() == NotInBackForwardCache && !m_renderTreeBeingDestroyed) { if (!m_frame) return const_cast<Document&>(*this); // This should always be non-null. Document* mainFrameDocument = m_frame->mainFrame().document(); return mainFrameDocument ? *mainFrameDocument : const_cast<Document&>(*this); } I'll go with if (auto mainDocument = frame->mainFrame().document()).
John Wilander
Comment 7 2021-10-04 16:38:41 PDT
John Wilander
Comment 8 2021-10-05 07:58:52 PDT
John Wilander
Comment 9 2021-10-05 07:59:20 PDT
Fixed test for iOS.
EWS
Comment 10 2021-10-05 17:46:50 PDT
Committed r283593 (242549@main): <https://commits.webkit.org/242549@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 440215 [details].
Note You need to log in before you can comment on or make changes to this bug.