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:
Mats Palmgren 2016-03-11 17:39:26 +01:00
Родитель 5d62d81f90
Коммит 44db3be14e
2 изменённых файлов: 14 добавлений и 19 удалений

Просмотреть файл

@ -2344,15 +2344,13 @@ nsGridContainerFrame::Grid::PlaceGridItems(GridReflowState& aState,
for (; !aState.mIter.AtEnd(); aState.mIter.Next()) {
nsIFrame* child = *aState.mIter;
GridItemInfo* info =
aState.mGridItems.AppendElement(GridItemInfo(PlaceDefinite(child,
colLineNameMap,
rowLineNameMap,
gridStyle)));
#ifdef DEBUG
aState.mGridItems.AppendElement(GridItemInfo(child,
PlaceDefinite(child,
colLineNameMap,
rowLineNameMap,
gridStyle)));
MOZ_ASSERT(aState.mIter.GridItemIndex() == aState.mGridItems.Length() - 1,
"GridItemIndex() is broken");
info->mFrame = child;
#endif
GridArea& area = info->mArea;
if (area.mCols.IsDefinite()) {
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) {
nsIFrame* child = e.get();
GridItemInfo* info =
aState.mAbsPosItems.AppendElement(GridItemInfo(PlaceAbsPos(child,
colLineNameMap,
rowLineNameMap,
gridStyle)));
#ifdef DEBUG
info->mFrame = child;
#endif
aState.mAbsPosItems.AppendElement(GridItemInfo(child,
PlaceAbsPos(child,
colLineNameMap,
rowLineNameMap,
gridStyle)));
GridArea& area = info->mArea;
if (area.mCols.mUntranslatedStart != int32_t(kAutoLine)) {
area.mCols.mStart = area.mCols.mUntranslatedStart + offsetToColZero;

Просмотреть файл

@ -330,20 +330,19 @@ protected:
};
struct GridItemInfo {
explicit GridItemInfo(const GridArea& aArea)
: mArea(aArea)
GridItemInfo(nsIFrame* aFrame, const GridArea& aArea)
: mFrame(aFrame)
, mArea(aArea)
{
mIsFlexing[0] = false;
mIsFlexing[1] = false;
}
nsIFrame* mFrame;
GridArea mArea;
bool mIsFlexing[2]; // does the item span a flex track? (LogicalAxis index)
static_assert(mozilla::eLogicalAxisBlock == 0, "unexpected index value");
static_assert(mozilla::eLogicalAxisInline == 1, "unexpected index value");
#ifdef DEBUG
nsIFrame* mFrame;
#endif
};
/**