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

hyatt hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc
Sat Sep 26 07:30:31 UTC 2009


The following commit has been merged in the debian/unstable branch:
commit 443912f5fbb0ef719dea865d045a0840f0ef1096
Author: hyatt <hyatt at 268f45cc-cd09-0410-ab3c-d52691b4dbfc>
Date:   Thu Mar 20 02:13:09 2003 +0000

    	Fix continuations so that they are smarter about reusing
    	anonymous blocks.  Avoids deep nesting when it isn't
    	necessary.
    
    	A complete implementation of the residual style fixes.  It
    	seems to fix all current outstanding bugs.
    
    	One of the bugs in the residual style list was caused by
    	font-weight not being reset to tables and is actually its
    	own problem.  I fixed that by moving the quirks resets for
    	table elements into the quirks stylesheet (which should be
    	a speed boost).
    
    	<b><p>Foo</b> Goo</p>
    
            Also fixed the huge XML failure issue that made us fail hundreds
            of test cases.  Attachment of text nodes was being done way too
            early, before the text of the node had been determined.  By moving
            the attachment from enterText to exitText, the problem is solved.
    
            Reviewed by darin (res. style fix 1) and gramps (rest of res. style fix and XML fix)
    
    	* ChangeLog:
            * khtml/css/quirks.css:
            * khtml/html/html_tableimpl.cpp:
            (HTMLTableElementImpl::attach):
            * khtml/html/htmlparser.cpp:
            (KHTMLParser::isResidualStyleTag):
            (KHTMLParser::isAffectedByResidualStyle):
            (KHTMLParser::handleResidualStyleCloseTagAcrossBlocks):
            (KHTMLParser::reopenResidualStyleTags):
            (KHTMLParser::popBlock):
            (KHTMLParser::popOneBlock):
            * khtml/html/htmlparser.h:
            * khtml/rendering/render_inline.cpp:
            (RenderInline::splitFlow):
            * khtml/xml/xml_tokenizer.cpp:
            (XMLHandler::enterText):
            (XMLHandler::exitText):
    
    
    git-svn-id: http://svn.webkit.org/repository/webkit/trunk@3869 268f45cc-cd09-0410-ab3c-d52691b4dbfc

diff --git a/WebCore/ChangeLog-2003-10-25 b/WebCore/ChangeLog-2003-10-25
index fd36783..5131ae5 100644
--- a/WebCore/ChangeLog-2003-10-25
+++ b/WebCore/ChangeLog-2003-10-25
@@ -1,3 +1,45 @@
+2003-03-19  David Hyatt  <hyatt at apple.com>
+
+	Fix continuations so that they are smarter about reusing
+	anonymous blocks.  Avoids deep nesting when it isn't 
+	necessary.
+
+	A complete implementation of the residual style fixes.  It
+	seems to fix all current outstanding bugs.
+
+	One of the bugs in the residual style list was caused by
+	font-weight not being reset to tables and is actually its
+	own problem.  I fixed that by moving the quirks resets for
+	table elements into the quirks stylesheet (which should be
+	a speed boost).
+	
+	<b><p>Foo</b> Goo</p>
+
+        Also fixed the huge XML failure issue that made us fail hundreds
+        of test cases.  Attachment of text nodes was being done way too
+        early, before the text of the node had been determined.  By moving
+        the attachment from enterText to exitText, the problem is solved.
+        
+        Reviewed by darin (res. style fix 1) and gramps (rest of res. style fix and XML fix)
+
+	* ChangeLog:
+        * khtml/css/quirks.css:
+        * khtml/html/html_tableimpl.cpp:
+        (HTMLTableElementImpl::attach):
+        * khtml/html/htmlparser.cpp:
+        (KHTMLParser::isResidualStyleTag):
+        (KHTMLParser::isAffectedByResidualStyle):
+        (KHTMLParser::handleResidualStyleCloseTagAcrossBlocks):
+        (KHTMLParser::reopenResidualStyleTags):
+        (KHTMLParser::popBlock):
+        (KHTMLParser::popOneBlock):
+        * khtml/html/htmlparser.h:
+        * khtml/rendering/render_inline.cpp:
+        (RenderInline::splitFlow):
+        * khtml/xml/xml_tokenizer.cpp:
+        (XMLHandler::enterText):
+        (XMLHandler::exitText):
+	
 2003-03-18  Darin Adler  <darin at apple.com>
 
         Reviewed by Ken.
