Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: e60be43b44bb7a2a6dad763e6d73038aefb37ae6
      
https://github.com/WebKit/WebKit/commit/e60be43b44bb7a2a6dad763e6d73038aefb37ae6
  Author: Alan Baradlay <[email protected]>
  Date:   2026-04-13 (Mon, 13 Apr 2026)

  Changed paths:
    A LayoutTests/fast/flexbox/fieldset-as-flex-item-with-legend-expected.txt
    A LayoutTests/fast/flexbox/fieldset-as-flex-item-with-legend.html
    M Source/WebCore/rendering/RenderFlexibleBox.cpp
    M Source/WebCore/rendering/RenderFlexibleBox.h

  Log Message:
  -----------
  Fieldset with legend is too tall on first layout when it's a flex item
https://bugs.webkit.org/show_bug.cgi?id=311249
<rdar://problem/174301311>

Reviewed by Antti Koivisto.

A fieldset's legend adds extra "intrinsic border" to make room above
the CSS border. This is set during fieldset layout (layoutExcludedChildren).

When a fieldset is a flex item:
1. constructFlexLayoutItem reads border+padding (intrinsic border is 0)
2. computeFlexBaseSizeForFlexItem lays out the fieldset (intrinsic border 
becomes 16px)
3. The stale border+padding from step 1 is used for the flex base size

The fix removes the mainAxisBorderAndPadding parameter from
computeFlexBaseSizeForFlexItem. It now reads border+padding after layout,
and constructFlexLayoutItem reads it after the call too.

* LayoutTests/fast/flexbox/fieldset-as-flex-item-with-legend-expected.txt: 
Added.
* LayoutTests/fast/flexbox/fieldset-as-flex-item-with-legend.html: Added.
* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeFlexBaseSizeForFlexItem):
(WebCore::RenderFlexibleBox::constructFlexLayoutItem):
* Source/WebCore/rendering/RenderFlexibleBox.h:

Canonical link: https://commits.webkit.org/311078@main



To unsubscribe from these emails, change your notification settings at 
https://github.com/WebKit/WebKit/settings/notifications

Reply via email to