<attachment> should be a runtime-enabled feature
authordino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2016 01:09:17 +0000 (01:09 +0000)
committerdino@apple.com <dino@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Mon, 14 Mar 2016 01:09:17 +0000 (01:09 +0000)
https://bugs.webkit.org/show_bug.cgi?id=155413
<rdar://problem/25120753>

Reviewed by Sam Weinig and Anders Carlsson.

Source/WebKit/mac:

Add an internal setting on WebPreferences
to enable the <attachment> element support.

* WebView/WebPreferenceKeysPrivate.h:
* WebView/WebPreferences.mm:
(+[WebPreferences initialize]):
(-[WebPreferences attachmentElementEnabled]):
(-[WebPreferences setAttachmentElementEnabled:]):
* WebView/WebPreferencesPrivate.h:
* WebView/WebView.mm:
(-[WebView _preferencesChanged:]):

Source/WebKit2:

Add an internal setting on WKWebViewConfiguration
to enable the <attachment> element support.

* Shared/WebPreferencesDefinitions.h:
* UIProcess/API/Cocoa/WKWebView.mm:
(-[WKWebView _initializeWithConfiguration:]):
* UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
(-[WKWebViewConfiguration init]):
(-[WKWebViewConfiguration copyWithZone:]):
(-[WKWebViewConfiguration _attachmentElementEnabled]):
(-[WKWebViewConfiguration _setAttachmentElementEnabled:]):
* UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::updatePreferences):

LayoutTests:

Now that <attachment> is disabled by default, use an
internal setting to turn them back on test by test.

* fast/attachment/attachment-default-icon-expected.html:
* fast/attachment/attachment-default-icon.html:
* fast/attachment/attachment-disabled-dom.html:
* fast/attachment/attachment-disabled-rendering.html:
* fast/attachment/attachment-dom.html:
* fast/attachment/attachment-folder-icon-expected.html:
* fast/attachment/attachment-folder-icon.html:
* fast/attachment/attachment-icon-from-file-extension-expected.html:
* fast/attachment/attachment-icon-from-file-extension.html:
* fast/attachment/attachment-label-highlight.html:
* fast/attachment/attachment-progress.html:
* fast/attachment/attachment-rendering.html:
* fast/attachment/attachment-select-on-click-inside-user-select-all.html:
* fast/attachment/attachment-select-on-click.html:
* fast/attachment/attachment-subtitle.html:
* fast/attachment/attachment-title.html:
* fast/attachment/attachment-type-attribute-expected.html:
* fast/attachment/attachment-type-attribute.html:
* editing/pasteboard/copy-paste-attachment.html:
* editing/pasteboard/drag-and-drop-attachment-contenteditable.html:

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@198088 268f45cc-cd09-0410-ab3c-d52691b4dbfc

32 files changed:
LayoutTests/ChangeLog
LayoutTests/editing/pasteboard/copy-paste-attachment.html
LayoutTests/editing/pasteboard/drag-and-drop-attachment-contenteditable.html
LayoutTests/fast/attachment/attachment-default-icon-expected.html
LayoutTests/fast/attachment/attachment-default-icon.html
LayoutTests/fast/attachment/attachment-disabled-dom.html
LayoutTests/fast/attachment/attachment-disabled-rendering.html
LayoutTests/fast/attachment/attachment-dom.html
LayoutTests/fast/attachment/attachment-folder-icon-expected.html
LayoutTests/fast/attachment/attachment-folder-icon.html
LayoutTests/fast/attachment/attachment-icon-from-file-extension-expected.html
LayoutTests/fast/attachment/attachment-icon-from-file-extension.html
LayoutTests/fast/attachment/attachment-label-highlight.html
LayoutTests/fast/attachment/attachment-progress.html
LayoutTests/fast/attachment/attachment-rendering.html
LayoutTests/fast/attachment/attachment-select-on-click-inside-user-select-all.html
LayoutTests/fast/attachment/attachment-select-on-click.html
LayoutTests/fast/attachment/attachment-subtitle.html
LayoutTests/fast/attachment/attachment-title.html
LayoutTests/fast/attachment/attachment-type-attribute-expected.html
LayoutTests/fast/attachment/attachment-type-attribute.html
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebPreferenceKeysPrivate.h
Source/WebKit/mac/WebView/WebPreferences.mm
Source/WebKit/mac/WebView/WebPreferencesPrivate.h
Source/WebKit/mac/WebView/WebView.mm
Source/WebKit2/ChangeLog
Source/WebKit2/Shared/WebPreferencesDefinitions.h
Source/WebKit2/UIProcess/API/Cocoa/WKWebView.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfiguration.mm
Source/WebKit2/UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 0886e48..df7d38a 100644 (file)
@@ -1,3 +1,35 @@
+2016-03-13  Dean Jackson  <dino@apple.com>
+
+        <attachment> should be a runtime-enabled feature
+        https://bugs.webkit.org/show_bug.cgi?id=155413
+        <rdar://problem/25120753>
+
+        Reviewed by Sam Weinig and Anders Carlsson.
+
+        Now that <attachment> is disabled by default, use an
+        internal setting to turn them back on test by test.
+
+        * fast/attachment/attachment-default-icon-expected.html:
+        * fast/attachment/attachment-default-icon.html:
+        * fast/attachment/attachment-disabled-dom.html:
+        * fast/attachment/attachment-disabled-rendering.html:
+        * fast/attachment/attachment-dom.html:
+        * fast/attachment/attachment-folder-icon-expected.html:
+        * fast/attachment/attachment-folder-icon.html:
+        * fast/attachment/attachment-icon-from-file-extension-expected.html:
+        * fast/attachment/attachment-icon-from-file-extension.html:
+        * fast/attachment/attachment-label-highlight.html:
+        * fast/attachment/attachment-progress.html:
+        * fast/attachment/attachment-rendering.html:
+        * fast/attachment/attachment-select-on-click-inside-user-select-all.html:
+        * fast/attachment/attachment-select-on-click.html:
+        * fast/attachment/attachment-subtitle.html:
+        * fast/attachment/attachment-title.html:
+        * fast/attachment/attachment-type-attribute-expected.html:
+        * fast/attachment/attachment-type-attribute.html:
+        * editing/pasteboard/copy-paste-attachment.html:
+        * editing/pasteboard/drag-and-drop-attachment-contenteditable.html:
+
 2016-03-13  Antti Koivisto  <antti@apple.com>
 
         ComposedTreeIterator fails to traverse slots if root is shadow host
index 571dc5f..9b1e763 100644 (file)
@@ -1,6 +1,10 @@
 <html>
 <head>
 <meta http-equiv="Content-type" content="text/html; charset=utf-8" />
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <script src="../../resources/js-test-pre.js"></script>
 </head>
 <body>
index 4560bc3..6849986 100644 (file)
@@ -1,6 +1,10 @@
 <!DOCTYPE html>
 <html>
 <head>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <script src="../../resources/js-test-pre.js"></script>
 <style>
 #target {
index 122a8dd..d1514aa 100644 (file)
@@ -1,6 +1,10 @@
 <!DOCTYPE html>
 <html>
 <body>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <attachment id="attachment" title="  "></attachment>
 <script>
 var file;
index c686259..fbf8490 100644 (file)
@@ -1,6 +1,10 @@
 <!DOCTYPE html>
 <html>
 <body>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <attachment></attachment>
 </body>
 </html>
index 057d33f..079ea9c 100644 (file)
@@ -7,9 +7,6 @@
 <body>
 <script>
 
-if (window.internals)
-    window.internals.settings.setAttachmentElementEnabled(false);
-
 description("This tests that attachments have an instance type of HTMLUnknownElement if attachments are disabled.");
 
 var attachment = document.createElement("attachment");
index 5abede6..f4281d8 100644 (file)
@@ -1,10 +1,4 @@
 <html>
-<head>
-    <script>
-        if (window.internals)
-            window.internals.settings.setAttachmentElementEnabled(false);
-    </script>
-</head>
 <body>
     <p>This tests that attachments don't have a custom renderer when they are disabled. This test must be run in the test runner.</p>
     <attachment></attachment>
