mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Fix for bug 297067 (First tag is not transformed). r=Pike, sr=jst.
This commit is contained in:
parent
53d768e870
commit
c5e408a7cd
@ -488,14 +488,36 @@ void txMozillaXMLOutput::closePrevious(PRInt8 aAction)
|
|||||||
NS_ASSERTION(NS_SUCCEEDED(rv), "Can't create wrapper element");
|
NS_ASSERTION(NS_SUCCEEDED(rv), "Can't create wrapper element");
|
||||||
|
|
||||||
nsCOMPtr<nsIDOMNode> child, resultNode;
|
nsCOMPtr<nsIDOMNode> child, resultNode;
|
||||||
PRUint32 i, childCount = document->GetChildCount();
|
PRUint32 i, j, childCount = document->GetChildCount();
|
||||||
for (i = 0; i < childCount; ++i) {
|
for (i = 0, j = 0; i < childCount; ++i) {
|
||||||
nsCOMPtr<nsIContent> childContent = document->GetChildAt(0);
|
nsCOMPtr<nsIContent> childContent = document->GetChildAt(j);
|
||||||
if (childContent == mRootContent) {
|
if (childContent == mRootContent) {
|
||||||
document->SetRootContent(nsnull);
|
document->SetRootContent(nsnull);
|
||||||
}
|
}
|
||||||
child = do_QueryInterface(childContent);
|
child = do_QueryInterface(childContent);
|
||||||
wrapper->AppendChild(child, getter_AddRefs(resultNode));
|
PRUint16 nodeType;
|
||||||
|
child->GetNodeType(&nodeType);
|
||||||
|
switch (nodeType) {
|
||||||
|
case nsIDOMNode::ELEMENT_NODE:
|
||||||
|
case nsIDOMNode::TEXT_NODE:
|
||||||
|
case nsIDOMNode::CDATA_SECTION_NODE:
|
||||||
|
case nsIDOMNode::ENTITY_REFERENCE_NODE:
|
||||||
|
case nsIDOMNode::PROCESSING_INSTRUCTION_NODE:
|
||||||
|
case nsIDOMNode::COMMENT_NODE:
|
||||||
|
case nsIDOMNode::DOCUMENT_FRAGMENT_NODE:
|
||||||
|
{
|
||||||
|
rv = wrapper->AppendChild(child,
|
||||||
|
getter_AddRefs(resultNode));
|
||||||
|
if (NS_FAILED(rv)) {
|
||||||
|
// XXX Need to notify about this!
|
||||||
|
++j;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
default:
|
||||||
|
{
|
||||||
|
++j;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
mParentNode = wrapper;
|
mParentNode = wrapper;
|
||||||
|
Loading…
Reference in New Issue
Block a user