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:
Jeremy Andrews 2022-08-16 16:11:48 -05:00 • committed by roytam1
commit c3e18955ad
3 changed files with 58 additions and 7 deletions

View file

@ -133,6 +133,21 @@ public:
uint32_t* aNumPackingSpacesRemaining,
nscoord* aPackingSpaceRemaining);
/**
* Given a frame for a flex item, this method returns true IFF that flex
* item's inline axis is the same as (i.e. not orthogonal to) its flex
* container's main axis.
*
* (This method is only intended to be used from external
* callers. Inside of flex reflow code, FlexItem::IsInlineAxisMainAxis() is
* equivalent & more optimal.)
*
* @param aFrame a flex item (must return true from IsFlexItem)
* @return true iff aFrame's inline axis is the same as (i.e. not orthogonal
* to) its flex container's main axis. Otherwise, false.
*/
static bool IsItemInlineAxisMainAxis(nsIFrame* aFrame);
protected:
// Protected constructor & destructor
explicit nsFlexContainerFrame(nsStyleContext* aContext)