Title: [280443] branches/safari-612.1.24.11-branch/Source/WebKit
Revision
280443
Author
alanc...@apple.com
Date
2021-07-29 13:15:15 -0700 (Thu, 29 Jul 2021)

Log Message

Cherry-pick r280433. rdar://problem/81286942

    The bundle path of downlevel Safari is wrong
    https://bugs.webkit.org/show_bug.cgi?id=228339

    Reviewed by Tim Horton.

    Use the same approach as `isSystemWebKit` to check whether the WebKit bundle
    is from the staged framework.

    * Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
    (WebKit::isFeatureFlagEnabled):

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

Modified Paths

Diff

Modified: branches/safari-612.1.24.11-branch/Source/WebKit/ChangeLog (280442 => 280443)


--- branches/safari-612.1.24.11-branch/Source/WebKit/ChangeLog	2021-07-29 20:15:11 UTC (rev 280442)
+++ branches/safari-612.1.24.11-branch/Source/WebKit/ChangeLog	2021-07-29 20:15:15 UTC (rev 280443)
@@ -1,5 +1,36 @@
 2021-07-29  Alan Coon  <alanc...@apple.com>
 
+        Cherry-pick r280433. rdar://problem/81286942
+
+    The bundle path of downlevel Safari is wrong
+    https://bugs.webkit.org/show_bug.cgi?id=228339
+    
+    Reviewed by Tim Horton.
+    
+    Use the same approach as `isSystemWebKit` to check whether the WebKit bundle
+    is from the staged framework.
+    
+    * Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
+    (WebKit::isFeatureFlagEnabled):
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@280433 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2021-07-29  Peng Liu  <peng.l...@apple.com>
+
+            The bundle path of downlevel Safari is wrong
+            https://bugs.webkit.org/show_bug.cgi?id=228339
+
+            Reviewed by Tim Horton.
+
+            Use the same approach as `isSystemWebKit` to check whether the WebKit bundle
+            is from the staged framework.
+
+            * Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm:
+            (WebKit::isFeatureFlagEnabled):
+
+2021-07-29  Alan Coon  <alanc...@apple.com>
+
         Cherry-pick r280424. rdar://problem/81286934
 
     [macOS Catalina] Some feature preferences have wrong default values

Modified: branches/safari-612.1.24.11-branch/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm (280442 => 280443)


--- branches/safari-612.1.24.11-branch/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm	2021-07-29 20:15:11 UTC (rev 280442)
+++ branches/safari-612.1.24.11-branch/Source/WebKit/Shared/Cocoa/WebPreferencesDefaultValuesCocoa.mm	2021-07-29 20:15:15 UTC (rev 280443)
@@ -40,7 +40,10 @@
 // Because of <rdar://problem/60608008>, WebKit has to parse the feature flags plist file
 bool isFeatureFlagEnabled(const String& featureName)
 {
-    BOOL isWebKitBundleFromStagedFramework = [[[NSBundle mainBundle] bundlePath] hasPrefix:@"/Library/Apple/System/Library/StagedFrameworks/Safari"];
+    static bool isWebKitBundleFromStagedFramework = [] {
+        NSBundle *webkit2Bundle = [NSBundle bundleForClass:NSClassFromString(@"WKWebView")];
+        return [webkit2Bundle.bundlePath hasPrefix:@"/Library/Apple/System/Library/StagedFrameworks/Safari/"];
+    }();
 
     if (!isWebKitBundleFromStagedFramework)
         return _os_feature_enabled_impl("WebKit", (const char*)featureName.utf8().data());
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to