Changeset 202380 in webkit


Ignore:
Timestamp:
Jun 23, 2016 9:35:17 AM (8 years ago)
Author:
wilander@apple.com
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.

Location:
trunk/Source
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WTF/ChangeLog

    r202297 r202380  
     12016-06-23  John Wilander  <wilander@apple.com>
     2
     3        Enable window.open() for existing versions of Secret Society
     4        https://bugs.webkit.org/show_bug.cgi?id=159049
     5        <rdar://problem/26528349>
     6       
     7        Reviewed by Andy Estes.
     8
     9        The Secret Society Hidden Mystery app has a broken version check treating iOS 10
     10        as iOS 1 on iPads. Therefore it believes it can use window.open() in a tap
     11        handler. We should allow the existing versions of the app to do this to not break
     12        them.
     13
     14        * wtf/spi/darwin/dyldSPI.h:
     15            Added DYLD_IOS_VERSION_10_0.
     16
    1172016-06-21  Said Abou-Hallawa  <sabouhallawa@apple,com>
    218
  • trunk/Source/WTF/wtf/spi/darwin/dyldSPI.h

    r200866 r202380  
    3838#define DYLD_IOS_VERSION_7_0 0x00070000
    3939#define DYLD_IOS_VERSION_9_0 0x00090000
     40#define DYLD_IOS_VERSION_10_0 0x000A0000
    4041
    4142#endif
  • trunk/Source/WebCore/ChangeLog

    r202379 r202380  
     12016-06-23  John Wilander  <wilander@apple.com>
     2
     3        Enable window.open() for existing versions of Secret Society
     4        https://bugs.webkit.org/show_bug.cgi?id=159049
     5        <rdar://problem/26528349>
     6
     7        Reviewed by Andy Estes.
     8
     9        The Secret Society Hidden Mystery app has a broken version check treating iOS 10
     10        as iOS 1 on iPads. Therefore it believes it can use window.open() in a tap
     11        handler. We should allow the existing versions of the app to do this to not break
     12        them.
     13
     14        No new tests. Tested manually in the app.
     15
     16        * page/DOMWindow.cpp:
     17        (WebCore::DOMWindow::allowPopUp):
     18            Now checks with Settings whether it should allow a popup even though it is
     19            not processing a user gesture.
     20        * page/Settings.in:
     21            Added setting allowWindowOpenWithoutUserGesture.
     22        * platform/RuntimeApplicationChecks.h:
     23        * platform/RuntimeApplicationChecks.mm:
     24        (WebCore::IOSApplication::isTheSecretSocietyHiddenMystery):
     25            Added.
     26
    1272016-06-23  Chris Dumez  <cdumez@apple.com>
    228
  • trunk/Source/WebCore/page/DOMWindow.cpp

    r202242 r202380  
    359359{
    360360    ASSERT(firstFrame);
    361 
    362     if (ScriptController::processingUserGesture())
     361   
     362    auto& settings = firstFrame->settings();
     363
     364    if (ScriptController::processingUserGesture() || settings.allowWindowOpenWithoutUserGesture())
    363365        return true;
    364366
    365     return firstFrame->settings().javaScriptCanOpenWindowsAutomatically();
     367    return settings.javaScriptCanOpenWindowsAutomatically();
    366368}
    367369
  • trunk/Source/WebCore/page/Settings.in

    r201759 r202380  
    265265allowContentSecurityPolicySourceStarToMatchAnyProtocol initial=false
    266266
     267allowWindowOpenWithoutUserGesture initial=false
     268
    267269selectionPaintingWithoutSelectionGapsEnabled initial=false
    268270
  • trunk/Source/WebCore/platform/RuntimeApplicationChecks.h

    r202017 r202380  
    7676WEBCORE_EXPORT bool isQuora();
    7777WEBCORE_EXPORT bool isXtraMath();
     78WEBCORE_EXPORT bool isTheSecretSocietyHiddenMystery();
    7879
    7980} // IOSApplication
  • trunk/Source/WebCore/platform/RuntimeApplicationChecks.mm

    r202017 r202380  
    254254}
    255255
     256bool IOSApplication::isTheSecretSocietyHiddenMystery()
     257{
     258    static bool isTheSecretSocietyHiddenMystery = applicationBundleIsEqualTo("com.g5e.secretsociety");
     259    return isTheSecretSocietyHiddenMystery;
     260}
     261   
    256262#endif
    257263
  • trunk/Source/WebKit/mac/ChangeLog

    r202346 r202380  
     12016-06-23  John Wilander  <wilander@apple.com>
     2
     3        Enable window.open() for existing versions of Secret Society app
     4        https://bugs.webkit.org/show_bug.cgi?id=159049
     5        <rdar://problem/26528349>
     6
     7        Reviewed by Andy Estes.
     8
     9        The Secret Society Hidden Mystery app has a broken version check treating iOS 10
     10        as iOS 1 on iPads. Therefore it believes it can use window.open() in a tap
     11        handler. We should allow the existing versions of the app to do this to not break
     12        them.
     13
     14        * WebView/WebView.mm:
     15        (shouldAllowWindowOpenWithoutUserGesture):
     16            Added.
     17        (shouldConvertInvalidURLsToBlank):
     18            Changed hex number to constant DYLD_IOS_VERSION_10_0.
     19
    1202016-06-22  Anders Carlsson  <andersca@apple.com>
    221
  • trunk/Source/WebKit/mac/WebView/WebView.mm

    r202346 r202380  
    877877}
    878878
     879static bool shouldAllowWindowOpenWithoutUserGesture()
     880{
     881#if PLATFORM(IOS)
     882    static bool shouldAllowWindowOpenWithoutUserGesture = IOSApplication::isTheSecretSocietyHiddenMystery() && dyld_get_program_sdk_version() < DYLD_IOS_VERSION_10_0;
     883    return shouldAllowWindowOpenWithoutUserGesture;
     884#else
     885    return false;
     886#endif
     887}
     888
    879889static bool shouldConvertInvalidURLsToBlank()
    880890{
    881891#if PLATFORM(IOS)
    882     static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= 0x000A0000;
     892    static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= DYLD_IOS_VERSION_10_0;
    883893#elif PLATFORM(MAC)
    884894    static bool shouldConvertInvalidURLsToBlank = dyld_get_program_sdk_version() >= 0x000A0C00;
     
    25422552
    25432553    settings.setAllowContentSecurityPolicySourceStarToMatchAnyProtocol(shouldAllowContentSecurityPolicySourceStarToMatchAnyProtocol());
     2554
     2555    settings.setAllowWindowOpenWithoutUserGesture(shouldAllowWindowOpenWithoutUserGesture());
    25442556
    25452557    settings.setShouldConvertInvalidURLsToBlank(shouldConvertInvalidURLsToBlank());
Note: See TracChangeset for help on using the changeset viewer.