Changeset 258564 in webkit


Ignore:
Timestamp:
Mar 17, 2020, 11:31:22 AM (5 years ago)
Author:
achristensen@apple.com
Message:

REGRESSION(r254856) Add exception for window.openDatabase to not masquerade as undefined in currently shipping Jesus Calling Devotional app
https://bugs.webkit.org/show_bug.cgi?id=209160
<rdar://problem/60297073>

Reviewed by Geoff Garen.

Source/WebCore:

Manually verified this fixes the app, which compares typeof openDatabase with 'undefined'
Going forward, we intend to completely remove WebSQL, so this is a temporary exception to our removal strategy.

  • bindings/js/JSDOMWindowCustom.cpp:

(WebCore::JSDOMWindow::openDatabase const):

  • platform/RuntimeApplicationChecks.h:
  • platform/cocoa/RuntimeApplicationChecksCocoa.mm:

(WebCore::IOSApplication::isJesusCalling):

Source/WTF:

  • wtf/spi/darwin/dyldSPI.h:
Location:
trunk/Source
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r258557 r258564  
     12020-03-17  Alex Christensen  <achristensen@webkit.org>
     2
     3        REGRESSION(r254856) Add exception for window.openDatabase to not masquerade as undefined in currently shipping Jesus Calling Devotional app
     4        https://bugs.webkit.org/show_bug.cgi?id=209160
     5        <rdar://problem/60297073>
     6
     7        Reviewed by Geoff Garen.
     8
     9        * wtf/spi/darwin/dyldSPI.h:
     10
    1112020-03-17  Per Arne Vollan  <pvollan@apple.com>
    212
  • trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h

    r256191 r258564  
    8686#define DYLD_IOS_VERSION_11_3 0x000B0300
    8787#define DYLD_IOS_VERSION_12_0 0x000C0000
     88#define DYLD_IOS_VERSION_12_2 0x000C0200
    8889#define DYLD_IOS_VERSION_13_0 0x000D0000
    8990#define DYLD_IOS_VERSION_13_2 0x000D0200
  • trunk/Source/WebCore/ChangeLog

    r258560 r258564  
     12020-03-17  Alex Christensen  <achristensen@webkit.org>
     2
     3        REGRESSION(r254856) Add exception for window.openDatabase to not masquerade as undefined in currently shipping Jesus Calling Devotional app
     4        https://bugs.webkit.org/show_bug.cgi?id=209160
     5        <rdar://problem/60297073>
     6
     7        Reviewed by Geoff Garen.
     8
     9        Manually verified this fixes the app, which compares typeof openDatabase with 'undefined'
     10        Going forward, we intend to completely remove WebSQL, so this is a temporary exception to our removal strategy.
     11
     12        * bindings/js/JSDOMWindowCustom.cpp:
     13        (WebCore::JSDOMWindow::openDatabase const):
     14        * platform/RuntimeApplicationChecks.h:
     15        * platform/cocoa/RuntimeApplicationChecksCocoa.mm:
     16        (WebCore::IOSApplication::isJesusCalling):
     17
    1182020-03-17  Andres Gonzalez  <andresg_22@apple.com>
    219
  • trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp

    r257399 r258564  
    6060#endif
    6161
     62#if PLATFORM(IOS)
     63#include "RuntimeApplicationChecks.h"
     64#include <wtf/cocoa/RuntimeApplicationChecksCocoa.h>
     65#endif
    6266
    6367namespace WebCore {
     
    633637JSValue JSDOMWindow::openDatabase(JSC::JSGlobalObject& lexicalGlobalObject) const
    634638{
     639#if PLATFORM(IOS)
     640    static const bool openDatabaseShouldBeDefinedEvenWhenDisabled = IOSApplication::isJesusCalling() && applicationSDKVersion() <= DYLD_IOS_VERSION_12_2;
     641#else
     642    constexpr bool openDatabaseShouldBeDefinedEvenWhenDisabled = false;
     643#endif
     644
    635645    VM& vm = lexicalGlobalObject.vm();
    636646    StringImpl* name = PropertyName(static_cast<JSVMClientData*>(vm.clientData)->builtinNames().openDatabasePublicName()).publicName();
    637     if (RuntimeEnabledFeatures::sharedFeatures().webSQLEnabled())
     647    if (RuntimeEnabledFeatures::sharedFeatures().webSQLEnabled() || openDatabaseShouldBeDefinedEvenWhenDisabled)
    638648        return JSFunction::create(vm, &lexicalGlobalObject, 4, name, jsDOMWindowInstanceFunctionOpenDatabase, NoIntrinsic);
    639649
  • trunk/Source/WebCore/platform/RuntimeApplicationChecks.h

    r258447 r258564  
    8787WEBCORE_EXPORT bool isMiniBrowser();
    8888bool isMobileStore();
     89bool isJesusCalling();
    8990bool isSpringBoard();
    9091WEBCORE_EXPORT bool isWebProcess();
  • trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm

    r258447 r258564  
    250250}
    251251
     252bool IOSApplication::isJesusCalling()
     253{
     254    static bool isJesusCalling = applicationBundleIsEqualTo("com.thomasnelson.jesuscalling"_s);
     255    return isJesusCalling;
     256}
     257
    252258bool IOSApplication::isMobileStore()
    253259{
Note: See TracChangeset for help on using the changeset viewer.