Use `U+000A`(`LF`) instead of `<br>` when `contenteditable=plaintext-only` and the line breakers are preformatted by `white-space`
Categories
(Core :: DOM: Editor, defect)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox135 | --- | fixed |
People
(Reporter: masayuki, Assigned: masayuki)
References
(Depends on 1 open bug, Blocks 2 open bugs)
Details
(Keywords: parity-chrome, parity-safari, webcompat:platform-bug)
Attachments
(3 files)
Chrome loves linefeed characters instead of <br> in contenteditable. Changing the behavior for contenteditable=true might be risky. I think that we should change our behavior only for contenteditable=plaintext-only first.
However, probably we need to change the behavior of inserting padding <br> for empty editor and last line since web apps do not assume linefeed and <br>s are mixed in same editing host.
| Assignee | ||
Comment 1•1 year ago
|
||
Ah, textContent does not convert <br> to \n. So, it might be important to support this.
It seems that it's okay to use <br> for empty paragraph. It's same as Chrome and Safari. However, they delete the padding <br> at typing something. We should follow it.
| Assignee | ||
Comment 2•1 year ago
|
||
When inserting a preformatted linefeed, Chrome inserts a Text which has only
a linefeed instead of inserting the linefeed to existing Text. This allows
to keep Text smaller. So, let's follow the behavior.
Depends on D231663
Updated•1 year ago
|
| Assignee | ||
Comment 3•1 year ago
|
||
Depends on D231664
| Assignee | ||
Comment 4•1 year ago
|
||
Currently, only the "insert line break" handler uses a preformatted linefeed
instead of <br> if it's better. However, in contenteditable="plaintext-only", we should use preformatted linefeeds in most cases. Therefore, we should make them call the inserters with the GetPreferredLineBreak` result.
Depends on D231665
Updated•1 year ago
|
https://hg.mozilla.org/mozilla-central/rev/3c5c29d73626
https://hg.mozilla.org/mozilla-central/rev/e2ea5020019f
https://hg.mozilla.org/mozilla-central/rev/f1683312c60f
Description
•