-
Notifications
You must be signed in to change notification settings - Fork 3.1k
Does <legend> element establish a new BFC? #2519
Description
In HTML5 spec said:
The `<fieldset>` element is expected to establish a new block formatting context.
What about the legend element?
Chrome and Safari will establish a BFC, see Blink code.
bool LayoutBox::AvoidsFloats() const {
// crbug.com/460704: This should be merged with createsNewFormattingContext().
return ShouldBeConsideredAsReplaced() || HasOverflowClip() || IsHR() ||
IsLegend() || IsWritingModeRoot() || IsFlexItemIncludingDeprecated() ||
Style()->GetColumnSpan() == kColumnSpanAll ||
Style()->ContainsPaint() || Style()->ContainsLayout() ||
Style()->Display() == EDisplay::kFlowRoot;
}I think the specification should be clear, to avoid incompatibility between browsers.
Summary for this issue:
PR for the standard: #2718
web-platform-tests: web-platform-tests/wpt#6125
Browser bugs:
https://bugs.chromium.org/p/chromium/issues/detail?id=727378
https://bugzilla.mozilla.org/show_bug.cgi?id=1368723
https://bugs.webkit.org/show_bug.cgi?id=172718
https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/12174566/

