mirror of
https://github.com/HeyPuter/firefox.git
synced 2026-11-15 17:55:15 -10:00
Automatic update from web-platform-tests
Snap Border, Outline, and Column-Rule Widths before Layout
Chrome renders a 1 pixel gap
between a parent's border and a child's background,
when a sub pixel borders widths decimal value is
greater than or equal to 0.5.
This happens because
* the parent's size gets calculated at layout time with
the sub pixel values
* the child's position gets calculated based on the
parent's position and size
* the border width gets floored at paint time to just the whole value
This leaves a 1 pixel gap between
the last pixel in the parent's border and
the first pixel in the child's background.
This behavior is a regression introduced in:
https://chromium-review.googlesource.com/c/chromium/src/+/2199140
This CL is also reverting the subpixel border width behavior of
https://codereview.chromium.org/2640143005
Which changed Chrome to
"Use floor instead of round for decimal border widths"
with the intent to increase interop with Firefox and Safari
which both floor borders.
Previously Chrome was rounding the borders at Paint time,
avoiding the gaps between a parent's border and a child's background.
The proposed fix is to snap (floor) the borders widths before
layout, matching what Gecko and WebKit do.
Outline widths also use `ConvertBorderWidth` as their conversion
function and will also be snapped before layout.
While Column-Rule widths were already snapped before layout by
`StyleBuilderConverter::ConvertLineWidth`,
with this CL they will also use
`StyleBuilderConverter::ConvertBorderWidth`
in order to unify the snapping of widths behavior and code paths.
CSS isses:
https://github.com/w3c/csswg-drafts/issues/5210
https://github.com/w3c/csswg-drafts/issues/7473
R=pdr
Change-Id: Ib32ba28e4f193ba79f90f96771378abaf0c589a8
Bug: 1120347, 1201762
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/3717365
Reviewed-by: David Baron <[email protected]>
Reviewed-by: Philip Rogers <[email protected]>
Commit-Queue: Traian Captan <[email protected]>
Reviewed-by: Xianzhu Wang <[email protected]>
Owners-Override: Philip Rogers <[email protected]>
Cr-Commit-Position: refs/heads/main@{#1060652}
--
wpt-commits: 250c39d10718c061fa6640eeb6d64b66e0968681
wpt-pr: 36189