⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 239880 in webkit


Ignore:
Timestamp:
Jan 11, 2019, 3:30:07 PM (8 years ago)
Author:
timothy_horton@apple.com
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.

Location:
trunk/Source
Files:
7 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r239877 r239880  
     12019-01-11  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
     4        https://bugs.webkit.org/show_bug.cgi?id=193366
     5        <rdar://problem/46097212>
     6
     7        Reviewed by Simon Fraser.
     8
     9        * platform/RuntimeApplicationChecks.h:
     10        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
     11        (WebCore::IOSApplication::isFirefox):
     12        Add a Firefox Mobile bundle check.
     13
    1142019-01-11  Antti Koivisto  <antti@apple.com>
    215
  • trunk/Source/WebCore/platform/RuntimeApplicationChecks.h

    r237935 r239880  
    9191WEBCORE_EXPORT bool isNike();
    9292bool isMoviStarPlus();
     93WEBCORE_EXPORT bool isFirefox();
    9394
    9495} // IOSApplication
  • trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm

    r239427 r239880  
    277277    return isMoviStarPlus;
    278278}
    279    
     279
     280bool IOSApplication::isFirefox()
     281{
     282    static bool isFirefox = applicationBundleIsEqualTo("org.mozilla.ios.Firefox"_s);
     283    return isFirefox;
     284}
     285
    280286#endif
    281287
  • trunk/Source/WebKit/ChangeLog

    r239864 r239880  
     12019-01-11  Tim Horton  <timothy_horton@apple.com>
     2
     3        REGRESSION (PSON): Firefox app lacks Open in New Tab in menu
     4        https://bugs.webkit.org/show_bug.cgi?id=193366
     5        <rdar://problem/46097212>
     6
     7        Reviewed by Simon Fraser.
     8
     9        A pair of unrelated changes broke Firefox's use of WKWebView internals
     10        to override the long-press menu. Maintain binary compatibility by
     11        introducing linked-on-or-after checks.
     12
     13        * UIProcess/Cocoa/VersionChecks.h:
     14        * UIProcess/WebProcessPool.cpp:
     15        (WebKit::WebProcessPool::createWebPage):
     16        Disable PSON in Firefox when linked against an SDK where PSON wasn't enabled by default.
     17        Because gestures are very stateful, we always swap them out when swapping
     18        processes (changing that behavior is fairly risky). Also, we don't always
     19        inform the client when we swap processes (only when the process actually crashes),
     20        so they currently don't re-adjust the gesture recognizers when a PSON swap occurs.
     21
     22        * UIProcess/ios/WKContentView.mm:
     23        (-[WKContentView _commonInitializationWithProcessPool:configuration:]):
     24        Synchronously install gesture recognizers under -init when linked against
     25        an SDK before the version that introduces lazy gesture recognizer installation.
     26        r237331 is an optimization that made us lazily install gestures when the
     27        view is parented, but Firefox (and potentially other clients) depend
     28        on them being installed synchronously in order to find and override them.
     29
    1302019-01-11  Wenson Hsieh  <wenson_hsieh@apple.com>
    231
  • trunk/Source/WebKit/UIProcess/Cocoa/VersionChecks.h

    r237266 r239880  
    2828#import <wtf/spi/darwin/dyldSPI.h>
    2929
     30#if USE(APPLE_INTERNAL_SDK)
     31#import <WebKitAdditions/VersionChecksAdditions.h>
     32#else
     33#define DYLD_IOS_VERSION_FIRST_WITH_LAZY_GESTURE_RECOGNIZER_INSTALLATION 0
     34#define DYLD_IOS_VERSION_FIRST_WITH_PROCESS_SWAP_ON_CROSS_SITE_NAVIGATION 0
     35#endif
     36
    3037namespace WebKit {
    3138
    … …  
    4249    FirstWhereUIScrollViewDoesNotApplyKeyboardInsetsUnconditionally = DYLD_IOS_VERSION_12_0,
    4350    FirstWithMainThreadReleaseAssertionInWebPageProxy = DYLD_IOS_VERSION_12_0,
     51    FirstWithLazyGestureRecognizerInstallation = DYLD_IOS_VERSION_FIRST_WITH_LAZY_GESTURE_RECOGNIZER_INSTALLATION,
     52    FirstWithProcessSwapOnCrossSiteNavigation = DYLD_IOS_VERSION_FIRST_WITH_PROCESS_SWAP_ON_CROSS_SITE_NAVIGATION,
    4453#elif PLATFORM(MAC)
    4554    FirstWithNetworkCache = DYLD_MACOSX_VERSION_10_11,
  • trunk/Source/WebKit/UIProcess/WebProcessPool.cpp

    r239816 r239880  
    8888#include <WebCore/ProcessWarming.h>
    8989#include <WebCore/ResourceRequest.h>
     90#include <WebCore/RuntimeApplicationChecks.h>
    9091#include <pal/SessionID.h>
    9192#include <wtf/Language.h>
    … …  
    114115#include "WaylandCompositor.h"
    115116#include <WebCore/PlatformDisplay.h>
     117#endif
     118
     119#if PLATFORM(COCOA)
     120#include "VersionChecks.h"
    116121#endif
    117122
    … …  
    11461151
    11471152    auto page = process->createWebPage(pageClient, WTFMove(pageConfiguration));
    1148     m_configuration->setProcessSwapsOnNavigationFromExperimentalFeatures(page->preferences().processSwapOnCrossSiteNavigationEnabled());
     1153
     1154    bool enableProcessSwapOnCrossSiteNavigation = page->preferences().processSwapOnCrossSiteNavigationEnabled();
     1155#if PLATFORM(IOS_FAMILY)
     1156    if (WebCore::IOSApplication::isFirefox() && !linkedOnOrAfter(WebKit::SDKVersion::FirstWithProcessSwapOnCrossSiteNavigation))
     1157        enableProcessSwapOnCrossSiteNavigation = false;
     1158#endif
     1159
     1160    m_configuration->setProcessSwapsOnNavigationFromExperimentalFeatures(enableProcessSwapOnCrossSiteNavigation);
    11491161    m_configuration->setShouldCaptureAudioInUIProcess(page->preferences().captureAudioInUIProcessEnabled());
    11501162    m_configuration->setShouldCaptureVideoInUIProcess(page->preferences().captureVideoInUIProcessEnabled());
  • trunk/Source/WebKit/UIProcess/ios/WKContentView.mm

    r239454 r239880  
    4040#import "SmartMagnificationController.h"
    4141#import "UIKitSPI.h"
     42#import "VersionChecks.h"
    4243#import "WKBrowsingContextControllerInternal.h"
    4344#import "WKBrowsingContextGroupPrivate.h"
    … …  
    220221    [_fixedClippingView addSubview:_rootContentView.get()];
    221222
     223    if (!linkedOnOrAfter(WebKit::SDKVersion::FirstWithLazyGestureRecognizerInstallation))
     224        [self setupInteraction];
    222225    [self setUserInteractionEnabled:YES];
    223226
Note: See TracChangeset for help on using the changeset viewer.