Skip to content

Commit

Permalink
[FFC] LogicalFlexItemRects are border box based now (and not margin box)
Browse files Browse the repository at this point in the history
https://bugs.webkit.org/show_bug.cgi?id=258792

Reviewed by Antti Koivisto.

This is a follow-up fix on LogicalFlexItemRects. They are now border box based.

* Source/WebCore/layout/formattingContexts/flex/FlexFormattingContext.cpp:
(WebCore::Layout::FlexFormattingContext::setFlexItemsGeometry):

Canonical link: https://commits.webkit.org/265719@main
  • Loading branch information
alanbaradlay committed Jul 3, 2023
1 parent e2c6f17 commit 51493cf
Showing 1 changed file with 2 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -266,13 +266,8 @@ void FlexFormattingContext::setFlexItemsGeometry(const FlexLayout::LogicalFlexIt
auto contentBoxWidth = isMainAxisParallelWithInlineAxis ? logicalRect.width() : logicalRect.height();
auto contentBoxHeight = isMainAxisParallelWithInlineAxis ? logicalRect.height() : logicalRect.width();
if (!logicalFlexItem.isContentBoxBased()) {
auto usedHorizontalMargin = horizontalMargin(logicalRects[index], flexDirection);
auto usedVerticalMargin = verticalMargin(logicalRects[index], flexDirection);
auto horizontalMarginBorderAndPadding = usedHorizontalMargin.start + flexItemGeometry.horizontalBorderAndPadding() + usedHorizontalMargin.end;
auto verticallMarginBorderAndPadding = usedVerticalMargin.before + flexItemGeometry.verticalBorderAndPadding() + usedVerticalMargin.after;

contentBoxWidth -= horizontalMarginBorderAndPadding;
contentBoxHeight -= verticallMarginBorderAndPadding;
contentBoxWidth -= flexItemGeometry.horizontalBorderAndPadding();
contentBoxHeight -= flexItemGeometry.verticalBorderAndPadding();
}
flexItemGeometry.setContentBoxWidth(contentBoxWidth);
flexItemGeometry.setContentBoxHeight(contentBoxHeight);
Expand Down

0 comments on commit 51493cf

Please sign in to comment.