index 33568a9..b0c8677 100644 (file)
@@ -2,6 +2,10 @@
 <html>
 <head>
 <meta charset="utf-8">
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <script src="../../resources/js-test-pre.js"></script>
 </head>
 <body>
index 52650cb..cab19c0 100644 (file)
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <body>
 <attachment title=" "></attachment>
 <attachment title=" "></attachment>
index 90383b9..56bc322 100644 (file)
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <body>
 <attachment type="multipart/x-folder"></attachment>
 <attachment type="application/vnd.apple.folder"></attachment>
index fb61277..d071d53 100644 (file)
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <body>
 <attachment></attachment>
 <script>
index 4d9ebe2..c41131d 100644 (file)
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <body>
 <attachment title="test-file.txt"></attachment>
 </body>
index 6c89c55..6987448 100644 (file)
@@ -2,6 +2,9 @@
 <html>
 <body>
 <script>
+if (window.internals)
+    window.internals.settings.setAttachmentElementEnabled(true)
+
 var attachmentShortLabel = document.createElement("attachment");
 var attachmentLongOnTopLabel = document.createElement("attachment");
 var attachmentLongOnBottomLabel = document.createElement("attachment");
index da3270c..981f34b 100644 (file)
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <body>
 <attachment progress="-1.5"></attachment>
 <attachment progress="0"></attachment>
index e3b59c7..b41edda 100644 (file)
@@ -1,5 +1,9 @@
 <html>
 <head>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 </head>
 <body>
     <p>This tests that attachments have a custom renderer.</p>
index 57e7251..ff16bfb 100644 (file)
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <body onload="runTest()">
 <div style="-webkit-user-select: all;">text before <attachment id="attachment"></attachment> text after</div>
 <script>
index bc5e18f..ee0cc2a 100644 (file)
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <body onload="runTest()">
 <div>text before <attachment id="attachment"></attachment> text after</div>
 <script>
index 521e0a5..ed052cb 100644 (file)
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <body>
 <attachment id="attachment" subtitle="1024 bytes"></attachment>
 <script>
index 95537d3..a28462a 100644 (file)
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <body>
 <attachment id="attachment" title="overridden title" subtitle="1024 bytes"></attachment>
 <script>
index b4d4cc7..be936bf 100644 (file)
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <body>
 <attachment id="attachment" title="  "></attachment>
 <script>
index 19f929b..4f957ef 100644 (file)
@@ -1,5 +1,9 @@
 <!DOCTYPE html>
 <html>
+<script>
+    if (window.internals)
+        window.internals.settings.setAttachmentElementEnabled(true)
+</script>
 <body>
 <attachment type="text/plain"></attachment>
 </body>
index 4d2784b..31bf5e4 100644 (file)
@@ -1,3 +1,23 @@
+2016-03-13  Dean Jackson  <dino@apple.com>
+
+        <attachment> should be a runtime-enabled feature
+        https://bugs.webkit.org/show_bug.cgi?id=155413
+        <rdar://problem/25120753>
+
+        Reviewed by Sam Weinig and Anders Carlsson.
+
+        Add an internal setting on WebPreferences
+        to enable the <attachment> element support.
+
+        * WebView/WebPreferenceKeysPrivate.h:
+        * WebView/WebPreferences.mm:
+        (+[WebPreferences initialize]):
+        (-[WebPreferences attachmentElementEnabled]):
+        (-[WebPreferences setAttachmentElementEnabled:]):
+        * WebView/WebPreferencesPrivate.h:
+        * WebView/WebView.mm:
+        (-[WebView _preferencesChanged:]):
+
 2016-03-12  Sam Weinig  <sam@webkit.org>
 
         WebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSession enabled
index 8f8e861..669d54e 100644 (file)
 #define WebKitMediaDataLoadsAutomaticallyPreferenceKey @"WebKitMediaDataLoadsAutomatically"
 #define WebKitMockCaptureDevicesEnabledPreferenceKey @"WebKitMockCaptureDevicesEnabled"
 
+#define WebKitAttachmentElementEnabledPreferenceKey @"WebKitAttachmentElementEnabled"
+
index 17c2dcf..566b773 100644 (file)
@@ -45,6 +45,7 @@
 #import <WebCore/NetworkStorageSession.h>
 #import <WebCore/PlatformCookieJar.h>
 #import <WebCore/ResourceHandle.h>
