https://bugs.webkit.org/show_bug.cgi?id=70662
Reviewed by Gavin Barraclough.
* manual-tests/caret-in-columns.html: Added.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::paintCaret): Removed the call to offsetForContents(). That function takes
a point in local coordinates, whereas this function was applying it to a point in painting root
coordinates. The desired effect was only to undo the scroll adjustment done by the caller,
paintObject().
(WebCore::RenderBlock::paintObject): Pass the original, rather than scroll-adjusted, paint offset
to paintCaret().
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@98191
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-10-21 Dan Bernstein <mitz@apple.com>
+
+ Caret is drawn in the wrong place in multi-column blocks
+ https://bugs.webkit.org/show_bug.cgi?id=70662
+
+ Reviewed by Gavin Barraclough.
+
+ * manual-tests/caret-in-columns.html: Added.
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::paintCaret): Removed the call to offsetForContents(). That function takes
+ a point in local coordinates, whereas this function was applying it to a point in painting root
+ coordinates. The desired effect was only to undo the scroll adjustment done by the caller,
+ paintObject().
+ (WebCore::RenderBlock::paintObject): Pass the original, rather than scroll-adjusted, paint offset
+ to paintCaret().
+
2011-10-21 Nat Duca <nduca@chromium.org>
[chromium] Make setVisibility extension- and thread-correct
2011-10-21 Nat Duca <nduca@chromium.org>
[chromium] Make setVisibility extension- and thread-correct
--- /dev/null
+<div id="target" style="
+ margin: 100px;
+ -webkit-columns: 3;
+ width: 300px;
+ height: 100px;
+ -webkit-user-modify: read-write;
+ outline: none;
+">
+ <br>
+ <br>
+ <br>
+ <br>
+ <br>
+ <br>
+ The blinking insertion point should be here →
+</div>
+<script>
+ var target = document.getElementById("target");
+ target.focus();
+ getSelection().modify("move", "forward", "documentboundary");
+</script>
}
if (caretPainter == this && (isContentEditable || caretBrowsing)) {
}
if (caretPainter == this && (isContentEditable || caretBrowsing)) {
- // Convert the painting offset into the local coordinate system of this renderer,
- // to match the localCaretRect computed by the FrameSelection
- LayoutPoint adjustedPaintOffset = paintOffset;
- offsetForContents(adjustedPaintOffset);
-
- frame()->selection()->paintCaret(paintInfo.context, adjustedPaintOffset, paintInfo.rect);
+ frame()->selection()->paintCaret(paintInfo.context, paintOffset, paintInfo.rect);
- frame()->page()->dragCaretController()->paintDragCaret(frame(), paintInfo.context, adjustedPaintOffset, paintInfo.rect);
+ frame()->page()->dragCaretController()->paintDragCaret(frame(), paintInfo.context, paintOffset, paintInfo.rect);
// If the caret's node's render object's containing block is this block, and the paint action is PaintPhaseForeground,
// then paint the caret.
if (paintPhase == PaintPhaseForeground) {
// If the caret's node's render object's containing block is this block, and the paint action is PaintPhaseForeground,
// then paint the caret.
if (paintPhase == PaintPhaseForeground) {
- paintCaret(paintInfo, scrolledOffset, CursorCaret);
- paintCaret(paintInfo, scrolledOffset, DragCaret);
+ paintCaret(paintInfo, paintOffset, CursorCaret);
+ paintCaret(paintInfo, paintOffset, DragCaret);