Bug 248387

Summary: [iOS] Double-space to insert period is not working in a contenteditable paragraph
Product: WebKit Reporter: ocavue
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: Safari 16   
Hardware: iPhone / iPad   
OS: iOS 16   
Attachments:
Description Flags
The HTML file to reproduce this bug none

Description ocavue 2022-11-28 01:30:04 PST
Created attachment 463752 [details]
The HTML file to reproduce this bug

## Bug description 

On iOS Safari, when I have multiple paragraphs in a `<div contenteditable="true">` element, double-spaces to insert a period doesn't work well. 

## Reproduce steps 

- Use a web server to serve the `index.html`. You can find the source code of `index.html` at this [link](https://gist.github.com/ocavue/8d4139c40096cfa08780dc6d18f30e1c).
- Open this file with Safari on macOS and iOS.
- Put the cursor at the end the first `paragraph element.`. 
- Type a space, then a word, then two spaces. 

## Expected behavior

Double-pressing spaces to period works in both blue and red area. 

## Actual behavior 

iOS Safari only works in the blue area. Mac Safari works on both two areas. Particularly, on iOS, the first and second paragraph doesn't work, but the third (last) paragraph works well. 

The following two videos show the behavior on iOS and on macOS. 

https://user-images.githubusercontent.com/24715727/204239949-247aee00-3abc-418a-ab1b-f1aa02faa4db.MP4

https://user-images.githubusercontent.com/24715727/204240408-c92e569c-ca59-428b-a657-7e6d11c93b20.mp4

## Version 

- iOS: 16.1.1
- macOS: 12.6; Safari Version 16.1 (17614.2.9.1.13, 17614)
Comment 1 Radar WebKit Bug Importer 2022-12-05 01:31:16 PST
<rdar://problem/102973289>