Changeset 269886 in webkit
- Timestamp:
- Nov 16, 2020 4:00:32 PM (3 years ago)
- Location:
- trunk
- Files:
-
- 28 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r269880 r269886 1 2020-11-16 John Wilander <wilander@apple.com> 2 3 PCM: Change attribute and JSON key names according to the W3C conversation 4 https://bugs.webkit.org/show_bug.cgi?id=218967 5 6 Reviewed by Brent Fulgham. 7 8 We've discussed extensively with Google and others on naming for the link 9 attributes and JSON key names in these issues: 10 https://github.com/privacycg/private-click-measurement/issues/30 11 https://github.com/privacycg/private-click-measurement/issues/56 12 13 This patch changes PCM accordingly. 14 15 * http/tests/contentextensions/block-private-click-measurement.html: 16 * http/tests/privateClickMeasurement/anchor-tag-attributes-reflect-expected.txt: 17 * http/tests/privateClickMeasurement/anchor-tag-attributes-reflect.html: 18 * http/tests/privateClickMeasurement/anchor-tag-attributes-validation-expected.txt: 19 * http/tests/privateClickMeasurement/anchor-tag-attributes-validation.html: 20 * http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html: 21 * http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window.html: 22 * http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html: 23 * http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html: 24 * http/tests/privateClickMeasurement/clear-through-website-data-removal.html: 25 * http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html: 26 * http/tests/privateClickMeasurement/expired-attributions-removed.html: 27 * http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority.html: 28 * http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority.html: 29 * http/tests/privateClickMeasurement/second-conversion-with-higher-priority.html: 30 * http/tests/privateClickMeasurement/second-conversion-with-lower-priority.html: 31 * http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt: 32 * http/tests/privateClickMeasurement/send-attribution-conversion-request.html: 33 * http/tests/privateClickMeasurement/store-disabled-in-ephemeral-session.html: 34 * http/tests/privateClickMeasurement/store-private-click-measurement.html: 35 1 36 2020-11-16 Antoine Quint <graouts@webkit.org> 2 37 -
trunk/LayoutTests/http/tests/contentextensions/block-private-click-measurement.html
r269712 r269886 9 9 <body onload="setTimeout(runTest, 0)"> 10 10 <div id="description">Tests that private click measurement redirects to well-known location don't trigger a conversion if they are blocked by content blockers.</div> 11 <a id="targetLink" href="http://localhost:8000/contentextensions/block-private-click-measurement.html?stepTwo" a dcampaignid="3" addestination="http://localhost:8000">Link</a><br>11 <a id="targetLink" href="http://localhost:8000/contentextensions/block-private-click-measurement.html?stepTwo" attributionsourceid="3" attributeon="http://localhost:8000">Link</a><br> 12 12 <div id="output"></div> 13 13 <script> -
trunk/LayoutTests/http/tests/privateClickMeasurement/anchor-tag-attributes-reflect-expected.txt
r269712 r269886 4 4 5 5 6 PASS anchorTag.a dcampaignid is "40"7 PASS anchorTag.a ddestination is "destination.example"6 PASS anchorTag.attributionsourceid is "40" 7 PASS anchorTag.attributeon is "destination.example" 8 8 PASS successfullyParsed is true 9 9 -
trunk/LayoutTests/http/tests/privateClickMeasurement/anchor-tag-attributes-reflect.html
r269712 r269886 6 6 </head> 7 7 <body> 8 <a id="testTag" href="http://localhost:8000" a dcampaignid="40" addestination="destination.example"></a>8 <a id="testTag" href="http://localhost:8000" attributionsourceid="40" attributeon="destination.example"></a> 9 9 <script> 10 10 description("Test for the new private click measurement attributes on anchor tags."); 11 11 12 12 const anchorTag = document.getElementById("testTag"); 13 shouldBeEqualToString("anchorTag.a dcampaignid", "40");14 shouldBeEqualToString("anchorTag.a ddestination", "destination.example");13 shouldBeEqualToString("anchorTag.attributionsourceid", "40"); 14 shouldBeEqualToString("anchorTag.attributeon", "destination.example"); 15 15 </script> 16 16 </body> -
trunk/LayoutTests/http/tests/privateClickMeasurement/anchor-tag-attributes-validation-expected.txt
r269712 r269886 1 CONSOLE MESSAGE: a dcampaignid must have a non-negative value less than or equal to 63 for Private Click Measurement.2 CONSOLE MESSAGE: a dcampaignid must have a non-negative value less than or equal to 63 for Private Click Measurement.3 CONSOLE MESSAGE: a dcampaignid can not be converted to a non-negative integer which is required for Private Click Measurement.4 CONSOLE MESSAGE: a dcampaignid can not be converted to a non-negative integer which is required for Private Click Measurement.5 CONSOLE MESSAGE: a dcampaignid can not be converted to a non-negative integer which is required for Private Click Measurement.6 CONSOLE MESSAGE: a ddestination could not be converted to a valid HTTP-family URL.7 CONSOLE MESSAGE: a ddestination could not be converted to a valid HTTP-family URL.8 CONSOLE MESSAGE: a ddestination could not be converted to a valid HTTP-family URL.9 CONSOLE MESSAGE: Both a dcampaignid and addestination need to be set for Private Click Measurement to work.10 CONSOLE MESSAGE: Both a dcampaignid and addestination need to be set for Private Click Measurement to work.11 CONSOLE MESSAGE: a ddestination can not be the same site as the current website.1 CONSOLE MESSAGE: attributionsourceid must have a non-negative value less than or equal to 63 for Private Click Measurement. 2 CONSOLE MESSAGE: attributionsourceid must have a non-negative value less than or equal to 63 for Private Click Measurement. 3 CONSOLE MESSAGE: attributionsourceid can not be converted to a non-negative integer which is required for Private Click Measurement. 4 CONSOLE MESSAGE: attributionsourceid can not be converted to a non-negative integer which is required for Private Click Measurement. 5 CONSOLE MESSAGE: attributionsourceid can not be converted to a non-negative integer which is required for Private Click Measurement. 6 CONSOLE MESSAGE: attributeon could not be converted to a valid HTTP-family URL. 7 CONSOLE MESSAGE: attributeon could not be converted to a valid HTTP-family URL. 8 CONSOLE MESSAGE: attributeon could not be converted to a valid HTTP-family URL. 9 CONSOLE MESSAGE: Both attributionsourceid and attributeon need to be set for Private Click Measurement to work. 10 CONSOLE MESSAGE: Both attributionsourceid and attributeon need to be set for Private Click Measurement to work. 11 CONSOLE MESSAGE: attributeon can not be the same site as the current website. 12 12 Test for validity of private click measurement attributes on anchor tags. 13 13 -
trunk/LayoutTests/http/tests/privateClickMeasurement/anchor-tag-attributes-validation.html
r269712 r269886 25 25 anchorElement.id = elementID; 26 26 anchorElement.classList.add("wide-link"); 27 anchorElement.a dcampaignid = adCampaignID;28 anchorElement.a ddestination = adDestination;27 anchorElement.attributionsourceid = adCampaignID; 28 anchorElement.attributeon = adDestination; 29 29 anchorElement.href = "#"; 30 30 anchorElement.innerText = "Link" + currentTest; -
trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html
r269712 r269886 9 9 <body onload="setTimeout(runTest, 0)"> 10 10 <div id="description">Tests that triggering of private click measurement conversions through cross-site redirects do not work.</div> 11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html?stepTwo" a dcampaignid="3" addestination="http://localhost:8000">Link</a><br>11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html?stepTwo" attributionsourceid="3" attributeon="http://localhost:8000">Link</a><br> 12 12 <div id="output"></div> 13 13 <script> -
trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window.html
r269712 r269886 9 9 <body onload="setTimeout(runTest, 0)"> 10 10 <div id="description">Tests triggering of private click measurement conversions in a new window.</div> 11 <a target="_blank" rel="opener" id="targetLink" href="http://localhost:8000/privateClickMeasurement/resources/convertAndPostMessageBack.html" a dcampaignid="3" addestination="http://localhost:8000">Link</a><br>11 <a target="_blank" rel="opener" id="targetLink" href="http://localhost:8000/privateClickMeasurement/resources/convertAndPostMessageBack.html" attributionsourceid="3" attributeon="http://localhost:8000">Link</a><br> 12 12 <div id="output"></div> 13 13 <script> -
trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html
r269712 r269886 9 9 <body onload="setTimeout(runTest, 0)"> 10 10 <div id="description">Tests triggering of private click measurement conversions with priority.</div> 11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html?stepTwo" a dcampaignid="3" addestination="http://localhost:8000">Link</a><br>11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html?stepTwo" attributionsourceid="3" attributeon="http://localhost:8000">Link</a><br> 12 12 <div id="output"></div> 13 13 <script> -
trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html
r269712 r269886 9 9 <body onload="setTimeout(runTest, 0)"> 10 10 <div id="description">Tests triggering of private click measurement conversions without priority.</div> 11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html?stepTwo" a dcampaignid="3" addestination="http://localhost:8000">Link</a><br>11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html?stepTwo" attributionsourceid="3" attributeon="http://localhost:8000">Link</a><br> 12 12 <div id="output"></div> 13 13 <script> -
trunk/LayoutTests/http/tests/privateClickMeasurement/clear-through-website-data-removal.html
r269712 r269886 16 16 { 17 17 href: "http://localhost:8000" + path + "?stepTwo", 18 a dcampaignid: "3",19 a ddestination: "http://localhost:8000"18 attributionsourceid: "3", 19 attributeon: "http://localhost:8000" 20 20 }, 21 21 { 22 22 href: "http://127.0.0.1:8000" + path + "?stepThree", 23 a dcampaignid: "4",24 a ddestination: "http://127.0.0.1:8000"23 attributionsourceid: "4", 24 attributeon: "http://127.0.0.1:8000" 25 25 } 26 26 ]; … … 31 31 let linkElement = document.getElementById("targetLink"); 32 32 linkElement.setAttribute("href", configuration[index].href); 33 linkElement.setAttribute("a dcampaignid", configuration[index].adcampaignid);34 linkElement.setAttribute("a ddestination", configuration[index].addestination);33 linkElement.setAttribute("attributionsourceid", configuration[index].attributionsourceid); 34 linkElement.setAttribute("attributeon", configuration[index].attributeon); 35 35 } 36 36 -
trunk/LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html
r269712 r269886 9 9 <body onload="setTimeout(runTest, 0)"> 10 10 <div id="description">Tests that stored attributions cannot be converted in an ephemeral session.</div> 11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html?stepTwo" a dcampaignid="3" addestination="http://localhost:8000">Link</a><br>11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html?stepTwo" attributionsourceid="3" attributeon="http://localhost:8000">Link</a><br> 12 12 <div id="output"></div> 13 13 <script> -
trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attributions-removed.html
r269712 r269886 9 9 <body onload="setTimeout(runTest, 0)"> 10 10 <div id="description">Tests expiration of private click measurement.</div> 11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/expired-attributions-removed.html?stepTwo" a dcampaignid="3" addestination="http://localhost:8000">Link</a><br>11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/expired-attributions-removed.html?stepTwo" attributionsourceid="3" attributeon="http://localhost:8000">Link</a><br> 12 12 <div id="output"></div> 13 13 <script> -
trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority.html
r269712 r269886 16 16 { 17 17 href: "http://localhost:8000" + path + "?stepTwo", 18 a dcampaignid: "3",19 a ddestination: "http://localhost:8000"18 attributionsourceid: "3", 19 attributeon: "http://localhost:8000" 20 20 }, 21 21 { 22 22 href: "http://localhost:8000" + path + "?stepFour", 23 a dcampaignid: "4",24 a ddestination: "http://localhost:8000"23 attributionsourceid: "4", 24 attributeon: "http://localhost:8000" 25 25 } 26 26 ]; … … 31 31 let linkElement = document.getElementById("targetLink"); 32 32 linkElement.setAttribute("href", configuration[index].href); 33 linkElement.setAttribute("a dcampaignid", configuration[index].adcampaignid);34 linkElement.setAttribute("a ddestination", configuration[index].addestination);33 linkElement.setAttribute("attributionsourceid", configuration[index].attributionsourceid); 34 linkElement.setAttribute("attributeon", configuration[index].attributeon); 35 35 } 36 36 -
trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority.html
r269712 r269886 16 16 { 17 17 href: "http://localhost:8000" + path + "?stepTwo", 18 a dcampaignid: "3",19 a ddestination: "http://localhost:8000"18 attributionsourceid: "3", 19 attributeon: "http://localhost:8000" 20 20 }, 21 21 { 22 22 href: "http://localhost:8000" + path + "?stepFour", 23 a dcampaignid: "4",24 a ddestination: "http://localhost:8000"23 attributionsourceid: "4", 24 attributeon: "http://localhost:8000" 25 25 } 26 26 ]; … … 31 31 let linkElement = document.getElementById("targetLink"); 32 32 linkElement.setAttribute("href", configuration[index].href); 33 linkElement.setAttribute("a dcampaignid", configuration[index].adcampaignid);34 linkElement.setAttribute("a ddestination", configuration[index].addestination);33 linkElement.setAttribute("attributionsourceid", configuration[index].attributionsourceid); 34 linkElement.setAttribute("attributeon", configuration[index].attributeon); 35 35 } 36 36 -
trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-higher-priority.html
r269712 r269886 16 16 { 17 17 href: "http://localhost:8000" + path + "?stepTwo", 18 a dcampaignid: "3",19 a ddestination: "http://localhost:8000"18 attributionsourceid: "3", 19 attributeon: "http://localhost:8000" 20 20 } 21 21 ]; … … 26 26 let linkElement = document.getElementById("targetLink"); 27 27 linkElement.setAttribute("href", configuration[index].href); 28 linkElement.setAttribute("a dcampaignid", configuration[index].adcampaignid);29 linkElement.setAttribute("a ddestination", configuration[index].addestination);28 linkElement.setAttribute("attributionsourceid", configuration[index].attributionsourceid); 29 linkElement.setAttribute("attributeon", configuration[index].attributeon); 30 30 } 31 31 -
trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-lower-priority.html
r269712 r269886 16 16 { 17 17 href: "http://localhost:8000" + path + "?stepTwo", 18 a dcampaignid: "3",19 a ddestination: "http://localhost:8000"18 attributionsourceid: "3", 19 attributeon: "http://localhost:8000" 20 20 } 21 21 ]; … … 26 26 let linkElement = document.getElementById("targetLink"); 27 27 linkElement.setAttribute("href", configuration[index].href); 28 linkElement.setAttribute("a dcampaignid", configuration[index].adcampaignid);29 linkElement.setAttribute("a ddestination", configuration[index].addestination);28 linkElement.setAttribute("attributionsourceid", configuration[index].attributionsourceid); 29 linkElement.setAttribute("attributeon", configuration[index].attributeon); 30 30 } 31 31 -
trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt
r269712 r269886 17 17 No cookies in conversion request. 18 18 Request body: 19 {" content-type":"click","content-site":"127.0.0.1","content-id":3,"conversion-site":"localhost","conversion-data":12,"report-version":1}19 {"source-engagement-type":"click","source-site":"127.0.0.1","source-id":3,"attributed-on-site":"localhost","trigger-data":12,"report-version":1} 20 20 21 21 -
trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request.html
r269712 r269886 9 9 <body onload="setTimeout(runTest, 0)"> 10 10 <div id="description">Tests sending of private click measurement requests after a conversion. Also tests that cookies are not sent in those requests and cookies are not accepted in the responses.</div> 11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/send-attribution-conversion-request.html?stepTwo" a dcampaignid="3" addestination="http://localhost:8000">Link</a><br>11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/send-attribution-conversion-request.html?stepTwo" attributionsourceid="3" attributeon="http://localhost:8000">Link</a><br> 12 12 <div id="output"></div> 13 13 <script> -
trunk/LayoutTests/http/tests/privateClickMeasurement/store-disabled-in-ephemeral-session.html
r269712 r269886 10 10 <body onload="setTimeout(runTest, 0)"> 11 11 <div id="description">Tests that storage of private click measurement is disabled in ephemeral sessions.</div> 12 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/store-disabled-in-ephemeral-session.html?stepTwo" a dcampaignid="3" addestination="http://localhost:8000">Link</a><br>12 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/store-disabled-in-ephemeral-session.html?stepTwo" attributionsourceid="3" attributeon="http://localhost:8000">Link</a><br> 13 13 <div id="output"></div> 14 14 <script> -
trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement.html
r269712 r269886 9 9 <body onload="setTimeout(runTest, 0)"> 10 10 <div id="description">Tests storage of private click measurement.</div> 11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/store-private-click-measurement.html?stepTwo" a dcampaignid="3" addestination="http://localhost:8000">Link</a><br>11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/store-private-click-measurement.html?stepTwo" attributionsourceid="3" attributeon="http://localhost:8000">Link</a><br> 12 12 <div id="output"></div> 13 13 <script> -
trunk/Source/WebCore/ChangeLog
r269880 r269886 1 2020-11-16 John Wilander <wilander@apple.com> 2 3 PCM: Change attribute and JSON key names according to the W3C conversation 4 https://bugs.webkit.org/show_bug.cgi?id=218967 5 6 Reviewed by Brent Fulgham. 7 8 We've discussed extensively with Google and others on naming for the link 9 attributes and JSON key names in these issues: 10 https://github.com/privacycg/private-click-measurement/issues/30 11 https://github.com/privacycg/private-click-measurement/issues/56 12 13 This patch changes PCM accordingly. 14 15 No new tests. Exiting tests updated. 16 17 * html/HTMLAnchorElement.cpp: 18 (WebCore::HTMLAnchorElement::parsePrivateClickMeasurement const): 19 * html/HTMLAnchorElement.idl: 20 * html/HTMLAttributeNames.in: 21 * loader/PrivateClickMeasurement.cpp: 22 (WebCore::PrivateClickMeasurement::json const): 23 1 24 2020-11-16 Antoine Quint <graouts@webkit.org> 2 25 -
trunk/Source/WebCore/html/HTMLAnchorElement.cpp
r269712 r269886 417 417 return WTF::nullopt; 418 418 419 if (!hasAttributeWithoutSynchronization(a dcampaignidAttr) && !hasAttributeWithoutSynchronization(addestinationAttr))419 if (!hasAttributeWithoutSynchronization(attributionsourceidAttr) && !hasAttributeWithoutSynchronization(attributeonAttr)) 420 420 return WTF::nullopt; 421 421 422 auto a dCampaignIDAttr = attributeWithoutSynchronization(adcampaignidAttr);423 auto a dDestinationAttr = attributeWithoutSynchronization(addestinationAttr);422 auto attributionSourceIDAttr = attributeWithoutSynchronization(attributionsourceidAttr); 423 auto attributeOnAttr = attributeWithoutSynchronization(attributeonAttr); 424 424 425 if (a dCampaignIDAttr.isEmpty() || adDestinationAttr.isEmpty()) {426 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "Both a dcampaignid and addestination need to be set for Private Click Measurement to work."_s);425 if (attributionSourceIDAttr.isEmpty() || attributeOnAttr.isEmpty()) { 426 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "Both attributionsourceid and attributeon need to be set for Private Click Measurement to work."_s); 427 427 return WTF::nullopt; 428 428 } … … 434 434 } 435 435 436 auto a dCampaignID = parseHTMLNonNegativeInteger(adCampaignIDAttr);437 if (!a dCampaignID) {438 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "a dcampaignid can not be converted to a non-negative integer which is required for Private Click Measurement."_s);436 auto attributionSourceID = parseHTMLNonNegativeInteger(attributionSourceIDAttr); 437 if (!attributionSourceID) { 438 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "attributionsourceid can not be converted to a non-negative integer which is required for Private Click Measurement."_s); 439 439 return WTF::nullopt; 440 440 } 441 441 442 if (a dCampaignID.value() > PrivateClickMeasurement::MaxEntropy) {443 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, makeString("a dcampaignid must have a non-negative value less than or equal to ", PrivateClickMeasurement::MaxEntropy, " for Private Click Measurement."));444 return WTF::nullopt; 445 } 446 447 URL a dDestinationURL { URL(), adDestinationAttr };448 if (!a dDestinationURL.isValid() || !adDestinationURL.protocolIsInHTTPFamily()) {449 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "a ddestination could not be converted to a valid HTTP-family URL."_s);442 if (attributionSourceID.value() > PrivateClickMeasurement::MaxEntropy) { 443 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, makeString("attributionsourceid must have a non-negative value less than or equal to ", PrivateClickMeasurement::MaxEntropy, " for Private Click Measurement.")); 444 return WTF::nullopt; 445 } 446 447 URL attributeOnURL { URL(), attributeOnAttr }; 448 if (!attributeOnURL.isValid() || !attributeOnURL.protocolIsInHTTPFamily()) { 449 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "attributeon could not be converted to a valid HTTP-family URL."_s); 450 450 return WTF::nullopt; 451 451 } 452 452 453 453 RegistrableDomain documentRegistrableDomain { document().url() }; 454 if (documentRegistrableDomain.matches(a dDestinationURL)) {455 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "a ddestination can not be the same site as the current website."_s);456 return WTF::nullopt; 457 } 458 459 return PrivateClickMeasurement { Campaign(a dCampaignID.value()), Source(documentRegistrableDomain), Destination(adDestinationURL) };454 if (documentRegistrableDomain.matches(attributeOnURL)) { 455 document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "attributeon can not be the same site as the current website."_s); 456 return WTF::nullopt; 457 } 458 459 return PrivateClickMeasurement { Campaign(attributionSourceID.value()), Source(documentRegistrableDomain), Destination(attributeOnURL) }; 460 460 } 461 461 -
trunk/Source/WebCore/html/HTMLAnchorElement.idl
r269712 r269886 22 22 Exposed=Window 23 23 ] interface HTMLAnchorElement : HTMLElement { 24 [CEReactions=NotNeeded, EnabledBySetting=PrivateClickMeasurement, Reflect] attribute DOMString a dcampaignid;25 [CEReactions=NotNeeded, EnabledBySetting=PrivateClickMeasurement, Reflect] attribute DOMString a ddestination;24 [CEReactions=NotNeeded, EnabledBySetting=PrivateClickMeasurement, Reflect] attribute DOMString attributionsourceid; 25 [CEReactions=NotNeeded, EnabledBySetting=PrivateClickMeasurement, Reflect] attribute DOMString attributeon; 26 26 [CEReactions=NotNeeded, Reflect] attribute DOMString charset; 27 27 [CEReactions=NotNeeded, Reflect] attribute DOMString coords; -
trunk/Source/WebCore/html/HTMLAttributeNames.in
r267939 r269886 67 67 as 68 68 async 69 a dcampaignid70 a ddestination69 attributionsourceid 70 attributeon 71 71 autocomplete 72 72 autofocus -
trunk/Source/WebCore/loader/PrivateClickMeasurement.cpp
r269712 r269886 171 171 return reportDetails; 172 172 173 reportDetails->setString(" content-type"_s, "click"_s);174 reportDetails->setString(" content-site"_s, m_source.registrableDomain.string());175 reportDetails->setInteger(" content-id"_s, m_campaign.id);176 reportDetails->setString(" conversion-site"_s, m_destination.registrableDomain.string());177 reportDetails->setInteger(" conversion-data"_s, m_conversion->data);173 reportDetails->setString("source-engagement-type"_s, "click"_s); 174 reportDetails->setString("source-site"_s, m_source.registrableDomain.string()); 175 reportDetails->setInteger("source-id"_s, m_campaign.id); 176 reportDetails->setString("attributed-on-site"_s, m_destination.registrableDomain.string()); 177 reportDetails->setInteger("trigger-data"_s, m_conversion->data); 178 178 reportDetails->setInteger("report-version"_s, 1); 179 179 return reportDetails; -
trunk/Tools/ChangeLog
r269874 r269886 1 2020-11-16 John Wilander <wilander@apple.com> 2 3 PCM: Change attribute and JSON key names according to the W3C conversation 4 https://bugs.webkit.org/show_bug.cgi?id=218967 5 6 Reviewed by Brent Fulgham. 7 8 We've discussed extensively with Google and others on naming for the link 9 attributes and JSON key names in these issues: 10 https://github.com/privacycg/private-click-measurement/issues/30 11 https://github.com/privacycg/private-click-measurement/issues/56 12 13 This patch changes PCM accordingly. 14 15 * TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp: 16 (TestWebKitAPI::TEST): 17 1 18 2020-11-16 Matt Lewis <jlewis3@apple.com> 2 19 -
trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp
r269712 r269886 51 51 ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/"); 52 52 53 ASSERT_EQ(attribution.json()->toJSONString(), "{\" content-type\":\"click\",\"content-site\":\"webkit.org\",\"content-id\":0,\"conversion-site\":\"example.com\",\"conversion-data\":0,\"report-version\":1}");53 ASSERT_EQ(attribution.json()->toJSONString(), "{\"source-engagement-type\":\"click\",\"source-site\":\"webkit.org\",\"source-id\":0,\"attributed-on-site\":\"example.com\",\"trigger-data\":0,\"report-version\":1}"); 54 54 } 55 55 … … 63 63 ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/"); 64 64 65 ASSERT_EQ(attribution.json()->toJSONString(), "{\" content-type\":\"click\",\"content-site\":\"webkit.org\",\"content-id\":12,\"conversion-site\":\"example.com\",\"conversion-data\":44,\"report-version\":1}");65 ASSERT_EQ(attribution.json()->toJSONString(), "{\"source-engagement-type\":\"click\",\"source-site\":\"webkit.org\",\"source-id\":12,\"attributed-on-site\":\"example.com\",\"trigger-data\":44,\"report-version\":1}"); 66 66 } 67 67 … … 75 75 ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/"); 76 76 77 ASSERT_EQ(attribution.json()->toJSONString(), "{\" content-type\":\"click\",\"content-site\":\"webkit.org\",\"content-id\":63,\"conversion-site\":\"example.com\",\"conversion-data\":63,\"report-version\":1}");77 ASSERT_EQ(attribution.json()->toJSONString(), "{\"source-engagement-type\":\"click\",\"source-site\":\"webkit.org\",\"source-id\":63,\"attributed-on-site\":\"example.com\",\"trigger-data\":63,\"report-version\":1}"); 78 78 } 79 79
Note: See TracChangeset
for help on using the changeset viewer.