mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 851916 part 2 - createHTMLDocument() should work with no arguments; r=bz
This commit is contained in:
parent
16ce916fd5
commit
a7b2b75371
@ -211,20 +211,22 @@ DOMImplementation::CreateHTMLDocument(const nsAString& aTitle,
|
||||
rv = root->AppendChildTo(head, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIContent> title;
|
||||
rv = doc->CreateElem(NS_LITERAL_STRING("title"), nullptr, kNameSpaceID_XHTML,
|
||||
getter_AddRefs(title));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = head->AppendChildTo(title, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
if (!DOMStringIsNull(aTitle)) {
|
||||
nsCOMPtr<nsIContent> title;
|
||||
rv = doc->CreateElem(NS_LITERAL_STRING("title"), nullptr,
|
||||
kNameSpaceID_XHTML, getter_AddRefs(title));
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = head->AppendChildTo(title, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
nsCOMPtr<nsIContent> titleText;
|
||||
rv = NS_NewTextNode(getter_AddRefs(titleText), doc->NodeInfoManager());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = titleText->SetText(aTitle, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = title->AppendChildTo(titleText, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
nsCOMPtr<nsIContent> titleText;
|
||||
rv = NS_NewTextNode(getter_AddRefs(titleText), doc->NodeInfoManager());
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = titleText->SetText(aTitle, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
rv = title->AppendChildTo(titleText, false);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
}
|
||||
|
||||
nsCOMPtr<nsIContent> body;
|
||||
rv = doc->CreateElem(NS_LITERAL_STRING("body"), nullptr, kNameSpaceID_XHTML,
|
||||
@ -241,12 +243,14 @@ DOMImplementation::CreateHTMLDocument(const nsAString& aTitle,
|
||||
}
|
||||
|
||||
already_AddRefed<nsIDocument>
|
||||
DOMImplementation::CreateHTMLDocument(const nsAString& aTitle,
|
||||
DOMImplementation::CreateHTMLDocument(const Optional<nsAString>& aTitle,
|
||||
ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsIDocument> document;
|
||||
nsCOMPtr<nsIDOMDocument> domDocument;
|
||||
aRv = CreateHTMLDocument(aTitle, getter_AddRefs(document),
|
||||
aRv = CreateHTMLDocument(aTitle.WasPassed() ? aTitle.Value()
|
||||
: NullString(),
|
||||
getter_AddRefs(document),
|
||||
getter_AddRefs(domDocument));
|
||||
return document.forget();
|
||||
}
|
||||
|
@ -73,7 +73,7 @@ public:
|
||||
ErrorResult& aRv);
|
||||
|
||||
already_AddRefed<nsIDocument>
|
||||
CreateHTMLDocument(const nsAString& aTitle, ErrorResult& aRv);
|
||||
CreateHTMLDocument(const Optional<nsAString>& aTitle, ErrorResult& aRv);
|
||||
|
||||
private:
|
||||
nsresult CreateDocument(const nsAString& aNamespaceURI,
|
||||
|
@ -63,7 +63,6 @@
|
||||
"Document interface: calling prepend(union) on xmlDoc with too few arguments must throw TypeError": true,
|
||||
"Document interface: xmlDoc must inherit property \"append\" with the proper type (29)": true,
|
||||
"Document interface: calling append(union) on xmlDoc with too few arguments must throw TypeError": true,
|
||||
"DOMImplementation interface: operation createHTMLDocument(DOMString)": true,
|
||||
"DocumentFragment interface: attribute children": true,
|
||||
"DocumentFragment interface: attribute firstElementChild": true,
|
||||
"DocumentFragment interface: attribute lastElementChild": true,
|
||||
|
@ -11,7 +11,6 @@ include $(DEPTH)/config/autoconf.mk
|
||||
|
||||
MOCHITEST_FILES := \
|
||||
test_CharacterData-remove.html.json \
|
||||
test_DOMImplementation-createHTMLDocument.html.json \
|
||||
test_Document-createElementNS.html.json \
|
||||
test_Document-getElementsByTagName.html.json \
|
||||
test_DocumentType-remove.html.json \
|
||||
|
@ -1,3 +0,0 @@
|
||||
{
|
||||
"Missing title argument": true
|
||||
}
|
@ -23,5 +23,5 @@ interface DOMImplementation {
|
||||
[TreatNullAs=EmptyString] DOMString qualifiedName,
|
||||
DocumentType? doctype);
|
||||
[Throws]
|
||||
Document createHTMLDocument(DOMString title);
|
||||
Document createHTMLDocument(optional DOMString title);
|
||||
};
|
||||
|
Loading…
Reference in New Issue
Block a user