Changeset 283593 in webkit
- Timestamp:
- Oct 5, 2021 5:46:43 PM (10 months ago)
- Location:
- trunk
- Files:
-
- 3 added
- 3 edited
-
LayoutTests/ChangeLog (modified) (1 diff)
-
LayoutTests/http/tests/privateClickMeasurement/resources/nestedTargetLink.html (added)
-
LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-nested-expected.txt (added)
-
LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement-nested.html (added)
-
Source/WebCore/ChangeLog (modified) (1 diff)
-
Source/WebCore/html/HTMLAnchorElement.cpp (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r283591 r283593 1 2021-10-05 John Wilander <wilander@apple.com> 2 3 PCM: Allow measurement of links in nested, cross-site iframes 4 https://bugs.webkit.org/show_bug.cgi?id=229204 5 <rdar://problem/82310386> 6 7 Reviewed by Alex Christensen. 8 9 Developers have said it would be great to allow measurement of links served in 10 nested, cross-site iframes on the click source. The click still count as if it 11 happened on the first party click source site, and any attribution report still 12 goes to that first party. This change enables the *serving* of measurable links 13 in nested, cross-site iframes. 14 15 The standards issue where this was discussed: 16 https://github.com/privacycg/private-click-measurement/issues/7 17 18 * http/tests/privateClickMeasurement/resources/nestedTargetLink.html: Added. 19 * http/tests/privateClickMeasurement/store-private-click-measurement-nested-expected.txt: Added. 20 * http/tests/privateClickMeasurement/store-private-click-measurement-nested.html: Added. 21 1 22 2021-10-05 Fujii Hironori <Hironori.Fujii@sony.com> 2 23 -
trunk/Source/WebCore/ChangeLog
r283592 r283593 1 2021-10-05 John Wilander <wilander@apple.com> 2 3 PCM: Allow measurement of links in nested, cross-site iframes 4 https://bugs.webkit.org/show_bug.cgi?id=229204 5 <rdar://problem/82310386> 6 7 Reviewed by Alex Christensen. 8 9 Developers have said it would be great to allow measurement of links served in 10 nested, cross-site iframes on the click source. The click still count as if it 11 happened on the first party click source site, and any attribution report still 12 goes to that first party. This change enables the *serving* of measurable links 13 in nested, cross-site iframes. 14 15 The standards issue where this was discussed: 16 https://github.com/privacycg/private-click-measurement/issues/7 17 18 Test: http/tests/privateClickMeasurement/store-private-click-measurement-nested.html 19 20 * html/HTMLAnchorElement.cpp: 21 (WebCore::HTMLAnchorElement::parsePrivateClickMeasurement const): 22 Removed the block for nested, cross-site iframes. 23 1 24 2021-10-05 Aditya Keerthi <akeerthi@apple.com> 2 25 -
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
r283313 r283593 403 403 using AttributionDestinationSite = PrivateClickMeasurement::AttributionDestinationSite; 404 404 405 RefPtr<Frame> frame = document().frame(); 405 406 auto* page = document().page(); 406 if (! page || page->sessionID().isEphemeral()407 if (!frame ||!page || page->sessionID().isEphemeral() 407 408 || !document().settings().privateClickMeasurementEnabled() 408 409 || !UserGestureIndicator::processingUserGesture()) … … 422 423 } 423 424 424 RefPtr<Frame> frame = document().frame();425 if (!frame || !frame->isMainFrame()) {426 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "Private Click Measurement is only supported in the main frame."_s);427 return std::nullopt;428 }429 430 425 auto attributionSourceID = parseHTMLNonNegativeInteger(attributionSourceIDAttr); 431 426 if (!attributionSourceID) { … … 445 440 } 446 441 447 RegistrableDomain documentRegistrableDomain { document().url() }; 448 if (documentRegistrableDomain.matches(destinationURL)) { 442 RegistrableDomain mainDocumentRegistrableDomain; 443 if (auto mainDocument = frame->mainFrame().document()) 444 mainDocumentRegistrableDomain = RegistrableDomain { mainDocument->url() }; 445 else { 446 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "Could not find a main document to use as source site for Private Click Measurement."_s); 447 return std::nullopt; 448 } 449 450 if (mainDocumentRegistrableDomain.matches(destinationURL)) { 449 451 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "attributiondestination can not be the same site as the current website."_s); 450 452 return std::nullopt; … … 456 458 String bundleID; 457 459 #endif 458 auto privateClickMeasurement = PrivateClickMeasurement { SourceID(attributionSourceID.value()), SourceSite(WTFMove( documentRegistrableDomain)), AttributionDestinationSite(destinationURL), bundleID, WallTime::now(), PrivateClickMeasurement::AttributionEphemeral::No };460 auto privateClickMeasurement = PrivateClickMeasurement { SourceID(attributionSourceID.value()), SourceSite(WTFMove(mainDocumentRegistrableDomain)), AttributionDestinationSite(destinationURL), bundleID, WallTime::now(), PrivateClickMeasurement::AttributionEphemeral::No }; 459 461 460 462 auto attributionSourceNonceAttr = attributeWithoutSynchronization(attributionsourcenonceAttr);
Note: See TracChangeset
for help on using the changeset viewer.