Source code
Revision control
Copy as Markdown
Other Tools
<!doctype html>
<html class="reftest-wait">
<meta charset="utf-8">
<title>Bug 2076437: Caret after a `text-top` image follows the writing mode's default baseline</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<style>
@font-face {
font-family: Ahem;
src: url("Ahem.ttf");
}
div {
font: 20px/40px Ahem;
padding: 20px 0;
width: 200px;
outline: none;
}
img {
vertical-align: text-top;
width: 0;
height: 1em;
}
</style>
<div contenteditable="true" spellcheck="false">abc<img></div>
<script>
SimpleTest.waitForFocus(async function() {
await document.fonts.ready;
const div = document.querySelector("div");
div.focus();
getSelection().collapse(div, div.childNodes.length);
requestAnimationFrame(function() {
requestAnimationFrame(function() {
document.documentElement.removeAttribute("class");
});
});
});
</script>