Disable Dark Mode in the Plugin process to avoid rendering issues
authorcdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jul 2018 16:59:17 +0000 (16:59 +0000)
committercdumez@apple.com <cdumez@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Thu, 26 Jul 2018 16:59:17 +0000 (16:59 +0000)
https://bugs.webkit.org/show_bug.cgi?id=188059
<rdar://problem/42369281>

Reviewed by Tim Horton.

Plugins generally do not support dark mode and this causes rendering issues so
disable dark mode in the plugin process.

* PluginProcess/mac/PluginProcessMac.mm:
(WebKit::PluginProcess::platformInitializePluginProcess):

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

Source/WebKit/ChangeLog
Source/WebKit/PluginProcess/mac/PluginProcessMac.mm

index ecc9f72..3a4007b 100644 (file)
@@ -1,5 +1,19 @@
 2018-07-26  Chris Dumez  <cdumez@apple.com>
 
 2018-07-26  Chris Dumez  <cdumez@apple.com>
 
+        Disable Dark Mode in the Plugin process to avoid rendering issues
+        https://bugs.webkit.org/show_bug.cgi?id=188059
+        <rdar://problem/42369281>
+
+        Reviewed by Tim Horton.
+
+        Plugins generally do not support dark mode and this causes rendering issues so
+        disable dark mode in the plugin process.
+
+        * PluginProcess/mac/PluginProcessMac.mm:
+        (WebKit::PluginProcess::platformInitializePluginProcess):
+
+2018-07-26  Chris Dumez  <cdumez@apple.com>
+
         WebSiteData-related methods should take in CompletionHandlers instead of Functions
         https://bugs.webkit.org/show_bug.cgi?id=188027
 
         WebSiteData-related methods should take in CompletionHandlers instead of Functions
         https://bugs.webkit.org/show_bug.cgi?id=188027
 
index b1c3173..7ec04bc 100644 (file)
@@ -521,6 +521,11 @@ void PluginProcess::platformInitializePluginProcess(PluginProcessCreationParamet
         initWithMemoryCapacity:pluginMemoryCacheSize
         diskCapacity:pluginDiskCacheSize
         diskPath:m_nsurlCacheDirectory]).get()];
         initWithMemoryCapacity:pluginMemoryCacheSize
         diskCapacity:pluginDiskCacheSize
         diskPath:m_nsurlCacheDirectory]).get()];
+
+#if PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED >= 101400
+    // Disable Dark Mode in the plugin process to avoid rendering issues.
+    [NSApp setAppearance:[NSAppearance appearanceNamed:NSAppearanceNameAqua]];
+#endif
 }
 
 void PluginProcess::platformInitializeProcess(const ChildProcessInitializationParameters& parameters)
 }
 
 void PluginProcess::platformInitializeProcess(const ChildProcessInitializationParameters& parameters)