Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /dom/nodes/ParentNode-querySelector-svg-not-root.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>svg:not(:root) in a HTML document</title>
<meta charset="utf-8">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<rect width="1" height="2" x="0" fill="#008d46" />
<rect width="1" height="2" x="1" fill="#ffffff" />
<rect width="1" height="2" x="2" fill="#d2232c" />
</svg>
<script>
"use strict";
test(() => {
const theSvg = document.getElementById("the-svg");
assert_not_equals(theSvg, null, "precondition check: getElementById works");
assert_equals(document.querySelector("svg:not(:root)"), theSvg);
});
</script>