Files
sousa-gecko/testing/web-platform/tests/css/css-break/table/table-parts-offsetheight.html
T
Morten Stenshorne 335bd789ca Bug 1965799 [wpt PR 52462] - offsetWidth and offsetHeight to use bounding boxes of fragments.,
Automatic update from web-platform-tests
offsetWidth and offsetHeight to use bounding boxes of fragments.

Change offsetWidth and offsetHeight so that they use the bounding box of
all fragments that the node generates. This is what the spec says here:
https://drafts.csswg.org/cssom-view/#extensions-to-the-htmlelement-interface

This was already working for line-wrapping inlines, but not with block
fragmentation. Fix it for LayoutInline, LayoutBox, and (tada!)
LayoutTableColumn. Also add some notes to a couple of functions in
LayoutInline which cannot possibly behave correctly with block
fragmentation (not new).

Depends on runtime feature LayoutBoxVisualLocation.

Updated quite a few block fragmentation tests, which assumed that
offsetWidth and offsetHeight would be in the stitched "flow-thread"
coordinate system (and not simply the bounding box of all fragments). I
don't think I found any test for inlines that both get inline-fragmented
AND block-fragmented, so added a test for that.

Another test started failing because of this change. But it has in fact
been a bug for some time already (since LayoutNG got introduced, from
the looks of it), just that the method of testing didn't catch it. This
should have been a reftest. See crbug.com/394900337 for full story.

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

--

wpt-commits: ada437b67a16745e6724db1b5559169d19c96b4e
wpt-pr: 52462

Differential Revision: https://phabricator.services.mozilla.com/D249358
2025-05-14 16:00:03 +00:00

30 lines
1.4 KiB
HTML

<!DOCTYPE html>
<link rel="author" title="Morten Stenshorne" href="mailto:mstensho@chromium.org">
<link rel="help" href="https://www.w3.org/TR/css-break-3/#box-splitting">
<link rel="help" href="https://www.w3.org/TR/cssom-view/#extensions-to-the-htmlelement-interface">
<div style="columns:3; column-fill:auto; height:70px; background:yellow;">
<div id="table" style="display:table; border-spacing:7px; border:2px solid; padding:1px;">
<div id="colgroup" style="display:table-column-group;">
<div id="col" style="display:table-column;"></div>
</div>
<div id="rowgroup" style="display:table-row-group;">
<div id="row" style="display:table-row;">
<div id="cell" style="display:table-cell;">
<div id="content" style="width:100px; height:100px; background:blue;"></div>
</div>
</div>
</div>
</div>
</div>
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script>
test(()=> { assert_equals(table.offsetHeight, 70); }, "table");
test(()=> { assert_equals(colgroup.offsetHeight, 70); }, "colgroup");
test(()=> { assert_equals(col.offsetHeight, 70); }, "col");
test(()=> { assert_equals(rowgroup.offsetHeight, 70); }, "rowgroup");
test(()=> { assert_equals(row.offsetHeight, 70); }, "row");
test(()=> { assert_equals(cell.offsetHeight, 70); }, "cell");
test(()=> { assert_equals(content.offsetHeight, 70); }, "content");
</script>