Bug 248366

Summary: Don't inherit block style if text is inserted after paragraph selection
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: karlcow, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: BrowserCompat, InRadar
Version: Safari Technology Preview   
Hardware: Unspecified   
OS: Unspecified   

Description Ahmad Saleem 2022-11-26 16:21:38 PST
Hi Team,

I was not able to find this bug and Safari 16.1 and Technology Preview 158 both are failing this test while Firefox as well.

Test Case Failing - https://jsfiddle.net/epsyfc2q/show

Blink Commit - https://src.chromium.org/viewvc/blink?view=revision&revision=170157

Webkit GitHub Source - https://github.com/WebKit/WebKit/blob/65da5f9b2e68fb35c7e4e43b77281d005180d4ce/Source/WebCore/editing/DeleteSelectionCommand.cpp#L508 & https://github.com/WebKit/WebKit/blob/65da5f9b2e68fb35c7e4e43b77281d005180d4ce/Source/WebCore/editing/InsertTextCommand.cpp#LL144

Just want to raise this bug for future so if needed, this can be fixed.

Thanks!
Comment 1 Karl Dubost 2022-11-27 19:01:11 PST
fwiw, the test is failing everywhere.

WebKit:
```
FAIL container.innerHTML should be <p style="text-indent: 3em;"><span>aBar</span></p>. Was <p style="text-indent: 0px;"><span>aBar</span></p>.
```


Gecko:
```
TEST COMPLETE
FAIL container.innerHTML should be <p style="text-indent: 3em;"><span>aBar</span></p>. Was <p>a</p><p style="text-indent: 3em;"><span>Bar</span></p>.
```


Blink:
```
PASS container.innerHTML is "<p style=\"text-indent: 3em;\"><span>aBar</span></p>"
```
Comment 2 Radar WebKit Bug Importer 2022-11-27 19:01:23 PST
<rdar://problem/102701248>
Comment 3 Karl Dubost 2022-11-27 19:01:57 PST
(In reply to Karl Dubost from comment #1)
> fwiw, the test is failing everywhere.

doh! The test is failing only in Gecko and WebKit and differently.