Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /html/rendering/non-replaced-elements/flow-content-0/slot-element-default-display.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<title>CSS Test (Display): <slot> elements default display should be contents</title>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<body>
<script>
test(() => {
let host = document.body.appendChild(document.createElement("div"));
let slot = host.attachShadow({ mode: "open" }).appendChild(document.createElement("slot"));
let cs = getComputedStyle(slot);
assert_equals(cs.getPropertyValue("display"), "contents", "slot default display is not contents");
document.body.removeChild(host);
}, `slot element with default display should be contents`);
</script>