mirror of
https://repo.dactyloidae.xyz/Dactyloidae/UXP.git
synced 2026-09-05 15:28:39 +09:00
Issue #1986 - Part 2: Add IsItemInlineAxisMainAxis() and rework some nsFrame code.
It turns out part 10 was actually needed, but Bug 1449838 had a significantly better version of what that code does that was easy enough to backport to what we have. As far as I can tell, this passes the relevant reftests now.
This commit is contained in:
parent
7527371d78
commit
c3e18955ad
3 changed files with 58 additions and 7 deletions
|
|
@ -39,6 +39,7 @@
|
|||
#include "mozilla/Logging.h"
|
||||
#include "mozilla/Sprintf.h"
|
||||
#include "nsFrameManager.h"
|
||||
#include "nsFlexContainerFrame.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "LayoutLogging.h"
|
||||
#include "mozilla/RestyleManager.h"
|
||||
|
|
@ -4752,12 +4753,11 @@ 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 =
|
||||
flexDirection == NS_STYLE_FLEX_DIRECTION_ROW ||
|
||||
flexDirection == NS_STYLE_FLEX_DIRECTION_ROW_REVERSE;
|
||||
nsFlexContainerFrame::IsItemInlineAxisMainAxis(this);
|
||||
|
||||
const nsStyleCoord* flexBasis = &(stylePos->mFlexBasis);
|
||||
SetCoordToFlexBasis(isInlineFlexItem, false, flexBasis,
|
||||
|
|
@ -4973,11 +4973,8 @@ 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 =
|
||||
flexDirection == NS_STYLE_FLEX_DIRECTION_ROW ||
|
||||
flexDirection == NS_STYLE_FLEX_DIRECTION_ROW_REVERSE;
|
||||
nsFlexContainerFrame::IsItemInlineAxisMainAxis(this);
|
||||
|
||||
// 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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue