Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 6 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /css/selectors/heading-prefixed.html - WPT Dashboard Interop Dashboard
<!doctype html>
<meta charset=utf-8>
<title>:heading(N) matches prefixed HTML headings</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<div id="host"></div>
<script>
for (let level = 1; level <= 6; level++) {
test(t => {
const el = document.createElementNS(xhtml, `h:h${level}`);
document.getElementById("host").append(el);
t.add_cleanup(() => el.remove());
assert_true(el.matches(`:heading(${level})`), `:heading(${level}) matches`);
assert_true(el.matches(":heading"), ":heading matches");
}, `:heading(${level}) matches <h:h${level}> in the HTML namespace`);
}
</script>