Ignore Ad Click Attribution where source and destination are same-site
authorwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2019 01:36:28 +0000 (01:36 +0000)
committerwilander@apple.com <wilander@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 14 Feb 2019 01:36:28 +0000 (01:36 +0000)
commit9a30d1bf2686316091810db1cbe9299731415c15
tree79fd5d262f73c4ee6f4fc549854bd49bb9944b49
parent1f095044896ac0860468aea5a61d1c226b52a84a
Ignore Ad Click Attribution where source and destination are same-site
https://bugs.webkit.org/show_bug.cgi?id=194620
<rdar://problem/47890018>

Reviewed by Jiewen Tan.

Source/WebCore:

Updated the existing test.

We should not accept Ad Click Attribution requests where the site of the
anchor tag and its addestination attribute are same-site. Such attributions
don’t make sense (the site can track intra-site clicks through better means)
and would just lead to increased memory use where are the pending
attributions are stored.

For ports that don't have access to the Public Suffix List, this patch
only checks that the hosts don't match, i.e. not just eTLD+1.

* html/HTMLAnchorElement.cpp:
(WebCore::HTMLAnchorElement::parseAdClickAttribution const):
    Now returns WTF::nullopt if the current document and the
    addestination are same site. Also fixed a console message
    typo.

LayoutTests:

Same-site test added and test results updated.

* http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt:
* http/tests/adClickAttribution/anchor-tag-attributes-validation.html:
* platform/ios-wk2/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@241490 268f45cc-cd09-0410-ab3c-d52691b4dbfc
LayoutTests/ChangeLog
LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt
LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation.html
LayoutTests/platform/ios-wk2/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt
Source/WebCore/ChangeLog
Source/WebCore/html/HTMLAnchorElement.cpp