[SCM] WebKit Debian packaging branch, debian/unstable, updated. debian/1.1.15-1-40151-g37bb677

darin darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 08:41:06 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit d4dbaa7f5ee9b6ba93870ce2d086ef8524f4e5a6
Author: darin <darin at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Fri May 21 17:22:18 2004 +0000

            Reviewed by Ken and Chris.
    
            - fixed <rdar://problem/3656948>: (markup strings that contain <html> and <body> elements don't work, producing nothing)
    
            * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::createContextualFragment):
            Changed things around so that nodes are removed from their parent node before
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@6660 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index 762e91d..da0d01f 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,6 +1,15 @@
 2004-05-21  Darin Adler  <darin at apple.com>
 
-        Reviewed by Ken.
+        Reviewed by Ken and Chris.
+
+        - fixed <rdar://problem/3656948>: (markup strings that contain <html> and <body> elements don't work, producing nothing)
+
+        * khtml/html/html_elementimpl.cpp: (HTMLElementImpl::createContextualFragment):
+        Changed things around so that nodes are removed from their parent node before 
+
+2004-05-21  Darin Adler  <darin at apple.com>
+
+        Reviewed by Ken and Chris.
 
         - fixed part of <rdar://problem/3656948>: (HTML Editing: -[WebView replaceSelectionWithMarkupString:] doesn't seem to work)
 
diff --git a/WebCore/khtml/html/html_elementimpl.cpp b/WebCore/khtml/html/html_elementimpl.cpp
index 370a682..efd023c 100644
--- a/WebCore/khtml/html/html_elementimpl.cpp
+++ b/WebCore/khtml/html/html_elementimpl.cpp
@@ -714,34 +714,27 @@ DocumentFragmentImpl *HTMLElementImpl::createContextualFragment( const DOMString
     // accomadate folks passing complete HTML documents to make the
     // child of an element.
 
-    NodeImpl *node = fragment->firstChild(); 
-    while (node != NULL) {
+    NodeImpl *nextNode;
+    for (NodeImpl *node = fragment->firstChild(); node != NULL; node = nextNode) {
+        nextNode = node->nextSibling();
 	if (node->id() == ID_HTML || node->id() == ID_BODY) {
 	    NodeImpl *firstChild = node->firstChild();
-	    NodeImpl *child = firstChild; 
-	    while (child != NULL) {
-		NodeImpl *nextChild = child->nextSibling();
+            if (firstChild != NULL) {
+                nextNode = firstChild;
+            }
+	    NodeImpl *nextChild;
+            for (NodeImpl *child = firstChild; child != NULL; child = nextChild) {
+		nextChild = child->nextSibling();
+                child->ref();
+                node->removeChild(child, ignoredExceptionCode);
 		fragment->insertBefore(child, node, ignoredExceptionCode);
-                // FIXME: Does node leak here?
-		child = nextChild;
-	    }
-	    if (firstChild == NULL) {
-		NodeImpl *nextNode = node->nextSibling();
-		fragment->removeChild(node, ignoredExceptionCode);
-                // FIXME: Does node leak here?
-                node = nextNode;
-	    } else {
-		fragment->removeChild(node, ignoredExceptionCode);
-                // FIXME: Does node leak here?
-		node = firstChild;
+                child->deref();
 	    }
+            fragment->removeChild(node, ignoredExceptionCode);
+            // FIXME: Does node leak here?
 	} else if (node->id() == ID_HEAD) {
-	    NodeImpl *nextNode = node->nextSibling();
 	    fragment->removeChild(node, ignoredExceptionCode);
             // FIXME: Does node leak here?
-	    node = nextNode;
-	} else {
-	    node = node->nextSibling();
 	}
     }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list