DOM subtrees are inserted into documents via one insert/append call.
Reviewed by kocienda
* khtml/xml/dom_nodeimpl.cpp:
(NodeImpl::nextRenderer):
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@8709
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2005-02-25 David Hyatt <hyatt@apple.com>
+
+ Fix for 4010774, make sure to avoid an O(N^2) algorithm in nextRenderer() that is triggered when large
+ DOM subtrees are inserted into documents via one insert/append call.
+
+ Reviewed by kocienda
+
+ * khtml/xml/dom_nodeimpl.cpp:
+ (NodeImpl::nextRenderer):
+
2005-02-25 Richard Williamson <rjw@apple.com>
Fixed <rdar://problem/3382926> Bidi neutrals at RTL/LTR boundaries not handled correctly.
RenderObject * NodeImpl::nextRenderer()
{
+ // Avoid an O(n^2) problem with this function by not checking for nextRenderer() when the parent element hasn't even
+ // been attached yet.
+ if (parent() && !parent()->attached())
+ return 0;
+
for (NodeImpl *n = nextSibling(); n; n = n->nextSibling()) {
if (n->renderer())
return n->renderer();