+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>
}
}
+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;
// 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
#include "render_flow.h"
+typedef enum {
+ CursorCaret,
+ DragCaret,
+} CaretType;
+
namespace DOM {
class Position;
}
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);