Title: [101905] trunk/Source/WebKit/chromium
Revision
101905
Author
[email protected]
Date
2011-12-02 21:51:02 -0800 (Fri, 02 Dec 2011)

Log Message

Don't call FocusController:setActive() in
WebViewImpl::setFocus(), since being active and
being focused are different concepts and chromium
now properly sends setActive IPCs on all platforms.
https://bugs.webkit.org/show_bug.cgi?id=73687

Reviewed by Eric Seidel.

* src/WebViewImpl.cpp:
(WebKit::WebViewImpl::setFocus):
* tests/WebViewTest.cpp: Test how different combinations of
    setIsActive() and setFocus() affect whether the document
    has focus.

Modified Paths

Diff

Modified: trunk/Source/WebKit/chromium/ChangeLog (101904 => 101905)


--- trunk/Source/WebKit/chromium/ChangeLog	2011-12-03 05:40:46 UTC (rev 101904)
+++ trunk/Source/WebKit/chromium/ChangeLog	2011-12-03 05:51:02 UTC (rev 101905)
@@ -1,3 +1,19 @@
+2011-12-02  Nate Chapin  <[email protected]>
+
+        Don't call FocusController:setActive() in 
+        WebViewImpl::setFocus(), since being active and
+        being focused are different concepts and chromium
+        now properly sends setActive IPCs on all platforms.
+        https://bugs.webkit.org/show_bug.cgi?id=73687
+
+        Reviewed by Eric Seidel.
+
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::setFocus):
+        * tests/WebViewTest.cpp: Test how different combinations of
+            setIsActive() and setFocus() affect whether the document
+            has focus.
+
 2011-12-02  Dave Michael  <[email protected]>
 
         Add WebArrayBuffer to chromium API

Modified: trunk/Source/WebKit/chromium/src/WebViewImpl.cpp (101904 => 101905)


--- trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-12-03 05:40:46 UTC (rev 101904)
+++ trunk/Source/WebKit/chromium/src/WebViewImpl.cpp	2011-12-03 05:51:02 UTC (rev 101905)
@@ -1423,7 +1423,6 @@
 void WebViewImpl::setFocus(bool enable)
 {
     m_page->focusController()->setFocused(enable);
-    m_page->focusController()->setActive(enable);
     if (enable) {
         RefPtr<Frame> focusedFrame = m_page->focusController()->focusedFrame();
         if (focusedFrame) {

Modified: trunk/Source/WebKit/chromium/tests/WebViewTest.cpp (101904 => 101905)


--- trunk/Source/WebKit/chromium/tests/WebViewTest.cpp	2011-12-03 05:40:46 UTC (rev 101904)
+++ trunk/Source/WebKit/chromium/tests/WebViewTest.cpp	2011-12-03 05:51:02 UTC (rev 101905)
@@ -97,15 +97,24 @@
     WebView* webView = FrameTestHelpers::createWebViewAndLoad(m_baseURL + "visible_iframe.html");
 
     webView->setFocus(true);
+    webView->setIsActive(true);
     WebFrameImpl* frame = static_cast<WebFrameImpl*>(webView->mainFrame());
     EXPECT_TRUE(frame->frame()->document()->isHTMLDocument());
 
     WebCore::HTMLDocument* document = static_cast<WebCore::HTMLDocument*>(frame->frame()->document());
     EXPECT_TRUE(document->hasFocus());
     webView->setFocus(false);
+    webView->setIsActive(false);
     EXPECT_FALSE(document->hasFocus());
     webView->setFocus(true);
+    webView->setIsActive(true);
     EXPECT_TRUE(document->hasFocus());
+    webView->setFocus(true);
+    webView->setIsActive(false);
+    EXPECT_FALSE(document->hasFocus());
+    webView->setFocus(false);
+    webView->setIsActive(true);
+    EXPECT_TRUE(document->hasFocus());
 
     webView->close();
 }
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes

Reply via email to