@@ -59,7 +101,6 @@
 
 2003-03-18  Maciej Stachowiak  <mjs at apple.com>
 
->>>>>>> 1.1521
         Reviewed by John.
 
 	- fixed 3119663 - document.lastModified returns the wrong date format
diff --git a/WebCore/ChangeLog-2005-08-23 b/WebCore/ChangeLog-2005-08-23
index fd36783..5131ae5 100644
--- a/WebCore/ChangeLog-2005-08-23
+++ b/WebCore/ChangeLog-2005-08-23
@@ -1,3 +1,45 @@
+2003-03-19  David Hyatt  <hyatt at apple.com>
+
+	Fix continuations so that they are smarter about reusing
+	anonymous blocks.  Avoids deep nesting when it isn't 
+	necessary.
+
+	A complete implementation of the residual style fixes.  It
+	seems to fix all current outstanding bugs.
+
+	One of the bugs in the residual style list was caused by
+	font-weight not being reset to tables and is actually its
+	own problem.  I fixed that by moving the quirks resets for
+	table elements into the quirks stylesheet (which should be
+	a speed boost).
+	
+	<b><p>Foo</b> Goo</p>
+
+        Also fixed the huge XML failure issue that made us fail hundreds
+        of test cases.  Attachment of text nodes was being done way too
+        early, before the text of the node had been determined.  By moving
+        the attachment from enterText to exitText, the problem is solved.
+        
+        Reviewed by darin (res. style fix 1) and gramps (rest of res. style fix and XML fix)
+
+	* ChangeLog:
+        * khtml/css/quirks.css:
+        * khtml/html/html_tableimpl.cpp:
+        (HTMLTableElementImpl::attach):
+        * khtml/html/htmlparser.cpp:
+        (KHTMLParser::isResidualStyleTag):
+        (KHTMLParser::isAffectedByResidualStyle):
+        (KHTMLParser::handleResidualStyleCloseTagAcrossBlocks):
+        (KHTMLParser::reopenResidualStyleTags):
+        (KHTMLParser::popBlock):
+        (KHTMLParser::popOneBlock):
+        * khtml/html/htmlparser.h:
+        * khtml/rendering/render_inline.cpp:
+        (RenderInline::splitFlow):
+        * khtml/xml/xml_tokenizer.cpp:
+        (XMLHandler::enterText):
+        (XMLHandler::exitText):
+	
 2003-03-18  Darin Adler  <darin at apple.com>
 
         Reviewed by Ken.
@@ -59,7 +101,6 @@
 
 2003-03-18  Maciej Stachowiak  <mjs at apple.com>
 
->>>>>>> 1.1521
         Reviewed by John.
 
 	- fixed 3119663 - document.lastModified returns the wrong date format
