Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /container-timing/tentative/containertiming-with-child-svg-ignore.html - WPT Dashboard Interop Dashboard
<!DOCTYPE HTML>
<meta charset=utf-8>
<title>Container Timing: containertimingignore on an SVG element has no effect</title>
<body>
<style>
body {
margin: 0;
}
</style>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/container-timing/resources/container-timing-helpers.js"></script>
<script>
promise_test(async t => {
assert_implements(window.PerformanceContainerTiming, "PerformanceContainerTiming is not implemented");
const div = addContainerRoot(document.body, 'div_ct');
const svg = document.createElementNS(kSvgNS, 'svg');
svg.setAttribute('width', '100');
svg.setAttribute('height', '100');
svg.style.display = 'block';
const g = document.createElementNS(kSvgNS, 'g');
g.setAttribute('containertimingignore', '');
const image = document.createElementNS(kSvgNS, 'image');
image.id = 'svg_img_id';
image.setAttribute('href', '/container-timing/resources/square100.png');
image.setAttribute('width', '100');
image.setAttribute('height', '100');
g.appendChild(image);
svg.appendChild(g);
const beforeRender = performance.now();
div.appendChild(svg);
const entries = await getContainerEntries(t);
assert_equals(entries.length, 1);
const entry = entries[0];
checkContainerEntry(entry, 'div_ct', 'svg_img_id', beforeRender);
assert_equals(entry.rootElement, div);
checkContainerSize(entry, 10000);
}, 'containertimingignore on an SVG element does not stop propagation to an HTML container root.');
</script>
</body>