servo/tests/unit
bors-servo f24f517965
Auto merge of #23272 - tdelacour:ISSUE-20455, r=SimonSapin
ISSUE-20455: introduce stronger types for textinput indexing

<!-- Please describe your changes on the following line: -->
Added two new types:
- ByteOffset
- UTF16CodeUnitOffset

I've replaced any instance of `usize` that would be better represented by one or the other of these. I also updated any downstream code, including the unit tests for `textinput.rs`. Along the way, I tried to add or edit comments to better reflect my understanding of this file - happy to revisit if I have misrepresented anything.

I did not end up finding any places where types were very obviously being mixed, as the issue description suggested I should do... LMK if I should re-audit the file for that (might need a bit of guidance)!

---
<!-- Thank you for contributing to Servo! Please replace each `[ ]` by `[X]` when the step is complete, and replace `___` with appropriate data: -->
- [X] `./mach build -d` does not report any errors
- [X] `./mach test-tidy` does not report any errors
- [X] These changes fix #20455 (GitHub issue number if applicable)

<!-- Either: -->
- [X] There are tests for these changes OR
- [ ] These changes do not require tests because ___

<!-- Also, please make sure that "Allow edits from maintainers" checkbox is checked, so that we can help you if you get stuck somewhere along the way.-->

<!-- Pull requests that do not address these steps are welcome, but they will require additional verification as part of the review process. -->

<!-- Reviewable:start -->
---
This change is [<img src="https://reviewable.io/review_button.svg" height="34" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/23272)
<!-- Reviewable:end -->
2019-05-23 12:01:29 -04:00
..
deny_public_fields Update MPL license to https (part 5) 2018-11-27 19:09:17 +01:00
malloc_size_of Update MPL license to https (part 5) 2018-11-27 19:09:17 +01:00
metrics Update MPL license to https (part 5) 2018-11-27 19:09:17 +01:00
profile Update MPL license to https (part 5) 2018-11-27 19:09:17 +01:00
script ISSUE-20455: introduce stronger types for textinput indexing 2019-05-16 15:33:24 -04:00
script_plugins Update MPL license to https (part 5) 2018-11-27 19:09:17 +01:00
style Revert "Glutin update: dependencies update" 2019-05-22 14:18:38 -04:00