diff --git a/WebCore/khtml/css/quirks.css b/WebCore/khtml/css/quirks.css
index 27a20b9..5b3535c 100644
--- a/WebCore/khtml/css/quirks.css
+++ b/WebCore/khtml/css/quirks.css
@@ -26,6 +26,10 @@ UL, OL, MENU, DIR {
 TABLE {
     white-space: normal;
     line-height: normal;
+    font-weight: normal;
+    font-size: medium;
+    font-family: \2d konq-body;
+    color: \2d konq-text;
 }
 
 
diff --git a/WebCore/khtml/html/html_tableimpl.cpp b/WebCore/khtml/html/html_tableimpl.cpp
index cd2a6cb..53a017e 100644
--- a/WebCore/khtml/html/html_tableimpl.cpp
+++ b/WebCore/khtml/html/html_tableimpl.cpp
@@ -531,15 +531,6 @@ void HTMLTableElementImpl::attach()
 {
     assert(!m_attached);
     if (parent()->renderer()) {
-        // reset font color and sizes here, if we don't have strict parse mode.
-        // this is 90% compatible to ie and mozilla, and the by way easiest solution...
-        // only difference to 100% correct is that in strict mode <font> elements are propagated into tables.
-        if ( getDocument()->inQuirksMode() ) {
-            addCSSProperty( CSS_PROP_FONT_SIZE, CSS_VAL_MEDIUM );
-            addCSSProperty( CSS_PROP_COLOR, CSS_VAL__KONQ_TEXT );
-            addCSSProperty( CSS_PROP_FONT_FAMILY, CSS_VAL__KONQ_BODY );
-        }
-        
         if (!m_noBorder) {
             int v = m_solid ? CSS_VAL_SOLID : CSS_VAL_OUTSET;
             addCSSProperty(CSS_PROP_BORDER_TOP_STYLE, v);
diff --git a/WebCore/khtml/html/htmlparser.cpp b/WebCore/khtml/html/htmlparser.cpp
index 7b11912..cfbeef5 100644
--- a/WebCore/khtml/html/htmlparser.cpp
+++ b/WebCore/khtml/html/htmlparser.cpp
@@ -1179,6 +1179,235 @@ void KHTMLParser::processCloseTag(Token *t)
 #endif
 }
 
+bool KHTMLParser::isResidualStyleTag(int _id)
+{
+    switch (_id) {
+        case ID_A:
+        case ID_FONT:
+        case ID_EM:
+        case ID_B:
+        case ID_STRONG:
+        case ID_I:
+        case ID_TT:
+        case ID_CODE:
+        case ID_SMALL:
+            return true;
+        default:
+            return false;
+    }
+}
+
+bool KHTMLParser::isAffectedByResidualStyle(int _id)
+{
+    if (isResidualStyleTag(_id))
+        return true;
+    
+    switch (_id) {
+        case ID_P:
+        case ID_DIV:
+        case ID_BLOCKQUOTE:
+        case ID_ADDRESS:
+        case ID_H1:
+        case ID_H2:
+        case ID_H3:
+        case ID_H4:
+        case ID_H5:
+        case ID_H6:
+        case ID_CENTER:
+            return true;
+        default:
+            return false;
+    }
+}
+
+void KHTMLParser::handleResidualStyleCloseTagAcrossBlocks(HTMLStackElem* elem)
+{
+    // Find the element that crosses over to a higher level.   For now, if there is more than
+    // one, we will just give up and not attempt any sort of correction.  It's highly unlikely that
+    // there will be more than one, since <p> tags aren't allowed to be nested.
+    int exceptionCode = 0;
+    HTMLStackElem* curr = blockStack;
+    HTMLStackElem* maxElem = 0;
+    HTMLStackElem* prev = 0;
+    HTMLStackElem* prevMaxElem = 0;
+    while (curr && curr != elem) {
+        if (curr->level > elem->level) {
+            if (maxElem)
+                return;
+            maxElem = curr;
+            prevMaxElem = prev;
+        }
+
+        prev = curr;
+        curr = curr->next;
+    }
+
+    if (!curr || !maxElem || !isAffectedByResidualStyle(maxElem->id)) return;
+
+    NodeImpl* residualElem = prev->node;
+    NodeImpl* blockElem = prevMaxElem ? prevMaxElem->node : current;
+    NodeImpl* parentElem = elem->node;
+    
+    if (maxElem->node->parentNode() != elem->node) {
+        // Walk the stack and remove any elements that aren't residual style tags.  These
+        // are basically just being closed up.  Example:
+        // <font><span>Moo<p>Goo</font></p>.
+        // In the above example, the <span> doesn't need to be reopened.  It can just close.
+        HTMLStackElem* currElem = maxElem->next;
+        HTMLStackElem* prevElem = maxElem;
+        while (currElem != elem) {
+            HTMLStackElem* nextElem = currElem->next;
+            if (!isResidualStyleTag(currElem->id)) {
+                prevElem->next = nextElem;
+                prevElem->node = currElem->node;
+                delete currElem;
+            }
+            else
+                prevElem = currElem;
+            currElem = nextElem;
+        }
+        
+        // We have to reopen residual tags in between maxElem and elem.  An example of this case is:
+        // <font><i>Moo<p>Foo</font>.
+        // In this case, we need to transform the part before the <p> into:
+        // <font><i>Moo</i></font><i>
+        // so that the <i> will remain open.  This involves the modification of elements
+        // in the block stack.
+        // This will also affect how we ultimately reparent the block, since we want it to end up
+        // under the reopened residual tags (e.g., the <i> in the above example.)
+        NodeImpl* prevNode = 0;
+        NodeImpl* currNode = 0;
+        currElem = maxElem;
+        while (currElem->node != residualElem) {
+            if (isResidualStyleTag(currElem->node->id())) {
+                // Create a clone of this element.
+                currNode = currElem->node->cloneNode(false);
+
+                // Change the stack element's node to point to the clone.
+                currElem->node = currNode;
+                
+                // Attach the previous node as a child of this new node.
+                if (prevNode)
+                    currNode->appendChild(prevNode, exceptionCode);
+                else // The new parent for the block element is going to be the innermost clone.
+                    parentElem = currNode;
+                                
+                prevNode = currNode;
+            }
+            
+            currElem = currElem->next;
+        }
+
+        // Now append the chain of new residual style elements if one exists.
+        if (prevNode)
+            elem->node->appendChild(prevNode, exceptionCode);
+    }
+         
+    // We need to make a clone of |residualElem| and place it just inside |blockElem|.
+    // All content of |blockElem| is reparented to be under this clone.  We then
+    // reparent |blockElem| using real DOM calls so that attachment/detachment will
+    // be performed to fix up the rendering tree.
+    // So for this example: <b>...<p>Foo</b>Goo</p>
+    // The end result will be: <b>...</b><p><b>Foo</b>Goo</p>
+    //
+    // Step 1: Remove |blockElem| from its parent, doing a batch detach of all the kids.
+    blockElem->parentNode()->removeChild(blockElem, exceptionCode);
+        
+    // Step 2: Clone |residualElem|.
+    NodeImpl* newNode = residualElem->cloneNode(false); // Shallow clone. We don't pick up the same kids.
+
+    // Step 3: Place |blockElem|'s children under |newNode|.  Remove all of the children of |blockElem|
+    // before we've put |newElem| into the document.  That way we'll only do one attachment of all
+    // the new content (instead of a bunch of individual attachments).
+    NodeImpl* currNode = blockElem->firstChild();
+    while (currNode) {
+        NodeImpl* nextNode = currNode->nextSibling();
+        blockElem->removeChild(currNode, exceptionCode);
+        newNode->appendChild(currNode, exceptionCode);
+        currNode = nextNode;
+    }
+
+    // Step 4: Place |newNode| under |blockElem|.  |blockElem| is still out of the document, so no
+    // attachment can occur yet.
+    blockElem->appendChild(newNode, exceptionCode);
+    
+    // Step 5: Reparent |blockElem|.  Now the full attachment of the fixed up tree takes place.
+    parentElem->appendChild(blockElem, exceptionCode);
+    
+    // Step 6: Elide |elem|, since it is effectively no longer open.  Also update
+    // the node associated with the previous stack element so that when it gets popped,
+    // it doesn't make the residual element the next current node.
+    HTMLStackElem* currElem = maxElem;
+    HTMLStackElem* prevElem = 0;
+    while (currElem != elem) {
+        prevElem = currElem;
+        currElem = currElem->next;
+    }
+    prevElem->next = elem->next;
+    prevElem->node = elem->node;
+    delete elem;
+    
+    // Step 7: Reopen intermediate inlines, e.g., <b><p><i>Foo</b>Goo</p>.
+    // In the above example, Goo should stay italic.
+    curr = blockStack;
+    HTMLStackElem* residualStyleStack = 0;
+    while (curr && curr != maxElem) {
+        // In quirks mode only, we will actually schedule this tag for reopening
+        // after we complete the close of this entire block.
+        NodeImpl* currNode = current;
+        if (isResidualStyleTag(curr->id)) {
+            // We've overloaded the use of stack elements and are just reusing the
+            // struct with a slightly different meaning to the variables.  Instead of chaining
+            // from innermost to outermost, we build up a list of all the tags we need to reopen
+            // from the outermost to the innermost, i.e., residualStyleStack will end up pointing
+            // to the outermost tag we need to reopen.
+            // We also set curr->node to be the actual element that corresponds to the ID stored in
+            // curr->id rather than the node that you should pop to when the element gets pulled off
+            // the stack.
+            popOneBlock(false);
+            curr->next = 0;
+            curr->node = currNode;
+            if (!residualStyleStack)
+                residualStyleStack = curr;
+            else
+                residualStyleStack->next = curr;
+        }
+        else
+            popOneBlock();
+
+        curr = blockStack;
+    }
+
+    reopenResidualStyleTags(residualStyleStack);
+}
+
+void KHTMLParser::reopenResidualStyleTags(HTMLStackElem* elem)
+{
+    // Nothing required.
+    if (!elem)
+        return;
+
+    // We have some tags that need to be reopened.
+    int exceptionCode = 0;
+    while (elem) {
+        // Create a shallow clone of the DOM node for this element.
+        NodeImpl* newNode = elem->node->cloneNode(false); 
+
+        // Append the new node.
+        current->appendChild(newNode, exceptionCode);
+
+        // Now push a new stack element for this node we just created.
+        pushBlock(elem->id, elem->level);
+
+        // Update |current| manually to point to the new node.
+        current = newNode;
+        
+        // Advance to the next tag that needs to be reopened.
+        HTMLStackElem* next = elem->next;
+        delete elem;
+        elem = next;
+    }
+}
 
 void KHTMLParser::pushBlock(int _id, int _level)
 {
@@ -1211,11 +1440,22 @@ void KHTMLParser::popBlock( int _id )
         }
         Elem = Elem->next;
     }
-    if (!Elem || maxLevel > Elem->level)
+
+    if (!Elem)
         return;
 
-    Elem = blockStack;
+    if (maxLevel > Elem->level) {
+        // We didn't match because the tag is in a different scope, e.g.,
+        // <b><p>Foo</b>.  In quirks mode only, try to correct the problem.
+        if (!document->document()->inQuirksMode() || !isResidualStyleTag(_id))
+            return;
+        return handleResidualStyleCloseTagAcrossBlocks(Elem);
+    }
 
+    bool isAffectedByStyle = isAffectedByResidualStyle(Elem->id);
+    HTMLStackElem* residualStyleStack = 0;
+    
+    Elem = blockStack;
     while (Elem)
     {
         if (Elem->id == _id)
@@ -1230,14 +1470,37 @@ void KHTMLParser::popBlock( int _id )
                 // malformed HTML).  Set an attribute on the form to clear out its
                 // bottom margin.
                 form->setMalformed(true);
-            
-            popOneBlock();
+
+            // In quirks mode only, we will actually schedule this tag for reopening
+            // after we complete the close of this entire block.
+            NodeImpl* currNode = current;
+            if (isAffectedByStyle && document->document()->inQuirksMode() && isResidualStyleTag(Elem->id)) {
+                // We've overloaded the use of stack elements and are just reusing the
+                // struct with a slightly different meaning to the variables.  Instead of chaining
+                // from innermost to outermost, we build up a list of all the tags we need to reopen
+                // from the outermost to the innermost, i.e., residualStyleStack will end up pointing
+                // to the outermost tag we need to reopen.
+                // We also set Elem->node to be the actual element that corresponds to the ID stored in
+                // Elem->id rather than the node that you should pop to when the element gets pulled off
+                // the stack.
+                popOneBlock(false);
+                Elem->next = 0;
+                Elem->node = currNode;
+                if (!residualStyleStack)
+                    residualStyleStack = Elem;
+                else
+                    residualStyleStack->next = Elem;
+            }
+            else
+                popOneBlock();
             Elem = blockStack;
         }
     }
+
+    reopenResidualStyleTags(residualStyleStack);
 }
 
