[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    kdelibs/khtml
From:       Germain Garand <germain () ebooksfrance ! com>
Date:       2005-03-18 17:11:58
Message-ID: 20050318171158.2489B16DE8 () office ! kde ! org
[Download RAW message or body]

CVS commit by ggarand: 


Fix crash.
traverseNextNode() was doing random things when restricted to a sub-tree.

This lead to e.g inserted/removedFromDocument being called for every node in the
document in the worst case

BUG: 101711


  M +5 -0      ChangeLog   1.404
  M +2 -2      xml/dom_nodeimpl.cpp   1.250


--- kdelibs/khtml/ChangeLog  #1.403:1.404
@@ -1,4 +1,9 @@
 2005-03-18  Germain Garand  <germain@ebooksfrance.org>
 
+        * xml/dom_nodeimpl.cpp (traverseNextNode): fix broken algorithm for stayWithin
+        case (#101711)
+
+2005-03-18  Germain Garand  <germain@ebooksfrance.org>
+
         make disabling of CSSheets via DOM actually do something.
 

--- kdelibs/khtml/xml/dom_nodeimpl.cpp  #1.249:1.250
@@ -683,5 +683,5 @@ NodeImpl *NodeImpl::childNode(unsigned l
 NodeImpl *NodeImpl::traverseNextNode(NodeImpl *stayWithin) const
 {
-    if (firstChild())
+    if (firstChild() || stayWithin == this)
         return firstChild();
     else if (nextSibling())
@@ -691,5 +691,5 @@ NodeImpl *NodeImpl::traverseNextNode(Nod
         while (n && !n->nextSibling() && (!stayWithin || n->parentNode() != stayWithin))
             n = n->parentNode();
-        if (n && (!stayWithin || n->parentNode() != stayWithin))
+        if (n)
             return n->nextSibling();
     }


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic