Diff
Modified: trunk/Source/WebCore/ChangeLog (197461 => 197462)
--- trunk/Source/WebCore/ChangeLog 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/ChangeLog 2016-03-02 21:42:22 UTC (rev 197462)
@@ -1,3 +1,56 @@
+2016-03-02 Zalan Bujtas <[email protected]>
+
+ Use IndentTextOrNot instead of passing isFirstLine/shouldIndentText as bool.
+ https://bugs.webkit.org/show_bug.cgi?id=154628
+
+ Reviewed by Simon Fraser.
+
+ No change in behaviour.
+
+ * rendering/RenderBlock.cpp:
+ (WebCore::RenderBlock::computeStartPositionDeltaForChildAvoidingFloats):
+ (WebCore::RenderBlock::logicalLeftSelectionOffset):
+ (WebCore::RenderBlock::logicalRightSelectionOffset):
+ * rendering/RenderBlock.h:
+ (WebCore::RenderBlock::availableLogicalWidthForLineInRegion):
+ (WebCore::RenderBlock::logicalRightOffsetForLineInRegion):
+ (WebCore::RenderBlock::logicalLeftOffsetForLineInRegion):
+ (WebCore::RenderBlock::startOffsetForLineInRegion):
+ (WebCore::RenderBlock::endOffsetForLineInRegion):
+ (WebCore::RenderBlock::availableLogicalWidthForLine):
+ (WebCore::RenderBlock::logicalRightOffsetForLine):
+ (WebCore::RenderBlock::logicalLeftOffsetForLine):
+ (WebCore::RenderBlock::startOffsetForLine):
+ (WebCore::RenderBlock::endOffsetForLine):
+ * rendering/RenderBlockFlow.cpp:
+ (WebCore::RenderBlockFlow::getClearDelta):
+ * rendering/RenderBlockLineLayout.cpp:
+ (WebCore::updateLogicalInlinePositions):
+ (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
+ (WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
+ (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
+ (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
+ * rendering/RenderBox.cpp:
+ (WebCore::RenderBox::shrinkLogicalWidthToAvoidFloats):
+ (WebCore::RenderBox::containingBlockAvailableLineWidthInRegion):
+ * rendering/RenderDeprecatedFlexibleBox.cpp:
+ (WebCore::RenderDeprecatedFlexibleBox::applyLineClamp):
+ * rendering/RenderListItem.cpp:
+ (WebCore::RenderListItem::positionListMarker):
+ * rendering/RootInlineBox.cpp:
+ (WebCore::RootInlineBox::selectionTop):
+ (WebCore::RootInlineBox::selectionBottom):
+ * rendering/SimpleLineLayout.cpp:
+ (WebCore::SimpleLineLayout::canUseForWithReason):
+ (WebCore::SimpleLineLayout::updateLineConstrains):
+ * rendering/line/LineBreaker.cpp:
+ (WebCore::LineBreaker::skipLeadingWhitespace):
+ * rendering/line/LineWidth.cpp:
+ (WebCore::LineWidth::shrinkAvailableWidthForNewFloatIfNeeded):
+ (WebCore::availableWidthAtOffset):
+ * rendering/line/LineWidth.h:
+ (WebCore::LineWidth::shouldIndentText):
+
2016-03-02 Beth Dakin <[email protected]>
Add support for playbackControlsManager
Modified: trunk/Source/WebCore/rendering/RenderBlock.cpp (197461 => 197462)
--- trunk/Source/WebCore/rendering/RenderBlock.cpp 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/RenderBlock.cpp 2016-03-02 21:42:22 UTC (rev 197462)
@@ -1097,7 +1097,7 @@
if (region)
blockOffset = std::max(blockOffset, blockOffset + (region->logicalTopForFlowThreadContent() - offsetFromLogicalTopOfFirstPage()));
- LayoutUnit startOff = startOffsetForLineInRegion(blockOffset, false, region, logicalHeightForChild(child));
+ LayoutUnit startOff = startOffsetForLineInRegion(blockOffset, DoNotIndentText, region, logicalHeightForChild(child));
if (style().textAlign() != WEBKIT_CENTER && !child.style().marginStartUsing(&style()).isAuto()) {
if (childMarginStart < 0)
@@ -2026,7 +2026,7 @@
LayoutUnit RenderBlock::logicalLeftSelectionOffset(RenderBlock& rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches& cache)
{
- LayoutUnit logicalLeft = logicalLeftOffsetForLine(position, false);
+ LayoutUnit logicalLeft = logicalLeftOffsetForLine(position, DoNotIndentText);
if (logicalLeft == logicalLeftOffsetForContent()) {
if (&rootBlock != this) // The border can potentially be further extended by our containingBlock().
return cache.containingBlockInfo(*this).logicalLeftSelectionOffset(rootBlock, position + logicalTop());
@@ -2048,7 +2048,7 @@
LayoutUnit RenderBlock::logicalRightSelectionOffset(RenderBlock& rootBlock, LayoutUnit position, const LogicalSelectionOffsetCaches& cache)
{
- LayoutUnit logicalRight = logicalRightOffsetForLine(position, false);
+ LayoutUnit logicalRight = logicalRightOffsetForLine(position, DoNotIndentText);
if (logicalRight == logicalRightOffsetForContent()) {
if (&rootBlock != this) // The border can potentially be further extended by our containingBlock().
return cache.containingBlockInfo(*this).logicalRightSelectionOffset(rootBlock, position + logicalTop());
Modified: trunk/Source/WebCore/rendering/RenderBlock.h (197461 => 197462)
--- trunk/Source/WebCore/rendering/RenderBlock.h 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/RenderBlock.h 2016-03-02 21:42:22 UTC (rev 197462)
@@ -24,6 +24,7 @@
#define RenderBlock_h
#include "GapRects.h"
+#include "LineWidth.h"
#include "RenderBox.h"
#include "TextRun.h"
#include <memory>
@@ -121,48 +122,48 @@
// Versions that can compute line offsets with the region and page offset passed in. Used for speed to avoid having to
// compute the region all over again when you already know it.
- LayoutUnit availableLogicalWidthForLineInRegion(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
+ LayoutUnit availableLogicalWidthForLineInRegion(LayoutUnit position, IndentTextOrNot shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
{
return std::max<LayoutUnit>(0, logicalRightOffsetForLineInRegion(position, shouldIndentText, region, logicalHeight)
- logicalLeftOffsetForLineInRegion(position, shouldIndentText, region, logicalHeight));
}
- LayoutUnit logicalRightOffsetForLineInRegion(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
+ LayoutUnit logicalRightOffsetForLineInRegion(LayoutUnit position, IndentTextOrNot shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
{
return logicalRightOffsetForLine(position, logicalRightOffsetForContent(region), shouldIndentText, logicalHeight);
}
- LayoutUnit logicalLeftOffsetForLineInRegion(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
+ LayoutUnit logicalLeftOffsetForLineInRegion(LayoutUnit position, IndentTextOrNot shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
{
return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(region), shouldIndentText, logicalHeight);
}
- LayoutUnit startOffsetForLineInRegion(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
+ LayoutUnit startOffsetForLineInRegion(LayoutUnit position, IndentTextOrNot shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
{
return style().isLeftToRightDirection() ? logicalLeftOffsetForLineInRegion(position, shouldIndentText, region, logicalHeight)
: logicalWidth() - logicalRightOffsetForLineInRegion(position, shouldIndentText, region, logicalHeight);
}
- LayoutUnit endOffsetForLineInRegion(LayoutUnit position, bool shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
+ LayoutUnit endOffsetForLineInRegion(LayoutUnit position, IndentTextOrNot shouldIndentText, RenderRegion* region, LayoutUnit logicalHeight = 0) const
{
return !style().isLeftToRightDirection() ? logicalLeftOffsetForLineInRegion(position, shouldIndentText, region, logicalHeight)
: logicalWidth() - logicalRightOffsetForLineInRegion(position, shouldIndentText, region, logicalHeight);
}
- LayoutUnit availableLogicalWidthForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
+ LayoutUnit availableLogicalWidthForLine(LayoutUnit position, IndentTextOrNot shouldIndentText, LayoutUnit logicalHeight = 0) const
{
return availableLogicalWidthForLineInRegion(position, shouldIndentText, regionAtBlockOffset(position), logicalHeight);
}
- LayoutUnit logicalRightOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
+ LayoutUnit logicalRightOffsetForLine(LayoutUnit position, IndentTextOrNot shouldIndentText, LayoutUnit logicalHeight = 0) const
{
return logicalRightOffsetForLine(position, logicalRightOffsetForContent(position), shouldIndentText, logicalHeight);
}
- LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
+ LayoutUnit logicalLeftOffsetForLine(LayoutUnit position, IndentTextOrNot shouldIndentText, LayoutUnit logicalHeight = 0) const
{
return logicalLeftOffsetForLine(position, logicalLeftOffsetForContent(position), shouldIndentText, logicalHeight);
}
- LayoutUnit startOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
+ LayoutUnit startOffsetForLine(LayoutUnit position, IndentTextOrNot shouldIndentText, LayoutUnit logicalHeight = 0) const
{
return style().isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, logicalHeight)
: logicalWidth() - logicalRightOffsetForLine(position, shouldIndentText, logicalHeight);
}
- LayoutUnit endOffsetForLine(LayoutUnit position, bool shouldIndentText, LayoutUnit logicalHeight = 0) const
+ LayoutUnit endOffsetForLine(LayoutUnit position, IndentTextOrNot shouldIndentText, LayoutUnit logicalHeight = 0) const
{
return !style().isLeftToRightDirection() ? logicalLeftOffsetForLine(position, shouldIndentText, logicalHeight)
: logicalWidth() - logicalRightOffsetForLine(position, shouldIndentText, logicalHeight);
Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.cpp (197461 => 197462)
--- trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.cpp 2016-03-02 21:42:22 UTC (rev 197462)
@@ -2844,7 +2844,7 @@
if (!result && child.avoidsFloats()) {
LayoutUnit newLogicalTop = logicalTop;
while (true) {
- LayoutUnit availableLogicalWidthAtNewLogicalTopOffset = availableLogicalWidthForLine(newLogicalTop, false, logicalHeightForChild(child));
+ LayoutUnit availableLogicalWidthAtNewLogicalTopOffset = availableLogicalWidthForLine(newLogicalTop, DoNotIndentText, logicalHeightForChild(child));
if (availableLogicalWidthAtNewLogicalTopOffset == availableLogicalWidthForContent(newLogicalTop))
return newLogicalTop - logicalTop;
Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (197461 => 197462)
--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp 2016-03-02 21:42:22 UTC (rev 197462)
@@ -672,16 +672,16 @@
}
}
-static void updateLogicalInlinePositions(RenderBlockFlow& block, float& lineLogicalLeft, float& lineLogicalRight, float& availableLogicalWidth, bool firstLine, IndentTextOrNot shouldIndentText, LayoutUnit boxLogicalHeight,
- RootInlineBox* rootBox)
+static void updateLogicalInlinePositions(RenderBlockFlow& block, float& lineLogicalLeft, float& lineLogicalRight, float& availableLogicalWidth, bool firstLine,
+ IndentTextOrNot shouldIndentText, LayoutUnit boxLogicalHeight, RootInlineBox* rootBox)
{
LayoutUnit lineLogicalHeight = block.minLineHeightForReplacedRenderer(firstLine, boxLogicalHeight);
if (rootBox->hasAnonymousInlineBlock()) {
lineLogicalLeft = block.logicalLeftOffsetForContent(block.logicalHeight());
lineLogicalRight = block.logicalRightOffsetForContent(block.logicalHeight());
} else {
- lineLogicalLeft = block.logicalLeftOffsetForLine(block.logicalHeight(), shouldIndentText == IndentText, lineLogicalHeight);
- lineLogicalRight = block.logicalRightOffsetForLine(block.logicalHeight(), shouldIndentText == IndentText, lineLogicalHeight);
+ lineLogicalLeft = block.logicalLeftOffsetForLine(block.logicalHeight(), shouldIndentText, lineLogicalHeight);
+ lineLogicalRight = block.logicalRightOffsetForLine(block.logicalHeight(), shouldIndentText, lineLogicalHeight);
}
availableLogicalWidth = lineLogicalRight - lineLogicalLeft;
}
@@ -1337,14 +1337,14 @@
if (paginated)
adjustLinePositionForPagination(lineBox, adjustment, overflowsRegion, layoutState.flowThread());
-
if (adjustment) {
- LayoutUnit oldLineWidth = availableLogicalWidthForLine(oldLogicalHeight, layoutState.lineInfo().isFirstLine());
+ IndentTextOrNot shouldIndentText = layoutState.lineInfo().isFirstLine() ? IndentText : DoNotIndentText;
+ LayoutUnit oldLineWidth = availableLogicalWidthForLine(oldLogicalHeight, shouldIndentText);
lineBox->adjustBlockDirectionPosition(adjustment);
if (layoutState.usesRepaintBounds())
layoutState.updateRepaintRangeFromBox(lineBox);
- if (availableLogicalWidthForLine(oldLogicalHeight + adjustment, layoutState.lineInfo().isFirstLine()) != oldLineWidth) {
+ if (availableLogicalWidthForLine(oldLogicalHeight + adjustment, shouldIndentText) != oldLineWidth) {
// We have to delete this line, remove all floats that got added, and let line layout re-run.
lineBox->deleteLine();
end = restartLayoutRunsAndFloatsInRange(oldLogicalHeight, oldLogicalHeight + adjustment, lastFloatFromPreviousLine, resolver, oldEnd);
@@ -1998,14 +1998,14 @@
{
ETextAlign textAlign = style().textAlign();
bool ltr = style().isLeftToRightDirection();
- bool firstLine = true;
+ IndentTextOrNot shouldIndentText = IndentText;
for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
if (curr->hasEllipsisBox()) {
curr->clearTruncation();
// Shift the line back where it belongs if we cannot accomodate an ellipsis.
- float logicalLeft = logicalLeftOffsetForLine(curr->lineTop(), firstLine);
- float availableLogicalWidth = logicalRightOffsetForLine(curr->lineTop(), false) - logicalLeft;
+ float logicalLeft = logicalLeftOffsetForLine(curr->lineTop(), shouldIndentText);
+ float availableLogicalWidth = logicalRightOffsetForLine(curr->lineTop(), DoNotIndentText) - logicalLeft;
float totalLogicalWidth = curr->logicalWidth();
updateLogicalWidthForAlignment(textAlign, curr, 0, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
@@ -2014,7 +2014,7 @@
else
curr->adjustLogicalPosition(-(curr->logicalLeft() - logicalLeft), 0);
}
- firstLine = false;
+ shouldIndentText = DoNotIndentText;
}
}
@@ -2036,22 +2036,22 @@
ETextAlign textAlign = style().textAlign();
bool firstLine = true;
for (RootInlineBox* curr = firstRootBox(); curr; curr = curr->nextRootBox()) {
- LayoutUnit blockRightEdge = logicalRightOffsetForLine(curr->lineTop(), firstLine);
- LayoutUnit blockLeftEdge = logicalLeftOffsetForLine(curr->lineTop(), firstLine);
+ IndentTextOrNot shouldIndentText = firstLine ? IndentText : DoNotIndentText;
+ LayoutUnit blockRightEdge = logicalRightOffsetForLine(curr->lineTop(), shouldIndentText);
+ LayoutUnit blockLeftEdge = logicalLeftOffsetForLine(curr->lineTop(), shouldIndentText);
LayoutUnit lineBoxEdge = ltr ? curr->x() + curr->logicalWidth() : curr->x();
if ((ltr && lineBoxEdge > blockRightEdge) || (!ltr && lineBoxEdge < blockLeftEdge)) {
// This line spills out of our box in the appropriate direction. Now we need to see if the line
// can be truncated. In order for truncation to be possible, the line must have sufficient space to
// accommodate our truncation string, and no replaced elements (images, tables) can overlap the ellipsis
// space.
-
LayoutUnit width = firstLine ? firstLineEllipsisWidth : ellipsisWidth;
LayoutUnit blockEdge = ltr ? blockRightEdge : blockLeftEdge;
if (curr->lineCanAccommodateEllipsis(ltr, blockEdge, lineBoxEdge, width)) {
float totalLogicalWidth = curr->placeEllipsis(ellipsisStr, ltr, blockLeftEdge, blockRightEdge, width);
float logicalLeft = 0; // We are only interested in the delta from the base position.
- float truncatedWidth = availableLogicalWidthForLine(curr->lineTop(), firstLine);
+ float truncatedWidth = availableLogicalWidthForLine(curr->lineTop(), shouldIndentText);
updateLogicalWidthForAlignment(textAlign, curr, nullptr, logicalLeft, totalLogicalWidth, truncatedWidth, 0);
if (ltr)
curr->adjustLogicalPosition(logicalLeft, 0);
@@ -2143,12 +2143,12 @@
// This quirk is for legacy content that doesn't work properly with the center positioning scheme
// being honored (e.g., epubs).
if (shouldApplyIndentText || document().settings()->useLegacyTextAlignPositionedElementBehavior()) // FIXME: Handle TAEND here
- return startOffsetForLine(position, shouldIndentText == IndentText);
+ return startOffsetForLine(position, shouldIndentText);
// updateLogicalWidthForAlignment() handles the direction of the block so no need to consider it here
float totalLogicalWidth = 0;
- float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false);
- float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), false) - logicalLeft;
+ float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), DoNotIndentText);
+ float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), DoNotIndentText) - logicalLeft;
// FIXME: Bug 129311: We need to pass a valid RootInlineBox here, considering the bidi level used to construct the line.
updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (197461 => 197462)
--- trunk/Source/WebCore/rendering/RenderBox.cpp 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp 2016-03-02 21:42:22 UTC (rev 197462)
@@ -1868,7 +1868,7 @@
}
LayoutUnit logicalHeight = cb->logicalHeightForChild(*this);
- LayoutUnit result = cb->availableLogicalWidthForLineInRegion(logicalTopPosition, false, containingBlockRegion, logicalHeight) - childMarginStart - childMarginEnd;
+ LayoutUnit result = cb->availableLogicalWidthForLineInRegion(logicalTopPosition, DoNotIndentText, containingBlockRegion, logicalHeight) - childMarginStart - childMarginEnd;
// We need to see if margins on either the start side or the end side can contain the floats in question. If they can,
// then just using the line width is inaccurate. In the case where a float completely fits, we don't need to use the line
@@ -1878,7 +1878,7 @@
if (childMarginStart > 0) {
LayoutUnit startContentSide = cb->startOffsetForContent(containingBlockRegion);
LayoutUnit startContentSideWithMargin = startContentSide + childMarginStart;
- LayoutUnit startOffset = cb->startOffsetForLineInRegion(logicalTopPosition, false, containingBlockRegion, logicalHeight);
+ LayoutUnit startOffset = cb->startOffsetForLineInRegion(logicalTopPosition, DoNotIndentText, containingBlockRegion, logicalHeight);
if (startOffset > startContentSideWithMargin)
result += childMarginStart;
else
@@ -1888,7 +1888,7 @@
if (childMarginEnd > 0) {
LayoutUnit endContentSide = cb->endOffsetForContent(containingBlockRegion);
LayoutUnit endContentSideWithMargin = endContentSide + childMarginEnd;
- LayoutUnit endOffset = cb->endOffsetForLineInRegion(logicalTopPosition, false, containingBlockRegion, logicalHeight);
+ LayoutUnit endOffset = cb->endOffsetForLineInRegion(logicalTopPosition, DoNotIndentText, containingBlockRegion, logicalHeight);
if (endOffset > endContentSideWithMargin)
result += childMarginEnd;
else
@@ -1952,7 +1952,7 @@
logicalTopPosition = std::max(logicalTopPosition, logicalTopPosition + offsetFromLogicalTopOfRegion);
containingBlockRegion = cb->clampToStartAndEndRegions(region);
}
- return cb->availableLogicalWidthForLineInRegion(logicalTopPosition, false, containingBlockRegion, availableLogicalHeight(IncludeMarginBorderPadding));
+ return cb->availableLogicalWidthForLineInRegion(logicalTopPosition, DoNotIndentText, containingBlockRegion, availableLogicalHeight(IncludeMarginBorderPadding));
}
LayoutUnit RenderBox::perpendicularContainingBlockLogicalHeight() const
Modified: trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp (197461 => 197462)
--- trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/RenderDeprecatedFlexibleBox.cpp 2016-03-02 21:42:22 UTC (rev 197462)
@@ -1014,13 +1014,13 @@
if (!leftToRight)
continue;
- LayoutUnit blockRightEdge = destBlock.logicalRightOffsetForLine(lastVisibleLine->y(), false);
+ LayoutUnit blockRightEdge = destBlock.logicalRightOffsetForLine(lastVisibleLine->y(), DoNotIndentText);
if (!lastVisibleLine->lineCanAccommodateEllipsis(leftToRight, blockRightEdge, lastVisibleLine->x() + lastVisibleLine->logicalWidth(), totalWidth))
continue;
// Let the truncation code kick in.
// FIXME: the text alignment should be recomputed after the width changes due to truncation.
- LayoutUnit blockLeftEdge = destBlock.logicalLeftOffsetForLine(lastVisibleLine->y(), false);
+ LayoutUnit blockLeftEdge = destBlock.logicalLeftOffsetForLine(lastVisibleLine->y(), DoNotIndentText);
lastVisibleLine->placeEllipsis(anchorBox ? ellipsisAndSpaceStr : ellipsisStr, leftToRight, blockLeftEdge, blockRightEdge, totalWidth, anchorBox);
destBlock.setHasMarkupTruncation(true);
}
Modified: trunk/Source/WebCore/rendering/RenderListItem.cpp (197461 => 197462)
--- trunk/Source/WebCore/rendering/RenderListItem.cpp 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/RenderListItem.cpp 2016-03-02 21:42:22 UTC (rev 197462)
@@ -351,7 +351,7 @@
// FIXME: Need to account for relative positioning in the layout overflow.
if (style().isLeftToRightDirection()) {
- LayoutUnit leftLineOffset = logicalLeftOffsetForLine(blockOffset, logicalLeftOffsetForLine(blockOffset, false), false);
+ LayoutUnit leftLineOffset = logicalLeftOffsetForLine(blockOffset, logicalLeftOffsetForLine(blockOffset, DoNotIndentText), false);
markerLogicalLeft = leftLineOffset - lineOffset - paddingStart() - borderStart() + m_marker->marginStart();
m_marker->inlineBoxWrapper()->adjustLineDirectionPosition(markerLogicalLeft - markerOldLogicalLeft);
for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); box; box = box->parent()) {
@@ -374,7 +374,7 @@
hitSelfPaintingLayer = true;
}
} else {
- LayoutUnit rightLineOffset = logicalRightOffsetForLine(blockOffset, logicalRightOffsetForLine(blockOffset, false), false);
+ LayoutUnit rightLineOffset = logicalRightOffsetForLine(blockOffset, logicalRightOffsetForLine(blockOffset, DoNotIndentText), false);
markerLogicalLeft = rightLineOffset - lineOffset + paddingStart() + borderStart() + m_marker->marginEnd();
m_marker->inlineBoxWrapper()->adjustLineDirectionPosition(markerLogicalLeft - markerOldLogicalLeft);
for (InlineFlowBox* box = m_marker->inlineBoxWrapper()->parent(); box; box = box->parent()) {
Modified: trunk/Source/WebCore/rendering/RootInlineBox.cpp (197461 => 197462)
--- trunk/Source/WebCore/rendering/RootInlineBox.cpp 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/RootInlineBox.cpp 2016-03-02 21:42:22 UTC (rev 197462)
@@ -635,10 +635,10 @@
// This line has actually been moved further down, probably from a large line-height, but possibly because the
// line was forced to clear floats. If so, let's check the offsets, and only be willing to use the previous
// line's bottom if the offsets are greater on both sides.
- LayoutUnit prevLeft = blockFlow().logicalLeftOffsetForLine(prevBottom, false);
- LayoutUnit prevRight = blockFlow().logicalRightOffsetForLine(prevBottom, false);
- LayoutUnit newLeft = blockFlow().logicalLeftOffsetForLine(selectionTop, false);
- LayoutUnit newRight = blockFlow().logicalRightOffsetForLine(selectionTop, false);
+ LayoutUnit prevLeft = blockFlow().logicalLeftOffsetForLine(prevBottom, DoNotIndentText);
+ LayoutUnit prevRight = blockFlow().logicalRightOffsetForLine(prevBottom, DoNotIndentText);
+ LayoutUnit newLeft = blockFlow().logicalLeftOffsetForLine(selectionTop, DoNotIndentText);
+ LayoutUnit newRight = blockFlow().logicalRightOffsetForLine(selectionTop, DoNotIndentText);
if (prevLeft > newLeft || prevRight < newRight)
return selectionTop;
}
@@ -718,10 +718,10 @@
// The next line has actually been moved further over, probably from a large line-height, but possibly because the
// line was forced to clear floats. If so, let's check the offsets, and only be willing to use the next
// line's top if the offsets are greater on both sides.
- LayoutUnit nextLeft = blockFlow().logicalLeftOffsetForLine(nextTop, false);
- LayoutUnit nextRight = blockFlow().logicalRightOffsetForLine(nextTop, false);
- LayoutUnit newLeft = blockFlow().logicalLeftOffsetForLine(selectionBottom, false);
- LayoutUnit newRight = blockFlow().logicalRightOffsetForLine(selectionBottom, false);
+ LayoutUnit nextLeft = blockFlow().logicalLeftOffsetForLine(nextTop, DoNotIndentText);
+ LayoutUnit nextRight = blockFlow().logicalRightOffsetForLine(nextTop, DoNotIndentText);
+ LayoutUnit newLeft = blockFlow().logicalLeftOffsetForLine(selectionBottom, DoNotIndentText);
+ LayoutUnit newRight = blockFlow().logicalRightOffsetForLine(selectionBottom, DoNotIndentText);
if (nextLeft > newLeft || nextRight < newRight)
return selectionBottom;
}
Modified: trunk/Source/WebCore/rendering/SimpleLineLayout.cpp (197461 => 197462)
--- trunk/Source/WebCore/rendering/SimpleLineLayout.cpp 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/SimpleLineLayout.cpp 2016-03-02 21:42:22 UTC (rev 197462)
@@ -331,7 +331,7 @@
if (floatingObject->renderer().shapeOutsideInfo())
SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedFloat, reasons, includeReasons);
#endif
- float availableWidth = flow.availableLogicalWidthForLine(floatingObject->y(), false);
+ float availableWidth = flow.availableLogicalWidthForLine(floatingObject->y(), DoNotIndentText);
if (availableWidth < minimumWidthNeeded)
SET_REASON_AND_RETURN_IF_NEEDED(FlowHasUnsupportedFloat, reasons, includeReasons);
}
@@ -568,8 +568,9 @@
bool shouldApplyTextIndent = !flow.isAnonymous() || flow.parent()->firstChild() == &flow;
LayoutUnit height = flow.logicalHeight();
LayoutUnit logicalHeight = flow.minLineHeightForReplacedRenderer(false, 0);
- float logicalRightOffset = flow.logicalRightOffsetForLine(height, false, logicalHeight);
- line.setLogicalLeftOffset(flow.logicalLeftOffsetForLine(height, false, logicalHeight) + (shouldApplyTextIndent && isFirstLine ? flow.textIndentOffset() : LayoutUnit(0)));
+ float logicalRightOffset = flow.logicalRightOffsetForLine(height, DoNotIndentText, logicalHeight);
+ line.setLogicalLeftOffset(flow.logicalLeftOffsetForLine(height, DoNotIndentText, logicalHeight) +
+ (shouldApplyTextIndent && isFirstLine ? flow.textIndentOffset() : LayoutUnit(0)));
line.setAvailableWidth(std::max<float>(0, logicalRightOffset - line.logicalLeftOffset()));
}
Modified: trunk/Source/WebCore/rendering/line/LineBreaker.cpp (197461 => 197462)
--- trunk/Source/WebCore/rendering/line/LineBreaker.cpp 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/line/LineBreaker.cpp 2016-03-02 21:42:22 UTC (rev 197462)
@@ -60,7 +60,7 @@
while (!resolver.position().atEnd() && !requiresLineBox(resolver.position(), lineInfo, LeadingWhitespace)) {
RenderObject& object = *resolver.position().renderer();
if (object.isOutOfFlowPositioned()) {
- setStaticPositions(m_block, downcast<RenderBox>(object), width.shouldIndentText() ? IndentText : DoNotIndentText);
+ setStaticPositions(m_block, downcast<RenderBox>(object), width.shouldIndentText());
if (object.style().isOriginalDisplayInlineType()) {
resolver.runs().addRun(new BidiRun(0, 1, object, resolver.context(), resolver.dir()));
lineInfo.incrementRunsFromLeadingWhitespace();
Modified: trunk/Source/WebCore/rendering/line/LineWidth.cpp (197461 => 197462)
--- trunk/Source/WebCore/rendering/line/LineWidth.cpp 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/line/LineWidth.cpp 2016-03-02 21:42:22 UTC (rev 197462)
@@ -103,7 +103,7 @@
if (newFloat.type() == FloatingObject::FloatLeft) {
float newLeft = m_block.logicalRightForFloat(newFloat);
- if (shouldIndentText() && m_block.style().isLeftToRightDirection())
+ if (shouldIndentText() == IndentText && m_block.style().isLeftToRightDirection())
newLeft += floorToInt(m_block.textIndentOffset());
#if ENABLE(CSS_SHAPES)
if (shapeDeltas.isValid()) {
@@ -116,7 +116,7 @@
m_left = std::max<float>(m_left, newLeft);
} else {
float newRight = m_block.logicalLeftForFloat(newFloat);
- if (shouldIndentText() && !m_block.style().isLeftToRightDirection())
+ if (shouldIndentText() == IndentText && !m_block.style().isLeftToRightDirection())
newRight -= floorToInt(m_block.textIndentOffset());
#if ENABLE(CSS_SHAPES)
if (shapeDeltas.isValid()) {
@@ -156,7 +156,8 @@
m_overhangWidth += startOverhang + endOverhang;
}
-inline static float availableWidthAtOffset(const RenderBlockFlow& block, const LayoutUnit& offset, bool shouldIndentText, float& newLineLeft, float& newLineRight, const LayoutUnit& lineHeight = 0)
+inline static float availableWidthAtOffset(const RenderBlockFlow& block, const LayoutUnit& offset, IndentTextOrNot shouldIndentText,
+ float& newLineLeft, float& newLineRight, const LayoutUnit& lineHeight = 0)
{
newLineLeft = block.logicalLeftOffsetForLine(offset, shouldIndentText, lineHeight);
newLineRight = block.logicalRightOffsetForLine(offset, shouldIndentText, lineHeight);
Modified: trunk/Source/WebCore/rendering/line/LineWidth.h (197461 => 197462)
--- trunk/Source/WebCore/rendering/line/LineWidth.h 2016-03-02 20:59:28 UTC (rev 197461)
+++ trunk/Source/WebCore/rendering/line/LineWidth.h 2016-03-02 21:42:22 UTC (rev 197462)
@@ -76,7 +76,7 @@
void applyOverhang(RenderRubyRun*, RenderObject* startRenderer, RenderObject* endRenderer);
void fitBelowFloats(bool isFirstLine = false);
void setTrailingWhitespaceWidth(float collapsedWhitespace, float borderPaddingMargin = 0);
- bool shouldIndentText() const { return m_shouldIndentText == IndentText; }
+ IndentTextOrNot shouldIndentText() const { return m_shouldIndentText; }
private:
void computeAvailableWidthFromLeftAndRight();