WebKit Bugzilla
Attachment 359809 Details for
Bug 193685
: Add Ad Click Attribution as an internal/experimental feature
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-193685-20190122165342.patch (text/plain), 15.84 KB, created by
John Wilander
on 2019-01-22 16:53:43 PST
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
John Wilander
Created:
2019-01-22 16:53:43 PST
Size:
15.84 KB
patch
obsolete
>Subversion Revision: 240269 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index c2e528dcd9957cef760dddb8a4e04c246836dfbd..1c30d6c5569660a0cc72c7979508d1f314d4a103 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,27 @@ >+2019-01-22 John Wilander <wilander@apple.com> >+ >+ Add Ad Click Attribution as an experimental feature >+ https://bugs.webkit.org/show_bug.cgi?id=193685 >+ <rdar://problem/47450399> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Test: http/tests/adClickAttribution/anchor-tag-attributes-reflect.html >+ >+ * html/HTMLAnchorElement.cpp: >+ (WebCore::HTMLAnchorElement::adcampaignid const): >+ (WebCore::HTMLAnchorElement::addestination const): >+ * html/HTMLAnchorElement.h: >+ * html/HTMLAnchorElement.idl: >+ * html/HTMLAttributeNames.in: >+ Addeed two new experimental attributes: >+ - adcampaignid: Ad campaign ID. >+ - addestination: Ad link destination site. >+ * page/RuntimeEnabledFeatures.h: >+ (WebCore::RuntimeEnabledFeatures::adClickAttributionEnabled const): >+ (WebCore::RuntimeEnabledFeatures::setAdClickAttributionEnabled): >+ * page/Settings.yaml: >+ > 2019-01-22 Claudio Saavedra <csaavedra@igalia.com> > > [GTK] Build fix for Ubuntu LTS 16.04 >diff --git a/Source/WebKit/ChangeLog b/Source/WebKit/ChangeLog >index fdfa234e85ee9a26a6dc87473d0e08359405ee36..46a2b93a3145fc2ee0b2ce306621fe30e61027da 100644 >--- a/Source/WebKit/ChangeLog >+++ b/Source/WebKit/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-22 John Wilander <wilander@apple.com> >+ >+ Add Ad Click Attribution as an experimental feature >+ https://bugs.webkit.org/show_bug.cgi?id=193685 >+ <rdar://problem/47450399> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * Shared/WebPreferences.yaml: >+ Added AdClickAttributionEnabled as a runtime enabled feature, off by default. >+ > 2019-01-22 Oriol Brufau <obrufau@igalia.com> > > [css-logical] Implement flow-relative margin, padding and border shorthands >diff --git a/Source/WebKitLegacy/mac/ChangeLog b/Source/WebKitLegacy/mac/ChangeLog >index 7faf7328428f26f0fada3933dbe71da62f6ec3c3..f91c60ef975007cc967b6b79644155b508701e4f 100644 >--- a/Source/WebKitLegacy/mac/ChangeLog >+++ b/Source/WebKitLegacy/mac/ChangeLog >@@ -1,3 +1,21 @@ >+2019-01-22 John Wilander <wilander@apple.com> >+ >+ Add Ad Click Attribution as an experimental feature >+ https://bugs.webkit.org/show_bug.cgi?id=193685 >+ <rdar://problem/47450399> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * WebView/WebPreferenceKeysPrivate.h: >+ * WebView/WebPreferences.mm: >+ (+[WebPreferences initialize]): >+ (-[WebPreferences adClickAttributionEnabled]): >+ (-[WebPreferences setAdClickAttributionEnabled:]): >+ Added support for experimental ad click attribution. >+ * WebView/WebPreferencesPrivate.h: >+ * WebView/WebView.mm: >+ (-[WebView _preferencesChanged:]): >+ > 2019-01-22 Oriol Brufau <obrufau@igalia.com> > > [css-logical] Implement flow-relative margin, padding and border shorthands >diff --git a/Source/WebCore/html/HTMLAnchorElement.cpp b/Source/WebCore/html/HTMLAnchorElement.cpp >index e7e167c95b4177513432f96c6f41e385afb62e44..9e4c9779da1621822fc320846f4212ab1e8dddb1 100644 >--- a/Source/WebCore/html/HTMLAnchorElement.cpp >+++ b/Source/WebCore/html/HTMLAnchorElement.cpp >@@ -371,6 +371,22 @@ void HTMLAnchorElement::sendPings(const URL& destinationURL) > PingLoader::sendPing(*document().frame(), document().completeURL(pingURLs[i]), destinationURL); > } > >+const AtomicString& HTMLAnchorElement::adcampaignid() const >+{ >+ if (!RuntimeEnabledFeatures::sharedFeatures().adClickAttributionEnabled()) >+ return nullAtom(); >+ >+ return adcampaignidAttr->localName(); >+} >+ >+const AtomicString& HTMLAnchorElement::addestination() const >+{ >+ if (!RuntimeEnabledFeatures::sharedFeatures().adClickAttributionEnabled()) >+ return nullAtom(); >+ >+ return addestinationAttr->localName(); >+} >+ > #if USE(SYSTEM_PREVIEW) > bool HTMLAnchorElement::isSystemPreviewLink() const > { >diff --git a/Source/WebCore/html/HTMLAnchorElement.h b/Source/WebCore/html/HTMLAnchorElement.h >index 6b02c9ab4d462685036e170396e45b81e8d329e8..f156a5aeaf833ce99f1d3716a37f5aa29ceadffe 100644 >--- a/Source/WebCore/html/HTMLAnchorElement.h >+++ b/Source/WebCore/html/HTMLAnchorElement.h >@@ -69,6 +69,9 @@ public: > > WEBCORE_EXPORT DOMTokenList& relList() const; > >+ const AtomicString& adcampaignid() const; >+ const AtomicString& addestination() const; >+ > #if USE(SYSTEM_PREVIEW) > WEBCORE_EXPORT bool isSystemPreviewLink() const; > #endif >diff --git a/Source/WebCore/html/HTMLAnchorElement.idl b/Source/WebCore/html/HTMLAnchorElement.idl >index b7f59462150ca7dacf7aae5e26c4d39df0f19634..0d21fc7d9ea9639983e9fa9815febde089c72dfb 100644 >--- a/Source/WebCore/html/HTMLAnchorElement.idl >+++ b/Source/WebCore/html/HTMLAnchorElement.idl >@@ -19,6 +19,8 @@ > */ > > interface HTMLAnchorElement : HTMLElement { >+ [CEReactions=NotNeeded, EnabledAtRuntime=AdClickAttribution, Reflect] attribute DOMString adcampaignid; >+ [CEReactions=NotNeeded, EnabledAtRuntime=AdClickAttribution, Reflect] attribute DOMString addestination; > [CEReactions=NotNeeded, Reflect] attribute DOMString charset; > [CEReactions=NotNeeded, Reflect] attribute DOMString coords; > [CEReactions=NotNeeded, Conditional=DOWNLOAD_ATTRIBUTE, EnabledAtRuntime=DownloadAttribute, Reflect] attribute DOMString download; >diff --git a/Source/WebCore/html/HTMLAttributeNames.in b/Source/WebCore/html/HTMLAttributeNames.in >index d82228207936e0cd4d097a387eb61cd1c2f7cd0f..ec0978dd7372023c50cb63f8157d8a2436d77c95 100644 >--- a/Source/WebCore/html/HTMLAttributeNames.in >+++ b/Source/WebCore/html/HTMLAttributeNames.in >@@ -66,6 +66,8 @@ aria-valuenow > aria-valuetext > as > async >+adcampaignid >+addestination > autocomplete > autofocus > autoplay >diff --git a/Source/WebCore/page/RuntimeEnabledFeatures.h b/Source/WebCore/page/RuntimeEnabledFeatures.h >index ab58159695e62312e87788de40d8b3065268cef1..0f7e7a500450a6506df3e28d3ca934fc0cc0763a 100644 >--- a/Source/WebCore/page/RuntimeEnabledFeatures.h >+++ b/Source/WebCore/page/RuntimeEnabledFeatures.h >@@ -341,6 +341,9 @@ public: > void setCSSLogicalEnabled(bool isEnabled) { m_CSSLogicalEnabled = isEnabled; } > bool cssLogicalEnabled() const { return m_CSSLogicalEnabled; } > >+ bool adClickAttributionEnabled() const { return m_adClickAttributionEnabled; } >+ void setAdClickAttributionEnabled(bool isEnabled) { m_adClickAttributionEnabled = isEnabled; } >+ > WEBCORE_EXPORT static RuntimeEnabledFeatures& sharedFeatures(); > > private: >@@ -516,6 +519,8 @@ private: > > bool m_CSSLogicalEnabled { false }; > >+ bool m_adClickAttributionEnabled { false }; >+ > friend class WTF::NeverDestroyed<RuntimeEnabledFeatures>; > }; > >diff --git a/Source/WebCore/page/Settings.yaml b/Source/WebCore/page/Settings.yaml >index 9b9a6e87c6acdf5b188e9dbc3c1ff3967db02a60..17136e182900730265316504bda6b870080f5e11 100644 >--- a/Source/WebCore/page/Settings.yaml >+++ b/Source/WebCore/page/Settings.yaml >@@ -788,3 +788,6 @@ videoQualityIncludesDisplayCompositingEnabled: > > editableImagesEnabled: > initial: false >+ >+adClickAttributionEnabled: >+ initial: false >diff --git a/Source/WebKit/Shared/WebPreferences.yaml b/Source/WebKit/Shared/WebPreferences.yaml >index c6145b1255d390ec8356a9e75d8aa25fd3a4c58f..7bb7591aa9c9db6da0a2803b4163cc514165597a 100644 >--- a/Source/WebKit/Shared/WebPreferences.yaml >+++ b/Source/WebKit/Shared/WebPreferences.yaml >@@ -1543,3 +1543,11 @@ CSSLogicalEnabled: > humanReadableDescription: "Enable CSS Logical Properties and Values" > webcoreBinding: RuntimeEnabledFeatures > category: internal >+ >+AdClickAttributionEnabled: >+ type: bool >+ defaultValue: false >+ humanReadableName: "Ad Click Attribution" >+ humanReadableDescription: "Enable Ad Click Attribution for Cross-Site Link Navigations" >+ webcoreBinding: RuntimeEnabledFeatures >+ category: experimental >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h b/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >index 8493a0ae9973a49a3f06da21a8f908f8bee94791..49d342ff2e27404ae8c269e2b5a960a26df3b980 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferenceKeysPrivate.h >@@ -264,3 +264,4 @@ > #define WebKitServerTimingEnabledPreferenceKey @"WebKitServerTimingEnabled" > #define WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey @"WebKitSelectionAcrossShadowBoundariesEnabled" > #define WebKitCSSLogicalEnabledPreferenceKey @"WebKitCSSLogicalEnabled" >+#define WebKitAdClickAttributionEnabledPreferenceKey @"WebKitAdClickAttributionEnabled" >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >index 3361b2f403ae2d29ef65ce8f83caab3f860656b2..20c0c254661f3df78ac65aa466ff900ee32c001a 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm >@@ -669,6 +669,7 @@ + (void)initialize > #endif > [NSNumber numberWithBool:YES], WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey, > [NSNumber numberWithBool:NO], WebKitCSSLogicalEnabledPreferenceKey, >+ [NSNumber numberWithBool:NO], WebKitAdClickAttributionEnabledPreferenceKey, > #if ENABLE(INTERSECTION_OBSERVER) > @NO, WebKitIntersectionObserverEnabledPreferenceKey, > #endif >@@ -3389,6 +3390,16 @@ - (void)setCSSLogicalEnabled:(BOOL)flag > [self _setBoolValue:flag forKey:WebKitCSSLogicalEnabledPreferenceKey]; > } > >+- (BOOL)adClickAttributionEnabled >+{ >+ return [self _boolValueForKey:WebKitAdClickAttributionEnabledPreferenceKey]; >+} >+ >+- (void)setAdClickAttributionEnabled:(BOOL)flag >+{ >+ [self _setBoolValue:flag forKey:WebKitAdClickAttributionEnabledPreferenceKey]; >+} >+ > @end > > @implementation WebPreferences (WebInternal) >diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h b/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h >index 2d7f11a5d2699ed7069c1182e41c5ca83659a8cf..8820db2703f7ab859726e5ac71ad1d595f38c283 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h >+++ b/Source/WebKitLegacy/mac/WebView/WebPreferencesPrivate.h >@@ -585,6 +585,9 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification WEBKIT_DEPR > - (void)setCSSLogicalEnabled:(BOOL)flag; > - (BOOL)cssLogicalEnabled; > >+- (BOOL)adClickAttributionEnabled; >+- (void)setAdClickAttributionEnabled:(BOOL)flag; >+ > @property (nonatomic) BOOL visualViewportEnabled; > @property (nonatomic) BOOL visualViewportAPIEnabled; > @property (nonatomic) BOOL CSSOMViewScrollingAPIEnabled; >diff --git a/Source/WebKitLegacy/mac/WebView/WebView.mm b/Source/WebKitLegacy/mac/WebView/WebView.mm >index ed0e0df79b03da66e8a29bced9ceaa93cd665e8c..48870a590a9cad6089f6dc7987631f9a530a0284 100644 >--- a/Source/WebKitLegacy/mac/WebView/WebView.mm >+++ b/Source/WebKitLegacy/mac/WebView/WebView.mm >@@ -3079,6 +3079,8 @@ - (void)_preferencesChanged:(WebPreferences *)preferences > > RuntimeEnabledFeatures::sharedFeatures().setCSSLogicalEnabled([preferences cssLogicalEnabled]); > >+ RuntimeEnabledFeatures::sharedFeatures().setAdClickAttributionEnabled([preferences adClickAttributionEnabled]); >+ > settings.setHiddenPageDOMTimerThrottlingEnabled([preferences hiddenPageDOMTimerThrottlingEnabled]); > > settings.setHiddenPageCSSAnimationSuspensionEnabled([preferences hiddenPageCSSAnimationSuspensionEnabled]); >diff --git a/Tools/ChangeLog b/Tools/ChangeLog >index eba7e9f2765a8d31dafb4d430dd97c78b914fd7f..ff0d86f5d6a52077896228bd05c120dffa65f7ff 100644 >--- a/Tools/ChangeLog >+++ b/Tools/ChangeLog >@@ -1,3 +1,16 @@ >+2019-01-22 John Wilander <wilander@apple.com> >+ >+ Add Ad Click Attribution as an experimental feature >+ https://bugs.webkit.org/show_bug.cgi?id=193685 >+ <rdar://problem/47450399> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * DumpRenderTree/TestOptions.cpp: >+ (TestOptions::TestOptions): >+ * DumpRenderTree/TestOptions.h: >+ Added test option adClickAttributionEnabled. >+ > 2019-01-22 Tadeu Zagallo <tzagallo@apple.com> > > Cache bytecode to disk >diff --git a/Tools/DumpRenderTree/TestOptions.cpp b/Tools/DumpRenderTree/TestOptions.cpp >index ee99dc94bed38e3e6161e8bb4a68a64335cce266..5a598670422ce62e64029c3b7a19d30141c6e051 100644 >--- a/Tools/DumpRenderTree/TestOptions.cpp >+++ b/Tools/DumpRenderTree/TestOptions.cpp >@@ -109,6 +109,8 @@ TestOptions::TestOptions(const std::string& pathOrURL, const std::string& absolu > enableWebGPU = parseBooleanTestHeaderValue(value); > else if (key == "internal:CSSLogicalEnabled") > enableCSSLogical = parseBooleanTestHeaderValue(value); >+ else if (key == "experimental:adClickAttributionEnabled") >+ adClickAttributionEnabled = parseBooleanTestHeaderValue(value); > pairStart = pairEnd + 1; > } > } >diff --git a/Tools/DumpRenderTree/TestOptions.h b/Tools/DumpRenderTree/TestOptions.h >index 3756e9539cf576f9dbf9aa7ad592f1ff116be6cd..c27e842a48f57ac80f5f04bbb5e6a92ad105d81d 100644 >--- a/Tools/DumpRenderTree/TestOptions.h >+++ b/Tools/DumpRenderTree/TestOptions.h >@@ -45,6 +45,7 @@ struct TestOptions { > bool enableSelectionAcrossShadowBoundaries { true }; > bool enableWebGPU { false }; > bool enableCSSLogical { false }; >+ bool adClickAttributionEnabled { false }; > std::string jscOptions; > > TestOptions(const std::string& pathOrURL, const std::string& absolutePath); >diff --git a/LayoutTests/ChangeLog b/LayoutTests/ChangeLog >index 85d40067644d3322811b56042f9b66848190fe09..f3e1b2e01113b12643f9d577d4a55cd4d93eb333 100644 >--- a/LayoutTests/ChangeLog >+++ b/LayoutTests/ChangeLog >@@ -1,3 +1,14 @@ >+2019-01-22 John Wilander <wilander@apple.com> >+ >+ Add Ad Click Attribution as an experimental feature >+ https://bugs.webkit.org/show_bug.cgi?id=193685 >+ <rdar://problem/47450399> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ * http/tests/adClickAttribution/anchor-tag-attributes-reflect-expected.txt: Added. >+ * http/tests/adClickAttribution/anchor-tag-attributes-reflect.html: Added. >+ > 2019-01-22 Oriol Brufau <obrufau@igalia.com> > > [css-logical] Implement flow-relative margin, padding and border shorthands >diff --git a/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-reflect-expected.txt b/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-reflect-expected.txt >new file mode 100644 >index 0000000000000000000000000000000000000000..d09bc7f238a83181bb56b3b2391c5080a7e3d3d5 >--- /dev/null >+++ b/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-reflect-expected.txt >@@ -0,0 +1,11 @@ >+Test for the new ad click attribution attributes on anchor tags. >+ >+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE". >+ >+ >+PASS anchorTag.adcampaignid is "ff" >+PASS anchorTag.addestination is "destination.example" >+PASS successfullyParsed is true >+ >+TEST COMPLETE >+ >diff --git a/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-reflect.html b/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-reflect.html >new file mode 100644 >index 0000000000000000000000000000000000000000..070fe92291d470f5c3abe7984a321f852675da55 >--- /dev/null >+++ b/LayoutTests/http/tests/adClickAttribution/anchor-tag-attributes-reflect.html >@@ -0,0 +1,17 @@ >+<!DOCTYPE html> <!-- webkit-test-runner [ experimental:AdClickAttributionEnabled=true ] --> >+<html lang="en"> >+<head> >+ <meta charset="UTF-8"> >+ <script src="/js-test-resources/js-test.js"></script> >+</head> >+<body> >+<a id="testTag" href="http://localhost:8000" adcampaignid="ff" addestination="destination.example"></a> >+<script> >+ description("Test for the new ad click attribution attributes on anchor tags."); >+ >+ const anchorTag = document.getElementById("testTag"); >+ shouldBeEqualToString("anchorTag.adcampaignid", "ff"); >+ shouldBeEqualToString("anchorTag.addestination", "destination.example"); >+</script> >+</body> >+</html>
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 193685
:
359779
|
359794
|
359800
|
359809
|
359815
|
359828
|
359842
|
359843
|
359904
|
359918
|
359921
|
359951
|
359974