H&R Block 2010 Help window can not be reopened.
authorcommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Jul 2013 10:13:34 +0000 (10:13 +0000)
committercommit-queue@webkit.org <commit-queue@webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 3 Jul 2013 10:13:34 +0000 (10:13 +0000)
https://bugs.webkit.org/show_bug.cgi?id=118342

Patch by Zalan Bujtas <zalan@apple.com> on 2013-07-03
Reviewed by Antti Koivisto.

http://trac.webkit.org/changeset/118916 changed the window.focus() behaviour so that
only the opener can (re)focus() a particular window.
H&R Block app relies on the relaxed window.focus() rules.

Source/WebCore:

* WebCore.exp.in:
* platform/RuntimeApplicationChecks.cpp:
(WebCore::applicationIsHRBlock):
* platform/RuntimeApplicationChecks.h:

Source/WebKit/mac:

* WebView/WebView.mm:
(shouldRestrictWindowFocus):
(-[WebView _preferencesChanged:]):

git-svn-id: https://svn.webkit.org/repository/webkit/trunk@152348 268f45cc-cd09-0410-ab3c-d52691b4dbfc

Source/WebCore/ChangeLog
Source/WebCore/WebCore.exp.in
Source/WebCore/platform/RuntimeApplicationChecks.cpp
Source/WebCore/platform/RuntimeApplicationChecks.h
Source/WebKit/mac/ChangeLog
Source/WebKit/mac/WebView/WebView.mm

index bfaae0d..91c1fc4 100644 (file)
@@ -1,3 +1,19 @@
+2013-07-03  Zalan Bujtas  <zalan@apple.com>
+
+        H&R Block 2010 Help window can not be reopened.
+        https://bugs.webkit.org/show_bug.cgi?id=118342
+
+        Reviewed by Antti Koivisto.
+
+        http://trac.webkit.org/changeset/118916 changed the window.focus() behaviour so that
+        only the opener can (re)focus() a particular window.
+        H&R Block app relies on the relaxed window.focus() rules.
+
+        * WebCore.exp.in:
+        * platform/RuntimeApplicationChecks.cpp:
+        (WebCore::applicationIsHRBlock):
+        * platform/RuntimeApplicationChecks.h:
+
 2013-07-03  Zan Dobersek  <zdobersek@igalia.com>
 
         Further build fixing for build configurations that disable CSS regions support.
index beeb178..6a95e56 100644 (file)
@@ -1843,6 +1843,7 @@ __ZN7WebCore19applicationIsSafariEv
 __ZN7WebCore20PlatformEventFactory24createPlatformMouseEventEP7NSEventP6NSView
 __ZN7WebCore20PlatformEventFactory27createPlatformKeyboardEventEP7NSEvent
 __ZN7WebCore20builtInPDFPluginNameEv
+__ZN7WebCore20applicationIsHRBlockEv
 __ZN7WebCore21DeviceOrientationData6createEbdbdbdbb
 __ZN7WebCore21applicationIsApertureEv
 __ZN7WebCore21applicationIsVersionsEv
index 178949f..62fce37 100644 (file)
@@ -108,6 +108,12 @@ bool applicationIsVersions()
     return isVersions;
 }
 
+bool applicationIsHRBlock()
+{
+    static bool isHRBlock = mainBundleIsEqualTo("com.hrblock.tax.2010");
+    return isHRBlock;
+}
+
 bool applicationIsSolidStateNetworksDownloader()
 {
     static bool isSolidStateNetworksDownloader = mainBundleIsEqualTo("com.solidstatenetworks.awkhost");
index 2ff49a7..479fe38 100644 (file)
@@ -38,6 +38,7 @@ bool applicationIsMicrosoftOutlook();
 bool applicationIsSafari();
 bool applicationIsSolidStateNetworksDownloader();
 bool applicationIsVersions();
+bool applicationIsHRBlock();
 
 } // namespace WebCore
 
index 7e60da2..f794492 100644 (file)
@@ -1,3 +1,18 @@
+2013-07-03  Zalan Bujtas  <zalan@apple.com>
+
+        H&R Block 2010 Help window can not be reopened.
+        https://bugs.webkit.org/show_bug.cgi?id=118342
+
+        Reviewed by Antti Koivisto.
+
+        http://trac.webkit.org/changeset/118916 changed the window.focus() behaviour so that
+        only the opener can (re)focus() a particular window.
+        H&R Block app relies on the relaxed window.focus() rules.
+
+        * WebView/WebView.mm:
+        (shouldRestrictWindowFocus):
+        (-[WebView _preferencesChanged:]):
+
 2013-07-01  Timothy Hatcher  <timothy@apple.com>
 
         Link to WebInspectorUI.framework at build time instead of soft linking.
index 14ea40d..759670b 100644 (file)
@@ -623,6 +623,11 @@ static bool shouldEnableLoadDeferring()
     return !applicationIsAdobeInstaller();
 }
 
+static bool shouldRestrictWindowFocus()
+{
+    return !applicationIsHRBlock();
+}
+
 - (void)_dispatchPendingLoadRequests
 {
     resourceLoadScheduler()->servePendingRequests();
@@ -1499,6 +1504,7 @@ static bool needsSelfRetainWhileLoadingQuirk()
     settings->setWebGLEnabled([preferences webGLEnabled]);
     settings->setAccelerated2dCanvasEnabled([preferences accelerated2dCanvasEnabled]);
     settings->setLoadDeferringEnabled(shouldEnableLoadDeferring());
+    settings->setWindowFocusRestricted(shouldRestrictWindowFocus());
     settings->setFrameFlatteningEnabled([preferences isFrameFlatteningEnabled]);
     settings->setSpatialNavigationEnabled([preferences isSpatialNavigationEnabled]);
     settings->setPaginateDuringLayoutEnabled([preferences paginateDuringLayoutEnabled]);