summaryrefslogtreecommitdiff
path: root/layout/generic/nsFrame.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2022-09-27 20:04:02 +0000
committerMoonchild <moonchild@palemoon.org>2022-09-27 20:04:02 +0000
commit5f8d70dacd2efad6f16c706f5d5261181938cc74 (patch)
tree413caf1e47a117aff088ec950554720688ecd561 /layout/generic/nsFrame.cpp
parent4bf2bf74b15772ca9c63188cd1d6c6fc046c0ed0 (diff)
downloaduxp-5f8d70dacd2efad6f16c706f5d5261181938cc74.tar.gz
Revert "Issue #1986 - Part 2: Add IsItemInlineAxisMainAxis() and rework some nsFrame code."
This reverts commit ef4eb3f926821fe87bf9a64be29d859ab5e0a6f5.
Diffstat (limited to 'layout/generic/nsFrame.cpp')
-rw-r--r--layout/generic/nsFrame.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp
index 9bc4941e0b..43ad970890 100644
--- a/layout/generic/nsFrame.cpp
+++ b/layout/generic/nsFrame.cpp
@@ -39,7 +39,6 @@
#include "mozilla/Logging.h"
#include "mozilla/Sprintf.h"
#include "nsFrameManager.h"
-#include "nsFlexContainerFrame.h"
#include "nsLayoutUtils.h"
#include "LayoutLogging.h"
#include "mozilla/RestyleManager.h"
@@ -4753,11 +4752,12 @@ nsFrame::ComputeSize(nsRenderingContext* aRenderingContext,
}
bool isFlexItem = (parentFrameType == nsGkAtoms::flexContainerFrame &&
!(GetStateBits() & NS_FRAME_OUT_OF_FLOW));
-
bool isInlineFlexItem = false;
if (isFlexItem) {
+ uint32_t flexDirection = GetParent()->StylePosition()->mFlexDirection;
isInlineFlexItem =
- nsFlexContainerFrame::IsItemInlineAxisMainAxis(this);
+ flexDirection == NS_STYLE_FLEX_DIRECTION_ROW ||
+ flexDirection == NS_STYLE_FLEX_DIRECTION_ROW_REVERSE;
const nsStyleCoord* flexBasis = &(stylePos->mFlexBasis);
SetCoordToFlexBasis(isInlineFlexItem, false, flexBasis,
@@ -4973,8 +4973,11 @@ nsFrame::ComputeSizeWithIntrinsicDimensions(nsRenderingContext* aRenderingConte
// from our style struct. (Otherwise, we'll be using an irrelevant value in
// the aspect-ratio calculations below.)
if (isFlexItem) {
+ uint32_t flexDirection =
+ GetParent()->StylePosition()->mFlexDirection;
isInlineFlexItem =
- nsFlexContainerFrame::IsItemInlineAxisMainAxis(this);
+ flexDirection == NS_STYLE_FLEX_DIRECTION_ROW ||
+ flexDirection == NS_STYLE_FLEX_DIRECTION_ROW_REVERSE;
// If FlexItemMainSizeOverride frame-property is set, then that means the
// flex container is imposing a main-size on this flex item for it to use