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

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

Issue 23819007: Have Node::document() return a reference instead of a pointer (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase on master Created 7 years, 4 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/RenderNamedFlowThread.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/RenderObject.h
diff --git a/Source/core/rendering/RenderObject.h b/Source/core/rendering/RenderObject.h
index 60746515d1a3dd05bcfe3885ce4798a8df2b8371..16264201d1ada3c0f0700e92de4cf91429c8f572 100644
--- a/Source/core/rendering/RenderObject.h
+++ b/Source/core/rendering/RenderObject.h
@@ -369,7 +369,7 @@ public:
virtual bool isRenderScrollbarPart() const { return false; }
- bool isRoot() const { return document()->documentElement() == m_node; }
+ bool isRoot() const { return document().documentElement() == m_node; }
bool isBody() const;
bool isHR() const;
bool isLegend() const;
@@ -583,7 +583,7 @@ public:
virtual void updateDragState(bool dragOn);
- RenderView* view() const { return document()->renderView(); };
+ RenderView* view() const { return document().renderView(); };
// Returns true if this renderer is rooted, and optionally returns the hosting view (the root of the hierarchy).
bool isRooted(RenderView** = 0) const;
@@ -599,9 +599,8 @@ public:
// pseudo elements for which their parent node is returned.
Node* generatingNode() const { return isPseudoElement() ? node()->parentOrShadowHostNode() : node(); }
- // FIXME: This should return a reference.
- Document* document() const { return m_node->document(); }
- Frame* frame() const { return document()->frame(); }
+ Document& document() const { return m_node->document(); }
+ Frame* frame() const { return document().frame(); }
bool hasOutlineAnnotation() const;
bool hasOutline() const { return style()->hasOutline() || hasOutlineAnnotation(); }
@@ -756,7 +755,7 @@ public:
virtual LayoutUnit maxPreferredLogicalWidth() const { return 0; }
RenderStyle* style() const { return m_style.get(); }
- RenderStyle* firstLineStyle() const { return document()->styleSheetCollections()->usesFirstLineRules() ? cachedFirstLineStyle() : style(); }
+ RenderStyle* firstLineStyle() const { return document().styleSheetCollections()->usesFirstLineRules() ? cachedFirstLineStyle() : style(); }
RenderStyle* style(bool firstLine) const { return firstLine ? firstLineStyle() : style(); }
inline Color resolveColor(const RenderStyle* styleToUse, int colorProperty) const
@@ -1211,7 +1210,7 @@ private:
inline bool RenderObject::documentBeingDestroyed() const
{
- return !document()->renderer();
+ return !document().renderer();
}
inline bool RenderObject::isBeforeContent() const
« no previous file with comments | « Source/core/rendering/RenderNamedFlowThread.cpp ('k') | Source/core/rendering/RenderObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698