Skip to content

Commit

Permalink
Bug 1350037 Part 1 - Rename two variables storing grid item's axes. r…
Browse files Browse the repository at this point in the history
…=dholbert

Rename to make them clearer that they stores child's axes in grid container's
writing-mode. Without the "InWM" suffix, it's a bit confusing why not just use
`eLogicalAxisInline`.

Differential Revision: https://phabricator.services.mozilla.com/D196703
  • Loading branch information
aethanyc committed Dec 18, 2023
1 parent c991c14 commit a7f123d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions layout/generic/nsGridContainerFrame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7433,28 +7433,31 @@ void nsGridContainerFrame::ReflowInFlowChild(
j == StyleAlignFlags::NORMAL || j == StyleAlignFlags::STRETCH;
stretch[eLogicalAxisBlock] =
a == StyleAlignFlags::NORMAL || a == StyleAlignFlags::STRETCH;
auto childIAxis = isOrthogonal ? eLogicalAxisBlock : eLogicalAxisInline;

const auto childIAxisInWM =
isOrthogonal ? eLogicalAxisBlock : eLogicalAxisInline;
// Clamp during reflow if we're stretching in that axis.
if (stretch[childIAxis]) {
if (aGridItemInfo->mState[childIAxis] &
if (stretch[childIAxisInWM]) {
if (aGridItemInfo->mState[childIAxisInWM] &
ItemState::eClampMarginBoxMinSize) {
csFlags += ComputeSizeFlag::IClampMarginBoxMinSize;
}
} else {
csFlags += ComputeSizeFlag::ShrinkWrap;
}

auto childBAxis = GetOrthogonalAxis(childIAxis);
if (stretch[childBAxis] &&
aGridItemInfo->mState[childBAxis] & ItemState::eClampMarginBoxMinSize) {
const auto childBAxisInWM = GetOrthogonalAxis(childIAxisInWM);
if (stretch[childBAxisInWM] && aGridItemInfo->mState[childBAxisInWM] &
ItemState::eClampMarginBoxMinSize) {
csFlags += ComputeSizeFlag::BClampMarginBoxMinSize;
aChild->SetProperty(BClampMarginBoxMinSizeProperty(),
childCBSize.BSize(childWM));
} else {
aChild->RemoveProperty(BClampMarginBoxMinSizeProperty());
}

if ((aGridItemInfo->mState[childIAxis] & ItemState::eApplyAutoMinSize)) {
if ((aGridItemInfo->mState[childIAxisInWM] &
ItemState::eApplyAutoMinSize)) {
csFlags += ComputeSizeFlag::IApplyAutoMinSize;
}
}
Expand Down

0 comments on commit a7f123d

Please sign in to comment.