Bug 186554 XMLSerializer does not serialize documentElement correctly. Extended document encoder API to make it possible to seriaalize a node. r=jfrancis, sr=bzbarsky.

This commit is contained in:
heikki%netscape.com 2006-04-20 03:38:19 +00:00
Родитель 7451de2691
Коммит 14a4a86ef7
1 изменённых файлов: 1 добавлений и 9 удалений

Просмотреть файл

@ -38,7 +38,6 @@
#include "nsDOMSerializer.h"
#include "nsIDOMNode.h"
#include "nsIDOMRange.h"
#include "nsIDOMClassInfo.h"
#include "nsIOutputStream.h"
#include "nsIDocument.h"
@ -54,9 +53,6 @@
#include "nsICodebasePrincipal.h"
#include "nsIURI.h"
#include "nsLayoutCID.h" // XXX Need range CID
static NS_DEFINE_CID(kRangeCID,NS_RANGE_CID);
nsDOMSerializer::nsDOMSerializer()
{
}
@ -117,11 +113,7 @@ static nsresult SetUpEncoder(nsIDOMNode *aRoot, const char* aCharset, nsIDocumen
// If we are working on the entire document we do not need to specify which part to serialize
if (!entireDocument) {
nsCOMPtr<nsIDOMRange> range(do_CreateInstance(kRangeCID));
rv = range->SelectNode(aRoot);
if (NS_SUCCEEDED(rv)) {
rv = encoder->SetRange(range);
}
rv = encoder->SetNode(aRoot);
}
if (NS_SUCCEEDED(rv)) {