Bug 237376

Summary: Verify DOM and Render text lengths are in sync in RenderTextLineBoxes::dirtyRange()
Product: WebKit Reporter: Brandon <brandonstewart>
Component: Layout and RenderingAssignee: Brandon <brandonstewart>
Status: RESOLVED FIXED    
Severity: Normal CC: bfulgham, changseok, esprehn+autocc, ews-watchlist, glenn, kondapallykalyan, mmaxfield, pdr, simon.fraser, webkit-bug-importer, zalan
Priority: P2 Keywords: InRadar
Version: Other   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch
simon.fraser: review-, ews-feeder: commit-queue-
patch brandonstewart: commit-queue-

Description Brandon 2022-03-02 09:51:18 PST
<rdar://88813941>
Comment 1 Brandon 2022-03-02 09:58:05 PST
Created attachment 453630 [details]
Patch
Comment 2 Simon Fraser (smfr) 2022-03-02 11:03:19 PST
Comment on attachment 453630 [details]
Patch

View in context: https://bugs.webkit.org/attachment.cgi?id=453630&action=review

> Source/WebCore/rendering/RenderText.cpp:1297
> -    int delta = newText.length() - text().length();
> +    unsigned delta = std::abs(static_cast<int>(newText.length() - text().length()));

This doesn't seem right. dirtyRange() is written to accept negative delta values; see the assertion in offsetRun().

This clamping needs to be more nuanced somehow.
Comment 3 Brandon 2022-07-11 13:51:10 PDT
Created attachment 460797 [details]
patch
Comment 4 Brandon 2022-07-22 11:17:26 PDT
Pull request: https://github.com/WebKit/WebKit/pull/2660
Comment 5 EWS 2022-07-22 11:53:36 PDT
Committed 252736@main (22aafa30b9a2): <https://commits.webkit.org/252736@main>

Reviewed commits have been landed. Closing PR #2660 and removing active labels.