Make GetMappingUnitsForDOMRange clamp partially out-of-range units

GetMappingUnitsForDOMRange might return units that have partially out
of range, this change makes it modify those units so that all of them
are inside the range given.

Bug: 868227
Change-Id: I3223c27238630b4bbd15cdb6c269b543ef3d3f1f
Reviewed-on: https://chromium-review.googlesource.com/c/1436464
Reviewed-by: Xiaocheng Hu <xiaochengh@chromium.org>
Commit-Queue: Rakina Zata Amni <rakina@chromium.org>
Cr-Commit-Position: refs/heads/master@{#626011}
3 files changed