+#import <WebCore/RuntimeApplicationChecks.h>
 #import <WebCore/Settings.h>
 #import <WebCore/TextEncodingRegistry.h>
 #import <runtime/InitializeThreading.h>
@@ -393,9 +394,11 @@ public:
     JSC::initializeThreading();
     WTF::initializeMainThreadToProcessMainThread();
     RunLoop::initializeMainRunLoop();
+    bool attachmentElementEnabled = MacApplication::isAppleMail();
 #else
     bool allowsInlineMediaPlayback = WebCore::deviceClass() == MGDeviceClassiPad;
     bool requiresPlaysInlineAttribute = !allowsInlineMediaPlayback;
+    bool attachmentElementEnabled = IOSApplication::isMobileMail();
 #endif
     InitWebCoreSystemInterface();
 
@@ -519,6 +522,7 @@ public:
         [NSNumber numberWithBool:YES],  WebKitAVFoundationEnabledKey,
         [NSNumber numberWithBool:YES],  WebKitAVFoundationNSURLSessionEnabledKey,
         [NSNumber numberWithBool:NO],   WebKitSuppressesIncrementalRenderingKey,
+        [NSNumber numberWithBool:attachmentElementEnabled], WebKitAttachmentElementEnabledPreferenceKey,
 #if !PLATFORM(IOS)
         [NSNumber numberWithBool:NO],   WebKitRequiresUserGestureForVideoPlaybackPreferenceKey,
         [NSNumber numberWithBool:NO],   WebKitRequiresUserGestureForAudioPlaybackPreferenceKey,
@@ -2657,6 +2661,16 @@ static NSString *classIBCreatorID = nil;
     [self _setBoolValue:flag forKey:WebKitMediaDataLoadsAutomaticallyPreferenceKey];
 }
 
+- (BOOL)attachmentElementEnabled
+{
+    return [self _boolValueForKey:WebKitAttachmentElementEnabledPreferenceKey];
+}
+
+- (void)setAttachmentElementEnabled:(BOOL)flag
+{
+    [self _setBoolValue:flag forKey:WebKitAttachmentElementEnabledPreferenceKey];
+}
+
 - (BOOL)mockCaptureDevicesEnabled
 {
     return [self _boolValueForKey:WebKitMockCaptureDevicesEnabledPreferenceKey];
index 22b88b9..e2857b4 100644 (file)
@@ -483,5 +483,6 @@ extern NSString *WebPreferencesCacheModelChangedInternalNotification;
 
 @property (nonatomic) BOOL javaScriptMarkupEnabled;
 @property (nonatomic) BOOL mediaDataLoadsAutomatically;
+@property (nonatomic) BOOL attachmentElementEnabled;
 
 @end
index 1a267ad..ed6cc24 100644 (file)
@@ -2515,6 +2515,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
 #endif
 
     settings.setMediaDataLoadsAutomatically([preferences mediaDataLoadsAutomatically]);
+    settings.setAttachmentElementEnabled([preferences attachmentElementEnabled]);
 }
 
 static inline IMP getMethod(id o, SEL s)
index e70e32c..4962180 100644 (file)
@@ -1,3 +1,26 @@
+2016-03-13  Dean Jackson  <dino@apple.com>
+
+        <attachment> should be a runtime-enabled feature
+        https://bugs.webkit.org/show_bug.cgi?id=155413
+        <rdar://problem/25120753>
+
+        Reviewed by Sam Weinig and Anders Carlsson.
+
+        Add an internal setting on WKWebViewConfiguration
+        to enable the <attachment> element support.
+
+        * Shared/WebPreferencesDefinitions.h:
+        * UIProcess/API/Cocoa/WKWebView.mm:
+        (-[WKWebView _initializeWithConfiguration:]):
+        * UIProcess/API/Cocoa/WKWebViewConfiguration.mm:
+        (-[WKWebViewConfiguration init]):
+        (-[WKWebViewConfiguration copyWithZone:]):
+        (-[WKWebViewConfiguration _attachmentElementEnabled]):
+        (-[WKWebViewConfiguration _setAttachmentElementEnabled:]):
+        * UIProcess/API/Cocoa/WKWebViewConfigurationPrivate.h:
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::updatePreferences):
+
 2016-03-12  Sam Weinig  <sam@webkit.org>
 
         WebKit can easily crash below NetworkSession::dataTaskForIdentifier() with NSURLSession enabled
