Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /selection/cross-shadow-boundary-slot-2.html - WPT Dashboard Interop Dashboard
<!doctype html>
<head>
<link rel="match" href="cross-shadow-boundary-slot-1-ref.html"/>
</head>
<span id="outer">Outer</span>
<div>
<span id="slotted">Slotted</span>
<template shadowrootmode="open">
<slot></slot>
<span>Inner</span>
</template>
</div>
<script>
// Selected contents are:
// er
// Slot Inner
// In shadow including order, the shadow root is always before
// the light DOM elements, so setting the endpoint to "Slot" causes
// the "Inner" to be selected.
window.getSelection()
.setBaseAndExtent(outer.firstChild, 3, slotted.firstChild, 4);
</script>