Source code
Revision control
Copy as Markdown
Other Tools
Test Info:
- This WPT test may be referenced by the following Test IDs:
- /selection/crashtests/selection-modify-extend-foward-line-across-video-in-html.html - WPT Dashboard Interop Dashboard
<!doctype html>
<html class="reftest-wait">
<head>
<meta charset="utf-8">
<script>
"use strict";
addEventListener("DOMContentLoaded", async () => {
const main1 = document.createElement("main");
const main2 = document.createElement("main");
const video = document.createElement("video");
const track = document.createElement("track");
video.appendChild(track);
video.appendChild(main2);
main1.appendChild(video);
document.documentElement.appendChild(main1);
const selection = getSelection();
selection.selectAllChildren(main1);
let count = 10;
let id = setInterval(async () => {
selection.collapseToStart();
selection.modify("extend", "forward", "line");
if (count-- == 0) {
clearInterval(id);
document.documentElement.removeAttribute("class");
}
}, 0);
});
</script>
</head>
</html>