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

mjs mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:16:08 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 7a0118883d6ab3f59ad69f7bcddadf7cfda5d9c2
Author: mjs <mjs at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Wed Dec 18 03:24:26 2002 +0000

            Reviewed by John.
    
    	- fixed 3120729 - HOMEPAGE: Can't set a DIV innerHTML property
    	with html content starting with <html><head><head/><body>
    
            * khtml/html/html_elementimpl.cpp:
            (HTMLElementImpl::createContextualFragment): Pop <html> and
    	<body>, and remove <head> to allow a full HTML document to be made
    	and inserted as a contextual fragment.
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3112 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index ef2167b..99427cf 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,15 @@
+2002-12-17  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by John.
+
+	- fixed 3120729 - HOMEPAGE: Can't set a DIV innerHTML property
+	with html content starting with <html><head><head/><body>
+	
+        * khtml/html/html_elementimpl.cpp:
+        (HTMLElementImpl::createContextualFragment): Pop <html> and
+	<body>, and remove <head> to allow a full HTML document to be made
+	and inserted as a contextual fragment.
+
 === Alexander-39 ===
 
 2002-12-17  David Hyatt  <hyatt at apple.com>
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index ef2167b..99427cf 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,15 @@
+2002-12-17  Maciej Stachowiak  <mjs at apple.com>
+
+        Reviewed by John.
+
+	- fixed 3120729 - HOMEPAGE: Can't set a DIV innerHTML property
+	with html content starting with <html><head><head/><body>
+	
+        * khtml/html/html_elementimpl.cpp:
+        (HTMLElementImpl::createContextualFragment): Pop <html> and
+	<body>, and remove <head> to allow a full HTML document to be made
+	and inserted as a contextual fragment.
+
 === Alexander-39 ===
 
 2002-12-17  David Hyatt  <hyatt at apple.com>
diff --git a/WebCore/khtml/html/html_elementimpl.cpp b/WebCore/khtml/html/html_elementimpl.cpp
index 31d63d9..add1fa5 100644
--- a/WebCore/khtml/html/html_elementimpl.cpp
+++ b/WebCore/khtml/html/html_elementimpl.cpp
@@ -322,6 +322,40 @@ DocumentFragmentImpl *HTMLElementImpl::createContextualFragment( const DOMString
     tok->end();
     delete tok;
 
+    // Exceptions are ignored because none ought to happen here.
+    int ignoredExceptionCode;
+
+    // we need to pop <html> and <body> elements and remove <head> to
+    // accomadate folks passing complete HTML documents to make the
+    // child of an element.
+
+    NodeImpl *node = fragment->firstChild(); 
+    while (node != NULL) {
+	if (node->id() == ID_HTML || node->id() == ID_BODY) {
+	    NodeImpl *firstChild = node->firstChild();
+	    NodeImpl *child = firstChild; 
+	    while (child != NULL) {
+		NodeImpl *nextChild = child->nextSibling();
+		fragment->insertBefore (child, node, ignoredExceptionCode);
+		child = nextChild;
+	    }
+	    if (firstChild == NULL) {
+		NodeImpl *nextNode = node->nextSibling();
+		fragment->removeChild(node, ignoredExceptionCode);
+		node = nextNode;
+	    } else {
+		fragment->removeChild(node, ignoredExceptionCode);
+		node = firstChild;
+	    }
+	} else if (node->id() == ID_HEAD) {
+	    NodeImpl *nextNode = node->nextSibling();
+	    fragment->removeChild(node, ignoredExceptionCode);
+	    node = nextNode;
+	} else {
+	    node = node->nextSibling();
+	}
+    }
+
     return fragment;
 }
 

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list