RESOLVED FIXED 234935
Inline blocks that contain text with min-width, box-sizing: border-box incorrectly include the border in width calculation
https://bugs.webkit.org/show_bug.cgi?id=234935
Summary Inline blocks that contain text with min-width, box-sizing: border-box incorr...
Oliver Byford
Reported 2022-01-06 13:26:52 PST
Created attachment 448530 [details] CodePen in Safari Technology Preview r137 Given a span that contains a single character, and the following CSS: span { display: inline-block; box-sizing: border-box; min-width: 50px; min-height: 50px; border: 10px solid; } Expected result: The box should be 50px wide and 50px high. Actual result: The box is 70px wide (because it includes the border width, as if using box-sizing: content-box) and 50px high. If the box does not contain any text, the width is calculated correctly. CodePen: https://codepen.io/36degrees/pen/GRMBpQE Bisected using bisect-builds -s 285788 -e 287707 --sanity-check Works: r286120 Fails: r286121 https://trac.webkit.org/r286121
Attachments
CodePen in Safari Technology Preview r137 (1.58 MB, image/png)
2022-01-06 13:26 PST, Oliver Byford
no flags
CodePen in Safari 15.1 (17612.2.9.1.20) (642.78 KB, image/png)
2022-01-06 13:27 PST, Oliver Byford
no flags
CodePen in Chrome 96 (1.52 MB, image/png)
2022-01-06 13:27 PST, Oliver Byford
no flags
Patch (5.29 KB, patch)
2022-01-07 12:01 PST, zalan
no flags
Patch (5.29 KB, patch)
2022-01-07 12:17 PST, zalan
no flags
Oliver Byford
Comment 1 2022-01-06 13:27:23 PST
Created attachment 448531 [details] CodePen in Safari 15.1 (17612.2.9.1.20)
Oliver Byford
Comment 2 2022-01-06 13:27:36 PST
Created attachment 448532 [details] CodePen in Chrome 96
Radar WebKit Bug Importer
Comment 3 2022-01-06 13:46:48 PST
zalan
Comment 4 2022-01-06 13:48:07 PST
oh you bisected it, awesome!!! Will fix it shortly.
Radar WebKit Bug Importer
Comment 5 2022-01-06 13:48:26 PST
Alexey Proskuryakov
Comment 6 2022-01-06 21:24:06 PST
zalan
Comment 7 2022-01-07 12:01:23 PST
Antti Koivisto
Comment 8 2022-01-07 12:15:59 PST
Comment on attachment 448617 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=448617&action=review > Source/WebCore/layout/formattingContexts/inline/InlineFormattingContext.cpp:172 > + , ceiledLayoutUnit(computedIntrinsicWidthForConstraint(IntrinsicWidthMode::Maximum)) odd comma placement
zalan
Comment 9 2022-01-07 12:17:44 PST
EWS
Comment 10 2022-01-07 13:18:04 PST
Committed r287779 (245839@main): <https://commits.webkit.org/245839@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 448618 [details].
Note You need to log in before you can comment on or make changes to this bug.