Closed Bug 1949151 Opened 14 days ago Closed 2 days ago

Block-direction borders of an orthogonal child result in incorrect sizing of the parent

Categories

(Core :: Layout, defect)

defect

Tracking

()

RESOLVED FIXED
138 Branch
Tracking Status
firefox138 --- fixed

People

(Reporter: jfkthame, Assigned: jfkthame)

References

(Blocks 2 open bugs)

Details

Attachments

(3 files)

See testcase. The red <div> should be exactly as tall as its green (orthogonal) child, but is incorrectly extended by the height of the child's top/bottom borders.

Note that in contrast to bug 1949148 and bug 1949149, zooming does NOT "fix" the rendering here; the layout is stable (but wrong).

See Also: → 1949153

The parent block here ends up with the wrong size because we end up in the IntrinsicForAxis codepath that uses the child's block-size (which may not be correct yet, but that issue is bug 1949148), but then having assigned the block-size to result, we later end up adding offsets for the margins/borders/padding -- but the block's rect already included its borders and padding, so in effect they're being doubled.

Hence, ignoring the cases where the child's size is not yet set, or out-of-date (see bug 1949148 and bug 1949149), the "stable" layout we end up with has the parent incorrectly sized.

To avoid this, we should subtract the border/padding amounts from the child's BSize() before using it as the basis of the result here.

This corrects the rendering of the example here; a WPT reftest version
of the test is added in following patch.

(There are a number of existing layout tests in css/css-writing-modes
that are also impacted, but still fail for the time being due to
bug 1949148.)

Assignee: nobody → jfkthame
Status: NEW → ASSIGNED
Pushed by jkew@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/e945f6e2e27c Don't double-account for borders and padding when getting an orthogonal flow's intrinsic block size. r=dshin https://hg.mozilla.org/integration/autoland/rev/e91bff5f1b5e Add a WPT reftest for intrinsic sizing with an orthogonal child that has borders. r=dshin
Created web-platform-tests PR https://github.com/web-platform-tests/wpt/pull/51046 for changes under testing/web-platform/tests
Status: ASSIGNED → RESOLVED
Closed: 2 days ago
Resolution: --- → FIXED
Target Milestone: --- → 138 Branch
Upstream PR merged by moz-wptsync-bot
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: