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

Unified Diff: Source/WebCore/dom/DynamicNodeList.h

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/dom/ClassNodeList.cpp ('k') | Source/WebCore/dom/DynamicNodeList.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/WebCore/dom/DynamicNodeList.h
===================================================================
--- Source/WebCore/dom/DynamicNodeList.h (revision 122247)
+++ Source/WebCore/dom/DynamicNodeList.h (working copy)
@@ -53,8 +53,8 @@
AlwaysInvalidate,
DoNotInvalidateOnAttributeChange,
};
- DynamicNodeList(PassRefPtr<Node> node, RootType rootType, InvalidationType invalidationType)
- : m_node(node)
+ DynamicNodeList(PassRefPtr<Node> ownerNode, RootType rootType, InvalidationType invalidationType)
+ : m_ownerNode(ownerNode)
, m_caches(rootType, invalidationType)
{ }
virtual ~DynamicNodeList() { }
@@ -65,19 +65,19 @@
virtual Node* itemWithName(const AtomicString&) const;
// Other methods (not part of DOM)
- Node* node() const
- {
- if (m_caches.rootedAtDocument && m_node->inDocument())
- return m_node->document();
- return m_node.get();
- }
- Document* document() { return m_node->document(); }
-
+ Node* ownerNode() const { return m_ownerNode.get(); }
+ bool isRootedAtDocument() const { return m_caches.rootedAtDocument; }
bool shouldInvalidateOnAttributeChange() const { return m_caches.shouldInvalidateOnAttributeChange; }
-
void invalidateCache() { m_caches.reset(); }
protected:
+ Node* rootNode() const
+ {
+ if (m_caches.rootedAtDocument && m_ownerNode->inDocument())
+ return m_ownerNode->document();
+ return m_ownerNode.get();
+ }
+ Document* document() const { return m_ownerNode->document(); }
virtual bool nodeMatches(Element*) const = 0;
struct Caches {
@@ -107,7 +107,7 @@
unsigned shouldInvalidateOnAttributeChange : 1;
};
- RefPtr<Node> m_node;
+ RefPtr<Node> m_ownerNode;
mutable Caches m_caches;
private:
« no previous file with comments | « Source/WebCore/dom/ClassNodeList.cpp ('k') | Source/WebCore/dom/DynamicNodeList.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698