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

Unified Diff: Source/core/html/HTMLNameCollection.cpp

Issue 180143003: Have LiveNodeListBase::ownerNode() return a reference (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase 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/html/HTMLFormControlsCollection.idl ('k') | Source/core/html/HTMLOptionsCollection.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/html/HTMLNameCollection.cpp
diff --git a/Source/core/html/HTMLNameCollection.cpp b/Source/core/html/HTMLNameCollection.cpp
index 47f681dbbea9c48b664f5717f0996489bb3163b5..15a628ff4c7450e4fde18d870973fce516bf42e4 100644
--- a/Source/core/html/HTMLNameCollection.cpp
+++ b/Source/core/html/HTMLNameCollection.cpp
@@ -42,11 +42,10 @@ HTMLNameCollection::HTMLNameCollection(ContainerNode* document, CollectionType t
HTMLNameCollection::~HTMLNameCollection()
{
- ASSERT(ownerNode());
- ASSERT(ownerNode()->isDocumentNode());
+ ASSERT(ownerNode().isDocumentNode());
ASSERT(type() == WindowNamedItems || type() == DocumentNamedItems);
- ownerNode()->nodeLists()->removeCache(this, type(), m_name);
+ ownerNode().nodeLists()->removeCache(this, type(), m_name);
}
Element* HTMLNameCollection::virtualItemAfter(Element* previous) const
@@ -55,11 +54,11 @@ Element* HTMLNameCollection::virtualItemAfter(Element* previous) const
Element* current;
if (!previous)
- current = ElementTraversal::firstWithin(*ownerNode());
+ current = ElementTraversal::firstWithin(ownerNode());
else
- current = ElementTraversal::next(*previous, ownerNode());
+ current = ElementTraversal::next(*previous, &ownerNode());
- for (; current; current = ElementTraversal::next(*current, ownerNode())) {
+ for (; current; current = ElementTraversal::next(*current, &ownerNode())) {
switch (type()) {
case WindowNamedItems:
// find only images, forms, applets, embeds and objects by name,
« no previous file with comments | « Source/core/html/HTMLFormControlsCollection.idl ('k') | Source/core/html/HTMLOptionsCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698