| Summary: | computeIntrinsicLogicalContentHeightUsing doesn't take intrinsicBorderForFieldset() into account | ||||||
|---|---|---|---|---|---|---|---|
| Product: | WebKit | Reporter: | Oriol Brufau <obrufau> | ||||
| Component: | CSS | Assignee: | Oriol Brufau <obrufau> | ||||
| Status: | RESOLVED FIXED | ||||||
| Severity: | Normal | CC: | changseok, clopez, darin, esprehn+autocc, ews-watchlist, glenn, kondapallykalyan, pdr, webkit-bug-importer, youennf | ||||
| Priority: | P2 | Keywords: | InRadar | ||||
| Version: | WebKit Nightly Build | ||||||
| Hardware: | Unspecified | ||||||
| OS: | Unspecified | ||||||
| See Also: | https://github.com/web-platform-tests/wpt/pull/34061 | ||||||
| Bug Depends on: | |||||||
| Bug Blocks: | 240068 | ||||||
| Attachments: |
|
||||||
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]. |
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.