Fixed: <rdar://problem/3985211> Seed: Mail: Drag-and-drop destination indicator...
authorcblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Feb 2005 21:52:28 +0000 (21:52 +0000)
committercblu <cblu@268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Wed, 9 Feb 2005 21:52:28 +0000 (21:52 +0000)
        Reviewed by kocienda.

        * khtml/rendering/render_block.cpp:
        (khtml::RenderBlock::paintCaret): new
        (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret
        * khtml/rendering/render_block.h:

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

WebCore/ChangeLog-2005-08-23
WebCore/khtml/rendering/render_block.cpp
WebCore/khtml/rendering/render_block.h

index 9b2226b5de3c67ec0c18a05bec642a8f352de50b..b1c3debb46b88b200a5ad32086832fc3880b4a3b 100644 (file)
@@ -1,3 +1,14 @@
+2005-02-09  Chris Blumenberg  <cblu@apple.com>
+
+       Fixed: <rdar://problem/3985211> Seed: Mail: Drag-and-drop destination indicator / insertion point disappears
+
+        Reviewed by kocienda.
+
+        * khtml/rendering/render_block.cpp:
+        (khtml::RenderBlock::paintCaret): new
+        (khtml::RenderBlock::paintObject): call paintCaret for the cursor caret and the drag caret
+        * khtml/rendering/render_block.h:
+
 === Safari-185 ===
 
 2005-02-08  Ken Kocienda  <kocienda@apple.com>
index f96731822905af01a066bb0b7e538dc261127d98..32242f16aee77675c4dd82c2ba85973ab10b1f1f 100644 (file)
@@ -1257,6 +1257,20 @@ void RenderBlock::paintChildren(PaintInfo& i, int _tx, int _ty)
     }
 }
 
+void RenderBlock::paintCaret(PaintInfo& i, CaretType type)
+{
+    const Selection &s = type == CursorCaret ? document()->part()->selection() : document()->part()->dragCaret();
+    NodeImpl *caretNode = s.start().node();
+    RenderObject *renderer = caretNode ? caretNode->renderer() : 0;
+    if (renderer && (renderer == this || renderer->containingBlock() == this) && caretNode && caretNode->isContentEditable()) {
+        if (type == CursorCaret) {
+            document()->part()->paintCaret(i.p, i.r);
+        } else {
+            document()->part()->paintDragCaret(i.p, i.r);
+        }
+    }
+}
+
 void RenderBlock::paintObject(PaintInfo& i, int _tx, int _ty)
 {
     PaintAction paintAction = i.phase;
@@ -1303,14 +1317,9 @@ void RenderBlock::paintObject(PaintInfo& i, int _tx, int _ty)
     // 6. paint caret.
     // If the caret's node's render object's containing block is this block, and the paint action is PaintActionForeground,
     // then paint the caret.
-    if (!inlineFlow && paintAction == PaintActionForeground) {
-        const Selection &s = document()->part()->selection();
-        NodeImpl *caretNode = s.start().node();
-        RenderObject *renderer = caretNode ? caretNode->renderer() : 0;
-        if (renderer && (renderer == this || renderer->containingBlock() == this) && caretNode && caretNode->isContentEditable()) {
-            document()->part()->paintCaret(i.p, i.r);
-            document()->part()->paintDragCaret(i.p, i.r);
-        }
+    if (!inlineFlow && paintAction == PaintActionForeground) {        
+        paintCaret(i, CursorCaret);
+        paintCaret(i, DragCaret);
     }
 
 #ifdef BOX_DEBUG
index 6d363788e3d36e04e7758042cc1060601e134361..c773cb524de3d1c15835c17c7a22eb37fc534043 100644 (file)
 
 #include "render_flow.h"
 
+typedef enum {
+    CursorCaret,
+    DragCaret,
+} CaretType;
+
 namespace DOM {
     class Position;
 }
@@ -139,6 +144,7 @@ public:
     void paintChildren(PaintInfo& i, int _tx, int _ty);
     void paintEllipsisBoxes(PaintInfo& i, int _tx, int _ty);
     void paintSelection(PaintInfo& i, int _tx, int _ty);
+    void paintCaret(PaintInfo& i, CaretType);
     
     void insertFloatingObject(RenderObject *o);
     void removeFloatingObject(RenderObject *o);