Title: [240073] branches/safari-607-branch/Source
Revision
240073
Author
[email protected]
Date
2019-01-16 15:27:57 -0800 (Wed, 16 Jan 2019)

Log Message

Cherry-pick r239880. rdar://problem/47260310

    REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
    https://bugs.webkit.org/show_bug.cgi?id=193366
    <rdar://problem/46097212>

    Reviewed by Simon Fraser.

    Source/WebCore:

    * platform/RuntimeApplicationChecks.h:
    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
    (WebCore::IOSApplication::isFirefox):
    Add a Firefox Mobile bundle check.

    Source/WebKit:

    A pair of unrelated changes broke Firefox's use of WKWebView internals
    to override the long-press menu. Maintain binary compatibility by
    introducing linked-on-or-after checks.

    * UIProcess/Cocoa/VersionChecks.h:
    * UIProcess/WebProcessPool.cpp:
    (WebKit::WebProcessPool::createWebPage):
    Disable PSON in Firefox when linked against an SDK where PSON wasn't enabled by default.
    Because gestures are very stateful, we always swap them out when swapping
    processes (changing that behavior is fairly risky). Also, we don't always
    inform the client when we swap processes (only when the process actually crashes),
    so they currently don't re-adjust the gesture recognizers when a PSON swap occurs.

    * UIProcess/ios/WKContentView.mm:
    (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
    Synchronously install gesture recognizers under -init when linked against
    an SDK before the version that introduces lazy gesture recognizer installation.
    r237331 is an optimization that made us lazily install gestures when the
    view is parented, but Firefox (and potentially other clients) depend
    on them being installed synchronously in order to find and override them.

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

Modified Paths

Diff

Modified: branches/safari-607-branch/Source/WebCore/ChangeLog (240072 => 240073)


--- branches/safari-607-branch/Source/WebCore/ChangeLog	2019-01-16 23:27:52 UTC (rev 240072)
+++ branches/safari-607-branch/Source/WebCore/ChangeLog	2019-01-16 23:27:57 UTC (rev 240073)
@@ -1,5 +1,61 @@
 2019-01-15  Alan Coon  <[email protected]>
 
+        Cherry-pick r239880. rdar://problem/47260310
+
+    REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
+    https://bugs.webkit.org/show_bug.cgi?id=193366
+    <rdar://problem/46097212>
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebCore:
+    
+    * platform/RuntimeApplicationChecks.h:
+    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+    (WebCore::IOSApplication::isFirefox):
+    Add a Firefox Mobile bundle check.
+    
+    Source/WebKit:
+    
+    A pair of unrelated changes broke Firefox's use of WKWebView internals
+    to override the long-press menu. Maintain binary compatibility by
+    introducing linked-on-or-after checks.
+    
+    * UIProcess/Cocoa/VersionChecks.h:
+    * UIProcess/WebProcessPool.cpp:
+    (WebKit::WebProcessPool::createWebPage):
+    Disable PSON in Firefox when linked against an SDK where PSON wasn't enabled by default.
+    Because gestures are very stateful, we always swap them out when swapping
+    processes (changing that behavior is fairly risky). Also, we don't always
+    inform the client when we swap processes (only when the process actually crashes),
+    so they currently don't re-adjust the gesture recognizers when a PSON swap occurs.
+    
+    * UIProcess/ios/WKContentView.mm:
+    (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
+    Synchronously install gesture recognizers under -init when linked against
+    an SDK before the version that introduces lazy gesture recognizer installation.
+    r237331 is an optimization that made us lazily install gestures when the
+    view is parented, but Firefox (and potentially other clients) depend
+    on them being installed synchronously in order to find and override them.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-01-11  Tim Horton  <[email protected]>
+
+            REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
+            https://bugs.webkit.org/show_bug.cgi?id=193366
+            <rdar://problem/46097212>
+
+            Reviewed by Simon Fraser.
+
+            * platform/RuntimeApplicationChecks.h:
+            * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+            (WebCore::IOSApplication::isFirefox):
+            Add a Firefox Mobile bundle check.
+
+2019-01-15  Alan Coon  <[email protected]>
+
         Cherry-pick r239877. rdar://problem/47260302
 
     Release assert when removing element with a map element in the shadow tree

Modified: branches/safari-607-branch/Source/WebCore/platform/RuntimeApplicationChecks.h (240072 => 240073)


--- branches/safari-607-branch/Source/WebCore/platform/RuntimeApplicationChecks.h	2019-01-16 23:27:52 UTC (rev 240072)
+++ branches/safari-607-branch/Source/WebCore/platform/RuntimeApplicationChecks.h	2019-01-16 23:27:57 UTC (rev 240073)
@@ -90,6 +90,7 @@
 WEBCORE_EXPORT bool isCardiogram();
 WEBCORE_EXPORT bool isNike();
 bool isMoviStarPlus();
+WEBCORE_EXPORT bool isFirefox();
 
 } // IOSApplication
 

Modified: branches/safari-607-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm (240072 => 240073)


--- branches/safari-607-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm	2019-01-16 23:27:52 UTC (rev 240072)
+++ branches/safari-607-branch/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm	2019-01-16 23:27:57 UTC (rev 240073)
@@ -276,7 +276,13 @@
     static bool isMoviStarPlus = applicationBundleIsEqualTo("com.prisatv.yomvi"_s);
     return isMoviStarPlus;
 }
