Paint legends in vertical-rl fieldsets correctly.

Placed the code for calculating the fieldset border offset and cutout
rectangle for the legend in a separate file, to make it shareable with
LayoutNG (when fieldset eventually gets implemented there).

The test that's supposed to test this fails on Mac, due to sub-pixel
issues. The ref uses a table, and tables don't do sub-pixel layout.
The test (using fieldset-vertical.css) could have used
inline-size:fit-content instead of display:table to avoid this issue,
but it does use display:table, because "fit-content" isn't a supported
value in Gecko.

Bug: 476234
Cq-Include-Trybots: luci.chromium.try:linux_layout_tests_slimming_paint_v2;master.tryserver.blink:linux_trusty_blink_rel
Change-Id: I2b6faaecb1dbb609d0525881a1d164f7831e8759
Reviewed-on: https://chromium-review.googlesource.com/1222826
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Reviewed-by: Xianzhu Wang <wangxianzhu@chromium.org>
Reviewed-by: Emil A Eklund <eae@chromium.org>
Cr-Commit-Position: refs/heads/master@{#591120}
5 files changed