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

Unified Diff: Source/core/dom/Node.h

Issue 23717008: Remove useless null checks from Node::document() call sites (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: 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/EventPathWalker.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Node.h
diff --git a/Source/core/dom/Node.h b/Source/core/dom/Node.h
index 5831fdda7f7dbfea3b726784d99ef0b9229e72ab..8157bfcb4e9e51ab97112a31545eaff3fd13c9a1 100644
--- a/Source/core/dom/Node.h
+++ b/Source/core/dom/Node.h
@@ -481,17 +481,16 @@ public:
unsigned nodeIndex() const;
// Returns the DOM ownerDocument attribute. This method never returns NULL, except in the case
- // of (1) a Document node or (2) a DocumentType node that is not used with any Document yet.
+ // of a Document node.
Document* ownerDocument() const;
- // Returns the document associated with this node. This method never returns NULL, except in the case
- // of a DocumentType node that is not used with any Document yet. A Document node returns itself.
+ // FIXME: This should return a reference.
+ // Returns the document associated with this node. This method never returns 0.
+ // A Document node returns itself.
Document* document() const
{
ASSERT(this);
- // FIXME: below ASSERT is useful, but prevents the use of document() in the constructor or destructor
- // due to the virtual function call to nodeType().
- ASSERT(documentInternal() || (nodeType() == DOCUMENT_TYPE_NODE && !inDocument()));
+ ASSERT(documentInternal());
return documentInternal();
}
« no previous file with comments | « Source/core/dom/EventPathWalker.cpp ('k') | Source/core/dom/Node.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698