Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1554)

Unified Diff: Source/core/rendering/RenderDeprecatedFlexibleBox.cpp

Issue 184023003: Make InlineBox::renderer() and related subclass methods return reference. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: No reference reassignment. Created 6 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderInline.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
diff --git a/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp b/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
index 71658a1b74afb1a6a52edc2b6d6d45dafb9a61dc..a83c909daafd87533700392daa2d23ec3b17bd38 100644
--- a/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
+++ b/Source/core/rendering/RenderDeprecatedFlexibleBox.cpp
@@ -944,7 +944,7 @@ void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool
// Get ellipsis width, and if the last child is an anchor, it will go after the ellipsis, so add in a space and the anchor width too
LayoutUnit totalWidth;
InlineBox* anchorBox = lastLine->lastChild();
- if (anchorBox && anchorBox->renderer()->style()->isLink())
+ if (anchorBox && anchorBox->renderer().style()->isLink())
totalWidth = anchorBox->logicalWidth() + font.width(RenderBlockFlow::constructTextRun(this, font, ellipsisAndSpace, 2, style(), style()->direction()));
else {
anchorBox = 0;
@@ -952,26 +952,26 @@ void RenderDeprecatedFlexibleBox::applyLineClamp(FlexBoxIterator& iterator, bool
}
// See if this width can be accommodated on the last visible line
- RenderBlockFlow* destBlock = lastVisibleLine->block();
- RenderBlockFlow* srcBlock = lastLine->block();
+ RenderBlockFlow& destBlock = lastVisibleLine->block();
+ RenderBlockFlow& srcBlock = lastLine->block();
// FIXME: Directions of src/destBlock could be different from our direction and from one another.
- if (!srcBlock->style()->isLeftToRightDirection())
+ if (!srcBlock.style()->isLeftToRightDirection())
continue;
- bool leftToRight = destBlock->style()->isLeftToRightDirection();
+ bool leftToRight = destBlock.style()->isLeftToRightDirection();
if (!leftToRight)
continue;
- LayoutUnit blockRightEdge = destBlock->logicalRightOffsetForLine(lastVisibleLine->y(), false);
+ LayoutUnit blockRightEdge = destBlock.logicalRightOffsetForLine(lastVisibleLine->y(), false);
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(), false);
lastVisibleLine->placeEllipsis(anchorBox ? ellipsisAndSpaceStr : ellipsisStr, leftToRight, blockLeftEdge, blockRightEdge, totalWidth, anchorBox);
- destBlock->setHasMarkupTruncation(true);
+ destBlock.setHasMarkupTruncation(true);
}
}
« no previous file with comments | « Source/core/rendering/RenderBox.cpp ('k') | Source/core/rendering/RenderInline.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698