Runt this: <fieldset style="height: min-content; border: solid cyan"> <legend>foo</legend> <div style="border: solid fuchsia">bar</div> </fieldset> The fieldset is not big enough, the contents overflow. Or run this: <fieldset id="target" style="height: min-content"> <legend>foo</legend> </fieldset> <script> console.log(getComputedStyle(target).height); </script> It logs -15.59375px, negative height! That's because RenderBox::computeIntrinsicLogicalContentHeightUsing uses if (intrinsicContentHeight && style().boxSizing() == BoxSizing::BorderBox) return intrinsicContentHeight.value() + borderAndPaddingLogicalHeight(); return intrinsicContentHeight; This logic should be moved into a virtual method, and override it in RenderBlock to take intrinsicBorderForFieldset() into account. Just like adjustBorderBoxLogicalHeightForBoxSizing and adjustIntrinsicLogicalHeightForBoxSizing.
Created attachment 459312 [details] Patch
This patch modifies the imported WPT tests. Please ensure that any changes on the tests (not coming from a WPT import) are exported to WPT. Please see https://trac.webkit.org/wiki/WPTExportProcess
Comment on attachment 459312 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=459312&action=review > Source/WebCore/rendering/RenderBox.cpp:3269 > return intrinsicContentHeight; After the refactoring, this could just be return std::nullopt, and I think itβs clearer that way.
Committed r294275 (250621@main): <https://commits.webkit.org/250621@main> All reviewed patches have been landed. Closing bug and clearing flags on attachment 459312 [details].
<rdar://problem/93378304>