Bug 1738134 Comment 8 Edit History

Note: The actual edited comment in the bug view page will always show the original commenter’s name and original timestamp.

The reason why the text is inserted before the `<br>` element is, [editor adjusts caret before invisible `<br>` element before inserting text](https://searchfox.org/mozilla-central/rev/a9e0a3f5e5f7cde941d419db967997aaa1f06b0f/editor/libeditor/HTMLEditSubActionHandler.cpp#818-826).

However, if I write WPT with `data:text/html,<div contenteditable style="white-space:pre-wrap">a<br><span style="padding:1px"></span></div>`, Chrome also inserts new text the `<br>` element. So, restoring the original behavior restores incompatible behavior too. So we should not change the behavior for the other web apps.
The reason why the text is inserted before the `<br>` element is, [editor adjusts caret before invisible `<br>` element before inserting text](https://searchfox.org/mozilla-central/rev/a9e0a3f5e5f7cde941d419db967997aaa1f06b0f/editor/libeditor/HTMLEditSubActionHandler.cpp#818-826).

However, if I write WPT with `data:text/html,<div contenteditable style="white-space:pre-wrap">a<br><span style="padding:1px"></span></div>`, Chrome also inserts new text before the `<br>` element. So, restoring the original behavior restores incompatible behavior too. So we should not change the behavior for the other web apps.

Back to Bug 1738134 Comment 8