Bug 323711
| Summary: | Only a fieldset's rendered legend should shrink to fit | ||
|---|---|---|---|
| Product: | WebKit | Reporter: | Morne <morne> |
| Component: | Layout and Rendering | Assignee: | Nobody <webkit-unassigned> |
| Status: | NEW | ||
| Severity: | Normal | CC: | bfulgham, karlcow, simon.fraser, webkit-bug-importer, zalan |
| Priority: | P2 | Keywords: | InRadar |
| Version: | WebKit Nightly Build | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| See Also: |
https://bugs.webkit.org/show_bug.cgi?id=172718 https://bugs.webkit.org/show_bug.cgi?id=189650 https://bugs.webkit.org/show_bug.cgi?id=188643 https://bugs.webkit.org/show_bug.cgi?id=248087 |
||
Morne
WebKit sizes every <legend> to its content, not just the one its fieldset renders in the border.
RenderBox::sizesLogicalWidthToFitContent() groups HTMLLegendElement with input, select, button and textarea, so any legend with width:auto shrinks to fit. Per HTML only the rendered legend (the first in-flow <legend> child of a <fieldset>) is sized that way; any other legend is an ordinary block.
Steps:
1. Put <legend>hello</legend> directly in the body.
2. Compare its computed width to an identically styled <div>.
Expected: both fill the containing block.
Actual: the legend shrinks to its content, and is 0px wide when empty.
wpt.fyi for html/rendering/non-replaced-elements/the-fieldset-and-legend-elements/legend.html: Chrome 56/56, Firefox 56/56, Safari 49/56.
| Attachments | ||
|---|---|---|
| Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/186967632>
Morne
Pull request: https://github.com/WebKit/WebKit/pull/73516