[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

kocienda kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:52:16 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit eccc885bc35233eef1e611b396d604ecf32190ee
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Jul 22 22:41:05 2004 +0000

            Reviewed by Hyatt
    
            Fix for this bug:
    
            <rdar://problem/3711264> difficult (impossible?) to get cursor in an editable webview containing only tags
    
            * khtml/rendering/render_container.cpp:
            (RenderContainer::positionForCoordinates): Don't assume you can pass off
            the check to a first child if there is one, since the child can be an element
            we do not want to place the caret in, like a table row with no cells (the case
            in the bug above). So now, we iterate of the renderer's children looking for
            the closest one, but only consider those renderers which either have children
            themselves, or are render block flows or are render inlines.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7101 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 2932d74..b0fe459 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,19 @@
+2004-07-22  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Hyatt
+
+        Fix for this bug:
+        
+        <rdar://problem/3711264> difficult (impossible?) to get cursor in an editable webview containing only tags
+
+        * khtml/rendering/render_container.cpp:
+        (RenderContainer::positionForCoordinates): Don't assume you can pass off
+        the check to a first child if there is one, since the child can be an element
+        we do not want to place the caret in, like a table row with no cells (the case
+        in the bug above). So now, we iterate of the renderer's children looking for
+        the closest one, but only consider those renderers which either have children
+        themselves, or are render block flows or are render inlines. 
+
 2004-07-22  Darin Adler  <darin at apple.com>
 
         - remove a bunch of now-unused code
diff --git a/WebCore/khtml/rendering/render_container.cpp b/WebCore/khtml/rendering/render_container.cpp
index 3878cef..29d6e3f 100644
--- a/WebCore/khtml/rendering/render_container.cpp
+++ b/WebCore/khtml/rendering/render_container.cpp
@@ -483,8 +483,11 @@ Position RenderContainer::positionForCoordinates(int _x, int _y)
 
     // look for the geometrically-closest child and pass off to that child
     int min = INT_MAX;
-    RenderObject *closestRenderer = firstChild();
+    RenderObject *closestRenderer = 0;
     for (RenderObject *renderer = firstChild(); renderer; renderer = renderer->nextSibling()) {
+        if (!renderer->firstChild() && !renderer->isInline() && !renderer->isBlockFlow())
+            continue;
+
         int absx, absy;
         renderer->absolutePosition(absx, absy);
         
@@ -499,8 +502,11 @@ Position RenderContainer::positionForCoordinates(int _x, int _y)
         cmp = abs(_x - left);   if (cmp < min) { closestRenderer = renderer; min = cmp; }
         cmp = abs(_x - right);  if (cmp < min) { closestRenderer = renderer; min = cmp; }
     }
-
-    return closestRenderer->positionForCoordinates(_x, _y);
+    
+    if (closestRenderer)
+        return closestRenderer->positionForCoordinates(_x, _y);
+    
+    return Position(element(), 0);
 }
     
 #undef DEBUG_LAYOUT

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list