- Revision
- 239880
- Author
- [email protected]
- Date
- 2019-01-11 15:30:07 -0800 (Fri, 11 Jan 2019)
Log Message
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.
Modified Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (239879 => 239880)
--- trunk/Source/WebCore/ChangeLog 2019-01-11 23:10:31 UTC (rev 239879)
+++ trunk/Source/WebCore/ChangeLog 2019-01-11 23:30:07 UTC (rev 239880)
@@ -1,3 +1,16 @@
+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-11 Antti Koivisto <[email protected]>
Release assert when removing element with a map element in the shadow tree
Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.h (239879 => 239880)
--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.h 2019-01-11 23:10:31 UTC (rev 239879)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.h 2019-01-11 23:30:07 UTC (rev 239880)
@@ -90,6 +90,7 @@
WEBCORE_EXPORT bool isCardiogram();
WEBCORE_EXPORT bool isNike();
bool isMoviStarPlus();
+WEBCORE_EXPORT bool isFirefox();
} // IOSApplication
Modified: trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm (239879 => 239880)
--- trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm 2019-01-11 23:10:31 UTC (rev 239879)
+++ trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm 2019-01-11 23:30:07 UTC (rev 239880)
@@ -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: trunk/Source/WebKit/ChangeLog (239879 => 239880)
--- trunk/Source/WebKit/ChangeLog 2019-01-11 23:10:31 UTC (rev 239879)
+++ trunk/Source/WebKit/ChangeLog 2019-01-11 23:30:07 UTC (rev 239880)
@@ -1,3 +1,32 @@
+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-11 Wenson Hsieh <[email protected]>
Introduce IDL files for runtime-enabled UndoManager and UndoItem _javascript_ API
Modified: trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h (239879 => 239880)
--- trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h 2019-01-11 23:10:31 UTC (rev 239879)
+++ trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h 2019-01-11 23:30:07 UTC (rev 239880)
@@ -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: trunk/Source/WebKit/UIProcess/WebProcessPool.cpp (239879 => 239880)
--- trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-01-11 23:10:31 UTC (rev 239879)
+++ trunk/Source/WebKit/UIProcess/WebProcessPool.cpp 2019-01-11 23:30:07 UTC (rev 239880)
@@ -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: trunk/Source/WebKit/UIProcess/ios/WKContentView.mm (239879 => 239880)
--- trunk/Source/WebKit/UIProcess/ios/WKContentView.mm 2019-01-11 23:10:31 UTC (rev 239879)
+++ trunk/Source/WebKit/UIProcess/ios/WKContentView.mm 2019-01-11 23:30:07 UTC (rev 239880)
@@ -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;