Title: [258564] trunk/Source
Revision
258564
Author
[email protected]
Date
2020-03-17 11:31:22 -0700 (Tue, 17 Mar 2020)

Log 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:

Modified Paths

Diff

Modified: trunk/Source/WTF/ChangeLog (258563 => 258564)


--- trunk/Source/WTF/ChangeLog	2020-03-17 18:18:47 UTC (rev 258563)
+++ trunk/Source/WTF/ChangeLog	2020-03-17 18:31:22 UTC (rev 258564)
@@ -1,3 +1,13 @@
+2020-03-17  Alex Christensen  <[email protected]>
+
+        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.
+
+        * wtf/spi/darwin/dyldSPI.h:
+
 2020-03-17  Per Arne Vollan  <[email protected]>
 
         [Cocoa] Disable CF prefs direct mode

Modified: trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h (258563 => 258564)


--- trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h	2020-03-17 18:18:47 UTC (rev 258563)
+++ trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h	2020-03-17 18:31:22 UTC (rev 258564)
@@ -85,6 +85,7 @@
 #define DYLD_IOS_VERSION_11_0 0x000B0000
 #define DYLD_IOS_VERSION_11_3 0x000B0300
 #define DYLD_IOS_VERSION_12_0 0x000C0000
+#define DYLD_IOS_VERSION_12_2 0x000C0200
 #define DYLD_IOS_VERSION_13_0 0x000D0000
 #define DYLD_IOS_VERSION_13_2 0x000D0200
 #define DYLD_IOS_VERSION_13_4 0x000D0400

Modified: trunk/Source/WebCore/ChangeLog (258563 => 258564)


--- trunk/Source/WebCore/ChangeLog	2020-03-17 18:18:47 UTC (rev 258563)
+++ trunk/Source/WebCore/ChangeLog	2020-03-17 18:31:22 UTC (rev 258564)
@@ -1,3 +1,20 @@
+2020-03-17  Alex Christensen  <[email protected]>
+
+        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.
+
+        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):
+
 2020-03-17  Andres Gonzalez  <[email protected]>
 
         AXIsolatedTree removal should set all nodes to be removed on AX secondary thread.

Modified: trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp (258563 => 258564)


--- trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp	2020-03-17 18:18:47 UTC (rev 258563)
+++ trunk/Source/WebCore/bindings/js/JSDOMWindowCustom.cpp	2020-03-17 18:31:22 UTC (rev 258564)
@@ -59,6 +59,10 @@
 #include "JSWebKitNamespace.h"
 #endif
 
+#if PLATFORM(IOS)
+#include "RuntimeApplicationChecks.h"
+#include <wtf/cocoa/RuntimeApplicationChecksCocoa.h>
+#endif
 
 namespace WebCore {
 using namespace JSC;
@@ -632,9 +636,15 @@
 
 JSValue JSDOMWindow::openDatabase(JSC::JSGlobalObject& lexicalGlobalObject) const
 {
+#if PLATFORM(IOS)
+    static const bool openDatabaseShouldBeDefinedEvenWhenDisabled = IOSApplication::isJesusCalling() && applicationSDKVersion() <= DYLD_IOS_VERSION_12_2;
+#else
+    constexpr bool openDatabaseShouldBeDefinedEvenWhenDisabled = false;
+#endif
+
     VM& vm = lexicalGlobalObject.vm();
     StringImpl* name = PropertyName(static_cast<JSVMClientData*>(vm.clientData)->builtinNames().openDatabasePublicName()).publicName();
-    if (RuntimeEnabledFeatures::sharedFeatures().webSQLEnabled())
+    if (RuntimeEnabledFeatures::sharedFeatures().webSQLEnabled() || openDatabaseShouldBeDefinedEvenWhenDisabled)
         return JSFunction::create(vm, &lexicalGlobalObject, 4, name, jsDOMWindowInstanceFunctionOpenDatabase, NoIntrinsic);
 
     return JSFunction::createFunctionThatMasqueradesAsUndefined(vm, &lexicalGlobalObject, 4, name, jsDOMWindowInstanceFunctionOpenDatabase, NoIntrinsic);

Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.h (258563 => 258564)


--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.h	2020-03-17 18:18:47 UTC (rev 258563)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.h	2020-03-17 18:31:22 UTC (rev 258564)
@@ -86,6 +86,7 @@
 WEBCORE_EXPORT bool isDumpRenderTree();
 WEBCORE_EXPORT bool isMiniBrowser();
 bool isMobileStore();
+bool isJesusCalling();
 bool isSpringBoard();
 WEBCORE_EXPORT bool isWebProcess();
 WEBCORE_EXPORT bool isIBooks();

Modified: trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm (258563 => 258564)


--- trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm	2020-03-17 18:18:47 UTC (rev 258563)
+++ trunk/Source/WebCore/platform/cocoa/RuntimeApplicationChecksCocoa.mm	2020-03-17 18:31:22 UTC (rev 258564)
@@ -249,6 +249,12 @@
     return isDumpRenderTree;
 }
 
+bool IOSApplication::isJesusCalling()
+{
+    static bool isJesusCalling = applicationBundleIsEqualTo("com.thomasnelson.jesuscalling"_s);
+    return isJesusCalling;
+}
+
 bool IOSApplication::isMobileStore()
 {
     static bool isMobileStore = applicationBundleIsEqualTo("com.apple.MobileStore"_s);
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to