[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:51:02 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit ea5e72a0f0a6dfc0aeda3a6f2336c4de216a900a
Author: kocienda <kocienda at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri Jul 16 21:14:17 2004 +0000

            Reviewed by Hyatt
    
            Fix for these bugs:
    
            <rdar://problem/3730785> Crash when arrow navigation goes to empty table cell
            <rdar://problem/3730790> Caret does not blink when placed in empty table cell
    
            * khtml/rendering/render_block.cpp:
            (khtml::RenderBlock::paintObject): Caret node's renderer might be this block, so
            don't block the painting of the caret in this case. This was the case in 3730790.
            We had the right geometry for the caret but blocked its painting.
            * khtml/xml/dom_position.cpp:
            (DOM::Position::previousLinePosition): Rework the logic here. This function asserted
            that the new position we would navigate to had a line box, but empty table cells, for
            instance will not. So, deal with this situation as well. The end result is a
            function that worked like it did before in cases where the previous line position has
            a line box, but now also will allow navigation to work when it does not.
            (DOM::Position::nextLinePosition): Ditto.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@7042 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 5061164..a036783 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -2,6 +2,27 @@
 
         Reviewed by Hyatt
 
+        Fix for these bugs:
+
+        <rdar://problem/3730785> Crash when arrow navigation goes to empty table cell
+        <rdar://problem/3730790> Caret does not blink when placed in empty table cell
+
+        * khtml/rendering/render_block.cpp:
+        (khtml::RenderBlock::paintObject): Caret node's renderer might be this block, so
+        don't block the painting of the caret in this case. This was the case in 3730790.
+        We had the right geometry for the caret but blocked its painting. 
+        * khtml/xml/dom_position.cpp:
+        (DOM::Position::previousLinePosition): Rework the logic here. This function asserted
+        that the new position we would navigate to had a line box, but empty table cells, for
+        instance will not. So, deal with this situation as well. The end result is a 
+        function that worked like it did before in cases where the previous line position has
+        a line box, but now also will allow navigation to work when it does not.
+        (DOM::Position::nextLinePosition): Ditto.
+
+2004-07-16  Ken Kocienda  <kocienda at apple.com>
+
+        Reviewed by Hyatt
+
         Fix for this bug:
         
         <rdar://problem/3687216> editable inline causes crash when focused
diff --git a/WebCore/khtml/rendering/render_block.cpp b/WebCore/khtml/rendering/render_block.cpp
index 0cd07a5..8403907 100644
--- a/WebCore/khtml/rendering/render_block.cpp
+++ b/WebCore/khtml/rendering/render_block.cpp
@@ -1312,7 +1312,7 @@ void RenderBlock::paintObject(PaintInfo& i, int _tx, int _ty)
         const Selection &s = document()->part()->selection();
         NodeImpl *caretNode = s.start().node();
         RenderObject *renderer = caretNode ? caretNode->renderer() : 0;
-        if (renderer && renderer->containingBlock() == this && caretNode && caretNode->isContentEditable()) {
+        if (renderer && (renderer == this || renderer->containingBlock() == this) && caretNode && caretNode->isContentEditable()) {
             document()->part()->paintCaret(i.p, i.r);
             document()->part()->paintDragCaret(i.p, i.r);
         }
diff --git a/WebCore/khtml/xml/dom_position.cpp b/WebCore/khtml/xml/dom_position.cpp
index 9b9ccc7..04596c0 100644
--- a/WebCore/khtml/xml/dom_position.cpp
+++ b/WebCore/khtml/xml/dom_position.cpp
@@ -344,16 +344,16 @@ Position Position::previousLinePosition(int x) const
     if (!node()->renderer())
         return *this;
 
-    InlineBox *box = node()->renderer()->inlineBox(offset());
-    if (!box)
-        return *this;
-
     RenderBlock *containingBlock = 0;
-    RootInlineBox *root = box->root()->prevRootBox();
-    if (root) {
-        containingBlock = node()->renderer()->containingBlock();
+    RootInlineBox *root = 0;
+    InlineBox *box = node()->renderer()->inlineBox(offset());
+    if (box) {
+        root = box->root()->prevRootBox();
+        if (root)
+            containingBlock = node()->renderer()->containingBlock();
     }
-    else {
+
+    if (!root) {
         // This containing editable block does not have a previous line.
         // Need to move back to previous containing editable block in this root editable
         // block and find the last root line box in that block.
@@ -361,17 +361,24 @@ Position Position::previousLinePosition(int x) const
         NodeImpl *n = node()->previousEditable();
         while (n && startBlock == n->enclosingBlockFlowElement())
             n = n->previousEditable();
-        if (n) {
-            while (n && !Position(n, n->caretMaxOffset()).inRenderedContent())
-                n = n->previousEditable();
-            if (n && n->inSameRootEditableElement(node())) {
+        while (n) {
+            if (!n->inSameRootEditableElement(node()))
+                break;
+            Position pos(n, n->caretMaxOffset());
+            if (pos.inRenderedContent()) {
                 ASSERT(n->renderer());
                 box = n->renderer()->inlineBox(n->caretMaxOffset());
-                ASSERT(box);
-                // previous root line box found
-                root = box->root();
-                containingBlock = n->renderer()->containingBlock();
+                if (box) {
+                    // previous root line box found
+                    root = box->root();
+                    containingBlock = n->renderer()->containingBlock();
+                    break;
+                }
+                else {
+                    return pos;
+                }
             }
+            n = n->previousEditable();
         }
     }
     
@@ -393,16 +400,16 @@ Position Position::nextLinePosition(int x) const
     if (!node()->renderer())
         return *this;
 
-    InlineBox *box = node()->renderer()->inlineBox(offset());
-    if (!box)
-        return *this;
-
     RenderBlock *containingBlock = 0;
-    RootInlineBox *root = box->root()->nextRootBox();
-    if (root) {
-        containingBlock = node()->renderer()->containingBlock();
+    RootInlineBox *root = 0;
+    InlineBox *box = node()->renderer()->inlineBox(offset());
+    if (box) {
+        root = box->root()->nextRootBox();
+        if (root)
+            containingBlock = node()->renderer()->containingBlock();
     }
-    else {
+
+    if (!root) {
         // This containing editable block does not have a next line.
         // Need to move forward to next containing editable block in this root editable
         // block and find the first root line box in that block.
@@ -410,17 +417,24 @@ Position Position::nextLinePosition(int x) const
         NodeImpl *n = node()->nextEditable();
         while (n && startBlock == n->enclosingBlockFlowElement())
             n = n->nextEditable();
-        if (n) {
-            while (n && !Position(n, n->caretMinOffset()).inRenderedContent())
-                n = n->nextEditable();
-            if (n && n->inSameRootEditableElement(node())) {
+        while (n) {
+            if (!n->inSameRootEditableElement(node()))
+                break;
+            Position pos(n, n->caretMinOffset());
+            if (pos.inRenderedContent()) {
                 ASSERT(n->renderer());
                 box = n->renderer()->inlineBox(n->caretMinOffset());
-                ASSERT(box);
-                // previous root line box found
-                root = box->root();
-                containingBlock = n->renderer()->containingBlock();
+                if (box) {
+                    // next root line box found
+                    root = box->root();
+                    containingBlock = n->renderer()->containingBlock();
+                    break;
+                }
+                else {
+                    return pos;
+                }
             }
+            n = n->nextEditable();
         }
     }
     

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list