зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1725973 Part 2 - Mark flex items with percentage flex-basis in column flex container as depending on CB's block-size. r=dholbert
If so, `dependsOnCBBSize` will be set to true, and later in `ReflowInput::InitResizeFlags()` we will add `NS_FRAME_CONTAINS_RELATIVE_BSIZE` to the appropriate ancestor. Sorted the #include statements in ReflowInput.cpp because I added nsFlexContainerFrame.h. Differential Revision: https://phabricator.services.mozilla.com/D123703
This commit is contained in:
Родитель
85766432de
Коммит
736fbaef17
|
@ -8,29 +8,31 @@
|
|||
|
||||
#include "mozilla/ReflowInput.h"
|
||||
|
||||
#include <algorithm>
|
||||
|
||||
#include "CounterStyleManager.h"
|
||||
#include "LayoutLogging.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsCSSAnonBoxes.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsFontMetrics.h"
|
||||
#include "mozilla/dom/HTMLInputElement.h"
|
||||
#include "mozilla/SVGUtils.h"
|
||||
#include "nsBlockFrame.h"
|
||||
#include "nsLineBox.h"
|
||||
#include "nsCSSAnonBoxes.h"
|
||||
#include "nsFlexContainerFrame.h"
|
||||
#include "nsFontInflationData.h"
|
||||
#include "nsFontMetrics.h"
|
||||
#include "nsGkAtoms.h"
|
||||
#include "nsGridContainerFrame.h"
|
||||
#include "nsIContent.h"
|
||||
#include "nsIFrame.h"
|
||||
#include "nsIFrameInlines.h"
|
||||
#include "nsImageFrame.h"
|
||||
#include "nsTableFrame.h"
|
||||
#include "nsTableCellFrame.h"
|
||||
#include "nsIPercentBSizeObserver.h"
|
||||
#include "nsLayoutUtils.h"
|
||||
#include "nsFontInflationData.h"
|
||||
#include "nsLineBox.h"
|
||||
#include "nsPresContext.h"
|
||||
#include "nsStyleConsts.h"
|
||||
#include "nsTableCellFrame.h"
|
||||
#include "nsTableFrame.h"
|
||||
#include "StickyScrollContainer.h"
|
||||
#include "nsIFrameInlines.h"
|
||||
#include "CounterStyleManager.h"
|
||||
#include <algorithm>
|
||||
#include "mozilla/SVGUtils.h"
|
||||
#include "mozilla/dom/HTMLInputElement.h"
|
||||
#include "nsGridContainerFrame.h"
|
||||
|
||||
using namespace mozilla;
|
||||
using namespace mozilla::css;
|
||||
|
@ -669,6 +671,16 @@ void ReflowInput::InitResizeFlags(nsPresContext* aPresContext,
|
|||
!mStylePosition->mOffset.GetBEnd(wm).IsAuto() ||
|
||||
mFrame->IsXULBoxFrame();
|
||||
|
||||
// If mFrame is a flex item, and mFrame's block axis is the flex container's
|
||||
// main axis (e.g. in a column-oriented flex container with same
|
||||
// writing-mode), then its block-size depends on its CB size, if its
|
||||
// flex-basis has a percentage.
|
||||
if (mFrame->IsFlexItem() &&
|
||||
!nsFlexContainerFrame::IsItemInlineAxisMainAxis(mFrame)) {
|
||||
const auto& flexBasis = mStylePosition->mFlexBasis;
|
||||
dependsOnCBBSize |= (flexBasis.IsSize() && flexBasis.AsSize().HasPercent());
|
||||
}
|
||||
|
||||
if (mStyleText->mLineHeight.IsMozBlockHeight()) {
|
||||
// line-height depends on block bsize
|
||||
mFrame->AddStateBits(NS_FRAME_CONTAINS_RELATIVE_BSIZE);
|
||||
|
|
|
@ -1,2 +0,0 @@
|
|||
[flex-basis-011.html]
|
||||
expected: FAIL
|
Загрузка…
Ссылка в новой задаче