Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/canvas/element/manual/draw-element-image/layout-canvas-children.tentative.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<meta charset="utf-8">
<title>Canvas.drawElementImage: layoutsubtree tests</title>
<link rel="author" href="mailto:khushalsagar@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<style>
#child {
width: 100px;
height: 100px;
}
#parent {
width: 100px;
height: 100px;
background: grey;
}
</style>
<canvas id=parent layoutsubtree>
<div id=child></div>
</canvas>
<script>
promise_test(async () => {
let child = document.getElementById('child');
assert_equals(child.clientWidth, 100);
let parent = document.getElementById('parent');
parent.layoutSubtree = false;
assert_equals(child.clientWidth, 0);
}, 'canvas children have layout');
</script>