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

Unified Diff: Source/core/dom/NodeIterator.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/dom/Node.cpp ('k') | Source/core/dom/NodeRenderingContext.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/NodeIterator.cpp
diff --git a/Source/core/dom/NodeIterator.cpp b/Source/core/dom/NodeIterator.cpp
index bcf72ee115b1048f89a7535555620ed15e0fb368..903f53ffa05a34ac0cfe281f83fc0ed53c589d1e 100644
--- a/Source/core/dom/NodeIterator.cpp
+++ b/Source/core/dom/NodeIterator.cpp
@@ -79,12 +79,12 @@ NodeIterator::NodeIterator(PassRefPtr<Node> rootNode, unsigned whatToShow, PassR
, m_detached(false)
{
ScriptWrappable::init(this);
- root()->document()->attachNodeIterator(this);
+ root()->document().attachNodeIterator(this);
}
NodeIterator::~NodeIterator()
{
- root()->document()->detachNodeIterator(this);
+ root()->document().detachNodeIterator(this);
}
PassRefPtr<Node> NodeIterator::nextNode(ScriptState* state, ExceptionState& es)
@@ -147,7 +147,7 @@ PassRefPtr<Node> NodeIterator::previousNode(ScriptState* state, ExceptionState&
void NodeIterator::detach()
{
- root()->document()->detachNodeIterator(this);
+ root()->document().detachNodeIterator(this);
m_detached = true;
m_referenceNode.node.clear();
}
@@ -162,8 +162,7 @@ void NodeIterator::updateForNodeRemoval(Node* removedNode, NodePointer& referenc
{
ASSERT(!m_detached);
ASSERT(removedNode);
- ASSERT(root()->document());
- ASSERT(root()->document() == removedNode->document());
+ ASSERT(&root()->document() == &removedNode->document());
// Iterator is not affected if the removed node is the reference node and is the root.
// or if removed node is not the reference node, or the ancestor of the reference node.
« no previous file with comments | « Source/core/dom/Node.cpp ('k') | Source/core/dom/NodeRenderingContext.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698