-    
+
+bool IOSApplication::isFirefox()
+{
+    static bool isFirefox = applicationBundleIsEqualTo("org.mozilla.ios.Firefox"_s);
+    return isFirefox;
+}
+
 #endif
 
 } // namespace WebCore

Modified: branches/safari-607-branch/Source/WebKit/ChangeLog (240072 => 240073)


--- branches/safari-607-branch/Source/WebKit/ChangeLog	2019-01-16 23:27:52 UTC (rev 240072)
+++ branches/safari-607-branch/Source/WebKit/ChangeLog	2019-01-16 23:27:57 UTC (rev 240073)
@@ -1,5 +1,77 @@
 2019-01-15  Alan Coon  <[email protected]>
 
+        Cherry-pick r239880. rdar://problem/47260310
+
+    REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
+    https://bugs.webkit.org/show_bug.cgi?id=193366
+    <rdar://problem/46097212>
+    
+    Reviewed by Simon Fraser.
+    
+    Source/WebCore:
+    
+    * platform/RuntimeApplicationChecks.h:
+    * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
+    (WebCore::IOSApplication::isFirefox):
+    Add a Firefox Mobile bundle check.
+    
+    Source/WebKit:
+    
+    A pair of unrelated changes broke Firefox's use of WKWebView internals
+    to override the long-press menu. Maintain binary compatibility by
+    introducing linked-on-or-after checks.
+    
+    * UIProcess/Cocoa/VersionChecks.h:
+    * UIProcess/WebProcessPool.cpp:
+    (WebKit::WebProcessPool::createWebPage):
+    Disable PSON in Firefox when linked against an SDK where PSON wasn't enabled by default.
+    Because gestures are very stateful, we always swap them out when swapping
+    processes (changing that behavior is fairly risky). Also, we don't always
+    inform the client when we swap processes (only when the process actually crashes),
+    so they currently don't re-adjust the gesture recognizers when a PSON swap occurs.
+    
+    * UIProcess/ios/WKContentView.mm:
+    (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
+    Synchronously install gesture recognizers under -init when linked against
+    an SDK before the version that introduces lazy gesture recognizer installation.
+    r237331 is an optimization that made us lazily install gestures when the
+    view is parented, but Firefox (and potentially other clients) depend
+    on them being installed synchronously in order to find and override them.
+    
+    
+    git-svn-id: https://svn.webkit.org/repository/webkit/trunk@239880 268f45cc-cd09-0410-ab3c-d52691b4dbfc
+
+    2019-01-11  Tim Horton  <[email protected]>
+
+            REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
+            https://bugs.webkit.org/show_bug.cgi?id=193366
+            <rdar://problem/46097212>
+
+            Reviewed by Simon Fraser.
+
+            A pair of unrelated changes broke Firefox's use of WKWebView internals
+            to override the long-press menu. Maintain binary compatibility by
+            introducing linked-on-or-after checks.
+
+            * UIProcess/Cocoa/VersionChecks.h:
+            * UIProcess/WebProcessPool.cpp:
+            (WebKit::WebProcessPool::createWebPage):
+            Disable PSON in Firefox when linked against an SDK where PSON wasn't enabled by default.
+            Because gestures are very stateful, we always swap them out when swapping
+            processes (changing that behavior is fairly risky). Also, we don't always
+            inform the client when we swap processes (only when the process actually crashes),
+            so they currently don't re-adjust the gesture recognizers when a PSON swap occurs.
+
+            * UIProcess/ios/WKContentView.mm:
+            (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
+            Synchronously install gesture recognizers under -init when linked against
+            an SDK before the version that introduces lazy gesture recognizer installation.
+            r237331 is an optimization that made us lazily install gestures when the
+            view is parented, but Firefox (and potentially other clients) depend
+            on them being installed synchronously in order to find and override them.
+
+2019-01-15  Alan Coon  <[email protected]>
+
         Cherry-pick r239851. rdar://problem/47260326
 
     Add WKBundlePage SPI to temporarily force light or dark appearance on a page.

Modified: branches/safari-607-branch/Source/WebKit/UIProcess/Cocoa/VersionChecks.h (240072 => 240073)


--- branches/safari-607-branch/Source/WebKit/UIProcess/Cocoa/VersionChecks.h	2019-01-16 23:27:52 UTC (rev 240072)
+++ branches/safari-607-branch/Source/WebKit/UIProcess/Cocoa/VersionChecks.h	2019-01-16 23:27:57 UTC (rev 240073)
@@ -27,6 +27,13 @@
 
 #import <wtf/spi/darwin/dyldSPI.h>
 
+#if USE(APPLE_INTERNAL_SDK)
+#import <WebKitAdditions/VersionChecksAdditions.h>
+#else
+#define DYLD_IOS_VERSION_FIRST_WITH_LAZY_GESTURE_RECOGNIZER_INSTALLATION 0
+#define DYLD_IOS_VERSION_FIRST_WITH_PROCESS_SWAP_ON_CROSS_SITE_NAVIGATION 0
+#endif
+
 namespace WebKit {
 
 enum class SDKVersion : uint32_t {
@@ -41,6 +48,8 @@
     FirstWhereScrollViewContentInsetsAreNotObscuringInsets = DYLD_IOS_VERSION_12_0,
     FirstWhereUIScrollViewDoesNotApplyKeyboardInsetsUnconditionally = DYLD_IOS_VERSION_12_0,
     FirstWithMainThreadReleaseAssertionInWebPageProxy = DYLD_IOS_VERSION_12_0,
+    FirstWithLazyGestureRecognizerInstallation = DYLD_IOS_VERSION_FIRST_WITH_LAZY_GESTURE_RECOGNIZER_INSTALLATION,
+    FirstWithProcessSwapOnCrossSiteNavigation = DYLD_IOS_VERSION_FIRST_WITH_PROCESS_SWAP_ON_CROSS_SITE_NAVIGATION,
 #elif PLATFORM(MAC)
     FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11,
     FirstWithExceptionsForDuplicateCompletionHandlerCalls = DYLD_MACOSX_VERSION_10_13,

Modified: branches/safari-607-branch/Source/WebKit/UIProcess/WebProcessPool.cpp (240072 => 240073)


--- branches/safari-607-branch/Source/WebKit/UIProcess/WebProcessPool.cpp	2019-01-16 23:27:52 UTC (rev 240072)
+++ branches/safari-607-branch/Source/WebKit/UIProcess/WebProcessPool.cpp	2019-01-16 23:27:57 UTC (rev 240073)
@@ -87,6 +87,7 @@
 #include <WebCore/Process.h>
 #include <WebCore/ProcessWarming.h>
 #include <WebCore/ResourceRequest.h>
+#include <WebCore/RuntimeApplicationChecks.h>
 #include <pal/SessionID.h>
 #include <wtf/Language.h>
 #include <wtf/MainThread.h>
@@ -115,6 +116,10 @@
 #include <WebCore/PlatformDisplay.h>
 #endif
 
+#if PLATFORM(COCOA)
+#include "VersionChecks.h"
+#endif
+
 #ifndef NDEBUG
 #include <wtf/RefCountedLeakCounter.h>
 #endif
@@ -1145,7 +1150,14 @@
 #endif
 
     auto page = process->createWebPage(pageClient, WTFMove(pageConfiguration));
-    m_configuration->setProcessSwapsOnNavigationFromExperimentalFeatures(page->preferences().processSwapOnCrossSiteNavigationEnabled());
+
+    bool enableProcessSwapOnCrossSiteNavigation = page->preferences().processSwapOnCrossSiteNavigationEnabled();
+#if PLATFORM(IOS_FAMILY)
+    if (WebCore::IOSApplication::isFirefox() && !linkedOnOrAfter(WebKit::SDKVersion::FirstWithProcessSwapOnCrossSiteNavigation))
+        enableProcessSwapOnCrossSiteNavigation = false;
+#endif
+
+    m_configuration->setProcessSwapsOnNavigationFromExperimentalFeatures(enableProcessSwapOnCrossSiteNavigation);
     m_configuration->setShouldCaptureAudioInUIProcess(page->preferences().captureAudioInUIProcessEnabled());
     m_configuration->setShouldCaptureVideoInUIProcess(page->preferences().captureVideoInUIProcessEnabled());
 

Modified: branches/safari-607-branch/Source/WebKit/UIProcess/ios/WKContentView.mm (240072 => 240073)


--- branches/safari-607-branch/Source/WebKit/UIProcess/ios/WKContentView.mm	2019-01-16 23:27:52 UTC (rev 240072)
+++ branches/safari-607-branch/Source/WebKit/UIProcess/ios/WKContentView.mm	2019-01-16 23:27:57 UTC (rev 240073)
@@ -39,6 +39,7 @@
 #import "RemoteScrollingCoordinatorProxy.h"
 #import "SmartMagnificationController.h"
 #import "UIKitSPI.h"
+#import "VersionChecks.h"
 #import "WKBrowsingContextControllerInternal.h"
 #import "WKBrowsingContextGroupPrivate.h"
 #import "WKInspectorHighlightView.h"
@@ -219,6 +220,8 @@
     [self addSubview:_fixedClippingView.get()];
     [_fixedClippingView addSubview:_rootContentView.get()];
 
+    if (!linkedOnOrAfter(WebKit::SDKVersion::FirstWithLazyGestureRecognizerInstallation))
+        [self setupInteraction];
     [self setUserInteractionEnabled:YES];
 
     self.layer.hitTestsAsOpaque = YES;
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to