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

Unified Diff: Source/core/rendering/InlineFlowBox.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/InlineFlowBox.cpp
diff --git a/Source/core/rendering/InlineFlowBox.cpp b/Source/core/rendering/InlineFlowBox.cpp
index c5780f5a3c7fe5cf3cb2dcba9c1dcfa06eac58d4..1eee1e0e8ce5d6d6c1b3213c5b233dde7d3f3776 100644
--- a/Source/core/rendering/InlineFlowBox.cpp
+++ b/Source/core/rendering/InlineFlowBox.cpp
@@ -184,7 +184,7 @@ void InlineFlowBox::removeChild(InlineBox* child)
if (!isDirty())
dirtyLineBoxes();
- root()->childRemoved(child);
+ root().childRemoved(child);
if (child == m_firstChild)
m_firstChild = child->nextOnLine();
@@ -401,7 +401,7 @@ float InlineFlowBox::placeBoxRangeInInlineDirection(InlineBox* firstChild, Inlin
// Our offset that we cache needs to be from the edge of the right border box and
// not the left border box. We have to subtract |x| from the width of the block
// (which can be obtained from the root line box).
- curr->setLogicalLeft(root()->block().logicalWidth() - logicalLeft);
+ curr->setLogicalLeft(root().block().logicalWidth() - logicalLeft);
}
continue; // The positioned object has no effect on the width.
}
@@ -1044,11 +1044,11 @@ bool InlineFlowBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& re
// Constrain our hit testing to the line top and bottom if necessary.
bool noQuirksMode = renderer().document().inNoQuirksMode();
if (!noQuirksMode && !hasTextChildren() && !(descendantsHaveSameLineHeightAndBaseline() && hasTextDescendants())) {
- RootInlineBox* rootBox = root();
+ RootInlineBox& rootBox = root();
LayoutUnit& top = isHorizontal() ? minY : minX;
LayoutUnit& logicalHeight = isHorizontal() ? height : width;
- LayoutUnit bottom = min(rootBox->lineBottom(), top + logicalHeight);
- top = max(rootBox->lineTop(), top);
+ LayoutUnit bottom = min(rootBox.lineBottom(), top + logicalHeight);
+ top = max(rootBox.lineTop(), top);
logicalHeight = bottom - top;
}
@@ -1212,11 +1212,11 @@ void InlineFlowBox::constrainToLineTopAndBottomIfNeeded(LayoutRect& rect) const
{
bool noQuirksMode = renderer().document().inNoQuirksMode();
if (!noQuirksMode && !hasTextChildren() && !(descendantsHaveSameLineHeightAndBaseline() && hasTextDescendants())) {
- const RootInlineBox* rootBox = root();
+ const RootInlineBox& rootBox = root();
LayoutUnit logicalTop = isHorizontal() ? rect.y() : rect.x();
LayoutUnit logicalHeight = isHorizontal() ? rect.height() : rect.width();
- LayoutUnit bottom = min(rootBox->lineBottom(), logicalTop + logicalHeight);
- logicalTop = max(rootBox->lineTop(), logicalTop);
+ LayoutUnit bottom = min(rootBox.lineBottom(), logicalTop + logicalHeight);
+ logicalTop = max(rootBox.lineTop(), logicalTop);
logicalHeight = bottom - logicalTop;
if (isHorizontal()) {
rect.setY(logicalTop);

Powered by Google App Engine
This is Rietveld 408576698