Title: [98400] trunk/Source/WebCore
- Revision
- 98400
- Author
- [email protected]
- Date
- 2011-10-25 15:45:48 -0700 (Tue, 25 Oct 2011)
Log Message
Caret can be positioned or repainted incorrectly in flipped-blocks multi-column blocks
https://bugs.webkit.org/show_bug.cgi?id=70851
Reviewed by Dave Hyatt.
* manual-tests/caret-in-columns-flipped.html: Added.
* rendering/RenderBlock.cpp:
(WebCore::RenderBlock::adjustForColumns): Removed flipped-blocks writing mode considerations
from this function, since not all callers were expecting it to account for flippedness. This makes
it similar to adjustRectForColumns() in not adjusting for flippedness.
* rendering/RenderBox.cpp:
(WebCore::RenderBox::offsetFromContainer): In the columns case, account for flipped-blocks modes
by first mapping the point and the offset to non-flipped, non-columns space, then adjusting for
columns, then flipping.
Modified Paths
Added Paths
Diff
Modified: trunk/Source/WebCore/ChangeLog (98399 => 98400)
--- trunk/Source/WebCore/ChangeLog 2011-10-25 22:35:52 UTC (rev 98399)
+++ trunk/Source/WebCore/ChangeLog 2011-10-25 22:45:48 UTC (rev 98400)
@@ -1,3 +1,20 @@
+2011-10-25 Dan Bernstein <[email protected]>
+
+ Caret can be positioned or repainted incorrectly in flipped-blocks multi-column blocks
+ https://bugs.webkit.org/show_bug.cgi?id=70851
+
+ Reviewed by Dave Hyatt.
+
+ * manual-tests/caret-in-columns-flipped.html: Added.
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::adjustForColumns): Removed flipped-blocks writing mode considerations
+ from this function, since not all callers were expecting it to account for flippedness. This makes
+ it similar to adjustRectForColumns() in not adjusting for flippedness.
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::offsetFromContainer): In the columns case, account for flipped-blocks modes
+ by first mapping the point and the offset to non-flipped, non-columns space, then adjusting for
+ columns, then flipping.
+
2011-10-25 Michal Mocny <[email protected]>
LayerRendererChromium::setVisible called needlessly without a visibility change
Added: trunk/Source/WebCore/manual-tests/caret-in-columns-flipped.html (0 => 98400)
--- trunk/Source/WebCore/manual-tests/caret-in-columns-flipped.html (rev 0)
+++ trunk/Source/WebCore/manual-tests/caret-in-columns-flipped.html 2011-10-25 22:45:48 UTC (rev 98400)
@@ -0,0 +1,25 @@
+<p>
+ (Read from bottom to top)
+</p>
+<div id="target" style="
+ margin: 100px;
+ -webkit-columns: 3;
+ width: 300px;
+ height: 100px;
+ -webkit-user-modify: read-write;
+ -webkit-writing-mode: horizontal-bt;
+ 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>
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (98399 => 98400)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-10-25 22:35:52 UTC (rev 98399)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2011-10-25 22:45:48 UTC (rev 98400)
@@ -4757,10 +4757,7 @@
if (!isHorizontalWritingMode())
sliceRect = sliceRect.transposedRect();
- // If we have a flipped blocks writing mode, then convert the column so that it's coming from the after edge (either top or left edge).
- adjustStartEdgeForWritingModeIncludingColumns(sliceRect);
-
- LayoutUnit logicalOffset = style()->isFlippedBlocksWritingMode() ? (colCount - 1 - i) * colLogicalHeight : i * colLogicalHeight;
+ LayoutUnit logicalOffset = i * colLogicalHeight;
// Now we're in the same coordinate space as the point. See if it is inside the rectangle.
if (isHorizontalWritingMode()) {
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (98399 => 98400)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2011-10-25 22:35:52 UTC (rev 98399)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2011-10-25 22:45:48 UTC (rev 98400)
@@ -1422,15 +1422,15 @@
offset += relativePositionOffset();
if (!isInline() || isReplaced()) {
- if (style()->position() != AbsolutePosition && style()->position() != FixedPosition) {
- if (o->hasColumns()) {
- LayoutRect columnRect(frameRect());
- toRenderBlock(o)->adjustStartEdgeForWritingModeIncludingColumns(columnRect);
- offset += LayoutSize(columnRect.location().x(), columnRect.location().y());
- columnRect.moveBy(point);
- o->adjustForColumns(offset, columnRect.location());
- } else
- offset += topLeftLocationOffset();
+ if (style()->position() != AbsolutePosition && style()->position() != FixedPosition && o->hasColumns()) {
+ RenderBlock* block = toRenderBlock(o);
+ LayoutRect columnRect(frameRect());
+ block->adjustStartEdgeForWritingModeIncludingColumns(columnRect);
+ offset += toSize(columnRect.location());
+ IntPoint columnPoint = block->flipForWritingModeIncludingColumns(point + offset);
+ offset = toSize(block->flipForWritingModeIncludingColumns(LayoutPoint(offset)));
+ o->adjustForColumns(offset, columnPoint);
+ offset = block->flipForWritingMode(offset);
} else
offset += topLeftLocationOffset();
}
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo.cgi/webkit-changes