Add Ad Click Attribution as an internal/experimental feature
https://bugs.webkit.org/show_bug.cgi?id=193685
<rdar://problem/47450399>
Reviewed by Brent Fulgham.
Source/WebCore:
Test: http/tests/adClickAttribution/anchor-tag-attributes-reflect.html
* 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:
Source/WebKit:
* Shared/WebPreferences.yaml:
Added AdClickAttributionEnabled as a runtime enabled feature, off by default.
Source/WebKitLegacy/mac:
* 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:]):
Tools:
Added test option adClickAttributionEnabled.
* DumpRenderTree/TestOptions.cpp:
(TestOptions::TestOptions):
* DumpRenderTree/TestOptions.h:
* DumpRenderTree/mac/DumpRenderTree.mm:
(setWebPreferencesForTestOptions):
LayoutTests:
* http/tests/adClickAttribution/anchor-tag-attributes-reflect-expected.txt: Added.
* http/tests/adClickAttribution/anchor-tag-attributes-reflect.html: Added.
* platform/win/TestExpectations:
Skipped on Windows for now.
git-svn-id: http://svn.webkit.org/repository/webkit/trunk@240444 268f45cc-cd09-0410-ab3c-d52691b4dbfc
diff --git a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm
index 5cdab7b..e802c0a 100644
--- a/Source/WebKitLegacy/mac/WebView/WebPreferences.mm
+++ b/Source/WebKitLegacy/mac/WebView/WebPreferences.mm
@@ -670,6 +670,7 @@
#endif
[NSNumber numberWithBool:YES], WebKitSelectionAcrossShadowBoundariesEnabledPreferenceKey,
[NSNumber numberWithBool:NO], WebKitCSSLogicalEnabledPreferenceKey,
+ [NSNumber numberWithBool:NO], WebKitAdClickAttributionEnabledPreferenceKey,
#if ENABLE(INTERSECTION_OBSERVER)
@NO, WebKitIntersectionObserverEnabledPreferenceKey,
#endif
@@ -3390,6 +3391,16 @@
[self _setBoolValue:flag forKey:WebKitCSSLogicalEnabledPreferenceKey];
}
+- (BOOL)adClickAttributionEnabled
+{
+ return [self _boolValueForKey:WebKitAdClickAttributionEnabledPreferenceKey];
+}
+
+- (void)setAdClickAttributionEnabled:(BOOL)flag
+{
+ [self _setBoolValue:flag forKey:WebKitAdClickAttributionEnabledPreferenceKey];
+}
+
@end
@implementation WebPreferences (WebInternal)