WebKit Bugzilla
Attachment 361950 Details for
Bug 194620
: Ignore Ad Click Attribution where source and destination are same-site
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-194620-20190213155338.patch (text/plain), 9.09 KB, created by
John Wilander
on 2019-02-13 15:53:39 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
John Wilander
Created:
2019-02-13 15:53:39 PST
Size:
9.09 KB
patch
obsolete
>Subversion Revision: 241482 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index d99f481d12083ffdb9202410c339b26d8d1dbc64..112dc3d7d353e82f1c0262af769d3468c146a948 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,19 @@ >+2019-02-13 John Wilander <wilander@apple.com> >+ >+ 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 NOBODY (OOPS!). >+ >+ Updated existing test. >+ >+ * 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. >+ > 2019-02-13 Chris Dumez <cdumez@apple.com> > > Unreviewed, update localizable strings. >diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp >index 37d98a33bc8bfdadebd1de3fa7b0a6d5107ebc0f..b6353619fffea5a10ba9b91d6856f1f020d096b2 100644 >--- a/Source/WebCore/html/HTMLAnchorElement.cpp >+++ b/Source/WebCore/html/HTMLAnchorElement.cpp >@@ -42,6 +42,7 @@ > #include "MouseEvent.h" > #include "PingLoader.h" > #include "PlatformMouseEvent.h" >+#include "PublicSuffix.h" > #include "RenderImage.h" > #include "ResourceRequest.h" > #include "RuntimeEnabledFeatures.h" >@@ -436,7 +437,18 @@ Optional<AdClickAttribution> HTMLAnchorElement::parseAdClickAttribution() const > > URL adDestinationURL { URL(), adDestinationAttr }; > if (!adDestinationURL.isValid() || !adDestinationURL.protocolIsInHTTPFamily()) { >- document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "adddestination could not be converted to a valid HTTP-family URL."_s); >+ document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "addestination could not be converted to a valid HTTP-family URL."_s); >+ return WTF::nullopt; >+ } >+ >+ auto documentDomain = document().domain(); >+ auto adDestinationHost = adDestinationURL.host().toString(); >+#if ENABLE(PUBLIC_SUFFIX_LIST) >+ if (topPrivatelyControlledDomain(documentDomain) == topPrivatelyControlledDomain(adDestinationHost)) { >+#else >+ if (documentDomain == adDestinationHost) { >+#endif >+ document().addConsoleMessage(MessageSource::Other, MessageLevel::Warning, "addestination can not be the same site as the current website."_s); > return WTF::nullopt; > } > >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 230c801b656e74435efce6fbde42a24b26c842c3..9178a605c8846ceccb84b88d1f157f28b0888f30 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,17 @@ >+2019-02-13 John Wilander <wilander@apple.com> >+ >+ 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 NOBODY (OOPS!). >+ >+ 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: >+ > 2019-02-13 Tim Horton <timothy_horton@apple.com> > > Encrypted PDFs inside <embed> or <object> crash the Web Content process >diff --git a/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt b/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt >index 4de18cc3794b843aa8542c480707d484065aa689..caee0d202ee053133629a13ceffdb2956484b457 100644 >--- a/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt >+++ b/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt >@@ -3,29 +3,16 @@ CONSOLE MESSAGE: line 108: adcampaignid must have a non-negative value less than > CONSOLE MESSAGE: line 108: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution. > CONSOLE MESSAGE: line 108: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution. > CONSOLE MESSAGE: line 108: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution. >-CONSOLE MESSAGE: line 108: adddestination could not be converted to a valid HTTP-family URL. >-CONSOLE MESSAGE: line 108: adddestination could not be converted to a valid HTTP-family URL. >-CONSOLE MESSAGE: line 108: adddestination could not be converted to a valid HTTP-family URL. >+CONSOLE MESSAGE: line 108: addestination could not be converted to a valid HTTP-family URL. >+CONSOLE MESSAGE: line 108: addestination could not be converted to a valid HTTP-family URL. >+CONSOLE MESSAGE: line 108: addestination could not be converted to a valid HTTP-family URL. > CONSOLE MESSAGE: line 108: Both adcampaignid and addestination need to be set for Ad Click Attribution to work. > CONSOLE MESSAGE: line 108: Both adcampaignid and addestination need to be set for Ad Click Attribution to work. >+CONSOLE MESSAGE: line 108: addestination can not be the same site as the current website. > Test for validity of ad click attribution attributes on anchor tags. > > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > >-Link1 >-Link2 >-Link3 >-Link4 >-Link5 >-Link6 >-Link7 >-Link8 >-Link9 >-Link10 >-Link11 >-Link12 >-Link13 >-Link14 > > PASS successfullyParsed is true > >diff --git a/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation.html b/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation.html >index 1da45788c7d0c41e02e7224e2e2d9828f0852d13..3b602392715d25fd71611638050f1ef3b042a086 100644 >--- a/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation.html >+++ b/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-validation.html >@@ -51,6 +51,7 @@ > > const validAdCampaignID = "03"; > const validAdDestination = "http://webkit.org"; >+ const sameSite = document.location.origin; > const testCases = [ > [ validAdCampaignID, validAdDestination ], > [ "100", validAdDestination ], // Too many characters. >@@ -65,14 +66,17 @@ > [ validAdCampaignID, "://webkit.org" ], // Partially missing protocol. > [ validAdCampaignID, "" ], // Non-ASCII characters as destination. > [ "", validAdDestination ], // Empty campaign ID. >- [ validAdCampaignID, "" ] // Empty destination. >+ [ validAdCampaignID, "" ], // Empty destination. >+ [ validAdCampaignID, sameSite ] // Same-site destination. > ]; > > function runAllTests() { > if (currentTest < testCases.length) > runOneTest(testCases[currentTest][0], testCases[currentTest][1], runAllTests); >- else >+ else { >+ document.body.removeChild(output); > finishJSTest(); >+ } > } > </script> > </body> >diff --git a/LayoutTests/platform/ios-wk2/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt b/LayoutTests/platform/ios-wk2/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt >index 2ca10c55eec5190d4f8a48a812925903dacb1182..2e8984244135668b8465884971912efe516d706f 100644 >--- a/LayoutTests/platform/ios-wk2/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt >+++ b/LayoutTests/platform/ios-wk2/http/tests/adClickAttribution/anchor-tag-attributes-validation-expected.txt >@@ -3,29 +3,16 @@ CONSOLE MESSAGE: adcampaignid must have a non-negative value less than 64 for Ad > CONSOLE MESSAGE: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution. > CONSOLE MESSAGE: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution. > CONSOLE MESSAGE: adcampaignid can not be converted to a non-negative integer which is required for Ad Click Attribution. >-CONSOLE MESSAGE: adddestination could not be converted to a valid HTTP-family URL. >-CONSOLE MESSAGE: adddestination could not be converted to a valid HTTP-family URL. >-CONSOLE MESSAGE: adddestination could not be converted to a valid HTTP-family URL. >+CONSOLE MESSAGE: addestination could not be converted to a valid HTTP-family URL. >+CONSOLE MESSAGE: addestination could not be converted to a valid HTTP-family URL. >+CONSOLE MESSAGE: addestination could not be converted to a valid HTTP-family URL. > CONSOLE MESSAGE: Both adcampaignid and addestination need to be set for Ad Click Attribution to work. > CONSOLE MESSAGE: Both adcampaignid and addestination need to be set for Ad Click Attribution to work. >+CONSOLE MESSAGE: addestination can not be the same site as the current website. > Test for validity of ad click attribution attributes on anchor tags. > > On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". > >-Link1 >-Link2 >-Link3 >-Link4 >-Link5 >-Link6 >-Link7 >-Link8 >-Link9 >-Link10 >-Link11 >-Link12 >-Link13 >-Link14 > > PASS successfullyParsed is true >
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 194620
:
361950
|
361967