зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
7451de2691
Коммит
14a4a86ef7
|
@ -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)) {
|
||||
|
|
Загрузка…
Ссылка в новой задаче