Safari's AXFocusedUIElement attribute returns WebArea object with AXSelectedTextMarke...
authorcfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2011 01:12:21 +0000 (01:12 +0000)
committercfleizach@apple.com <cfleizach@apple.com@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Fri, 27 May 2011 01:12:21 +0000 (01:12 +0000)
https://bugs.webkit.org/show_bug.cgi?id=61492

Reviewed by Darin Adler.

The method for determining which WebPage is actually focused and foreground was faulty. More
extensive checks are required to check which WebPage should be returned as the focusable one.

* WebProcess/WebPage/WebPage.cpp:
(WebKit::WebPage::windowIsFocused):

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

Source/WebKit2/ChangeLog
Source/WebKit2/WebProcess/WebPage/WebPage.cpp

index 9d8d171..381a262 100644 (file)
@@ -1,3 +1,16 @@
+2011-05-26  Chris Fleizach  <cfleizach@apple.com>
+
+        Reviewed by Darin Adler.
+
+        Safari's AXFocusedUIElement attribute returns WebArea object with AXSelectedTextMarkerRange of nil
+        https://bugs.webkit.org/show_bug.cgi?id=61492
+
+        The method for determining which WebPage is actually focused and foreground was faulty. More
+        extensive checks are required to check which WebPage should be returned as the focusable one.
+
+        * WebProcess/WebPage/WebPage.cpp:
+        (WebKit::WebPage::windowIsFocused):
+
 2011-05-26  Jon Lee  <jonlee@apple.com>
 
         Reviewed by Darin Adler.
index dd0d2fc..32ac878 100644 (file)
@@ -1958,12 +1958,16 @@ void WebPage::windowAndViewFramesChanged(const WebCore::IntRect& windowFrameInSc
 }
 
 #endif
-    
+
 bool WebPage::windowIsFocused() const
 {
-    return m_page->focusController()->isActive();
-}
-    
+#if PLATFORM(MAC)
+    if (!m_windowIsVisible)
+        return false;
+#endif
+    return m_page->focusController()->isFocused() && m_page->focusController()->isActive();
+}    
+
 void WebPage::didReceiveMessage(CoreIPC::Connection* connection, CoreIPC::MessageID messageID, CoreIPC::ArgumentDecoder* arguments)
 {
     if (messageID.is<CoreIPC::MessageClassDrawingAreaLegacy>()) {