[SCM] WebKit Debian packaging branch, webkit-1.2, updated. upstream/1.1.90-6072-g9a69373

eric at webkit.org eric at webkit.org
Thu Apr 8 00:25:35 UTC 2010


The following commit has been merged in the webkit-1.2 branch:
commit b323e8964e7c238b00e11ce46bbfde1ff7fb294d
Author: eric at webkit.org <eric at webkit.org@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Tue Dec 8 01:22:23 2009 +0000

    2009-12-07  Finnur Thorarinsson  <finnur.webkit at gmail.com>
    
            Reviewed by Darin Fisher.
    
            A patch for Chromium to restrict the scope of the Gmail focus fix,
            where we set the Selection to 0,0 for content-editable fields and
            also make sure we set the selection end-state for find to select the
            text found (when not focusing a link we found).
            WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=32248
    
            * src/WebFrameImpl.cpp:
            (WebKit::WebFrameImpl::setFindEndstateFocusAndSelection):
            * src/WebViewImpl.cpp:
            (WebKit::WebViewImpl::setFocus):
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@51818 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebKit/chromium/ChangeLog b/WebKit/chromium/ChangeLog
index 1da6e3d..58b78ee 100644
--- a/WebKit/chromium/ChangeLog
+++ b/WebKit/chromium/ChangeLog
@@ -1,3 +1,18 @@
+2009-12-07  Finnur Thorarinsson  <finnur.webkit at gmail.com>
+
+        Reviewed by Darin Fisher.
+
+        A patch for Chromium to restrict the scope of the Gmail focus fix,
+        where we set the Selection to 0,0 for content-editable fields and
+        also make sure we set the selection end-state for find to select the
+        text found (when not focusing a link we found).
+        WebKit bug: https://bugs.webkit.org/show_bug.cgi?id=32248
+
+        * src/WebFrameImpl.cpp:
+        (WebKit::WebFrameImpl::setFindEndstateFocusAndSelection):
+        * src/WebViewImpl.cpp:
+        (WebKit::WebViewImpl::setFocus):
+
 2009-12-07  Dmitry Titov  <dimich at chromium.org>
 
         Rubber-stamped by Darin Adler.
diff --git a/WebKit/chromium/src/WebFrameImpl.cpp b/WebKit/chromium/src/WebFrameImpl.cpp
index f722860..4506696 100644
--- a/WebKit/chromium/src/WebFrameImpl.cpp
+++ b/WebKit/chromium/src/WebFrameImpl.cpp
@@ -1669,19 +1669,28 @@ void WebFrameImpl::setFindEndstateFocusAndSelection()
         if (node && node != frame()->document()) {
             // Found a focusable parent node. Set focus to it.
             frame()->document()->setFocusedNode(node);
-        } else {
-            // Iterate over all the nodes in the range until we find a focusable node.
-            // This, for example, sets focus to the first link if you search for
-            // text and text that is within one or more links.
-            node = m_activeMatch->firstNode();
-            while (node && node != m_activeMatch->pastLastNode()) {
-                if (node->isFocusable()) {
-                    frame()->document()->setFocusedNode(node);
-                    break;
-                }
-                node = node->traverseNextNode();
+            return;
+        }
+
+        // Iterate over all the nodes in the range until we find a focusable node.
+        // This, for example, sets focus to the first link if you search for
+        // text and text that is within one or more links.
+        node = m_activeMatch->firstNode();
+        while (node && node != m_activeMatch->pastLastNode()) {
+            if (node->isFocusable()) {
+                frame()->document()->setFocusedNode(node);
+                return;
             }
+            node = node->traverseNextNode();
         }
+
+        // No node related to the active match was focusable, so set the
+        // active match as the selection (so that when you end the Find session,
+        // you'll have the last thing you found highlighted) and make sure that
+        // we have nothing focused (otherwise you might have text selected but
+        // a link focused, which is weird).
+        frame()->selection()->setSelection(m_activeMatch.get());
+        frame()->document()->setFocusedNode(0);
     }
 }
 
diff --git a/WebKit/chromium/src/WebViewImpl.cpp b/WebKit/chromium/src/WebViewImpl.cpp
index 834e1ca..1f89ffe 100644
--- a/WebKit/chromium/src/WebViewImpl.cpp
+++ b/WebKit/chromium/src/WebViewImpl.cpp
@@ -925,11 +925,11 @@ void WebViewImpl::setFocus(bool enable)
                 Element* element = static_cast<Element*>(focusedNode);
                 if (element->isTextFormControl())
                     element->updateFocusAppearance(true);
-                else {
+                else if (focusedNode->isContentEditable()) {
                     // updateFocusAppearance() selects all the text of
                     // contentseditable DIVs. So we set the selection explicitly
                     // instead. Note that this has the side effect of moving the
-                    // caret back to the begining of the text.
+                    // caret back to the beginning of the text.
                     Position position(focusedNode, 0,
                                       Position::PositionIsOffsetInAnchor);
                     focusedFrame->selection()->setSelection(

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list