Bug 1735446 - part 4: Make Selection::GetRangeAt() take uint32_t instead of int32_t r=smaug
It's an internal API corresponding to `Selection.getRangeAt` DOM API. I think that it should use `uint32_t` rather than `size_t` because of the consistency with the DOM API and `Selection::RangeCount()`. This patch fixes all callers of `GetRangeAt()`, and rewrites it with ranged- loops unless original ones do not refer `RangeCount()` every time and may run script in the loop. Differential Revision: https://phabricator.services.mozilla.com/D128848
This commit is contained in:
@@ -2931,6 +2931,7 @@ NS_IMETHODIMP HTMLEditor::JoinTableCells(bool aMergeNonContiguousContents) {
|
||||
// Cleanup selection: remove ranges where cells were deleted
|
||||
uint32_t rangeCount = SelectionRef().RangeCount();
|
||||
|
||||
// TODO: Rewriting this with reversed ranged-loop may make it simpler.
|
||||
RefPtr<nsRange> range;
|
||||
for (uint32_t i = 0; i < rangeCount; i++) {
|
||||
range = SelectionRef().GetRangeAt(i);
|
||||
|
||||
Reference in New Issue
Block a user