Created attachment 331468 [details] Test case See attached test case (also available at http://persistent.info/webkit/test-cases/content-editable-wrap-trailing-space.html) The space disappears when the current line is as wide as the editable area, and the space causes it to start wrapping. The "word-wrap: break-word;" property for all contentEditable elements appears to be implicated, overriding it to "word-wrap: normal" causes the bug to go away. Reproduced in Safari 11.0.2 on High Sierra and an archive build at r227011 (the oldest builds I could find also had the bug, so this is not a recent regression).
I am able to reproduce this bug in Safari 15.6 on macOS 12.5 using attached test case and it shows following: beforeinput content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaax' input content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaax<nbsp>' beforeinput content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaax<nbsp>' input content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaaxa' <<<<< (NOT SPACE) *** Firefox Nightly 104 **** beforeinput content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaax' input content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaax ' beforeinput content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaax ' input content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaax a' <<< SPACE before 'a' *** Chrome Canary 106 *** beforeinput content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaax' input content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaax<nbsp>' beforeinput content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaax<nbsp>' input content: 'aaaaiiiiaaaaaaaaaaaaaaaaaaaaaaaaaaax a' <<<< SPACE before 'a' ________ Let me know if I am testing incorrectly. Thanks!
<rdar://problem/97630616>
*** This bug has been marked as a duplicate of bug 156657 ***