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

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

Issue 182413005: Return refererence from InlineBox::root() (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: re-upload because previous patch didn't upload correctly. 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
Index: Source/core/rendering/InlineTextBox.cpp
diff --git a/Source/core/rendering/InlineTextBox.cpp b/Source/core/rendering/InlineTextBox.cpp
index 378f153f7177e20a331a7a1ea8c65694bc6091ac..fed938064353d8cc7ac424fa19cdd33cd94cb54c 100644
--- a/Source/core/rendering/InlineTextBox.cpp
+++ b/Source/core/rendering/InlineTextBox.cpp
@@ -124,17 +124,17 @@ LayoutUnit InlineTextBox::lineHeight() const
LayoutUnit InlineTextBox::selectionTop()
{
- return root()->selectionTop();
+ return root().selectionTop();
}
LayoutUnit InlineTextBox::selectionBottom()
{
- return root()->selectionBottom();
+ return root().selectionBottom();
}
LayoutUnit InlineTextBox::selectionHeight()
{
- return root()->selectionHeight();
+ return root().selectionHeight();
}
bool InlineTextBox::isSelected(int startPos, int endPos) const
@@ -174,8 +174,8 @@ RenderObject::SelectionState InlineTextBox::selectionState()
}
// If there are ellipsis following, make sure their selection is updated.
- if (m_truncation != cNoTruncation && root()->ellipsisBox()) {
- EllipsisBox* ellipsis = root()->ellipsisBox();
+ if (m_truncation != cNoTruncation && root().ellipsisBox()) {
+ EllipsisBox* ellipsis = root().ellipsisBox();
if (state != RenderObject::SelectionNone) {
int start, end;
selectionStartEnd(start, end);
@@ -845,8 +845,8 @@ void InlineTextBox::paintSelection(GraphicsContext* context, const FloatPoint& b
if (respectHyphen)
ePos = textRun.length();
- LayoutUnit selectionBottom = root()->selectionBottom();
- LayoutUnit selectionTop = root()->selectionTopAdjustedForPrecedingBlock();
+ LayoutUnit selectionBottom = root().selectionBottom();
+ LayoutUnit selectionTop = root().selectionTopAdjustedForPrecedingBlock();
int deltaY = roundToInt(renderer().style()->isFlippedLinesWritingMode() ? selectionBottom - logicalBottom() : logicalTop() - selectionTop);
int selHeight = max(0, roundToInt(selectionBottom - selectionTop));
@@ -917,7 +917,7 @@ static int computeUnderlineOffset(const TextUnderlinePosition underlinePosition,
return fontMetrics.ascent() + gap; // Position underline near the alphabetic baseline.
case TextUnderlinePositionUnder: {
// Position underline relative to the under edge of the lowest element's content box.
- const float offset = inlineTextBox->root()->maxLogicalTop() - inlineTextBox->logicalTop();
+ const float offset = inlineTextBox->root().maxLogicalTop() - inlineTextBox->logicalTop();
if (offset > 0)
return inlineTextBox->logicalHeight() + gap + offset;
return inlineTextBox->logicalHeight() + gap;
@@ -1402,7 +1402,7 @@ float InlineTextBox::textPos() const
// from the containing block edge in its measurement. textPos() should be consistent so the text are rendered in the same width.
if (logicalLeft() == 0)
return 0;
- return logicalLeft() - root()->logicalLeft();
+ return logicalLeft() - root().logicalLeft();
}
int InlineTextBox::offsetForPosition(float lineOffset, bool includePartialGlyphs) const

Powered by Google App Engine
This is Rietveld 408576698