-void KHTMLParser::popOneBlock()
+void KHTMLParser::popOneBlock(bool delBlock)
 {
     HTMLStackElem *Elem = blockStack;
 
@@ -1267,8 +1530,9 @@ void KHTMLParser::popOneBlock()
 
     if (Elem->strayTableContent)
         inStrayTableContent = false;
-        
-    delete Elem;
+
+    if (delBlock)
+        delete Elem;
 }
 
 void KHTMLParser::popInlineBlocks()
diff --git a/WebCore/khtml/html/htmlparser.h b/WebCore/khtml/html/htmlparser.h
index e8b1747..20d2f20 100644
--- a/WebCore/khtml/html/htmlparser.h
+++ b/WebCore/khtml/html/htmlparser.h
@@ -120,13 +120,18 @@ protected:
     void pushBlock( int _id, int _level);
 
     void popBlock( int _id );
-    void popOneBlock();
+    void popOneBlock(bool delBlock = true);
     void popInlineBlocks();
 
     void freeBlock( void);
 
     void createHead();
 
+    bool isResidualStyleTag(int _id);
+    bool isAffectedByResidualStyle(int _id);
+    void handleResidualStyleCloseTagAcrossBlocks(HTMLStackElem* elem);
+    void reopenResidualStyleTags(HTMLStackElem* elem);
+    
     ushort *forbiddenTag;
 
     // For error handling, we sometimes destroy and recreate elements (usually when
