Re: [w3c/editing] Firefox: Cursor is misaligned on centered text with placeholder (Issue #501)

masayuki-nakano left a comment (w3c/editing#501)

Yeah, the position of caret in Firefox looks odd. On the other hand, I feel it's odd on Chrome too because the text is content of `::before` so that I feel that the caret should after the text. E.g., see this example:
```
data:text/html,<style>h3%3A%3Abefore { content%3A "before"; color%3A red } h3%3A%3Aafter { content%3A "after"; color%3A blue } h3 { text-align: center; }</style><div contenteditable><h3></h3></div>
```
The care is over the `::before` content since it's longer than `::after` so that the center of the `<h3>` is in `::before`. Additionally, once typing text in Chrome, caret moves between the pseudo-classes. So, the caret position is not inconsistent when there is no DOM child in the `<h3>`.

-- 
Reply to this email directly or view it on GitHub:
https://github.com/w3c/editing/issues/501#issuecomment-3644450187
You are receiving this because you are subscribed to this thread.

Message ID: <w3c/editing/issues/501/3644450187@github.com>

Received on Friday, 12 December 2025 01:00:58 UTC