It'll be useful to avoid too much duplicated code when adding the free highlighting tool.
Fixes issue #17379.
The goal is to be able to get these outlines to fill the shape corresponding to a text selection in order to highlight some text contents. The outlines will be used either to show selected/hovered highlights.