Bug 266919 - Add early return in 'prepareWhitespaceAtPositionForSplit' if there is no richly editable position
Summary: Add early return in 'prepareWhitespaceAtPositionForSplit' if there is no rich...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: HTML Editing (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2023-12-27 18:52 PST by Ahmad Saleem
Modified: 2024-01-02 10:23 PST (History)
3 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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>