Add slot default display style test (#37189)

Add `<slot>` default display style testcase

Testing: Add a new testcase for slot element default disply style.
Fixes: Add slot default display style test for #37174

---------

Signed-off-by: kongbai1996 <1782765876@qq.com>
Signed-off-by: Fuguo <1782765876@qq.com>
Co-authored-by: Euclid Ye <yezhizhenjiakang@gmail.com>
This commit is contained in:
Fuguo 2025-05-30 16:13:07 +08:00 committed by GitHub
parent 871630606f
commit 5de3b5d166
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 25 additions and 0 deletions

View file

@ -727275,6 +727275,13 @@
{}
]
],
"slot-element-default-display.html": [
"825efaa1a97d898c9cb2b7db1c18b3213c8ed214",
[
null,
{}
]
],
"slot-element-focusable.tentative.html": [
"b6d2449e890b31a9fc50712422c0dbca5e3e33a0",
[

View file

@ -0,0 +1,18 @@
<!DOCTYPE html>
<title>CSS Test (Display): <slot> elements default display should be contents</title>
<link rel="help" href="https://html.spec.whatwg.org/multipage/rendering.html#flow-content-3">
<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>