зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1144096 part 2 - [css-grid] Make GridItemInfo::mFrame available also in non-DEBUG builds since we'll need it to support fragmentation. r=dholbert
This commit is contained in:
Родитель
5d62d81f90
Коммит
44db3be14e
|
@ -2344,15 +2344,13 @@ nsGridContainerFrame::Grid::PlaceGridItems(GridReflowState& aState,
|
||||||
for (; !aState.mIter.AtEnd(); aState.mIter.Next()) {
|
for (; !aState.mIter.AtEnd(); aState.mIter.Next()) {
|
||||||
nsIFrame* child = *aState.mIter;
|
nsIFrame* child = *aState.mIter;
|
||||||
GridItemInfo* info =
|
GridItemInfo* info =
|
||||||
aState.mGridItems.AppendElement(GridItemInfo(PlaceDefinite(child,
|
aState.mGridItems.AppendElement(GridItemInfo(child,
|
||||||
colLineNameMap,
|
PlaceDefinite(child,
|
||||||
rowLineNameMap,
|
colLineNameMap,
|
||||||
gridStyle)));
|
rowLineNameMap,
|
||||||
#ifdef DEBUG
|
gridStyle)));
|
||||||
MOZ_ASSERT(aState.mIter.GridItemIndex() == aState.mGridItems.Length() - 1,
|
MOZ_ASSERT(aState.mIter.GridItemIndex() == aState.mGridItems.Length() - 1,
|
||||||
"GridItemIndex() is broken");
|
"GridItemIndex() is broken");
|
||||||
info->mFrame = child;
|
|
||||||
#endif
|
|
||||||
GridArea& area = info->mArea;
|
GridArea& area = info->mArea;
|
||||||
if (area.mCols.IsDefinite()) {
|
if (area.mCols.IsDefinite()) {
|
||||||
minCol = std::min(minCol, area.mCols.mUntranslatedStart);
|
minCol = std::min(minCol, area.mCols.mUntranslatedStart);
|
||||||
|
@ -2501,13 +2499,11 @@ nsGridContainerFrame::Grid::PlaceGridItems(GridReflowState& aState,
|
||||||
for (nsFrameList::Enumerator e(children); !e.AtEnd(); e.Next(), ++i) {
|
for (nsFrameList::Enumerator e(children); !e.AtEnd(); e.Next(), ++i) {
|
||||||
nsIFrame* child = e.get();
|
nsIFrame* child = e.get();
|
||||||
GridItemInfo* info =
|
GridItemInfo* info =
|
||||||
aState.mAbsPosItems.AppendElement(GridItemInfo(PlaceAbsPos(child,
|
aState.mAbsPosItems.AppendElement(GridItemInfo(child,
|
||||||
colLineNameMap,
|
PlaceAbsPos(child,
|
||||||
rowLineNameMap,
|
colLineNameMap,
|
||||||
gridStyle)));
|
rowLineNameMap,
|
||||||
#ifdef DEBUG
|
gridStyle)));
|
||||||
info->mFrame = child;
|
|
||||||
#endif
|
|
||||||
GridArea& area = info->mArea;
|
GridArea& area = info->mArea;
|
||||||
if (area.mCols.mUntranslatedStart != int32_t(kAutoLine)) {
|
if (area.mCols.mUntranslatedStart != int32_t(kAutoLine)) {
|
||||||
area.mCols.mStart = area.mCols.mUntranslatedStart + offsetToColZero;
|
area.mCols.mStart = area.mCols.mUntranslatedStart + offsetToColZero;
|
||||||
|
|
|
@ -330,20 +330,19 @@ protected:
|
||||||
};
|
};
|
||||||
|
|
||||||
struct GridItemInfo {
|
struct GridItemInfo {
|
||||||
explicit GridItemInfo(const GridArea& aArea)
|
GridItemInfo(nsIFrame* aFrame, const GridArea& aArea)
|
||||||
: mArea(aArea)
|
: mFrame(aFrame)
|
||||||
|
, mArea(aArea)
|
||||||
{
|
{
|
||||||
mIsFlexing[0] = false;
|
mIsFlexing[0] = false;
|
||||||
mIsFlexing[1] = false;
|
mIsFlexing[1] = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsIFrame* mFrame;
|
||||||
GridArea mArea;
|
GridArea mArea;
|
||||||
bool mIsFlexing[2]; // does the item span a flex track? (LogicalAxis index)
|
bool mIsFlexing[2]; // does the item span a flex track? (LogicalAxis index)
|
||||||
static_assert(mozilla::eLogicalAxisBlock == 0, "unexpected index value");
|
static_assert(mozilla::eLogicalAxisBlock == 0, "unexpected index value");
|
||||||
static_assert(mozilla::eLogicalAxisInline == 1, "unexpected index value");
|
static_assert(mozilla::eLogicalAxisInline == 1, "unexpected index value");
|
||||||
#ifdef DEBUG
|
|
||||||
nsIFrame* mFrame;
|
|
||||||
#endif
|
|
||||||
};
|
};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Загрузка…
Ссылка в новой задаче