mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-17 15:25:52 +00:00
Bug 1445140 part 3. Pass a DocumentType to nsIContentSerializer::AppendDoctype. r=mystor
MozReview-Commit-ID: 5UjRSP6MoDI
This commit is contained in:
parent
27d1556d72
commit
7bbb9b0ced
@ -24,7 +24,6 @@
|
||||
#include "nsIDOMText.h"
|
||||
#include "nsIDOMComment.h"
|
||||
#include "nsIDOMProcessingInstruction.h"
|
||||
#include "nsIDOMDocumentType.h"
|
||||
#include "nsIDOMNodeList.h"
|
||||
#include "nsRange.h"
|
||||
#include "nsIDOMRange.h"
|
||||
@ -45,6 +44,7 @@
|
||||
#include "nsTArray.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsStringBuffer.h"
|
||||
#include "mozilla/dom/DocumentType.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/ShadowRoot.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
@ -430,7 +430,7 @@ nsDocumentEncoder::SerializeNodeStart(nsINode* aNode,
|
||||
}
|
||||
case nsINode::DOCUMENT_TYPE_NODE:
|
||||
{
|
||||
mSerializer->AppendDoctype(static_cast<nsIContent*>(node), aStr);
|
||||
mSerializer->AppendDoctype(static_cast<DocumentType*>(node), aStr);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -16,6 +16,7 @@ class nsIDocument;
|
||||
namespace mozilla {
|
||||
class Encoding;
|
||||
namespace dom {
|
||||
class DocumentType;
|
||||
class Element;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
@ -51,7 +52,7 @@ class nsIContentSerializer : public nsISupports {
|
||||
NS_IMETHOD AppendComment(nsIContent* aComment, int32_t aStartOffset,
|
||||
int32_t aEndOffset, nsAString& aStr) = 0;
|
||||
|
||||
NS_IMETHOD AppendDoctype(nsIContent *aDoctype,
|
||||
NS_IMETHOD AppendDoctype(mozilla::dom::DocumentType* aDoctype,
|
||||
nsAString& aStr) = 0;
|
||||
|
||||
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
||||
|
@ -29,6 +29,7 @@ class nsIContent;
|
||||
|
||||
namespace mozilla {
|
||||
namespace dom {
|
||||
class DocumentType;
|
||||
class Element;
|
||||
} // namespace dom
|
||||
} // namespace mozilla
|
||||
@ -60,7 +61,7 @@ public:
|
||||
nsAString& aStr) override { return NS_OK; }
|
||||
NS_IMETHOD AppendComment(nsIContent* aComment, int32_t aStartOffset,
|
||||
int32_t aEndOffset, nsAString& aStr) override { return NS_OK; }
|
||||
NS_IMETHOD AppendDoctype(nsIContent *aDoctype,
|
||||
NS_IMETHOD AppendDoctype(mozilla::dom::DocumentType* aDoctype,
|
||||
nsAString& aStr) override { return NS_OK; }
|
||||
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
||||
mozilla::dom::Element* aOriginalElement,
|
||||
|
@ -15,7 +15,6 @@
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsIDOMProcessingInstruction.h"
|
||||
#include "nsIDOMComment.h"
|
||||
#include "nsIDOMDocumentType.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIContentInlines.h"
|
||||
#include "nsIDocument.h"
|
||||
@ -29,6 +28,7 @@
|
||||
#include "nsCRT.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsAttrName.h"
|
||||
#include "mozilla/dom/DocumentType.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/intl/LineBreaker.h"
|
||||
#include "nsParserConstants.h"
|
||||
@ -360,19 +360,17 @@ nsXMLContentSerializer::AppendComment(nsIContent* aComment,
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXMLContentSerializer::AppendDoctype(nsIContent* aDocType,
|
||||
nsXMLContentSerializer::AppendDoctype(DocumentType* aDocType,
|
||||
nsAString& aStr)
|
||||
{
|
||||
nsCOMPtr<nsIDOMDocumentType> docType = do_QueryInterface(aDocType);
|
||||
NS_ENSURE_ARG(docType);
|
||||
nsresult rv;
|
||||
nsAutoString name, publicId, systemId;
|
||||
|
||||
rv = docType->GetName(name);
|
||||
rv = aDocType->GetName(name);
|
||||
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
|
||||
rv = docType->GetPublicId(publicId);
|
||||
rv = aDocType->GetPublicId(publicId);
|
||||
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
|
||||
rv = docType->GetSystemId(systemId);
|
||||
rv = aDocType->GetSystemId(systemId);
|
||||
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
|
||||
|
||||
NS_ENSURE_TRUE(MaybeAddNewlineForRootNode(aStr), NS_ERROR_OUT_OF_MEMORY);
|
||||
|
@ -58,7 +58,7 @@ class nsXMLContentSerializer : public nsIContentSerializer {
|
||||
NS_IMETHOD AppendComment(nsIContent* aComment, int32_t aStartOffset,
|
||||
int32_t aEndOffset, nsAString& aStr) override;
|
||||
|
||||
NS_IMETHOD AppendDoctype(nsIContent *aDoctype,
|
||||
NS_IMETHOD AppendDoctype(mozilla::dom::DocumentType* aDoctype,
|
||||
nsAString& aStr) override;
|
||||
|
||||
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
||||
|
Loading…
Reference in New Issue
Block a user