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

Unified Diff: Source/core/rendering/InlineBox.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/InlineBox.cpp
diff --git a/Source/core/rendering/InlineBox.cpp b/Source/core/rendering/InlineBox.cpp
index 4a26f6a255de5c76bfd2fbd40c764791a6d11cce..83b54f59796b636a30479baf7ca2d2a3bf7dbbfc 100644
--- a/Source/core/rendering/InlineBox.cpp
+++ b/Source/core/rendering/InlineBox.cpp
@@ -213,20 +213,20 @@ bool InlineBox::nodeAtPoint(const HitTestRequest& request, HitTestResult& result
return renderer().hitTest(request, result, locationInContainer, childPoint);
}
-const RootInlineBox* InlineBox::root() const
+const RootInlineBox& InlineBox::root() const
{
if (m_parent)
return m_parent->root();
ASSERT(isRootInlineBox());
- return static_cast<const RootInlineBox*>(this);
+ return static_cast<const RootInlineBox&>(*this);
}
-RootInlineBox* InlineBox::root()
+RootInlineBox& InlineBox::root()
{
if (m_parent)
return m_parent->root();
ASSERT(isRootInlineBox());
- return static_cast<RootInlineBox*>(this);
+ return static_cast<RootInlineBox&>(*this);
}
bool InlineBox::nextOnLineExists() const
@@ -314,7 +314,7 @@ FloatPoint InlineBox::locationIncludingFlipping()
{
if (!renderer().style()->isFlippedBlocksWritingMode())
return FloatPoint(x(), y());
- RenderBlockFlow& block = root()->block();
+ RenderBlockFlow& block = root().block();
if (block.style()->isHorizontalWritingMode())
return FloatPoint(x(), block.height() - height() - y());
@@ -325,28 +325,28 @@ void InlineBox::flipForWritingMode(FloatRect& rect)
{
if (!renderer().style()->isFlippedBlocksWritingMode())
return;
- root()->block().flipForWritingMode(rect);
+ root().block().flipForWritingMode(rect);
}
FloatPoint InlineBox::flipForWritingMode(const FloatPoint& point)
{
if (!renderer().style()->isFlippedBlocksWritingMode())
return point;
- return root()->block().flipForWritingMode(point);
+ return root().block().flipForWritingMode(point);
}
void InlineBox::flipForWritingMode(LayoutRect& rect)
{
if (!renderer().style()->isFlippedBlocksWritingMode())
return;
- root()->block().flipForWritingMode(rect);
+ root().block().flipForWritingMode(rect);
}
LayoutPoint InlineBox::flipForWritingMode(const LayoutPoint& point)
{
if (!renderer().style()->isFlippedBlocksWritingMode())
return point;
- return root()->block().flipForWritingMode(point);
+ return root().block().flipForWritingMode(point);
}
} // namespace WebCore

Powered by Google App Engine
This is Rietveld 408576698