Linefeed seems to be not working correctly in contenteditable
Categories
(Core :: DOM: Editor, defect, P2)
Tracking
()
| Tracking | Status | |
|---|---|---|
| firefox120 | --- | fixed |
People
(Reporter: jjaschke, Assigned: jjaschke)
References
Details
Attachments
(2 files, 1 obsolete file)
This bug is part of fixing contenteditable for interop-2023.
Currently, a contenteditable with preformatted whitespace rules (pressing [Enter] should insert a \n, not a <br>) is showing wrong behaviour (a <br> is inserted instead of \n).
This condition seems to be incorrect. As a result, this condition evaluates to false and the code that inserts a line feed (and an additional line break if necessary) is never called.
| Assignee | ||
Comment 1•2 years ago
|
||
This patch is related to Bug 1840822, which fixes some issues
regarding additional invisible linebreaks needed at the end of
contenteditables.
This patch in particular fixes the case where the user
presses enter at the end of a pre-formatted
contenteditable, e.g.:
<span contenteditable style="display:block;white-space:pre-line">[]</span>
Prior to this patch, only one <br> was added,
the invisible padding linebreak was missing.
With this patch applied, the behaviour should be as expected:
<span contenteditable style="display:block;white-space:pre-line">\n<br></span>
Depends on D185935
Comment 2•2 years ago
|
||
Chrome inserts default paragraph separator even if the editing host cannot have
<div> nor <p> in the editing host.
I think that it's fine if a paragraph is at the insertion point and split it
because the web apps may create the invalid structure and the other browsers
works as so.
On the other hand, builtin editors should not create new invalid structure.
Therefore, if the editing host cannot have the paragraphs, inserting paragraph
should cause inserting <br> or \n.
Depends on D188908
Updated•2 years ago
|
Updated•2 years ago
|
| Assignee | ||
Comment 3•2 years ago
|
||
This patch is related to Bug 1840822, which fixes some issues
regarding additional invisible linebreaks needed at the end of
contenteditables.
This patch in particular fixes the case where the user
presses enter at the end of a pre-formatted
contenteditable, e.g.:
<span contenteditable style="display:block;white-space:pre-line">[]</span>
Prior to this patch, only one <br> was added,
the invisible padding linebreak was missing.
With this patch applied, the behaviour should be as expected:
<span contenteditable style="display:block;white-space:pre-line">\n<br></span>
Depends on D188937
Comment 6•2 years ago
|
||
| bugherder | ||
https://hg.mozilla.org/mozilla-central/rev/c4a3975cb52a
https://hg.mozilla.org/mozilla-central/rev/cbb65dd60bf7
Description
•