Fieldset NG: Fix block-direction position of LEGEND
According to the legacy layout behavior, WebKit behavior, and Firefox behavior, margins of a LEGEND should not affect block-direction position of the LEGEND. The border-box of the LEGEND should be centered vertically in the top border of the FIELDSET. - We should compare the block-start border width of the FIELDSET and the block size of the LEGEND border-box. - Even if the block size of LEGEND border-box is smaller than the block-start border of the FIELDSET, block-end margin of the LEGEND can affect the position of the FIELDSET content box. This fixes legend-after-margin-with-before-border-horizontal-mode.html and legend-small-after-margin-before-border-horizontal-mode.html, and the major part of legend-block-margins-2.html. Test changes: * NGFieldsetLayoutAlgorithmTest.LegendBreakBeforeAvoid The test assumed a break happened in the block-start margin of a LEGEND. We ignore the block-start margin, and the test broke inside the LEGEND. Add 'break-inside:avoid' to avoid breaking inside the LEGEND. * NGFieldsetLayoutAlgorithmTest.MarginTopPastEndOfFragmentainer Removed. The test made sure that if a break happens inside the block-start margin of a LEGEND, the reaiming block-start margin was ignored. We ignore the block-start margin, so we can't test the behavior. Bug: 875235 Change-Id: I78db12c42d5d1d5a928b7871838a5330f4b6943a Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2331995 Commit-Queue: Kent Tamura <tkent@chromium.org> Reviewed-by:Morten Stenshorne <mstensho@chromium.org> Reviewed-by:
Alison Maher <almaher@microsoft.com> Cr-Commit-Position: refs/heads/master@{#794889}
Showing
Please register or sign in to comment