Bug 266919

Summary: Add early return in 'prepareWhitespaceAtPositionForSplit' if there is no richly editable position
Product: WebKit Reporter: Ahmad Saleem <ahmad.saleem792>
Component: HTML EditingAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: rniwa, webkit-bug-importer, wenson_hsieh
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Ahmad Saleem 2023-12-27 18:52:34 PST
Hi Team,

While looking into HTML Editing code in Blink, I noticed that they have early return for 'prepareWhitespaceAtPositionForSplit'.

Blink Commit: https://source.chromium.org/chromium/chromium/src/+/main:third_party/blink/renderer/core/editing/commands/composite_edit_command.cc;l=814;drc=3adc67dbb288622b53c188b0858ec898626998ae

WebKit Source: https://searchfox.org/wubkat/rev/2cb2f84b68df8a519e252d535de43e7d19567883/Source/WebCore/editing/CompositeEditCommand.cpp#977

Following compiles:

 if (!isRichlyEditablePosition(position))
        return;

___

I don't have any benchmark or test cases run through above change but it does not seems like bad idea.

Thanks!
Comment 1 EWS 2024-01-02 10:22:11 PST
Committed 272570@main (77a2ca7c64f9): <https://commits.webkit.org/272570@main>

Reviewed commits have been landed. Closing PR #22254 and removing active labels.
Comment 2 Radar WebKit Bug Importer 2024-01-02 10:23:14 PST
<rdar://problem/120376672>