index 072e430..6e00345 100644 (file)
     macro(ShowsToolTipOverTruncatedText, showsToolTipOverTruncatedText, Bool, bool, false) \
     macro(MockScrollbarsEnabled, mockScrollbarsEnabled, Bool, bool, false) \
     macro(WebAudioEnabled, webAudioEnabled, Bool, bool, true) \
+    macro(AttachmentElementEnabled, attachmentElementEnabled, Bool, bool, false) \
     macro(SuppressesIncrementalRendering, suppressesIncrementalRendering, Bool, bool, false) \
     macro(BackspaceKeyNavigationEnabled, backspaceKeyNavigationEnabled, Bool, bool, DEFAULT_BACKSPACE_KEY_NAVIGATION_ENABLED) \
     macro(CaretBrowsingEnabled, caretBrowsingEnabled, Bool, bool, false) \
index 8f3f910..10b189d 100644 (file)
@@ -85,6 +85,7 @@
 #import <WebCore/IOSurface.h>
 #import <WebCore/JSDOMBinding.h>
 #import <WebCore/NSTextFinderSPI.h>
+#import <WebCore/RuntimeApplicationChecks.h>
 #import <wtf/HashMap.h>
 #import <wtf/MathExtras.h>
 #import <wtf/NeverDestroyed.h>
@@ -434,6 +435,13 @@ static WebCore::DataDetectorTypes fromWKDataDetectorTypes(uint64_t types)
     pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::invisibleAutoplayNotPermittedKey(), WebKit::WebPreferencesStore::Value(!![_configuration _invisibleAutoplayNotPermitted]));
     pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::mediaDataLoadsAutomaticallyKey(), WebKit::WebPreferencesStore::Value(!![_configuration _mediaDataLoadsAutomatically]));
 
+// FIXME: <rdar://problem/25135244> Remove bundle checks for attachmentElementEnabled
+#if PLATFORM(IOS)
+    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::attachmentElementEnabledKey(), WebKit::WebPreferencesStore::Value(WebCore::IOSApplication::isMobileMail() ? true : !![_configuration _attachmentElementEnabled]));
+#else
+    pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::attachmentElementEnabledKey(), WebKit::WebPreferencesStore::Value(WebCore::MacApplication::isAppleMail() ? true : !![_configuration _attachmentElementEnabled]));
+#endif
+
 #if ENABLE(DATA_DETECTION)
     pageConfiguration->preferenceValues().set(WebKit::WebPreferencesKey::dataDetectorTypesKey(), WebKit::WebPreferencesStore::Value(static_cast<uint32_t>(fromWKDataDetectorTypes([_configuration dataDetectorTypes]))));
 #endif
index 4669ac6..0b3e8bc 100644 (file)
@@ -36,6 +36,7 @@
 #import "WeakObjCPtr.h"
 #import "_WKVisitedLinkProvider.h"
 #import "_WKWebsiteDataStoreInternal.h"
+#import <WebCore/RuntimeApplicationChecks.h>
 #import <wtf/RetainPtr.h>
 
 #if PLATFORM(IOS)
@@ -43,6 +44,8 @@
 #import <WebCore/Device.h>
 #endif
 
