blob: 95952b5cb36f20aa35ebe0a4ccfa517a7465a120 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<style>
img {
position: absolute;
top: 0;
left: 0;
}
</style>
</head>
<body>
<img src="../resources/green-400x400.png"></img>
<script>
addEventListener("load", () => {
const image = document.querySelector("img");
internals.installImageOverlay(image, [
{
topLeft : new DOMPointReadOnly(0, 0),
topRight : new DOMPointReadOnly(1, 0),
bottomRight : new DOMPointReadOnly(1, 0.5),
bottomLeft : new DOMPointReadOnly(0, 0.5),
children: [
{
text : "hello",
topLeft : new DOMPointReadOnly(0, 0),
topRight : new DOMPointReadOnly(1, 0),
bottomRight : new DOMPointReadOnly(1, 0.5),
bottomLeft : new DOMPointReadOnly(0, 0.5),
}
],
}
]);
getSelection().selectAllChildren(internals.shadowRoot(image).querySelector(".image-overlay-text"));
});
</script>
</body>
</html>