RESOLVED FIXED 218544
Remove more functions that implicitly use composed tree
https://bugs.webkit.org/show_bug.cgi?id=218544
Summary Remove more functions that implicitly use composed tree
Darin Adler
Reported 2020-11-03 16:21:39 PST
Remove more functions that implicitly use composed tree
Attachments
Patch (31.81 KB, patch)
2020-11-03 16:41 PST, Darin Adler
no flags
Patch (31.87 KB, patch)
2020-11-03 16:45 PST, Darin Adler
rniwa: review+
Darin Adler
Comment 1 2020-11-03 16:41:02 PST
Darin Adler
Comment 2 2020-11-03 16:45:26 PST
Darin Adler
Comment 3 2020-11-03 17:26:58 PST
Comment on attachment 413124 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=413124&action=review > Source/WebCore/editing/VisiblePosition.cpp:828 > + auto midpoint = checkedSum<uint64_t>(characterRange.location, characterRange.length / 2); > + if (midpoint.hasOverflowed()) > + return { }; Since these are actual computed sizes of a document already in memory, I don’t see any way we’d actually need checked arithmetic, so this should probably be changed to normal arithmetic.
Darin Adler
Comment 4 2020-11-04 11:37:32 PST
(In reply to Darin Adler from comment #3) > Since these are actual computed sizes of a document already in memory, I > don’t see any way we’d actually need checked arithmetic, so this should > probably be changed to normal arithmetic. Or I can write a separate midpoint function that takes a CharacterRange, and clamps end to the maximum value of uint64_t rather than treating it as an error. Should be safe/practical for our uses.
Darin Adler
Comment 5 2020-11-05 09:36:37 PST
Radar WebKit Bug Importer
Comment 6 2020-11-05 09:37:38 PST
Ryosuke Niwa
Comment 7 2021-04-07 19:27:28 PDT
*** Bug 217313 has been marked as a duplicate of this bug. ***
Note You need to log in before you can comment on or make changes to this bug.