mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 817844 - Fix WebIDL signature of serializeToStream/parseFromStream. r=bz
This commit is contained in:
parent
63b95d95ed
commit
9e9d0a9573
@ -98,11 +98,14 @@ function runTest(parser, serializer) {
|
||||
"parseFromString test for " + t.type);
|
||||
|
||||
let ostream = {
|
||||
data: "",
|
||||
write: function(buf, count) { this.data += buf; return count; }
|
||||
};
|
||||
serializer.serializeToStream(parser.parseFromString(t.input, t.type), ostream, "UTF-8");
|
||||
is(ostream.data, t.expected, "serializeToStream test for " + t.type);
|
||||
for (let charset of [null, "UTF-8"]) {
|
||||
ostream.data = "";
|
||||
serializer.serializeToStream(parser.parseFromString(t.input, t.type), ostream, charset);
|
||||
is(ostream.data, t.expected,
|
||||
"serializeToStream test for " + t.type + ", charset=" + charset);
|
||||
}
|
||||
|
||||
if (t.type === "text/html") {
|
||||
// parseFromBuffer and parseFromStream don't support "text/html".
|
||||
@ -126,10 +129,12 @@ function runTest(parser, serializer) {
|
||||
}
|
||||
|
||||
let istream = Cc["@mozilla.org/io/string-input-stream;1"].
|
||||
createInstance(Ci.nsIStringInputStream);
|
||||
istream.setData(t.input, -1);
|
||||
is(serializer.serializeToString(parser.parseFromStream(istream, null, array.length, t.type)),
|
||||
t.expected, "parseFromStream test for " + t.type);
|
||||
createInstance(Ci.nsIStringInputStream);
|
||||
for (let charset of [null, "UTF-8"]) {
|
||||
istream.setData(t.input, -1);
|
||||
is(serializer.serializeToString(parser.parseFromStream(istream, charset, t.input.length, t.type)),
|
||||
t.expected, "parseFromStream test for " + t.type + ", charset=" + charset);
|
||||
}
|
||||
}
|
||||
throws(function() {
|
||||
parser.parseFromString("<xml></xml>", "foo/bar");
|
||||
|
@ -36,7 +36,7 @@ interface DOMParser {
|
||||
Document parseFromBuffer(Uint8Array buf, unsigned long bufLen,
|
||||
SupportedType type);
|
||||
[Creator, Throws, ChromeOnly]
|
||||
Document parseFromStream(InputStream stream, DOMString charset,
|
||||
Document parseFromStream(InputStream stream, DOMString? charset,
|
||||
long contentLength, SupportedType type);
|
||||
[Throws, ChromeOnly]
|
||||
void init(optional Principal? principal = null,
|
||||
|
@ -15,6 +15,6 @@ interface XMLSerializer {
|
||||
|
||||
// Mozilla-specific stuff
|
||||
[Throws, ChromeOnly]
|
||||
void serializeToStream(Node root, OutputStream stream, DOMString charset);
|
||||
void serializeToStream(Node root, OutputStream stream, DOMString? charset);
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user