Bug 237376 - Verify DOM and Render text lengths are in sync in RenderTextLineBoxes::dirtyRange()
Summary: Verify DOM and Render text lengths are in sync in RenderTextLineBoxes::dirtyR...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: Layout and Rendering (show other bugs)
Version: Other
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Brandon
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2022-03-02 09:51 PST by Brandon
Modified: 2022-07-22 11:53 PDT (History)
11 users (show)

See Also:


Attachments
Patch (3.21 KB, patch)
2022-03-02 09:58 PST, Brandon
simon.fraser: review-
ews-feeder: commit-queue-
Details | Formatted Diff | Diff
patch (941 bytes, patch)
2022-07-11 13:51 PDT, Brandon
brandonstewart: commit-queue-
Details | Formatted Diff | Diff

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