diff options
author | Russell Brenner <russellbrenner@google.com> | 2010-11-18 17:33:13 -0800 |
---|---|---|
committer | Russell Brenner <russellbrenner@google.com> | 2010-12-02 13:47:21 -0800 |
commit | 6b70adc33054f8aee8c54d0f460458a9df11b8a5 (patch) | |
tree | 103a13998c33944d6ab3b8318c509a037e639460 /WebCore/rendering/RenderBlockLineLayout.cpp | |
parent | bdf4ebc8e70b2d221b6ee7a65660918ecb1d33aa (diff) | |
download | external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.zip external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.tar.gz external_webkit-6b70adc33054f8aee8c54d0f460458a9df11b8a5.tar.bz2 |
Merge WebKit at r72274: Initial merge by git.
Change-Id: Ie51f0b4a16da82942bd516dce59cfb79ebbe25fb
Diffstat (limited to 'WebCore/rendering/RenderBlockLineLayout.cpp')
-rw-r--r-- | WebCore/rendering/RenderBlockLineLayout.cpp | 76 |
1 files changed, 28 insertions, 48 deletions
diff --git a/WebCore/rendering/RenderBlockLineLayout.cpp b/WebCore/rendering/RenderBlockLineLayout.cpp index e843110..b6dc39f 100644 --- a/WebCore/rendering/RenderBlockLineLayout.cpp +++ b/WebCore/rendering/RenderBlockLineLayout.cpp @@ -35,6 +35,7 @@ #include "RenderView.h" #include "Settings.h" #include "TrailingFloatsRootInlineBox.h" +#include "VerticalPositionCache.h" #include "break_lines.h" #include <wtf/AlwaysInline.h> #include <wtf/RefCountedLeakCounter.h> @@ -477,9 +478,10 @@ void RenderBlock::computeInlineDirectionPositionsForLine(RootInlineBox* lineBox, lineBox->placeBoxesInInlineDirection(logicalLeft, needsWordSpacing, textBoxDataMap); } -void RenderBlock::computeBlockDirectionPositionsForLine(RootInlineBox* lineBox, BidiRun* firstRun, GlyphOverflowAndFallbackFontsMap& textBoxDataMap) +void RenderBlock::computeBlockDirectionPositionsForLine(RootInlineBox* lineBox, BidiRun* firstRun, GlyphOverflowAndFallbackFontsMap& textBoxDataMap, + VerticalPositionCache& verticalPositionCache) { - setLogicalHeight(lineBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap)); + setLogicalHeight(lineBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, verticalPositionCache)); lineBox->setBlockLogicalHeight(logicalHeight()); // Now make sure we place replaced render objects correctly. @@ -639,6 +641,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintLogica if (fullLayout || o->selfNeedsLayout()) dirtyLineBoxesForRenderer(o, fullLayout); o->setNeedsLayout(false); +<<<<<<< HEAD #ifdef ANDROID_LAYOUT if (doTextWrap && !hasTextToWrap && o->isText()) { Node* node = o->node(); @@ -661,6 +664,8 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintLogica #endif if (!o->isText()) toRenderInline(o)->invalidateVerticalPosition(); // FIXME: Should do better here and not always invalidate everything. +======= +>>>>>>> webkit.org at r72274 } o = bidiNext(this, o, 0, false, &endOfInline); } @@ -783,6 +788,8 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintLogica bool isLineEmpty = true; bool paginated = view()->layoutState() && view()->layoutState()->isPaginated(); + VerticalPositionCache verticalPositionCache; + while (!end.atEnd()) { // FIXME: Is this check necessary before the first iteration or can it be moved to the end? if (checkForEndLineMatch && (endLineMatched = matchedEndLine(resolver, cleanLineStart, cleanLineBidiStatus, endLine, endLineLogicalTop, repaintLogicalBottom, repaintLogicalTop))) @@ -883,7 +890,7 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintLogica computeInlineDirectionPositionsForLine(lineBox, firstLine, resolver.firstRun(), trailingSpaceRun, end.atEnd(), textBoxDataMap); // Now position our text runs vertically. - computeBlockDirectionPositionsForLine(lineBox, resolver.firstRun(), textBoxDataMap); + computeBlockDirectionPositionsForLine(lineBox, resolver.firstRun(), textBoxDataMap, verticalPositionCache); #if ENABLE(SVG) // SVG text layout code computes vertical & horizontal positions on its own. @@ -1013,7 +1020,8 @@ void RenderBlock::layoutInlineChildren(bool relayoutChildren, int& repaintLogica m_lineBoxes.appendLineBox(trailingFloatsLineBox); trailingFloatsLineBox->setConstructed(); GlyphOverflowAndFallbackFontsMap textBoxDataMap; - trailingFloatsLineBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap); + VerticalPositionCache verticalPositionCache; + trailingFloatsLineBox->alignBoxesInBlockDirection(logicalHeight(), textBoxDataMap, verticalPositionCache); trailingFloatsLineBox->setBlockDirectionOverflowPositions(logicalHeight(), bottomLayoutOverflow, logicalHeight(), bottomVisualOverflow); trailingFloatsLineBox->setBlockLogicalHeight(logicalHeight()); } @@ -2162,66 +2170,38 @@ void RenderBlock::addOverflowFromInlineChildren() int RenderBlock::beforeSideVisibleOverflowForLine(RootInlineBox* line) const { - switch (style()->writingMode()) { - case TopToBottomWritingMode: + // Overflow is in the block's coordinate space, which means it isn't purely physical. For flipped blocks (rl and bt), + // we continue to use top and left overflow even though physically it's bottom and right. + if (style()->isHorizontalWritingMode()) return line->topVisibleOverflow(); - case LeftToRightWritingMode: - return line->leftVisibleOverflow(); - case RightToLeftWritingMode: - return line->rightVisibleOverflow(); - case BottomToTopWritingMode: - return line->bottomVisibleOverflow(); - } - ASSERT_NOT_REACHED(); - return line->topVisibleOverflow(); + return line->leftVisibleOverflow(); } int RenderBlock::afterSideVisibleOverflowForLine(RootInlineBox* line) const { - switch (style()->writingMode()) { - case TopToBottomWritingMode: + // Overflow is in the block's coordinate space, which means it isn't purely physical. For flipped blocks (rl and bt), + // we continue to use bottom and right overflow even though physically it's top and left. + if (style()->isHorizontalWritingMode()) return line->bottomVisibleOverflow(); - case LeftToRightWritingMode: - return line->rightVisibleOverflow(); - case RightToLeftWritingMode: - return line->leftVisibleOverflow(); - case BottomToTopWritingMode: - return line->topVisibleOverflow(); - } - ASSERT_NOT_REACHED(); - return line->bottomVisibleOverflow(); + return line->rightVisibleOverflow(); } int RenderBlock::beforeSideLayoutOverflowForLine(RootInlineBox* line) const { - switch (style()->writingMode()) { - case TopToBottomWritingMode: + // Overflow is in the block's coordinate space, which means it isn't purely physical. For flipped blocks (rl and bt), + // we continue to use top and left overflow even though physically it's bottom and right. + if (style()->isHorizontalWritingMode()) return line->topLayoutOverflow(); - case LeftToRightWritingMode: - return line->leftLayoutOverflow(); - case RightToLeftWritingMode: - return line->rightLayoutOverflow(); - case BottomToTopWritingMode: - return line->bottomLayoutOverflow(); - } - ASSERT_NOT_REACHED(); - return line->topLayoutOverflow(); + return line->leftLayoutOverflow(); } int RenderBlock::afterSideLayoutOverflowForLine(RootInlineBox* line) const { - switch (style()->writingMode()) { - case TopToBottomWritingMode: + // Overflow is in the block's coordinate space, which means it isn't purely physical. For flipped blocks (rl and bt), + // we continue to use bottom and right overflow even though physically it's top and left. + if (style()->isHorizontalWritingMode()) return line->bottomLayoutOverflow(); - case LeftToRightWritingMode: - return line->rightLayoutOverflow(); - case RightToLeftWritingMode: - return line->leftLayoutOverflow(); - case BottomToTopWritingMode: - return line->topLayoutOverflow(); - } - ASSERT_NOT_REACHED(); - return line->bottomLayoutOverflow(); + return line->rightLayoutOverflow(); } void RenderBlock::deleteEllipsisLineBoxes() |