diff --git a/WebCore/khtml/rendering/render_inline.cpp b/WebCore/khtml/rendering/render_inline.cpp
index bd367a0..3867318 100644
--- a/WebCore/khtml/rendering/render_inline.cpp
+++ b/WebCore/khtml/rendering/render_inline.cpp
@@ -173,15 +173,26 @@ void RenderInline::splitInlines(RenderBlock* fromBlock, RenderBlock* toBlock,
 void RenderInline::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox,
                              RenderObject* newChild, RenderFlow* oldCont)
 {
+    RenderBlock *pre = 0;
+    RenderStyle* newStyle = 0;
     RenderBlock* block = containingBlock();
-
-    RenderStyle* newStyle = new RenderStyle();
-    newStyle->inheritFrom(block->style());
-    newStyle->setDisplay(BLOCK);
-    RenderBlock *pre = new (renderArena()) RenderBlock(0 /* anonymous box */);
-    pre->setStyle(newStyle);
-    pre->setIsAnonymousBox(true);
-    pre->setChildrenInline(true);
+    bool madeNewBeforeBlock = false;
+    if (block->isAnonymousBox()) {
+        // We can reuse this block and make it the preBlock of the next continuation.
+        pre = block;
+        block = block->containingBlock();
+    }
+    else {
+        // No anonymous block available for use.  Make one.
+        newStyle = new RenderStyle();
+        newStyle->inheritFrom(block->style());
+        newStyle->setDisplay(BLOCK);
+        pre = new (renderArena()) RenderBlock(0 /* anonymous box */);
+        pre->setStyle(newStyle);
+        pre->setIsAnonymousBox(true);
+        pre->setChildrenInline(true);
+        madeNewBeforeBlock = true;
+    }
 
     newStyle = new RenderStyle();
     newStyle->inheritFrom(block->style());
@@ -191,20 +202,23 @@ void RenderInline::splitFlow(RenderObject* beforeChild, RenderBlock* newBlockBox
     post->setIsAnonymousBox(true);
     post->setChildrenInline(true);
 
-    RenderObject* boxFirst = block->firstChild();
-    block->insertChildNode(pre, boxFirst);
+    RenderObject* boxFirst = madeNewBeforeBlock ? block->firstChild() : pre->nextSibling();
+    if (madeNewBeforeBlock)
+        block->insertChildNode(pre, boxFirst);
     block->insertChildNode(newBlockBox, boxFirst);
     block->insertChildNode(post, boxFirst);
     block->setChildrenInline(false);
 
-    RenderObject* o = boxFirst;
-    while (o)
-    {
-        RenderObject* no = o;
-        o = no->nextSibling();
-        pre->appendChildNode(block->removeChildNode(no));
-        no->setLayouted(false);
-        no->setMinMaxKnown(false);
+    if (madeNewBeforeBlock) {
+        RenderObject* o = boxFirst;
+        while (o)
+        {
+            RenderObject* no = o;
+            o = no->nextSibling();
+            pre->appendChildNode(block->removeChildNode(no));
+            no->setLayouted(false);
+            no->setMinMaxKnown(false);
+        }
     }
 
     splitInlines(pre, post, newBlockBox, beforeChild, oldCont);
diff --git a/WebCore/khtml/xml/xml_tokenizer.cpp b/WebCore/khtml/xml/xml_tokenizer.cpp
index 257a528..f1129be 100644
--- a/WebCore/khtml/xml/xml_tokenizer.cpp
+++ b/WebCore/khtml/xml/xml_tokenizer.cpp
@@ -226,11 +226,6 @@ bool XMLHandler::enterText()
 {
     NodeImpl *newNode = m_doc->document()->createTextNode("");
     if (m_currentNode->addChild(newNode)) {
-        if (m_view && !newNode->attached()) {
-            newNode->init();
-            if (!newNode->attached())
-                newNode->attach();
-        }
         m_currentNode = newNode;
         return true;
     }
@@ -242,6 +237,12 @@ bool XMLHandler::enterText()
 
 void XMLHandler::exitText()
 {
+    if (m_view && m_currentNode && !m_currentNode->attached()) {
+        m_currentNode->init();
+        if (!m_currentNode->attached())
+            m_currentNode->attach();
+    }
+    
     NodeImpl* par = m_currentNode->parentNode();
     if (par != 0)
         m_currentNode = par;

-- 
WebKit Debian packaging



More information about the Pkg-webkit-commits mailing list