gecko-dev/layout/base/tests/bug1634543-1.html
Emilio Cobos Álvarez 50168d214b Bug 1634543 - Fix caret baseline of a block with only empty lines. r=jfkthame
Even with the fix above, we get the caret baseline wrong because the
line is non-empty, but the baseline is all the way to the top.

Maybe an alternative to this would be to move the line-height hack to
the beginning of layout but that sounds a bit more fishy.

Otherwise we should do this more often, I suspect. I added one test that
fails because of nsInlineFrame... Anyhow probably follow-up material?

Depends on D73362

Differential Revision: https://phabricator.services.mozilla.com/D73363
2020-05-01 14:34:11 +00:00

26 lines
678 B
HTML

<!doctype html>
<html class="reftest-wait">
<title>Caret is correctly position for block whose only child is an abspos pseudo</title>
<script src="/tests/SimpleTest/SimpleTest.js"></script>
<style>
div:focus {
outline: 3px solid blue;
}
div::before {
content: "";
/* This is the point of the test */
position: absolute;
}
</style>
<div contenteditable="true" spellcheck="false"></div>
<script>
SimpleTest.waitForFocus(function() {
document.querySelector('[contenteditable="true"]').focus();
requestAnimationFrame(function() {
requestAnimationFrame(function() {
document.documentElement.removeAttribute("class");
});
});
});
</script>