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

Unified Diff: Source/core/rendering/RenderText.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/RenderReplaced.cpp ('k') | Source/core/rendering/RootInlineBox.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderText.cpp
diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp
index d60eac1bd18d6904e6c73b16bf977a4694d396ea..7d6096c4a29127e77ff85aee1757053231d3976a 100644
--- a/Source/core/rendering/RenderText.cpp
+++ b/Source/core/rendering/RenderText.cpp
@@ -536,14 +536,13 @@ static PositionWithAffinity createPositionWithAffinityForBox(const InlineBox* bo
affinity = offset > box->caretMinOffset() ? VP_UPSTREAM_IF_POSSIBLE : DOWNSTREAM;
break;
}
- int textStartOffset = box->renderer()->isText() ? toRenderText(box->renderer())->textStartOffset() : 0;
- return box->renderer()->createPositionWithAffinity(offset + textStartOffset, affinity);
+ int textStartOffset = box->renderer().isText() ? toRenderText(box->renderer()).textStartOffset() : 0;
+ return box->renderer().createPositionWithAffinity(offset + textStartOffset, affinity);
}
static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffsetForBiDi(const InlineTextBox* box, int offset, ShouldAffinityBeDownstream shouldAffinityBeDownstream)
{
ASSERT(box);
- ASSERT(box->renderer());
ASSERT(offset >= 0);
if (offset && static_cast<unsigned>(offset) < box->len())
@@ -555,7 +554,7 @@ static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset
const InlineBox* prevBox = box->prevLeafChildIgnoringLineBreak();
if ((prevBox && prevBox->bidiLevel() == box->bidiLevel())
- || box->renderer()->containingBlock()->style()->direction() == box->direction()) // FIXME: left on 12CBA
+ || box->renderer().containingBlock()->style()->direction() == box->direction()) // FIXME: left on 12CBA
return createPositionWithAffinityForBox(box, box->caretLeftmostOffset(), shouldAffinityBeDownstream);
if (prevBox && prevBox->bidiLevel() > box->bidiLevel()) {
@@ -585,7 +584,7 @@ static PositionWithAffinity createPositionWithAffinityForBoxAfterAdjustingOffset
const InlineBox* nextBox = box->nextLeafChildIgnoringLineBreak();
if ((nextBox && nextBox->bidiLevel() == box->bidiLevel())
- || box->renderer()->containingBlock()->style()->direction() == box->direction())
+ || box->renderer().containingBlock()->style()->direction() == box->direction())
return createPositionWithAffinityForBox(box, box->caretRightmostOffset(), shouldAffinityBeDownstream);
// offset is on the right edge
@@ -1429,7 +1428,7 @@ void RenderText::dirtyLineBoxes(bool fullLayout)
InlineTextBox* RenderText::createTextBox()
{
- return new InlineTextBox(this);
+ return new InlineTextBox(*this);
}
InlineTextBox* RenderText::createInlineTextBox()
« no previous file with comments | « Source/core/rendering/RenderReplaced.cpp ('k') | Source/core/rendering/RootInlineBox.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698