Branch: refs/heads/main
  Home:   https://github.com/WebKit/WebKit
  Commit: 0cccc0f3cab860f3fbd272dfa7015c0097f58509
      
https://github.com/WebKit/WebKit/commit/0cccc0f3cab860f3fbd272dfa7015c0097f58509
  Author: Alan Baradlay <[email protected]>
  Date:   2026-05-25 (Mon, 25 May 2026)

  Changed paths:
    M Source/WebCore/rendering/RenderFlexibleBox.cpp
    M Source/WebCore/rendering/RenderFlexibleBox.h

  Log Message:
  -----------
  [cleanup] Refactor RenderFlexibleBox::computeFlexItemMinMaxSizes into 
spec-aligned helpers
https://bugs.webkit.org/show_bug.cgi?id=315423

Reviewed by Antti Koivisto.

Split the ~75-line monolith into four functions, each named after the spec
section it implements:

- computeUsedMaxMainSize (CSS Flexbox section 6, max main size)
- computeUsedNonAutoMinMainSize (CSS Flexbox section 6, non-auto cases)
- computeContentBasedMinMainSize (CSS Flexbox section 4.5, content-based min)
- computeFlexItemMinMaxMainSizes (dispatcher, returns the used min/max pair)

Reordered the main function so the auto-equivalent check
(useContentBasedMinimumSize) runs first, which lets the second branch collapse
to !min.isAuto() and the fall-through to the spec's "automatic minimum size is
zero for scroll containers" rule.

* Source/WebCore/rendering/RenderFlexibleBox.cpp:
(WebCore::RenderFlexibleBox::computeMainAxisExtentForFlexItem):
(WebCore::RenderFlexibleBox::computeUsedMaxMainSize):
(WebCore::RenderFlexibleBox::computeUsedNonAutoMinMainSize):
(WebCore::RenderFlexibleBox::computeContentBasedMinMainSize):
(WebCore::RenderFlexibleBox::computeFlexItemMinMaxMainSizes):
(WebCore::RenderFlexibleBox::constructFlexLayoutItem):
(WebCore::RenderFlexibleBox::computeFlexItemMinMaxSizes): Deleted.
* Source/WebCore/rendering/RenderFlexibleBox.h:

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



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

Reply via email to