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

Unified Diff: Source/core/rendering/InlineBox.h

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/EllipsisBox.cpp ('k') | Source/core/rendering/InlineBox.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/InlineBox.h
diff --git a/Source/core/rendering/InlineBox.h b/Source/core/rendering/InlineBox.h
index 5803cd17e2be61d2ab6c2f8c935e672d3829a6fe..82dc339ecc957cd78d5273a541a8981deb060af8 100644
--- a/Source/core/rendering/InlineBox.h
+++ b/Source/core/rendering/InlineBox.h
@@ -34,7 +34,7 @@ class RootInlineBox;
// some RenderObject (i.e., it represents a portion of that RenderObject).
class InlineBox {
public:
- InlineBox(RenderObject* obj)
+ InlineBox(RenderObject& obj)
: m_next(0)
, m_prev(0)
, m_parent(0)
@@ -46,7 +46,7 @@ public:
{
}
- InlineBox(RenderObject* obj, FloatPoint topLeft, float logicalWidth, bool firstLine, bool constructed,
+ InlineBox(RenderObject& obj, FloatPoint topLeft, float logicalWidth, bool firstLine, bool constructed,
bool dirty, bool extracted, bool isHorizontal, InlineBox* next, InlineBox* prev, InlineFlowBox* parent)
: m_next(next)
, m_prev(prev)
@@ -173,7 +173,7 @@ public:
InlineBox* nextLeafChildIgnoringLineBreak() const;
InlineBox* prevLeafChildIgnoringLineBreak() const;
- RenderObject* renderer() const { return m_renderer; }
+ RenderObject& renderer() const { return m_renderer; }
InlineFlowBox* parent() const
{
@@ -270,15 +270,15 @@ public:
int expansion() const { return m_bitfields.expansion(); }
- bool visibleToHitTestRequest(const HitTestRequest& request) const { return renderer()->visibleToHitTestRequest(request); }
+ bool visibleToHitTestRequest(const HitTestRequest& request) const { return renderer().visibleToHitTestRequest(request); }
- EVerticalAlign verticalAlign() const { return renderer()->style(m_bitfields.firstLine())->verticalAlign(); }
+ EVerticalAlign verticalAlign() const { return renderer().style(m_bitfields.firstLine())->verticalAlign(); }
// Use with caution! The type is not checked!
RenderBoxModelObject* boxModelObject() const
{
- if (!m_renderer->isText())
- return toRenderBoxModelObject(m_renderer);
+ if (!renderer().isText())
+ return toRenderBoxModelObject(&renderer());
return 0;
}
@@ -377,6 +377,7 @@ private:
InlineBox* m_prev; // The previous element on the same line as us.
InlineFlowBox* m_parent; // The box that contains us.
+ RenderObject& m_renderer;
protected:
// For RootInlineBox
@@ -398,8 +399,6 @@ protected:
// For InlineFlowBox and InlineTextBox
bool extracted() const { return m_bitfields.extracted(); }
- RenderObject* m_renderer;
-
FloatPoint m_topLeft;
float m_logicalWidth;
« no previous file with comments | « Source/core/rendering/EllipsisBox.cpp ('k') | Source/core/rendering/InlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698