summaryrefslogtreecommitdiffstats
path: root/Source/WebCore/dom/ContainerNode.h
diff options
context:
space:
mode:
authorNaiem Shaik <snaiem@codeaurora.org>2012-07-19 10:45:56 -0700
committerSteve Kondik <shade@chemlab.org>2013-01-20 18:38:33 -0800
commit0f5d4355d7a384679722338d55f65bbb92350cfc (patch)
treedf4a638aa4e81152ee68f0d523ed706128a251ff /Source/WebCore/dom/ContainerNode.h
parent8f6cf525ead3381029545c1d292c8586ec45ddb0 (diff)
downloadexternal_webkit-0f5d4355d7a384679722338d55f65bbb92350cfc.zip
external_webkit-0f5d4355d7a384679722338d55f65bbb92350cfc.tar.gz
external_webkit-0f5d4355d7a384679722338d55f65bbb92350cfc.tar.bz2
DOM Optimizations
DOM traversal optimizations DOM Core optimizations Prefetch optimization for DOM Tree Traversal Conflicts: Source/WebKit/android/jni/WebViewCore.cpp Change-Id: Icbb8a7229ee9cff1a5401b57c8181f18b9a6d6e0
Diffstat (limited to 'Source/WebCore/dom/ContainerNode.h')
-rw-r--r--Source/WebCore/dom/ContainerNode.h11
1 files changed, 11 insertions, 0 deletions
diff --git a/Source/WebCore/dom/ContainerNode.h b/Source/WebCore/dom/ContainerNode.h
index 76eb1bd..ee8252e 100644
--- a/Source/WebCore/dom/ContainerNode.h
+++ b/Source/WebCore/dom/ContainerNode.h
@@ -170,6 +170,17 @@ inline Node* Node::lastChild() const
return toContainerNode(this)->lastChild();
}
+inline RenderObject* Node::previousRenderer()
+{
+ // FIXME: We should have the same O(N^2) avoidance as nextRenderer does
+ // however, when I tried adding it, several tests failed.
+ for (Node* n = previousSibling(); n; n = n->previousSibling()) {
+ if (n->renderer())
+ return n->renderer();
+ }
+ return 0;
+}
+
} // namespace WebCore
#endif // ContainerNode_h