blob: b60347a106767bc99dab7d6cc6b15acdb265193a [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<title>HTML Test: element.outerHTML to verify HTML fragment serialization algorithm</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="https://html.spec.whatwg.org/multipage/#html-fragment-serialization-algorithm">
<link rel="help" href="https://dvcs.w3.org/hg/innerhtml/raw-file/tip/index.html#widl-Element-outerHTML">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
</head>
<body>
<div id="log"></div>
<script>
var element = [
"a",
"abbr",
"address",
"article",
"aside",
"audio",
"b",
"bdi",
"bdo",
"blockquote",
"body",
"button",
"canvas",
"caption",
"cite",
"code",
"colgroup",
"command",
"datalist",
"dd",
"del",
"details",
"dfn",
"dialog",
"div",
"dl",
"dt",
"em",
"fieldset",
"figcaption",
"figure",
"footer",
"form",
"h1",
"h2",
"h3",
"h4",
"h5",
"h6",
"head",
"header",
"hgroup",
"html",
"i",
"iframe",
"ins",
"kbd",
"label",
"legend",
"li",
"map",
"mark",
"menu",
"meter",
"nav",
"noscript",
"object",
"ol",
"optgroup",
"option",
"output",
"p",
"pre",
"progress",
"q",
"rp",
"rt",
"ruby",
"s",
"samp",
"script",
"section",
"select",
"small",
"span",
"strong",
"style",
"sub",
"summary",
"sup",
"table",
"tbody",
"td",
"textarea",
"tfoot",
"th",
"thead",
"time",
"title",
"tr",
"u",
"ul",
"var",
"video",
"data",
//"acronym",
//"applet",
//"basefont",
//"bgsound",
//"big",
//"blink",
//"center",
//"dir",
//"font",
//"frame",
//"frameset",
//"isindex",
//"listing",
//"marquee",
//"multicol",
//"nextid",
//"nobr",
//"noembed",
//"noframes",
//"plaintext",
//"rb",
//"spacer",
//"strike",
//"tt",
//"xmp",
];
var noEndTag = [
"area",
"base",
"br",
"col",
"embed",
"hr",
"img",
"input",
"keygen",
"link",
"meta",
"param",
"source",
"track",
"wbr",
];
test(function() {
element.forEach(function(ele) {
test(function() {
var e = document.createElement(ele);
assert_equals(e.outerHTML, "<" + ele + "></" + ele + ">", ele + " node created." );
}, "Node for " + ele);
});
noEndTag.forEach(function(ele) {
test(function() {
var e = document.createElement(ele);
assert_equals(e.outerHTML, "<" + ele + ">", ele + " node created." );
}, "Node for " + ele);
});
}, document.title);
</script>
</body>
</html>