зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1446598 part 1. Stop using nsIDOMComment in serializers. r=mystor
MozReview-Commit-ID: IBVkQJOi6O7
This commit is contained in:
Родитель
46cdbdc51b
Коммит
51c87c6d96
|
@ -43,6 +43,7 @@
|
|||
#include "nsTArray.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsStringBuffer.h"
|
||||
#include "mozilla/dom/Comment.h"
|
||||
#include "mozilla/dom/DocumentType.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/dom/ShadowRoot.h"
|
||||
|
@ -423,7 +424,7 @@ nsDocumentEncoder::SerializeNodeStart(nsINode* aNode,
|
|||
}
|
||||
case nsINode::COMMENT_NODE:
|
||||
{
|
||||
mSerializer->AppendComment(static_cast<nsIContent*>(node),
|
||||
mSerializer->AppendComment(static_cast<Comment*>(node),
|
||||
aStartOffset, aEndOffset, aStr);
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -16,6 +16,7 @@ class nsIDocument;
|
|||
namespace mozilla {
|
||||
class Encoding;
|
||||
namespace dom {
|
||||
class Comment;
|
||||
class DocumentType;
|
||||
class Element;
|
||||
} // namespace dom
|
||||
|
@ -49,7 +50,8 @@ class nsIContentSerializer : public nsISupports {
|
|||
int32_t aEndOffset,
|
||||
nsAString& aStr) = 0;
|
||||
|
||||
NS_IMETHOD AppendComment(nsIContent* aComment, int32_t aStartOffset,
|
||||
NS_IMETHOD AppendComment(mozilla::dom::Comment* aComment,
|
||||
int32_t aStartOffset,
|
||||
int32_t aEndOffset, nsAString& aStr) = 0;
|
||||
|
||||
NS_IMETHOD AppendDoctype(mozilla::dom::DocumentType* aDoctype,
|
||||
|
|
|
@ -59,8 +59,12 @@ public:
|
|||
int32_t aStartOffset,
|
||||
int32_t aEndOffset,
|
||||
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 AppendComment(mozilla::dom::Comment* aComment,
|
||||
int32_t aStartOffset,
|
||||
int32_t aEndOffset, nsAString& aStr) override
|
||||
{
|
||||
return NS_OK;
|
||||
}
|
||||
NS_IMETHOD AppendDoctype(mozilla::dom::DocumentType* aDoctype,
|
||||
nsAString& aStr) override { return NS_OK; }
|
||||
NS_IMETHOD AppendElementStart(mozilla::dom::Element* aElement,
|
||||
|
|
|
@ -28,6 +28,7 @@
|
|||
#include "nsCRT.h"
|
||||
#include "nsContentUtils.h"
|
||||
#include "nsAttrName.h"
|
||||
#include "mozilla/dom/Comment.h"
|
||||
#include "mozilla/dom/DocumentType.h"
|
||||
#include "mozilla/dom/Element.h"
|
||||
#include "mozilla/intl/LineBreaker.h"
|
||||
|
@ -303,17 +304,15 @@ nsXMLContentSerializer::AppendProcessingInstruction(nsIContent* aPI,
|
|||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
nsXMLContentSerializer::AppendComment(nsIContent* aComment,
|
||||
nsXMLContentSerializer::AppendComment(Comment* aComment,
|
||||
int32_t aStartOffset,
|
||||
int32_t aEndOffset,
|
||||
nsAString& aStr)
|
||||
{
|
||||
nsCOMPtr<nsIDOMComment> comment = do_QueryInterface(aComment);
|
||||
NS_ENSURE_ARG(comment);
|
||||
nsresult rv;
|
||||
nsAutoString data;
|
||||
|
||||
rv = comment->GetData(data);
|
||||
rv = aComment->GetData(data);
|
||||
if (NS_FAILED(rv)) return NS_ERROR_FAILURE;
|
||||
|
||||
int32_t dataLength = data.Length();
|
||||
|
|
|
@ -55,7 +55,8 @@ class nsXMLContentSerializer : public nsIContentSerializer {
|
|||
int32_t aEndOffset,
|
||||
nsAString& aStr) override;
|
||||
|
||||
NS_IMETHOD AppendComment(nsIContent* aComment, int32_t aStartOffset,
|
||||
NS_IMETHOD AppendComment(mozilla::dom::Comment* aComment,
|
||||
int32_t aStartOffset,
|
||||
int32_t aEndOffset, nsAString& aStr) override;
|
||||
|
||||
NS_IMETHOD AppendDoctype(mozilla::dom::DocumentType* aDoctype,
|
||||
|
|
Загрузка…
Ссылка в новой задаче