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