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

Unified Diff: Source/core/rendering/RenderBox.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/RenderBox.cpp
diff --git a/Source/core/rendering/RenderBox.cpp b/Source/core/rendering/RenderBox.cpp
index 760eab0aad7d7832b5fed5c1e2a2aff48cfc7088..ce57184643479aff6fb5fe357bc1802a60cded46 100644
--- a/Source/core/rendering/RenderBox.cpp
+++ b/Source/core/rendering/RenderBox.cpp
@@ -1956,8 +1956,8 @@ void RenderBox::positionLineBox(InlineBox* box)
// The value is cached in the xPos of the box. We only need this value if
// our object was inline originally, since otherwise it would have ended up underneath
// the inlines.
- RootInlineBox* root = box->root();
- root->block().setStaticInlinePositionForChild(this, root->lineTopWithLeading(), LayoutUnit::fromFloatRound(box->logicalLeft()));
+ RootInlineBox& root = box->root();
+ root.block().setStaticInlinePositionForChild(this, root.lineTopWithLeading(), LayoutUnit::fromFloatRound(box->logicalLeft()));
if (style()->hasStaticInlinePosition(box->isHorizontal()))
setChildNeedsLayout(MarkOnlyThis); // Just go ahead and mark the positioned object as needing layout, so it will update its position properly.
} else {
@@ -4013,10 +4013,10 @@ LayoutRect RenderBox::localCaretRect(InlineBox* box, int caretOffset, LayoutUnit
rect.move(LayoutSize(width() - caretWidth, 0));
if (box) {
- RootInlineBox* rootBox = box->root();
- LayoutUnit top = rootBox->lineTop();
+ RootInlineBox& rootBox = box->root();
+ LayoutUnit top = rootBox.lineTop();
rect.setY(top);
- rect.setHeight(rootBox->lineBottom() - top);
+ rect.setHeight(rootBox.lineBottom() - top);
}
// If height of box is smaller than font height, use the latter one,

Powered by Google App Engine
This is Rietveld 408576698