Title: [227371] trunk/Source/WebKitLegacy/mac
Revision
227371
Author
[email protected]
Date
2018-01-22 17:09:45 -0800 (Mon, 22 Jan 2018)

Log Message

WebViews created via -initSimpleHTMLDocumentWithStyle: don't propagate attachmentElementEnabled state
https://bugs.webkit.org/show_bug.cgi?id=181960
<rdar://problem/36431678>

Reviewed by Tim Horton.

Mail's compose view is initialized via the -initSimpleHTMLDocumentWithStyle: codepath. This is intended to be
a fast path for initializing WebViews, which bypasses certain initialization steps present in the regular -init
path, such as calling -_preferencesChanged: to sync RuntimeEnabledFeatures with WebPreferences.

This means that even though we set -[WebPreferences attachmentElementEnabled] to YES for Mail, the value of the
RuntimeEnabledFeature isn't updated to match. To fix this, we explicitly invoke
RuntimeEnabledFeatures::setAttachmentElementEnabled here to make sure the value is in sync with WebPreferences.

* WebView/WebView.mm:
(-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):

Modified Paths

Diff

Modified: trunk/Source/WebKitLegacy/mac/ChangeLog (227370 => 227371)


--- trunk/Source/WebKitLegacy/mac/ChangeLog	2018-01-23 00:52:32 UTC (rev 227370)
+++ trunk/Source/WebKitLegacy/mac/ChangeLog	2018-01-23 01:09:45 UTC (rev 227371)
@@ -1,3 +1,22 @@
+2018-01-22  Wenson Hsieh  <[email protected]>
+
+        WebViews created via -initSimpleHTMLDocumentWithStyle: don't propagate attachmentElementEnabled state
+        https://bugs.webkit.org/show_bug.cgi?id=181960
+        <rdar://problem/36431678>
+
+        Reviewed by Tim Horton.
+
+        Mail's compose view is initialized via the -initSimpleHTMLDocumentWithStyle: codepath. This is intended to be
+        a fast path for initializing WebViews, which bypasses certain initialization steps present in the regular -init
+        path, such as calling -_preferencesChanged: to sync RuntimeEnabledFeatures with WebPreferences.
+
+        This means that even though we set -[WebPreferences attachmentElementEnabled] to YES for Mail, the value of the
+        RuntimeEnabledFeature isn't updated to match. To fix this, we explicitly invoke
+        RuntimeEnabledFeatures::setAttachmentElementEnabled here to make sure the value is in sync with WebPreferences.
+
+        * WebView/WebView.mm:
+        (-[WebView initSimpleHTMLDocumentWithStyle:frame:preferences:groupName:]):
+
 2018-01-21  Ryosuke Niwa  <[email protected]>
 
         Turning off custom pasteboard data doesn't actually turn it off in WK2

Modified: trunk/Source/WebKitLegacy/mac/WebView/WebView.mm (227370 => 227371)


--- trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2018-01-23 00:52:32 UTC (rev 227370)
+++ trunk/Source/WebKitLegacy/mac/WebView/WebView.mm	2018-01-23 01:09:45 UTC (rev 227371)
@@ -1759,6 +1759,8 @@
     
     SecurityPolicy::setLocalLoadPolicy(SecurityPolicy::AllowLocalLoadsForLocalAndSubstituteData);
     
+    RuntimeEnabledFeatures::sharedFeatures().setAttachmentElementEnabled(self.preferences.attachmentElementEnabled);
+
     return self;
 }
 
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to