text: Speed up `offset_for_anchor` and `fragment_id_for_anchor` conversions (#46989)

And most importantly, speed `Anchor::cmp` by doing so.

Release Notes:

- N/A *or* Added/Fixed/Improved ...
d092f3a41bLukas Wirth committed on 1/16/2026, 3:23:57 PM· committed by GitHubparentdeb1b6e
5 files changedLine totals unavailable