mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-11-08 20:28:42 +02:00
--HG-- rename : testing/web-platform/tests/dom/nodes/Document-createComment.html => testing/web-platform/tests/dom/nodes/Document-createTextNode.html rename : testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-baseline.html => testing/web-platform/tests/selectors-api/tests/submissions/Opera/Element-matches.html rename : testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-baseline.html => testing/web-platform/tests/selectors-api/tests/submissions/Opera/ParentNode-find-findAll.html rename : testing/web-platform/tests/selectors-api/tests/submissions/Opera/level2-lib.js => testing/web-platform/tests/selectors-api/tests/submissions/Opera/ParentNode-find-findAll.js
25 lines
911 B
JavaScript
25 lines
911 B
JavaScript
function createHTMLDocuments(checkDoc) {
|
|
var tests = [
|
|
["", "", ""],
|
|
[null, "null", "null"],
|
|
[undefined, undefined, ""],
|
|
["foo bar baz", "foo bar baz", "foo bar baz"],
|
|
["foo\t\tbar baz", "foo\t\tbar baz", "foo bar baz"],
|
|
["foo\n\nbar baz", "foo\n\nbar baz", "foo bar baz"],
|
|
["foo\f\fbar baz", "foo\f\fbar baz", "foo bar baz"],
|
|
["foo\r\rbar baz", "foo\r\rbar baz", "foo bar baz"],
|
|
]
|
|
|
|
tests.forEach(function(t, i) {
|
|
var title = t[0], expectedtitle = t[1], normalizedtitle = t[2]
|
|
test(function() {
|
|
var doc = document.implementation.createHTMLDocument(title);
|
|
checkDoc(doc, expectedtitle, normalizedtitle)
|
|
}, "createHTMLDocument test " + i + ": " + t.map(function(el) { return format_value(el) }))
|
|
})
|
|
|
|
test(function() {
|
|
var doc = document.implementation.createHTMLDocument();
|
|
checkDoc(doc, undefined, "")
|
|
}, "Missing title argument");
|
|
}
|