mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 869002 - DocumentFragment should be constructable, r=Ms2ger
This commit is contained in:
parent
b01e546d2a
commit
8fbebab530
@ -107,6 +107,18 @@ DocumentFragment::DumpContent(FILE* out, int32_t aIndent,
|
||||
}
|
||||
#endif
|
||||
|
||||
/* static */ already_AddRefed<DocumentFragment>
|
||||
DocumentFragment::Constructor(const GlobalObject& aGlobal, ErrorResult& aRv)
|
||||
{
|
||||
nsCOMPtr<nsPIDOMWindow> window = do_QueryInterface(aGlobal.Get());
|
||||
if (!window || !window->GetDoc()) {
|
||||
aRv.Throw(NS_ERROR_FAILURE);
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
return window->GetDoc()->CreateDocumentFragment();
|
||||
}
|
||||
|
||||
// QueryInterface implementation for DocumentFragment
|
||||
NS_INTERFACE_MAP_BEGIN(DocumentFragment)
|
||||
NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
|
||||
|
@ -141,6 +141,9 @@ public:
|
||||
mHost = aHost;
|
||||
}
|
||||
|
||||
static already_AddRefed<DocumentFragment>
|
||||
Constructor(const GlobalObject& aGlobal, ErrorResult& aRv);
|
||||
|
||||
#ifdef DEBUG
|
||||
virtual void List(FILE* out, int32_t aIndent) const;
|
||||
virtual void DumpContent(FILE* out, int32_t aIndent, bool aDumpAll) const;
|
||||
|
@ -628,6 +628,7 @@ MOCHITEST_FILES_C= \
|
||||
test_bug869006.html \
|
||||
test_bug868999.html \
|
||||
test_bug869000.html \
|
||||
test_bug869002.html \
|
||||
$(NULL)
|
||||
|
||||
# OOP tests don't work on Windows (bug 763081) or native-fennec
|
||||
|
32
content/base/test/test_bug869002.html
Normal file
32
content/base/test/test_bug869002.html
Normal file
@ -0,0 +1,32 @@
|
||||
<!DOCTYPE HTML>
|
||||
<html>
|
||||
<!--
|
||||
https://bugzilla.mozilla.org/show_bug.cgi?id=868999
|
||||
-->
|
||||
<head>
|
||||
<meta charset="utf-8">
|
||||
<title>Test for Bug 868999</title>
|
||||
<script type="application/javascript" src="/tests/SimpleTest/SimpleTest.js"></script>
|
||||
<link rel="stylesheet" type="text/css" href="/tests/SimpleTest/test.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<a target="_blank" href="https://bugzilla.mozilla.org/show_bug.cgi?id=868999">Mozilla Bug 869002</a>
|
||||
<p id="display"></p>
|
||||
<div id="content" style="display: none">
|
||||
|
||||
</div>
|
||||
<pre id="test">
|
||||
<script type="application/javascript">
|
||||
|
||||
/** Test for Bug 868999 **/
|
||||
|
||||
var d = new DocumentFragment();
|
||||
ok(d, "DocumentFragment has been created");
|
||||
|
||||
document.appendChild(d);
|
||||
ok(true, "DocumentFragment has been added to the document");
|
||||
|
||||
</script>
|
||||
</pre>
|
||||
</body>
|
||||
</html>
|
@ -11,6 +11,7 @@
|
||||
* liability, trademark and document use rules apply.
|
||||
*/
|
||||
|
||||
[Constructor]
|
||||
interface DocumentFragment : Node {
|
||||
// NEW
|
||||
/*
|
||||
|
Loading…
Reference in New Issue
Block a user