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

Unified Diff: Source/core/editing/VisibleSelection.cpp

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/editing/VisiblePosition.cpp ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/VisibleSelection.cpp
diff --git a/Source/core/editing/VisibleSelection.cpp b/Source/core/editing/VisibleSelection.cpp
index 66afd401ff20de672cf5fb58da4daa443062cc79..257951e28d67fb3bdcfea11a2c9e6a9950873dce 100644
--- a/Source/core/editing/VisibleSelection.cpp
+++ b/Source/core/editing/VisibleSelection.cpp
@@ -133,7 +133,7 @@ PassRefPtr<Range> VisibleSelection::firstRange() const
return 0;
Position start = m_start.parentAnchoredEquivalent();
Position end = m_end.parentAnchoredEquivalent();
- return Range::create(start.anchorNode()->document(), start, end);
+ return Range::create(&start.anchorNode()->document(), start, end);
}
PassRefPtr<Range> VisibleSelection::toNormalizedRange() const
@@ -145,7 +145,7 @@ PassRefPtr<Range> VisibleSelection::toNormalizedRange() const
// in the course of running edit commands which modify the DOM.
// Failing to call this can result in equivalentXXXPosition calls returning
// incorrect results.
- m_start.anchorNode()->document()->updateLayout();
+ m_start.anchorNode()->document().updateLayout();
// Check again, because updating layout can clear the selection.
if (isNone())
@@ -189,7 +189,7 @@ PassRefPtr<Range> VisibleSelection::toNormalizedRange() const
// VisibleSelections are supposed to always be valid. This constructor will ASSERT
// if a valid range could not be created, which is fine for this callsite.
- return Range::create(s.anchorNode()->document(), s, e);
+ return Range::create(&s.anchorNode()->document(), s, e);
}
bool VisibleSelection::expandUsingGranularity(TextGranularity granularity)
@@ -206,15 +206,15 @@ static PassRefPtr<Range> makeSearchRange(const Position& pos)
Node* n = pos.deprecatedNode();
if (!n)
return 0;
- Document* d = n->document();
- Node* de = d->documentElement();
+ Document& d = n->document();
+ Node* de = d.documentElement();
if (!de)
return 0;
Node* boundary = n->enclosingBlockFlowElement();
if (!boundary)
return 0;
- RefPtr<Range> searchRange(Range::create(d));
+ RefPtr<Range> searchRange(Range::create(&d));
TrackExceptionState es;
Position start(pos.parentAnchoredEquivalent());
« no previous file with comments | « Source/core/editing/VisiblePosition.cpp ('k') | Source/core/editing/VisibleUnits.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698