Files
sousa-gecko/testing/web-platform/tests/css/css-multicol/subpixel-column-progression.html
T
Morten Stenshorne d381558d43 Bug 2005577 [wpt PR 56688] - Avoid column progression subpixel inaccuracies., a=testonly
Automatic update from web-platform-tests
Avoid column progression subpixel inaccuracies.

We can use LayoutUnitDiffuser so that everything sums up nicely.

Update a WPT test that relied on the inaccuracies now fixed. With the
code changes in this CL, we would render identically to what Firefox
does, but that wasn't the expected result, even though it is better.
Rewrite the test to not rely on subpixel behavior.

Also update one unit test, which was using subpixels for no reason (and
relying on the results being inaccurate).

Rewrite css-multicol/multicol-width-ch-001.xht , to make it fit within
the viewport (it was much wider than 800px), not use XHTML, and use grid
in the ref, since that's hopefully more likely to match. Adding five
13ch width elements with 1ch between them is not guaranteed to be the
same as 69ch. Instead, use grid, and distribute 1ch to the "gaps" and
1fr for the five "columns". And use Ahem.

Bug: 467869214
Change-Id: I946d2cd39e78b987af402c43f29fff191634786b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/7251229
Reviewed-by: Ian Kilpatrick <ikilpatrick@chromium.org>
Commit-Queue: Morten Stenshorne <mstensho@chromium.org>
Cr-Commit-Position: refs/heads/main@{#1563919}

--

wpt-commits: 3efb92ad353b33381e9c87c57bc7600e6865d66c
wpt-pr: 56688
2026-01-06 15:19:36 +00:00

47 lines
1.6 KiB
HTML

<!DOCTYPE html>
<title>Element placed right after all columns (as specified by column-count)</title>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://issues.chromium.org/issues/467869214">
<style>
body { margin:0; }
</style>
<div style="columns:479; column-fill:auto; gap:0; width:100px; height:1px;">
<div style="height:479px;"></div>
<div id="elm1" style="height:1px;"></div>
</div>
<div style="columns:479; column-fill:auto; gap:0; width:100px; height:1px;">
<div style="height:958px;"></div>
<div id="elm2" style="height:1px;"></div>
</div>
<div style="columns:100; column-fill:auto; gap:1.01px; width:500px; height:1px;">
<div style="height:99px;"></div>
<div id="elm3" style="margin-left:auto; width:0; height:1px;"></div>
</div>
<div style="columns:100; column-fill:auto; gap:1.01px; width:0; height:1px;">
<div style="height:100px;"></div>
<div id="elm4" style="height:1px;"></div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> {
assert_equals(elm1.getBoundingClientRect().left, 100);
}, "Should be exactly to the right of the multicol container");
test(()=> {
assert_equals(elm2.getBoundingClientRect().left, 200);
}, "Should equal to two multicol container widths");
test(()=> {
assert_equals(elm3.getBoundingClientRect().left, 500);
}, "Fractional column gaps and widths");
test(()=> {
assert_equals(elm4.getBoundingClientRect().left, 101);
}, "No space for columns, only gaps");
</script>