- Revision
- 202380
- Author
- [email protected]
- Date
- 2016-06-23 09:35:17 -0700 (Thu, 23 Jun 2016)
Log Message
Source/WebCore:
Enable window.open() for existing versions of Secret Society
https://bugs.webkit.org/show_bug.cgi?id=159049
<rdar://problem/26528349>
Reviewed by Andy Estes.
The Secret Society Hidden Mystery app has a broken version check treating iOS 10
as iOS 1 on iPads. Therefore it believes it can use window.open() in a tap
handler. We should allow the existing versions of the app to do this to not break
them.
No new tests. Tested manually in the app.
* page/DOMWindow.cpp:
(WebCore::DOMWindow::allowPopUp):
Now checks with Settings whether it should allow a popup even though it is
not processing a user gesture.
* page/Settings.in:
Added setting allowWindowOpenWithoutUserGesture.
* platform/RuntimeApplicationChecks.h:
* platform/RuntimeApplicationChecks.mm:
(WebCore::IOSApplication::isTheSecretSocietyHiddenMystery):
Added.
Source/WebKit/mac:
Enable window.open() for existing versions of Secret Society app
https://bugs.webkit.org/show_bug.cgi?id=159049
<rdar://problem/26528349>
Reviewed by Andy Estes.
The Secret Society Hidden Mystery app has a broken version check treating iOS 10
as iOS 1 on iPads. Therefore it believes it can use window.open() in a tap
handler. We should allow the existing versions of the app to do this to not break
them.
* WebView/WebView.mm:
(shouldAllowWindowOpenWithoutUserGesture):
Added.
(shouldConvertInvalidURLsToBlank):
Changed hex number to constant DYLD_IOS_VERSION_10_0.
Source/WTF:
Enable window.open() for existing versions of Secret Society
https://bugs.webkit.org/show_bug.cgi?id=159049
<rdar://problem/26528349>
Reviewed by Andy Estes.
The Secret Society Hidden Mystery app has a broken version check treating iOS 10
as iOS 1 on iPads. Therefore it believes it can use window.open() in a tap
handler. We should allow the existing versions of the app to do this to not break
them.
* wtf/spi/darwin/dyldSPI.h:
Added DYLD_IOS_VERSION_10_0.
Modified Paths
Diff
Modified: trunk/Source/WTF/ChangeLog (202379 => 202380)
--- trunk/Source/WTF/ChangeLog 2016-06-23 16:03:18 UTC (rev 202379)
+++ trunk/Source/WTF/ChangeLog 2016-06-23 16:35:17 UTC (rev 202380)
@@ -1,3 +1,19 @@
+2016-06-23 John Wilander <[email protected]>
+
+ Enable window.open() for existing versions of Secret Society
+ https://bugs.webkit.org/show_bug.cgi?id=159049
+ <rdar://problem/26528349>
+
+ Reviewed by Andy Estes.
+
+ The Secret Society Hidden Mystery app has a broken version check treating iOS 10
+ as iOS 1 on iPads. Therefore it believes it can use window.open() in a tap
+ handler. We should allow the existing versions of the app to do this to not break
+ them.
+
+ * wtf/spi/darwin/dyldSPI.h:
+ Added DYLD_IOS_VERSION_10_0.
+
2016-06-21 Said Abou-Hallawa <sabouhallawa@apple,com>
Add system tracing points for requestAnimationFrame() workflow
Modified: trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h (202379 => 202380)
--- trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h 2016-06-23 16:03:18 UTC (rev 202379)
+++ trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h 2016-06-23 16:35:17 UTC (rev 202380)
@@ -37,6 +37,7 @@
#define DYLD_IOS_VERSION_6_0 0x00060000
#define DYLD_IOS_VERSION_7_0 0x00070000
#define DYLD_IOS_VERSION_9_0 0x00090000
+#define DYLD_IOS_VERSION_10_0 0x000A0000
#endif
Modified: trunk/Source/WebCore/ChangeLog (202379 => 202380)
--- trunk/Source/WebCore/ChangeLog 2016-06-23 16:03:18 UTC (rev 202379)
+++ trunk/Source/WebCore/ChangeLog 2016-06-23 16:35:17 UTC (rev 202380)
@@ -1,3 +1,29 @@
+2016-06-23 John Wilander <[email protected]>
+
+ Enable window.open() for existing versions of Secret Society
+ https://bugs.webkit.org/show_bug.cgi?id=159049
+ <rdar://problem/26528349>
+
+ Reviewed by Andy Estes.
+
+ The Secret Society Hidden Mystery app has a broken version check treating iOS 10
+ as iOS 1 on iPads. Therefore it believes it can use window.open() in a tap
+ handler. We should allow the existing versions of the app to do this to not break
+ them.
+
+ No new tests. Tested manually in the app.
+
+ * page/DOMWindow.cpp:
+ (WebCore::DOMWindow::allowPopUp):
+ Now checks with Settings whether it should allow a popup even though it is
+ not processing a user gesture.
+ * page/Settings.in:
+ Added setting allowWindowOpenWithoutUserGesture.
+ * platform/RuntimeApplicationChecks.h:
+ * platform/RuntimeApplicationChecks.mm:
+ (WebCore::IOSApplication::isTheSecretSocietyHiddenMystery):
+ Added.
+
2016-06-23 Chris Dumez <[email protected]>
Only call sqlite3_initialize() when a SQLite database is actually being opened
Modified: trunk/Source/WebCore/page/DOMWindow.cpp (202379 => 202380)
--- trunk/Source/WebCore/page/DOMWindow.cpp 2016-06-23 16:03:18 UTC (rev 202379)
+++ trunk/Source/WebCore/page/DOMWindow.cpp 2016-06-23 16:35:17 UTC (rev 202380)
@@ -358,11 +358,13 @@
bool DOMWindow::allowPopUp(Frame* firstFrame)
{
ASSERT(firstFrame);
+
+ auto& settings = firstFrame->settings();
- if (ScriptController::processingUserGesture())
+ if (ScriptController::processingUserGesture() || settings.allowWindowOpenWithoutUserGesture())
return true;
- return firstFrame->settings()._javascript_CanOpenWindowsAutomatically();
+ return settings._javascript_CanOpenWindowsAutomatically();
}
bool DOMWindow::allowPopUp()
Modified: trunk/Source/WebCore/page/Settings.in (202379 => 202380)
--- trunk/Source/WebCore/page/Settings.in 2016-06-23 16:03:18 UTC (rev 202379)
+++ trunk/Source/WebCore/page/Settings.in 2016-06-23 16:35:17 UTC (rev 202380)
@@ -264,6 +264,8 @@
allowContentSecurityPolicySourceStarToMatchAnyProtocol initial=false
+allowWindowOpenWithoutUserGesture initial=false
+
selectionPaintingWithoutSelectionGapsEnabled initial=false
shouldConvertInvalidURLsToBlank initial=true
Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.h (202379 => 202380)
--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.h 2016-06-23 16:03:18 UTC (rev 202379)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.h 2016-06-23 16:35:17 UTC (rev 202380)
@@ -75,6 +75,7 @@
WEBCORE_EXPORT bool isEcobee();
WEBCORE_EXPORT bool isQuora();
WEBCORE_EXPORT bool isXtraMath();
+WEBCORE_EXPORT bool isTheSecretSocietyHiddenMystery();
} // IOSApplication
Modified: trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm (202379 => 202380)
--- trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm 2016-06-23 16:03:18 UTC (rev 202379)
+++ trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm 2016-06-23 16:35:17 UTC (rev 202380)
@@ -253,6 +253,12 @@
return isXtraMath;
}
+bool IOSApplication::isTheSecretSocietyHiddenMystery()
+{
+ static bool isTheSecretSocietyHiddenMystery = applicationBundleIsEqualTo("com.g5e.secretsociety");
+ return isTheSecretSocietyHiddenMystery;
+}
+
#endif
} // namespace WebCore
Modified: trunk/Source/WebKit/mac/ChangeLog (202379 => 202380)
--- trunk/Source/WebKit/mac/ChangeLog 2016-06-23 16:03:18 UTC (rev 202379)
+++ trunk/Source/WebKit/mac/ChangeLog 2016-06-23 16:35:17 UTC (rev 202380)
@@ -1,3 +1,22 @@
+2016-06-23 John Wilander <[email protected]>
+
+ Enable window.open() for existing versions of Secret Society app
+ https://bugs.webkit.org/show_bug.cgi?id=159049
+ <rdar://problem/26528349>
+
+ Reviewed by Andy Estes.
+
+ The Secret Society Hidden Mystery app has a broken version check treating iOS 10
+ as iOS 1 on iPads. Therefore it believes it can use window.open() in a tap
+ handler. We should allow the existing versions of the app to do this to not break
+ them.
+
+ * WebView/WebView.mm:
+ (shouldAllowWindowOpenWithoutUserGesture):
+ Added.
+ (shouldConvertInvalidURLsToBlank):
+ Changed hex number to constant DYLD_IOS_VERSION_10_0.
+
2016-06-22 Anders Carlsson <[email protected]>
Move the WebKitLegacy Apple Pay code to the open source repository
Modified: trunk/Source/WebKit/mac/WebView/WebView.mm (202379 => 202380)
--- trunk/Source/WebKit/mac/WebView/WebView.mm 2016-06-23 16:03:18 UTC (rev 202379)
+++ trunk/Source/WebKit/mac/WebView/WebView.mm 2016-06-23 16:35:17 UTC (rev 202380)
@@ -876,10 +876,20 @@
#endif
}
+static bool shouldAllowWindowOpenWithoutUserGesture()
+{
+#if PLATFORM(IOS)
+ static bool shouldAllowWindowOpenWithoutUserGesture = IOSApplication::isTheSecretSocietyHiddenMystery() && dyld_get_program_sdk_version() < DYLD_IOS_VERSION_10_0;
+ return shouldAllowWindowOpenWithoutUserGesture;
+#else
+ return false;
+#endif
+}
+
static bool shouldConvertInvalidURLsToBlank()
{
#if PLATFORM(IOS)
- static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= 0x000A0000;
+ static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_10_0;
#elif PLATFORM(MAC)
static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= 0x000A0C00;
#else
@@ -2542,6 +2552,8 @@
settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol());
+ settings.setAllowWindowOpenWithoutUserGesture(shouldAllowWindowOpenWithoutUserGesture());
+
settings.setShouldConvertInvalidURLsToBlank(shouldConvertInvalidURLsToBlank());
}