Let the embedder control pending tasks - #13
Merged
Merged
Conversation
springmin
pushed a commit
to springmin/WebKit
that referenced
this pull request
Aug 3, 2026
…s' per-flex-item static helpers https://bugs.webkit.org/show_bug.cgi?id=320019 Reviewed by Antti Koivisto. The per-item static helpers in FlexFormattingUtils took the flex container as an explicit (const RenderFlexibleBox&, const RenderBox& flexItem) pair, even though a flex item's parent is always the flex container. Drop the container argument from these twelve statics and derive it internally from the item's parent, mirroring what ScopedCrossAxisOverrideForFlexItem already does: auto& flexBox = downcast<RenderFlexibleBox>(*flexItem.parent()); The two that only forwarded the container to other statics (useContentBasedMinimumSize, flexBasisForFlexItem) no longer need it at all. All callers drop the container argument: the utils' own static-to-static calls and instance forwarders, RenderFlexibleBox's proxies and ScopedCrossAxisOverrideForFlexItem, and LayoutIntegration::FlexLayout (its positioned flex items are direct out-of-flow children, so their parent is the container too). The container-only statics (isColumnFlow, isHorizontalFlow, computeGap, ...) still take it. Also correct the cross-axis step comments in FlexFormattingContext::layout(): they labelled a section "9.6 (oven-sh#13 - oven-sh#16)" although the block also runs the §9.4 steps (oven-sh#9, dependency around the container's used-cross-size finalization (oven-sh#15), not by spec number, so the comment now says so. No change in behavior. * Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp: (WebCore::FlexFormattingContext::layout): * Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.cpp: (WebCore::FlexFormattingUtils::crossAxisMarginExtentForFlexItem): (WebCore::FlexFormattingUtils::preferredMainSizeLengthForFlexItem): (WebCore::FlexFormattingUtils::minMainSizeLengthForFlexItem): (WebCore::FlexFormattingUtils::preferredCrossSizeLengthForFlexItem): (WebCore::FlexFormattingUtils::mainAxisOverflowForFlexItem): (WebCore::FlexFormattingUtils::hasAutoMarginsInCrossAxis): (WebCore::FlexFormattingUtils::useContentBasedMinimumSize): (WebCore::FlexFormattingUtils::preferredAspectRatioForFlexItem const): (WebCore::FlexFormattingUtils::needToStretchFlexItemLogicalHeight const): (WebCore::FlexFormattingUtils::innerCrossSizeForFlexItem): (WebCore::FlexFormattingUtils::availableAlignmentSpaceForFlexItem const): (WebCore::FlexFormattingUtils::marginBoxAscentForFlexItem const): (WebCore::FlexFormattingUtils::mainAxisIsFlexItemInlineAxis): (WebCore::FlexFormattingUtils::flexBasisForFlexItem): (WebCore::FlexFormattingUtils::alignmentForFlexItem): (WebCore::FlexFormattingUtils::hasDefiniteCrossSizeForFlexItem): (WebCore::FlexFormattingUtils::crossAxisMarginExtentForFlexItem const): (WebCore::FlexFormattingUtils::preferredMainSizeLengthForFlexItem const): (WebCore::FlexFormattingUtils::minMainSizeLengthForFlexItem const): (WebCore::FlexFormattingUtils::preferredCrossSizeLengthForFlexItem const): (WebCore::FlexFormattingUtils::hasAutoMarginsInCrossAxis const): (WebCore::FlexFormattingUtils::useContentBasedMinimumSize const): (WebCore::FlexFormattingUtils::innerCrossSizeForFlexItem const): (WebCore::FlexFormattingUtils::mainAxisIsFlexItemInlineAxis const): (WebCore::FlexFormattingUtils::flexBasisForFlexItem const): (WebCore::FlexFormattingUtils::alignmentForFlexItem const): (WebCore::FlexFormattingUtils::hasDefiniteCrossSizeForFlexItem const): * Source/WebCore/layout/formattingContexts/flex/FlexFormattingUtils.h: * Source/WebCore/layout/integration/flex/LayoutIntegrationFlexLayout.cpp: (WebCore::LayoutIntegration::FlexLayout::firstLineBaseline const): (WebCore::LayoutIntegration::FlexLayout::lastLineBaseline const): (WebCore::LayoutIntegration::FlexLayout::baselineFlexItemInLine const): (WebCore::LayoutIntegration::FlexLayout::staticCrossAxisPositionForPositionedFlexItem): * Source/WebCore/rendering/RenderFlexibleBox.cpp: (WebCore::RenderFlexibleBox::ScopedCrossAxisOverrideForFlexItem::ScopedCrossAxisOverrideForFlexItem): (WebCore::RenderFlexibleBox::canUseFlexItemForPercentageResolution): (WebCore::RenderFlexibleBox::computeBlockAxisContentSizeForFlexItem): (WebCore::RenderFlexibleBox::setOverridingMainSizeForFlexItem): (WebCore::RenderFlexibleBox::resetAutoMarginsAndLogicalTopInCrossAxis): (WebCore::RenderFlexibleBox::useContentBasedMinimumBlockSize const): (WebCore::RenderFlexibleBox::hasStretchedFlexItemWithAspectRatio const): (WebCore::RenderFlexibleBox::mainAxisIsFlexItemInlineAxis const): (WebCore::RenderFlexibleBox::flexBasisForFlexItem const): (WebCore::RenderFlexibleBox::alignmentForFlexItem const): (WebCore::RenderFlexibleBox::hasDefiniteCrossSizeForFlexItem const): (WebCore::RenderFlexibleBox::flexItemMainSizeIsDefinite): Canonical link: https://commits.webkit.org/317776@main
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No description provided.