Changeset 269886 in webkit


Ignore:
Timestamp:
Nov 16, 2020 4:00:32 PM (3 years ago)
Author:
wilander@apple.com
Message:

PCM: Change attribute and JSON key names according to the W3C conversation
https://bugs.webkit.org/show_bug.cgi?id=218967

Reviewed by Brent Fulgham.

We've discussed extensively with Google and others on naming for the link
attributes and JSON key names in these issues:
https://github.com/privacycg/private-click-measurement/issues/30
https://github.com/privacycg/private-click-measurement/issues/56

This patch changes PCM accordingly.

Source/WebCore:

No new tests. Exiting tests updated.

  • html/HTMLAnchorElement.cpp:

(WebCore::HTMLAnchorElement::parsePrivateClickMeasurement const):

  • html/HTMLAnchorElement.idl:
  • html/HTMLAttributeNames.in:
  • loader/PrivateClickMeasurement.cpp:

(WebCore::PrivateClickMeasurement::json const):

Tools:

  • TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp:

(TestWebKitAPI::TEST):

LayoutTests:

  • http/tests/contentextensions/block-private-click-measurement.html:
  • http/tests/privateClickMeasurement/anchor-tag-attributes-reflect-expected.txt:
  • http/tests/privateClickMeasurement/anchor-tag-attributes-reflect.html:
  • http/tests/privateClickMeasurement/anchor-tag-attributes-validation-expected.txt:
  • http/tests/privateClickMeasurement/anchor-tag-attributes-validation.html:
  • http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html:
  • http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window.html:
  • http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html:
  • http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html:
  • http/tests/privateClickMeasurement/clear-through-website-data-removal.html:
  • http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html:
  • http/tests/privateClickMeasurement/expired-attributions-removed.html:
  • http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority.html:
  • http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority.html:
  • http/tests/privateClickMeasurement/second-conversion-with-higher-priority.html:
  • http/tests/privateClickMeasurement/second-conversion-with-lower-priority.html:
  • http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt:
  • http/tests/privateClickMeasurement/send-attribution-conversion-request.html:
  • http/tests/privateClickMeasurement/store-disabled-in-ephemeral-session.html:
  • http/tests/privateClickMeasurement/store-private-click-measurement.html:
