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

Unified Diff: Source/WebCore/dom/ChildNodeList.cpp

Issue 10696159: Merge 121003 (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/1180/
Patch Set: Created 8 years, 5 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/WebCore/bindings/js/JSNodeListCustom.cpp ('k') | Source/WebCore/dom/ClassNodeList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/ChildNodeList.cpp
===================================================================
--- Source/WebCore/dom/ChildNodeList.cpp (revision 122247)
+++ Source/WebCore/dom/ChildNodeList.cpp (working copy)
@@ -34,7 +34,7 @@
ChildNodeList::~ChildNodeList()
{
- node()->removeCachedChildNodeList();
+ ownerNode()->removeCachedChildNodeList();
}
unsigned ChildNodeList::length() const
@@ -43,7 +43,7 @@
return m_caches.cachedLength;
unsigned len = 0;
- for (Node* n = node()->firstChild(); n; n = n->nextSibling())
+ for (Node* n = rootNode()->firstChild(); n; n = n->nextSibling())
len++;
m_caches.cachedLength = len;
@@ -55,7 +55,7 @@
Node* ChildNodeList::item(unsigned index) const
{
unsigned int pos = 0;
- Node* n = node()->firstChild();
+ Node* n = rootNode()->firstChild();
if (m_caches.isItemCacheValid) {
if (index == m_caches.lastItemOffset)
@@ -76,7 +76,7 @@
int diff = index - pos;
unsigned dist = abs(diff);
if (dist > m_caches.cachedLength - 1 - index) {
- n = node()->lastChild();
+ n = rootNode()->lastChild();
pos = m_caches.cachedLength - 1;
}
}
@@ -108,7 +108,7 @@
// Note: Due to the overrides of the length and item functions above,
// this function will be called only by DynamicNodeList::itemWithName,
// for an element that was located with getElementById.
- return testNode->parentNode() == node();
+ return testNode->parentNode() == rootNode();
}
} // namespace WebCore
« no previous file with comments | « Source/WebCore/bindings/js/JSNodeListCustom.cpp ('k') | Source/WebCore/dom/ClassNodeList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698