⚠ Archived content — this site is no longer maintained.   Current WebKit documentation is at docs.webkit.org.

Changeset 98400 in webkit


Ignore:
Timestamp:
Oct 25, 2011, 3:45:48 PM (15 years ago)
Author:
mitz@apple.com
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.

Location:
trunk/Source/WebCore
Files:
1 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/Source/WebCore/ChangeLog

    r98392 r98400  
     12011-10-25  Dan Bernstein  <mitz@apple.com>
     2
     3        Caret can be positioned or repainted incorrectly in flipped-blocks multi-column blocks
     4        https://bugs.webkit.org/show_bug.cgi?id=70851
     5
     6        Reviewed by Dave Hyatt.
     7
     8        * manual-tests/caret-in-columns-flipped.html: Added.
     9        * rendering/RenderBlock.cpp:
     10        (WebCore::RenderBlock::adjustForColumns): Removed flipped-blocks writing mode considerations
     11        from this function, since not all callers were expecting it to account for flippedness. This makes
     12        it similar to adjustRectForColumns() in not adjusting for flippedness.
     13        * rendering/RenderBox.cpp:
     14        (WebCore::RenderBox::offsetFromContainer): In the columns case, account for flipped-blocks modes
     15        by first mapping the point and the offset to non-flipped, non-columns space, then adjusting for
     16        columns, then flipping.
     17
    1182011-10-25  Michal Mocny  <mmocny@google.com>
    219
  • trunk/Source/WebCore/rendering/RenderBlock.cpp

    r98191 r98400  
    47584758            sliceRect = sliceRect.transposedRect();
    47594759       
    4760         // 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).
    4761         adjustStartEdgeForWritingModeIncludingColumns(sliceRect);
    4762        
    4763         LayoutUnit logicalOffset = style()->isFlippedBlocksWritingMode() ? (colCount - 1 - i) * colLogicalHeight : i * colLogicalHeight;
     4760        LayoutUnit logicalOffset = i * colLogicalHeight;
    47644761
    47654762        // Now we're in the same coordinate space as the point.  See if it is inside the rectangle.
  • trunk/Source/WebCore/rendering/RenderBox.cpp

    r98021 r98400  
    14231423
    14241424    if (!isInline() || isReplaced()) {
    1425         if (style()->position() != AbsolutePosition && style()->position() != FixedPosition) {
    1426             if (o->hasColumns()) {
    1427                 LayoutRect columnRect(frameRect());
    1428                 toRenderBlock(o)->adjustStartEdgeForWritingModeIncludingColumns(columnRect);
    1429                 offset += LayoutSize(columnRect.location().x(), columnRect.location().y());
    1430                 columnRect.moveBy(point);
    1431                 o->adjustForColumns(offset, columnRect.location());
    1432             } else
    1433                 offset += topLeftLocationOffset();
     1425        if (style()->position() != AbsolutePosition && style()->position() != FixedPosition && o->hasColumns()) {
     1426            RenderBlock* block = toRenderBlock(o);
     1427            LayoutRect columnRect(frameRect());
     1428            block->adjustStartEdgeForWritingModeIncludingColumns(columnRect);
     1429            offset += toSize(columnRect.location());
     1430            IntPoint columnPoint = block->flipForWritingModeIncludingColumns(point + offset);
     1431            offset = toSize(block->flipForWritingModeIncludingColumns(LayoutPoint(offset)));
     1432            o->adjustForColumns(offset, columnPoint);
     1433            offset = block->flipForWritingMode(offset);
    14341434        } else
    14351435            offset += topLeftLocationOffset();
Note: See TracChangeset for help on using the changeset viewer.