Location:
trunk
Files:
28 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r269880 r269886  
     12020-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
    1362020-11-16  Antoine Quint  <graouts@webkit.org>
    237
  • trunk/LayoutTests/http/tests/contentextensions/block-private-click-measurement.html

    r269712 r269886  
    99<body onload="setTimeout(runTest, 0)">
    1010<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" adcampaignid="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>
    1212<div id="output"></div>
    1313<script>
  • trunk/LayoutTests/http/tests/privateClickMeasurement/anchor-tag-attributes-reflect-expected.txt

    r269712 r269886  
    44
    55
    6 PASS anchorTag.adcampaignid is "40"
    7 PASS anchorTag.addestination is "destination.example"
     6PASS anchorTag.attributionsourceid is "40"
     7PASS anchorTag.attributeon is "destination.example"
    88PASS successfullyParsed is true
    99
  • trunk/LayoutTests/http/tests/privateClickMeasurement/anchor-tag-attributes-reflect.html

    r269712 r269886  
    66</head>
    77<body>
    8 <a id="testTag" href="http://localhost:8000" adcampaignid="40" addestination="destination.example"></a>
     8<a id="testTag" href="http://localhost:8000" attributionsourceid="40" attributeon="destination.example"></a>
    99<script>
    1010    description("Test for the new private click measurement attributes on anchor tags.");
    1111
    1212    const anchorTag = document.getElementById("testTag");
    13     shouldBeEqualToString("anchorTag.adcampaignid", "40");
    14     shouldBeEqualToString("anchorTag.addestination", "destination.example");
     13    shouldBeEqualToString("anchorTag.attributionsourceid", "40");
     14    shouldBeEqualToString("anchorTag.attributeon", "destination.example");
    1515</script>
    1616</body>
  • trunk/LayoutTests/http/tests/privateClickMeasurement/anchor-tag-attributes-validation-expected.txt

    r269712 r269886  
    1 CONSOLE MESSAGE: adcampaignid must have a non-negative value less than or equal to 63 for Private Click Measurement.
    2 CONSOLE MESSAGE: adcampaignid must have a non-negative value less than or equal to 63 for Private Click Measurement.
    3 CONSOLE MESSAGE: adcampaignid can not be converted to a non-negative integer which is required for Private Click Measurement.
    4 CONSOLE MESSAGE: adcampaignid can not be converted to a non-negative integer which is required for Private Click Measurement.
    5 CONSOLE MESSAGE: adcampaignid can not be converted to a non-negative integer which is required for Private Click Measurement.
    6 CONSOLE MESSAGE: addestination could not be converted to a valid HTTP-family URL.
    7 CONSOLE MESSAGE: addestination could not be converted to a valid HTTP-family URL.
    8 CONSOLE MESSAGE: addestination could not be converted to a valid HTTP-family URL.
    9 CONSOLE MESSAGE: Both adcampaignid and addestination need to be set for Private Click Measurement to work.
    10 CONSOLE MESSAGE: Both adcampaignid and addestination need to be set for Private Click Measurement to work.
    11 CONSOLE MESSAGE: addestination can not be the same site as the current website.
     1CONSOLE MESSAGE: attributionsourceid must have a non-negative value less than or equal to 63 for Private Click Measurement.
     2CONSOLE MESSAGE: attributionsourceid must have a non-negative value less than or equal to 63 for Private Click Measurement.
     3CONSOLE MESSAGE: attributionsourceid can not be converted to a non-negative integer which is required for Private Click Measurement.
     4CONSOLE MESSAGE: attributionsourceid can not be converted to a non-negative integer which is required for Private Click Measurement.
     5CONSOLE MESSAGE: attributionsourceid can not be converted to a non-negative integer which is required for Private Click Measurement.
     6CONSOLE MESSAGE: attributeon could not be converted to a valid HTTP-family URL.
     7CONSOLE MESSAGE: attributeon could not be converted to a valid HTTP-family URL.
     8CONSOLE MESSAGE: attributeon could not be converted to a valid HTTP-family URL.
     9CONSOLE MESSAGE: Both attributionsourceid and attributeon need to be set for Private Click Measurement to work.
     10CONSOLE MESSAGE: Both attributionsourceid and attributeon need to be set for Private Click Measurement to work.
     11CONSOLE MESSAGE: attributeon can not be the same site as the current website.
    1212Test for validity of private click measurement attributes on anchor tags.
    1313
  • trunk/LayoutTests/http/tests/privateClickMeasurement/anchor-tag-attributes-validation.html

    r269712 r269886  
    2525        anchorElement.id = elementID;
    2626        anchorElement.classList.add("wide-link");
    27         anchorElement.adcampaignid = adCampaignID;
    28         anchorElement.addestination = adDestination;
     27        anchorElement.attributionsourceid = adCampaignID;
     28        anchorElement.attributeon = adDestination;
    2929        anchorElement.href = "#";
    3030        anchorElement.innerText = "Link" + currentTest;
  • trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-cross-site-image-redirect.html

    r269712 r269886  
    99<body onload="setTimeout(runTest, 0)">
    1010<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" adcampaignid="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>
    1212<div id="output"></div>
    1313<script>
  • trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-in-new-window.html

    r269712 r269886  
    99<body onload="setTimeout(runTest, 0)">
    1010<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" adcampaignid="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>
    1212<div id="output"></div>
    1313<script>
  • trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-with-priority.html

    r269712 r269886  
    99<body onload="setTimeout(runTest, 0)">
    1010<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" adcampaignid="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>
    1212<div id="output"></div>
    1313<script>
  • trunk/LayoutTests/http/tests/privateClickMeasurement/attribution-conversion-through-image-redirect-without-priority.html

    r269712 r269886  
    99<body onload="setTimeout(runTest, 0)">
    1010<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" adcampaignid="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>
    1212<div id="output"></div>
    1313<script>
  • trunk/LayoutTests/http/tests/privateClickMeasurement/clear-through-website-data-removal.html

    r269712 r269886  
    1616        {
    1717            href: "http://localhost:8000" + path + "?stepTwo",
    18             adcampaignid: "3",
    19             addestination: "http://localhost:8000"
     18            attributionsourceid: "3",
     19            attributeon: "http://localhost:8000"
    2020        },
    2121        {
    2222            href: "http://127.0.0.1:8000" + path + "?stepThree",
    23             adcampaignid: "4",
    24             addestination: "http://127.0.0.1:8000"
     23            attributionsourceid: "4",
     24            attributeon: "http://127.0.0.1:8000"
    2525        }
    2626    ];
     
    3131        let linkElement = document.getElementById("targetLink");
    3232        linkElement.setAttribute("href", configuration[index].href);
    33         linkElement.setAttribute("adcampaignid", configuration[index].adcampaignid);
    34         linkElement.setAttribute("addestination", configuration[index].addestination);
     33        linkElement.setAttribute("attributionsourceid", configuration[index].attributionsourceid);
     34        linkElement.setAttribute("attributeon", configuration[index].attributeon);
    3535    }
    3636
  • trunk/LayoutTests/http/tests/privateClickMeasurement/conversion-disabled-in-ephemeral-session.html

    r269712 r269886  
    99<body onload="setTimeout(runTest, 0)">
    1010<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" adcampaignid="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>
    1212<div id="output"></div>
    1313<script>
  • trunk/LayoutTests/http/tests/privateClickMeasurement/expired-attributions-removed.html

    r269712 r269886  
    99<body onload="setTimeout(runTest, 0)">
    1010<div id="description">Tests expiration of private click measurement.</div>
    11 <a id="targetLink" href="http://localhost:8000/privateClickMeasurement/expired-attributions-removed.html?stepTwo" adcampaignid="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>
    1212<div id="output"></div>
    1313<script>
  • trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-higher-priority.html

    r269712 r269886  
    1616        {
    1717            href: "http://localhost:8000" + path + "?stepTwo",
    18             adcampaignid: "3",
    19             addestination: "http://localhost:8000"
     18            attributionsourceid: "3",
     19            attributeon: "http://localhost:8000"
    2020        },
    2121        {
    2222            href: "http://localhost:8000" + path + "?stepFour",
    23             adcampaignid: "4",
    24             addestination: "http://localhost:8000"
     23            attributionsourceid: "4",
     24            attributeon: "http://localhost:8000"
    2525        }
    2626    ];
     
    3131        let linkElement = document.getElementById("targetLink");
    3232        linkElement.setAttribute("href", configuration[index].href);
    33         linkElement.setAttribute("adcampaignid", configuration[index].adcampaignid);
    34         linkElement.setAttribute("addestination", configuration[index].addestination);
     33        linkElement.setAttribute("attributionsourceid", configuration[index].attributionsourceid);
     34        linkElement.setAttribute("attributeon", configuration[index].attributeon);
    3535    }
    3636
  • trunk/LayoutTests/http/tests/privateClickMeasurement/second-attribution-converted-with-lower-priority.html

    r269712 r269886  
    1616        {
    1717            href: "http://localhost:8000" + path + "?stepTwo",
    18             adcampaignid: "3",
    19             addestination: "http://localhost:8000"
     18            attributionsourceid: "3",
     19            attributeon: "http://localhost:8000"
    2020        },
    2121        {
    2222            href: "http://localhost:8000" + path + "?stepFour",
    23             adcampaignid: "4",
    24             addestination: "http://localhost:8000"
     23            attributionsourceid: "4",
     24            attributeon: "http://localhost:8000"
    2525        }
    2626    ];
     
    3131        let linkElement = document.getElementById("targetLink");
    3232        linkElement.setAttribute("href", configuration[index].href);
    33         linkElement.setAttribute("adcampaignid", configuration[index].adcampaignid);
    34         linkElement.setAttribute("addestination", configuration[index].addestination);
     33        linkElement.setAttribute("attributionsourceid", configuration[index].attributionsourceid);
     34        linkElement.setAttribute("attributeon", configuration[index].attributeon);
    3535    }
    3636
  • trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-higher-priority.html

    r269712 r269886  
    1616        {
    1717            href: "http://localhost:8000" + path + "?stepTwo",
    18             adcampaignid: "3",
    19             addestination: "http://localhost:8000"
     18            attributionsourceid: "3",
     19            attributeon: "http://localhost:8000"
    2020        }
    2121    ];
     
    2626        let linkElement = document.getElementById("targetLink");
    2727        linkElement.setAttribute("href", configuration[index].href);
    28         linkElement.setAttribute("adcampaignid", configuration[index].adcampaignid);
    29         linkElement.setAttribute("addestination", configuration[index].addestination);
     28        linkElement.setAttribute("attributionsourceid", configuration[index].attributionsourceid);
     29        linkElement.setAttribute("attributeon", configuration[index].attributeon);
    3030    }
    3131
  • trunk/LayoutTests/http/tests/privateClickMeasurement/second-conversion-with-lower-priority.html

    r269712 r269886  
    1616        {
    1717            href: "http://localhost:8000" + path + "?stepTwo",
    18             adcampaignid: "3",
    19             addestination: "http://localhost:8000"
     18            attributionsourceid: "3",
     19            attributeon: "http://localhost:8000"
    2020        }
    2121    ];
     
    2626        let linkElement = document.getElementById("targetLink");
    2727        linkElement.setAttribute("href", configuration[index].href);
    28         linkElement.setAttribute("adcampaignid", configuration[index].adcampaignid);
    29         linkElement.setAttribute("addestination", configuration[index].addestination);
     28        linkElement.setAttribute("attributionsourceid", configuration[index].attributionsourceid);
     29        linkElement.setAttribute("attributeon", configuration[index].attributeon);
    3030    }
    3131
  • trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request-expected.txt

    r269712 r269886  
    1717No cookies in conversion request.
    1818Request 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}
    2020
    2121
  • trunk/LayoutTests/http/tests/privateClickMeasurement/send-attribution-conversion-request.html

    r269712 r269886  
    99<body onload="setTimeout(runTest, 0)">
    1010<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" adcampaignid="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>
    1212<div id="output"></div>
    1313<script>
  • trunk/LayoutTests/http/tests/privateClickMeasurement/store-disabled-in-ephemeral-session.html

    r269712 r269886  
    1010<body onload="setTimeout(runTest, 0)">
    1111<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" adcampaignid="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>
    1313<div id="output"></div>
    1414<script>
  • trunk/LayoutTests/http/tests/privateClickMeasurement/store-private-click-measurement.html

    r269712 r269886  
    99<body onload="setTimeout(runTest, 0)">
    1010<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" adcampaignid="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>
    1212<div id="output"></div>
    1313<script>
  • trunk/Source/WebCore/ChangeLog

    r269880 r269886  
     12020-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
    1242020-11-16  Antoine Quint  <graouts@webkit.org>
    225
  • trunk/Source/WebCore/html/HTMLAnchorElement.cpp

    r269712 r269886  
    417417        return WTF::nullopt;
    418418
    419     if (!hasAttributeWithoutSynchronization(adcampaignidAttr) && !hasAttributeWithoutSynchronization(addestinationAttr))
     419    if (!hasAttributeWithoutSynchronization(attributionsourceidAttr) && !hasAttributeWithoutSynchronization(attributeonAttr))
    420420        return WTF::nullopt;
    421421   
    422     auto adCampaignIDAttr = attributeWithoutSynchronization(adcampaignidAttr);
    423     auto adDestinationAttr = attributeWithoutSynchronization(addestinationAttr);
     422    auto attributionSourceIDAttr = attributeWithoutSynchronization(attributionsourceidAttr);
     423    auto attributeOnAttr = attributeWithoutSynchronization(attributeonAttr);
    424424   
    425     if (adCampaignIDAttr.isEmpty() || adDestinationAttr.isEmpty()) {
    426         document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "Both adcampaignid 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);
    427427        return WTF::nullopt;
    428428    }
     
    434434    }
    435435   
    436     auto adCampaignID = parseHTMLNonNegativeInteger(adCampaignIDAttr);
    437     if (!adCampaignID) {
    438         document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "adcampaignid 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);
    439439        return WTF::nullopt;
    440440    }
    441441   
    442     if (adCampaignID.value() > PrivateClickMeasurement::MaxEntropy) {
    443         document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, makeString("adcampaignid 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 adDestinationURL { URL(), adDestinationAttr };
    448     if (!adDestinationURL.isValid() || !adDestinationURL.protocolIsInHTTPFamily()) {
    449         document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "addestination 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);
    450450        return WTF::nullopt;
    451451    }
    452452
    453453    RegistrableDomain documentRegistrableDomain { document().url() };
    454     if (documentRegistrableDomain.matches(adDestinationURL)) {
    455         document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "addestination can not be the same site as the current website."_s);
    456         return WTF::nullopt;
    457     }
    458 
    459     return PrivateClickMeasurement { Campaign(adCampaignID.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) };
    460460}
    461461
  • trunk/Source/WebCore/html/HTMLAnchorElement.idl

    r269712 r269886  
    2222    Exposed=Window
    2323] interface HTMLAnchorElement : HTMLElement {
    24     [CEReactions=NotNeeded, EnabledBySetting=PrivateClickMeasurement, Reflect] attribute DOMString adcampaignid;
    25     [CEReactions=NotNeeded, EnabledBySetting=PrivateClickMeasurement, Reflect] attribute DOMString addestination;
     24    [CEReactions=NotNeeded, EnabledBySetting=PrivateClickMeasurement, Reflect] attribute DOMString attributionsourceid;
     25    [CEReactions=NotNeeded, EnabledBySetting=PrivateClickMeasurement, Reflect] attribute DOMString attributeon;
    2626    [CEReactions=NotNeeded, Reflect] attribute DOMString charset;
    2727    [CEReactions=NotNeeded, Reflect] attribute DOMString coords;
  • trunk/Source/WebCore/html/HTMLAttributeNames.in

    r267939 r269886  
    6767as
    6868async
    69 adcampaignid
    70 addestination
     69attributionsourceid
     70attributeon
    7171autocomplete
    7272autofocus
  • trunk/Source/WebCore/loader/PrivateClickMeasurement.cpp

    r269712 r269886  
    171171        return reportDetails;
    172172
    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);
    178178    reportDetails->setInteger("report-version"_s, 1);
    179179    return reportDetails;
  • trunk/Tools/ChangeLog

    r269874 r269886  
     12020-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
    1182020-11-16  Matt Lewis  <jlewis3@apple.com>
    219
  • trunk/Tools/TestWebKitAPI/Tests/WebCore/PrivateClickMeasurement.cpp

    r269712 r269886  
    5151    ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/");
    5252
    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}");
    5454}
    5555
     
    6363    ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/");
    6464
    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}");
    6666}
    6767
     
    7575    ASSERT_EQ(attributionURL.string(), "https://webkit.org/.well-known/private-click-measurement/");
    7676
    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}");
    7878}
    7979
Note: See TracChangeset for help on using the changeset viewer.