Bug 181719 - Trailing space disappears when it occurs at the end of an long line
Summary: Trailing space disappears when it occurs at the end of an long line
Status: RESOLVED DUPLICATE of bug 156657
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: Safari 11
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2018-01-16 22:30 PST by Mihai Parparita
Modified: 2022-07-27 19:18 PDT (History)
6 users (show)

See Also:


Attachments
Test case (1.37 KB, text/html)
2018-01-16 22:30 PST, Mihai Parparita
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mihai Parparita 2018-01-16 22:30:24 PST
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).
Comment 1 Ahmad Saleem 2022-07-26 14:56:59 PDT
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!
Comment 2 Radar WebKit Bug Importer 2022-07-26 15:00:21 PDT
<rdar://problem/97630616>
Comment 3 Alexey Proskuryakov 2022-07-27 19:18:28 PDT

*** This bug has been marked as a duplicate of bug 156657 ***