+using namespace WebCore;
+
 template<typename T> class LazyInitialized {
 public:
     typedef typename WTF::GetPtrHelper<T>::PtrType PtrType;
@@ -108,6 +111,7 @@ private:
 
     BOOL _invisibleAutoplayNotPermitted;
     BOOL _mediaDataLoadsAutomatically;
+    BOOL _attachmentElementEnabled;
     BOOL _requiresUserActionForVideoPlayback;
     BOOL _requiresUserActionForAudioPlayback;
     BOOL _mainContentUserGestureOverrideEnabled;
@@ -142,6 +146,13 @@ private:
     _mainContentUserGestureOverrideEnabled = NO;
     _invisibleAutoplayNotPermitted = NO;
 
+// FIXME: <rdar://problem/25135244> Should default to NO once clients have adopted the setting.
+#if PLATFORM(IOS)
+    _attachmentElementEnabled = IOSApplication::isMobileMail();
+#else
+    _attachmentElementEnabled = MacApplication::isAppleMail();
+#endif
+
 #if PLATFORM(IOS)
     _respectsImageOrientation = YES;
     _printsBackgrounds = YES;
@@ -249,6 +260,7 @@ private:
 
     configuration->_invisibleAutoplayNotPermitted = self->_invisibleAutoplayNotPermitted;
     configuration->_mediaDataLoadsAutomatically = self->_mediaDataLoadsAutomatically;
+    configuration->_attachmentElementEnabled = self->_attachmentElementEnabled;
     configuration->_requiresUserActionForVideoPlayback = self->_requiresUserActionForVideoPlayback;
     configuration->_requiresUserActionForAudioPlayback = self->_requiresUserActionForAudioPlayback;
     configuration->_mainContentUserGestureOverrideEnabled = self->_mainContentUserGestureOverrideEnabled;
@@ -565,6 +577,16 @@ static NSString *defaultApplicationNameForUserAgent()
     _mediaDataLoadsAutomatically = mediaDataLoadsAutomatically;
 }
 
+- (BOOL)_attachmentElementEnabled
+{
+    return _attachmentElementEnabled;
+}
+
+- (void)_setAttachmentElementEnabled:(BOOL)attachmentElementEnabled
+{
+    _attachmentElementEnabled = attachmentElementEnabled;
+}
+
 - (BOOL)_requiresUserActionForVideoPlayback
 {
     return _requiresUserActionForVideoPlayback;
index 253226a..2eb05f8 100644 (file)
@@ -55,6 +55,7 @@
 @property (nonatomic, setter=_setMainContentUserGestureOverrideEnabled:) BOOL _mainContentUserGestureOverrideEnabled WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
 @property (nonatomic, setter=_setInvisibleAutoplayNotPermitted:) BOOL _invisibleAutoplayNotPermitted WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
 @property (nonatomic, setter=_setMediaDataLoadsAutomatically:) BOOL _mediaDataLoadsAutomatically WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
+@property (nonatomic, setter=_setAttachmentElementEnabled:) BOOL _attachmentElementEnabled WK_AVAILABLE(WK_MAC_TBA, WK_IOS_TBA);
 
 #if TARGET_OS_IPHONE
 @property (nonatomic, setter=_setAlwaysRunsAtForegroundPriority:) BOOL _alwaysRunsAtForegroundPriority WK_AVAILABLE(NA, 9_0);
index d36d0e6..03150c7 100644 (file)
@@ -2904,6 +2904,9 @@ void WebPage::updatePreferences(const WebPreferencesStore& store)
     settings.setInlineMediaPlaybackRequiresPlaysInlineAttribute(store.getBoolValueForKey(WebPreferencesKey::inlineMediaPlaybackRequiresPlaysInlineAttributeKey()));
     settings.setInvisibleAutoplayNotPermitted(store.getBoolValueForKey(WebPreferencesKey::invisibleAutoplayNotPermittedKey()));
     settings.setMediaDataLoadsAutomatically(store.getBoolValueForKey(WebPreferencesKey::mediaDataLoadsAutomaticallyKey()));
+#if ENABLE(ATTACHMENT_ELEMENT)
+    settings.setAttachmentElementEnabled(store.getBoolValueForKey(WebPreferencesKey::attachmentElementEnabledKey()));
+#endif
     settings.setAllowsPictureInPictureMediaPlayback(store.getBoolValueForKey(WebPreferencesKey::allowsPictureInPictureMediaPlaybackKey()));
     settings.setMediaControlsScaleWithPageZoom(store.getBoolValueForKey(WebPreferencesKey::mediaControlsScaleWithPageZoomKey()));
     settings.setMockScrollbarsEnabled(store.getBoolValueForKey(WebPreferencesKey::mockScrollbarsEnabledKey()));