fune/testing/web-platform/tests/html/syntax/serializing-xml-fragments/outerHTML.html
Mason Freed 4e7062b569 Bug 1752467 [wpt PR 32583] - Add some missing elements to common.js element list, and consolidate, a=testonly
Automatic update from web-platform-tests
Add some missing elements to common.js element list, and consolidate

These six HTML standard elements were missing from the HTML5_ELEMENTS
list in common.js:

  <data>, <main>, <slot>, <sup>, <summary>, <template>

These elements are deprecated, and were moved to a new list of
deprecated elements:

 <hgroup>, <keygen>

Also, the <command> element, which was removed long ago, was removed
from the lists completely.

While in here, I also cleaned up several other roughly (though not
perfectly) duplicated lists in other tests.

Change-Id: I2f39ad4078efa7057379aedaa28cda88ad8d8caf
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3421606
Commit-Queue: Mason Freed <masonf@chromium.org>
Auto-Submit: Mason Freed <masonf@chromium.org>
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Xiaocheng Hu <xiaochengh@chromium.org>
Cr-Commit-Position: refs/heads/main@{#964784}

--

wpt-commits: 6ad4eb862ff51776df174efe8783fcf9f0c6658c
wpt-pr: 32583
2022-03-07 14:47:36 +00:00

39 lines
1.6 KiB
HTML

<!DOCTYPE html>
<html>
<head>
<title>HTML Test: element.outerHTML to verify XML fragment serialization algorithm</title>
<link rel="author" title="Intel" href="http://www.intel.com/">
<link rel="help" href="https://w3c.github.io/DOM-Parsing/#dfn-concept-serialize-xml">
<link rel="help" href="https://w3c.github.io/DOM-Parsing/#widl-Element-outerHTML">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="../../resources/common.js"></script>
</head>
<body>
<div id="log"></div>
<script>
test(function() {
var doc = document.implementation.createDocument(null, "");
assert_equals(doc.contentType, "application/xml");
var html_ns = "http://www.w3.org/1999/xhtml";
const non_void_elements = HTML5_ELEMENTS.filter(el => !HTML5_VOID_ELEMENTS.includes(el));
non_void_elements.forEach(function(ele) {
test(function() {
var e = doc.createElementNS(html_ns, ele);
assert_equals(e.outerHTML,
`<${ele} xmlns="${html_ns}"></${ele}>`,
ele + " node created." );
}, "Node for " + ele);
});
HTML5_VOID_ELEMENTS.forEach(function(ele) {
test(function() {
var e = doc.createElementNS(html_ns, ele);
assert_equals(e.outerHTML,
`<${ele} xmlns="${html_ns}" />`,
ele + " node created." );
}, "Node for " + ele);
});
}, document.title);
</script>
</body>
</html>