mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 1118820 part 2c+2d - [css-grid] Modify the LineNameMap::FindLine/RFindLine/FindNamedLine methods to take line names associated with 'repeat(auto-fill/auto-fit)' tracks into account. Instantiate and pass around a LineNameMap object instead of an array of line name arrays. r=dholbert
This commit is contained in:
parent
9cef43688a
commit
e806f21081
@ -242,16 +242,15 @@ public:
|
|||||||
* used on a grid-[row|column]-end property and -2 for a *-start property,
|
* used on a grid-[row|column]-end property and -2 for a *-start property,
|
||||||
* and aFromIndex is the line (which we should skip) on the opposite property.
|
* and aFromIndex is the line (which we should skip) on the opposite property.
|
||||||
*/
|
*/
|
||||||
static uint32_t FindNamedLine(const nsString& aName, int32_t* aNth,
|
uint32_t FindNamedLine(const nsString& aName, int32_t* aNth,
|
||||||
uint32_t aFromIndex, uint32_t aImplicitLine,
|
uint32_t aFromIndex, uint32_t aImplicitLine) const
|
||||||
const nsTArray<nsTArray<nsString>>& aNameList)
|
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aNth && *aNth != 0);
|
MOZ_ASSERT(aNth && *aNth != 0);
|
||||||
if (*aNth > 0) {
|
if (*aNth > 0) {
|
||||||
return FindLine(aName, aNth, aFromIndex, aImplicitLine, aNameList);
|
return FindLine(aName, aNth, aFromIndex, aImplicitLine);
|
||||||
}
|
}
|
||||||
int32_t nth = -*aNth;
|
int32_t nth = -*aNth;
|
||||||
int32_t line = RFindLine(aName, &nth, aFromIndex, aImplicitLine, aNameList);
|
int32_t line = RFindLine(aName, &nth, aFromIndex, aImplicitLine);
|
||||||
*aNth = -nth;
|
*aNth = -nth;
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
@ -260,18 +259,17 @@ private:
|
|||||||
/**
|
/**
|
||||||
* @see FindNamedLine, this function searches forward.
|
* @see FindNamedLine, this function searches forward.
|
||||||
*/
|
*/
|
||||||
static uint32_t FindLine(const nsString& aName, int32_t* aNth,
|
uint32_t FindLine(const nsString& aName, int32_t* aNth,
|
||||||
uint32_t aFromIndex, uint32_t aImplicitLine,
|
uint32_t aFromIndex, uint32_t aImplicitLine) const
|
||||||
const nsTArray<nsTArray<nsString>>& aNameList)
|
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aNth && *aNth > 0);
|
MOZ_ASSERT(aNth && *aNth > 0);
|
||||||
int32_t nth = *aNth;
|
int32_t nth = *aNth;
|
||||||
const uint32_t len = aNameList.Length();
|
const uint32_t end = mTemplateLinesEnd;
|
||||||
uint32_t line;
|
uint32_t line;
|
||||||
uint32_t i = aFromIndex;
|
uint32_t i = aFromIndex;
|
||||||
for (; i < len; i = line) {
|
for (; i < end; i = line) {
|
||||||
line = i + 1;
|
line = i + 1;
|
||||||
if (line == aImplicitLine || aNameList[i].Contains(aName)) {
|
if (line == aImplicitLine || Contains(i, aName)) {
|
||||||
if (--nth == 0) {
|
if (--nth == 0) {
|
||||||
return line;
|
return line;
|
||||||
}
|
}
|
||||||
@ -292,9 +290,8 @@ private:
|
|||||||
/**
|
/**
|
||||||
* @see FindNamedLine, this function searches in reverse.
|
* @see FindNamedLine, this function searches in reverse.
|
||||||
*/
|
*/
|
||||||
static uint32_t RFindLine(const nsString& aName, int32_t* aNth,
|
uint32_t RFindLine(const nsString& aName, int32_t* aNth,
|
||||||
uint32_t aFromIndex, uint32_t aImplicitLine,
|
uint32_t aFromIndex, uint32_t aImplicitLine) const
|
||||||
const nsTArray<nsTArray<nsString>>& aNameList)
|
|
||||||
{
|
{
|
||||||
MOZ_ASSERT(aNth && *aNth > 0);
|
MOZ_ASSERT(aNth && *aNth > 0);
|
||||||
if (MOZ_UNLIKELY(aFromIndex == 0)) {
|
if (MOZ_UNLIKELY(aFromIndex == 0)) {
|
||||||
@ -302,16 +299,16 @@ private:
|
|||||||
}
|
}
|
||||||
--aFromIndex; // (shift aFromIndex so we can treat it as inclusive)
|
--aFromIndex; // (shift aFromIndex so we can treat it as inclusive)
|
||||||
int32_t nth = *aNth;
|
int32_t nth = *aNth;
|
||||||
const uint32_t len = aNameList.Length();
|
// The implicit line may be beyond the explicit grid so we match
|
||||||
// The implicit line may be beyond the length of aNameList so we match this
|
// this line first if it's within the mTemplateLinesEnd..aFromIndex range.
|
||||||
// line first if it's within the len..aFromIndex range.
|
const uint32_t end = mTemplateLinesEnd;
|
||||||
if (aImplicitLine > len && aImplicitLine < aFromIndex) {
|
if (aImplicitLine > end && aImplicitLine < aFromIndex) {
|
||||||
if (--nth == 0) {
|
if (--nth == 0) {
|
||||||
return aImplicitLine;
|
return aImplicitLine;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
for (uint32_t i = std::min(aFromIndex, len); i; --i) {
|
for (uint32_t i = std::min(aFromIndex, end); i; --i) {
|
||||||
if (i == aImplicitLine || aNameList[i - 1].Contains(aName)) {
|
if (i == aImplicitLine || Contains(i - 1, aName)) {
|
||||||
if (--nth == 0) {
|
if (--nth == 0) {
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
@ -1336,7 +1333,7 @@ nsGridContainerFrame::ResolveLine(
|
|||||||
const nsStyleGridLine& aLine,
|
const nsStyleGridLine& aLine,
|
||||||
int32_t aNth,
|
int32_t aNth,
|
||||||
uint32_t aFromIndex,
|
uint32_t aFromIndex,
|
||||||
const nsTArray<nsTArray<nsString>>& aLineNameList,
|
const LineNameMap& aNameMap,
|
||||||
uint32_t GridNamedArea::* aAreaStart,
|
uint32_t GridNamedArea::* aAreaStart,
|
||||||
uint32_t GridNamedArea::* aAreaEnd,
|
uint32_t GridNamedArea::* aAreaEnd,
|
||||||
uint32_t aExplicitGridEnd,
|
uint32_t aExplicitGridEnd,
|
||||||
@ -1369,8 +1366,8 @@ nsGridContainerFrame::ResolveLine(
|
|||||||
lineName.AppendLiteral("-end");
|
lineName.AppendLiteral("-end");
|
||||||
implicitLine = area ? area->*aAreaEnd : 0;
|
implicitLine = area ? area->*aAreaEnd : 0;
|
||||||
}
|
}
|
||||||
line = LineNameMap::FindNamedLine(lineName, &aNth, aFromIndex, implicitLine,
|
line = aNameMap.FindNamedLine(lineName, &aNth, aFromIndex,
|
||||||
aLineNameList);
|
implicitLine);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1392,8 +1389,8 @@ nsGridContainerFrame::ResolveLine(
|
|||||||
implicitLine = area->*areaEdge;
|
implicitLine = area->*areaEdge;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
line = LineNameMap::FindNamedLine(aLine.mLineName, &aNth, aFromIndex, implicitLine,
|
line = aNameMap.FindNamedLine(aLine.mLineName, &aNth, aFromIndex,
|
||||||
aLineNameList);
|
implicitLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (line == 0) {
|
if (line == 0) {
|
||||||
@ -1420,7 +1417,7 @@ nsGridContainerFrame::LinePair
|
|||||||
nsGridContainerFrame::ResolveLineRangeHelper(
|
nsGridContainerFrame::ResolveLineRangeHelper(
|
||||||
const nsStyleGridLine& aStart,
|
const nsStyleGridLine& aStart,
|
||||||
const nsStyleGridLine& aEnd,
|
const nsStyleGridLine& aEnd,
|
||||||
const nsTArray<nsTArray<nsString>>& aLineNameList,
|
const LineNameMap& aNameMap,
|
||||||
uint32_t GridNamedArea::* aAreaStart,
|
uint32_t GridNamedArea::* aAreaStart,
|
||||||
uint32_t GridNamedArea::* aAreaEnd,
|
uint32_t GridNamedArea::* aAreaEnd,
|
||||||
uint32_t aExplicitGridEnd,
|
uint32_t aExplicitGridEnd,
|
||||||
@ -1442,7 +1439,7 @@ nsGridContainerFrame::ResolveLineRangeHelper(
|
|||||||
}
|
}
|
||||||
|
|
||||||
uint32_t from = aEnd.mInteger < 0 ? aExplicitGridEnd + 1: 0;
|
uint32_t from = aEnd.mInteger < 0 ? aExplicitGridEnd + 1: 0;
|
||||||
auto end = ResolveLine(aEnd, aEnd.mInteger, from, aLineNameList, aAreaStart,
|
auto end = ResolveLine(aEnd, aEnd.mInteger, from, aNameMap, aAreaStart,
|
||||||
aAreaEnd, aExplicitGridEnd, eLineRangeSideEnd,
|
aAreaEnd, aExplicitGridEnd, eLineRangeSideEnd,
|
||||||
aStyle);
|
aStyle);
|
||||||
int32_t span = aStart.mInteger == 0 ? 1 : aStart.mInteger;
|
int32_t span = aStart.mInteger == 0 ? 1 : aStart.mInteger;
|
||||||
@ -1452,7 +1449,7 @@ nsGridContainerFrame::ResolveLineRangeHelper(
|
|||||||
int32_t start = std::max(end - span, nsStyleGridLine::kMinLine);
|
int32_t start = std::max(end - span, nsStyleGridLine::kMinLine);
|
||||||
return LinePair(start, end);
|
return LinePair(start, end);
|
||||||
}
|
}
|
||||||
auto start = ResolveLine(aStart, -span, end, aLineNameList, aAreaStart,
|
auto start = ResolveLine(aStart, -span, end, aNameMap, aAreaStart,
|
||||||
aAreaEnd, aExplicitGridEnd, eLineRangeSideStart,
|
aAreaEnd, aExplicitGridEnd, eLineRangeSideStart,
|
||||||
aStyle);
|
aStyle);
|
||||||
return LinePair(start, end);
|
return LinePair(start, end);
|
||||||
@ -1476,7 +1473,7 @@ nsGridContainerFrame::ResolveLineRangeHelper(
|
|||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
uint32_t from = aStart.mInteger < 0 ? aExplicitGridEnd + 1: 0;
|
uint32_t from = aStart.mInteger < 0 ? aExplicitGridEnd + 1: 0;
|
||||||
start = ResolveLine(aStart, aStart.mInteger, from, aLineNameList,
|
start = ResolveLine(aStart, aStart.mInteger, from, aNameMap,
|
||||||
aAreaStart, aAreaEnd, aExplicitGridEnd,
|
aAreaStart, aAreaEnd, aExplicitGridEnd,
|
||||||
eLineRangeSideStart, aStyle);
|
eLineRangeSideStart, aStyle);
|
||||||
if (aEnd.IsAuto()) {
|
if (aEnd.IsAuto()) {
|
||||||
@ -1506,7 +1503,7 @@ nsGridContainerFrame::ResolveLineRangeHelper(
|
|||||||
} else {
|
} else {
|
||||||
from = aEnd.mInteger < 0 ? aExplicitGridEnd + 1: 0;
|
from = aEnd.mInteger < 0 ? aExplicitGridEnd + 1: 0;
|
||||||
}
|
}
|
||||||
auto end = ResolveLine(aEnd, nth, from, aLineNameList, aAreaStart,
|
auto end = ResolveLine(aEnd, nth, from, aNameMap, aAreaStart,
|
||||||
aAreaEnd, aExplicitGridEnd, eLineRangeSideEnd, aStyle);
|
aAreaEnd, aExplicitGridEnd, eLineRangeSideEnd, aStyle);
|
||||||
if (start == int32_t(kAutoLine)) {
|
if (start == int32_t(kAutoLine)) {
|
||||||
// auto / definite line
|
// auto / definite line
|
||||||
@ -1519,13 +1516,13 @@ nsGridContainerFrame::LineRange
|
|||||||
nsGridContainerFrame::ResolveLineRange(
|
nsGridContainerFrame::ResolveLineRange(
|
||||||
const nsStyleGridLine& aStart,
|
const nsStyleGridLine& aStart,
|
||||||
const nsStyleGridLine& aEnd,
|
const nsStyleGridLine& aEnd,
|
||||||
const nsTArray<nsTArray<nsString>>& aLineNameList,
|
const LineNameMap& aNameMap,
|
||||||
uint32_t GridNamedArea::* aAreaStart,
|
uint32_t GridNamedArea::* aAreaStart,
|
||||||
uint32_t GridNamedArea::* aAreaEnd,
|
uint32_t GridNamedArea::* aAreaEnd,
|
||||||
uint32_t aExplicitGridEnd,
|
uint32_t aExplicitGridEnd,
|
||||||
const nsStylePosition* aStyle)
|
const nsStylePosition* aStyle)
|
||||||
{
|
{
|
||||||
LinePair r = ResolveLineRangeHelper(aStart, aEnd, aLineNameList, aAreaStart,
|
LinePair r = ResolveLineRangeHelper(aStart, aEnd, aNameMap, aAreaStart,
|
||||||
aAreaEnd, aExplicitGridEnd, aStyle);
|
aAreaEnd, aExplicitGridEnd, aStyle);
|
||||||
MOZ_ASSERT(r.second != int32_t(kAutoLine));
|
MOZ_ASSERT(r.second != int32_t(kAutoLine));
|
||||||
|
|
||||||
@ -1550,16 +1547,18 @@ nsGridContainerFrame::ResolveLineRange(
|
|||||||
|
|
||||||
nsGridContainerFrame::GridArea
|
nsGridContainerFrame::GridArea
|
||||||
nsGridContainerFrame::PlaceDefinite(nsIFrame* aChild,
|
nsGridContainerFrame::PlaceDefinite(nsIFrame* aChild,
|
||||||
|
const LineNameMap& aColLineNameMap,
|
||||||
|
const LineNameMap& aRowLineNameMap,
|
||||||
const nsStylePosition* aStyle)
|
const nsStylePosition* aStyle)
|
||||||
{
|
{
|
||||||
const nsStylePosition* itemStyle = aChild->StylePosition();
|
const nsStylePosition* itemStyle = aChild->StylePosition();
|
||||||
return GridArea(
|
return GridArea(
|
||||||
ResolveLineRange(itemStyle->mGridColumnStart, itemStyle->mGridColumnEnd,
|
ResolveLineRange(itemStyle->mGridColumnStart, itemStyle->mGridColumnEnd,
|
||||||
aStyle->mGridTemplateColumns.mLineNameLists,
|
aColLineNameMap,
|
||||||
&GridNamedArea::mColumnStart, &GridNamedArea::mColumnEnd,
|
&GridNamedArea::mColumnStart, &GridNamedArea::mColumnEnd,
|
||||||
mExplicitGridColEnd, aStyle),
|
mExplicitGridColEnd, aStyle),
|
||||||
ResolveLineRange(itemStyle->mGridRowStart, itemStyle->mGridRowEnd,
|
ResolveLineRange(itemStyle->mGridRowStart, itemStyle->mGridRowEnd,
|
||||||
aStyle->mGridTemplateRows.mLineNameLists,
|
aRowLineNameMap,
|
||||||
&GridNamedArea::mRowStart, &GridNamedArea::mRowEnd,
|
&GridNamedArea::mRowStart, &GridNamedArea::mRowEnd,
|
||||||
mExplicitGridRowEnd, aStyle));
|
mExplicitGridRowEnd, aStyle));
|
||||||
}
|
}
|
||||||
@ -1568,7 +1567,7 @@ nsGridContainerFrame::LineRange
|
|||||||
nsGridContainerFrame::ResolveAbsPosLineRange(
|
nsGridContainerFrame::ResolveAbsPosLineRange(
|
||||||
const nsStyleGridLine& aStart,
|
const nsStyleGridLine& aStart,
|
||||||
const nsStyleGridLine& aEnd,
|
const nsStyleGridLine& aEnd,
|
||||||
const nsTArray<nsTArray<nsString>>& aLineNameList,
|
const LineNameMap& aNameMap,
|
||||||
uint32_t GridNamedArea::* aAreaStart,
|
uint32_t GridNamedArea::* aAreaStart,
|
||||||
uint32_t GridNamedArea::* aAreaEnd,
|
uint32_t GridNamedArea::* aAreaEnd,
|
||||||
uint32_t aExplicitGridEnd,
|
uint32_t aExplicitGridEnd,
|
||||||
@ -1582,7 +1581,7 @@ nsGridContainerFrame::ResolveAbsPosLineRange(
|
|||||||
}
|
}
|
||||||
uint32_t from = aEnd.mInteger < 0 ? aExplicitGridEnd + 1: 0;
|
uint32_t from = aEnd.mInteger < 0 ? aExplicitGridEnd + 1: 0;
|
||||||
int32_t end =
|
int32_t end =
|
||||||
ResolveLine(aEnd, aEnd.mInteger, from, aLineNameList, aAreaStart,
|
ResolveLine(aEnd, aEnd.mInteger, from, aNameMap, aAreaStart,
|
||||||
aAreaEnd, aExplicitGridEnd, eLineRangeSideEnd, aStyle);
|
aAreaEnd, aExplicitGridEnd, eLineRangeSideEnd, aStyle);
|
||||||
if (aEnd.mHasSpan) {
|
if (aEnd.mHasSpan) {
|
||||||
++end;
|
++end;
|
||||||
@ -1595,7 +1594,7 @@ nsGridContainerFrame::ResolveAbsPosLineRange(
|
|||||||
if (aEnd.IsAuto()) {
|
if (aEnd.IsAuto()) {
|
||||||
uint32_t from = aStart.mInteger < 0 ? aExplicitGridEnd + 1: 0;
|
uint32_t from = aStart.mInteger < 0 ? aExplicitGridEnd + 1: 0;
|
||||||
int32_t start =
|
int32_t start =
|
||||||
ResolveLine(aStart, aStart.mInteger, from, aLineNameList, aAreaStart,
|
ResolveLine(aStart, aStart.mInteger, from, aNameMap, aAreaStart,
|
||||||
aAreaEnd, aExplicitGridEnd, eLineRangeSideStart, aStyle);
|
aAreaEnd, aExplicitGridEnd, eLineRangeSideStart, aStyle);
|
||||||
if (aStart.mHasSpan) {
|
if (aStart.mHasSpan) {
|
||||||
start = std::max(aGridEnd - start, aGridStart);
|
start = std::max(aGridEnd - start, aGridStart);
|
||||||
@ -1604,7 +1603,7 @@ nsGridContainerFrame::ResolveAbsPosLineRange(
|
|||||||
return LineRange(start, kAutoLine);
|
return LineRange(start, kAutoLine);
|
||||||
}
|
}
|
||||||
|
|
||||||
LineRange r = ResolveLineRange(aStart, aEnd, aLineNameList, aAreaStart,
|
LineRange r = ResolveLineRange(aStart, aEnd, aNameMap, aAreaStart,
|
||||||
aAreaEnd, aExplicitGridEnd, aStyle);
|
aAreaEnd, aExplicitGridEnd, aStyle);
|
||||||
if (r.IsAuto()) {
|
if (r.IsAuto()) {
|
||||||
MOZ_ASSERT(aStart.mHasSpan && aEnd.mHasSpan, "span / span is the only case "
|
MOZ_ASSERT(aStart.mHasSpan && aEnd.mHasSpan, "span / span is the only case "
|
||||||
@ -1656,6 +1655,8 @@ nsGridContainerFrame::FindAutoCol(uint32_t aStartCol, uint32_t aLockedRow,
|
|||||||
|
|
||||||
nsGridContainerFrame::GridArea
|
nsGridContainerFrame::GridArea
|
||||||
nsGridContainerFrame::PlaceAbsPos(nsIFrame* aChild,
|
nsGridContainerFrame::PlaceAbsPos(nsIFrame* aChild,
|
||||||
|
const LineNameMap& aColLineNameMap,
|
||||||
|
const LineNameMap& aRowLineNameMap,
|
||||||
const nsStylePosition* aStyle)
|
const nsStylePosition* aStyle)
|
||||||
{
|
{
|
||||||
const nsStylePosition* itemStyle = aChild->StylePosition();
|
const nsStylePosition* itemStyle = aChild->StylePosition();
|
||||||
@ -1664,14 +1665,14 @@ nsGridContainerFrame::PlaceAbsPos(nsIFrame* aChild,
|
|||||||
return GridArea(
|
return GridArea(
|
||||||
ResolveAbsPosLineRange(itemStyle->mGridColumnStart,
|
ResolveAbsPosLineRange(itemStyle->mGridColumnStart,
|
||||||
itemStyle->mGridColumnEnd,
|
itemStyle->mGridColumnEnd,
|
||||||
aStyle->mGridTemplateColumns.mLineNameLists,
|
aColLineNameMap,
|
||||||
&GridNamedArea::mColumnStart,
|
&GridNamedArea::mColumnStart,
|
||||||
&GridNamedArea::mColumnEnd,
|
&GridNamedArea::mColumnEnd,
|
||||||
mExplicitGridColEnd, gridColStart, mGridColEnd,
|
mExplicitGridColEnd, gridColStart, mGridColEnd,
|
||||||
aStyle),
|
aStyle),
|
||||||
ResolveAbsPosLineRange(itemStyle->mGridRowStart,
|
ResolveAbsPosLineRange(itemStyle->mGridRowStart,
|
||||||
itemStyle->mGridRowEnd,
|
itemStyle->mGridRowEnd,
|
||||||
aStyle->mGridTemplateRows.mLineNameLists,
|
aRowLineNameMap,
|
||||||
&GridNamedArea::mRowStart,
|
&GridNamedArea::mRowStart,
|
||||||
&GridNamedArea::mRowEnd,
|
&GridNamedArea::mRowEnd,
|
||||||
mExplicitGridRowEnd, gridRowStart, mGridRowEnd,
|
mExplicitGridRowEnd, gridRowStart, mGridRowEnd,
|
||||||
@ -1802,6 +1803,12 @@ nsGridContainerFrame::PlaceGridItems(GridReflowState& aState)
|
|||||||
mCellMap.ClearOccupied();
|
mCellMap.ClearOccupied();
|
||||||
InitializeGridBounds(gridStyle);
|
InitializeGridBounds(gridStyle);
|
||||||
|
|
||||||
|
uint32_t numRepeatCols = 0; // XXX will be fixed in a later patch
|
||||||
|
LineNameMap colLineNameMap(gridStyle->mGridTemplateColumns, numRepeatCols);
|
||||||
|
|
||||||
|
uint32_t numRepeatRows = 0; // XXX will be fixed in a later patch
|
||||||
|
LineNameMap rowLineNameMap(gridStyle->mGridTemplateRows, numRepeatRows);
|
||||||
|
|
||||||
// http://dev.w3.org/csswg/css-grid/#line-placement
|
// http://dev.w3.org/csswg/css-grid/#line-placement
|
||||||
// Resolve definite positions per spec chap 9.2.
|
// Resolve definite positions per spec chap 9.2.
|
||||||
int32_t minCol = 1;
|
int32_t minCol = 1;
|
||||||
@ -1810,7 +1817,10 @@ nsGridContainerFrame::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 =
|
||||||
mGridItems.AppendElement(GridItemInfo(PlaceDefinite(child, gridStyle)));
|
mGridItems.AppendElement(GridItemInfo(PlaceDefinite(child,
|
||||||
|
colLineNameMap,
|
||||||
|
rowLineNameMap,
|
||||||
|
gridStyle)));
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
MOZ_ASSERT(aState.mIter.GridItemIndex() == mGridItems.Length() - 1,
|
MOZ_ASSERT(aState.mIter.GridItemIndex() == mGridItems.Length() - 1,
|
||||||
"GridItemIndex() is broken");
|
"GridItemIndex() is broken");
|
||||||
@ -1963,7 +1973,10 @@ nsGridContainerFrame::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 =
|
||||||
mAbsPosItems.AppendElement(GridItemInfo(PlaceAbsPos(child, gridStyle)));
|
mAbsPosItems.AppendElement(GridItemInfo(PlaceAbsPos(child,
|
||||||
|
colLineNameMap,
|
||||||
|
rowLineNameMap,
|
||||||
|
gridStyle)));
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
info->mFrame = child;
|
info->mFrame = child;
|
||||||
#endif
|
#endif
|
||||||
|
@ -327,7 +327,7 @@ protected:
|
|||||||
* a specified line name, it's permitted to pass in zero which
|
* a specified line name, it's permitted to pass in zero which
|
||||||
* will be treated as one.
|
* will be treated as one.
|
||||||
* @param aFromIndex the zero-based index to start counting from
|
* @param aFromIndex the zero-based index to start counting from
|
||||||
* @param aLineNameList the explicit named lines
|
* @param aNameMap for looking up explicit named lines
|
||||||
* @param aAreaStart a pointer to GridNamedArea::mColumnStart/mRowStart
|
* @param aAreaStart a pointer to GridNamedArea::mColumnStart/mRowStart
|
||||||
* @param aAreaEnd a pointer to GridNamedArea::mColumnEnd/mRowEnd
|
* @param aAreaEnd a pointer to GridNamedArea::mColumnEnd/mRowEnd
|
||||||
* @param aExplicitGridEnd the last line in the explicit grid
|
* @param aExplicitGridEnd the last line in the explicit grid
|
||||||
@ -338,7 +338,7 @@ protected:
|
|||||||
int32_t ResolveLine(const nsStyleGridLine& aLine,
|
int32_t ResolveLine(const nsStyleGridLine& aLine,
|
||||||
int32_t aNth,
|
int32_t aNth,
|
||||||
uint32_t aFromIndex,
|
uint32_t aFromIndex,
|
||||||
const nsTArray<nsTArray<nsString>>& aLineNameList,
|
const LineNameMap& aNameMap,
|
||||||
uint32_t GridNamedArea::* aAreaStart,
|
uint32_t GridNamedArea::* aAreaStart,
|
||||||
uint32_t GridNamedArea::* aAreaEnd,
|
uint32_t GridNamedArea::* aAreaEnd,
|
||||||
uint32_t aExplicitGridEnd,
|
uint32_t aExplicitGridEnd,
|
||||||
@ -353,7 +353,7 @@ protected:
|
|||||||
* @param aStyle the StylePosition() for the grid container
|
* @param aStyle the StylePosition() for the grid container
|
||||||
* @param aStart style data for the start line
|
* @param aStart style data for the start line
|
||||||
* @param aEnd style data for the end line
|
* @param aEnd style data for the end line
|
||||||
* @param aLineNameList the explicit named lines
|
* @param aNameMap for looking up explicit named lines
|
||||||
* @param aAreaStart a pointer to GridNamedArea::mColumnStart/mRowStart
|
* @param aAreaStart a pointer to GridNamedArea::mColumnStart/mRowStart
|
||||||
* @param aAreaEnd a pointer to GridNamedArea::mColumnEnd/mRowEnd
|
* @param aAreaEnd a pointer to GridNamedArea::mColumnEnd/mRowEnd
|
||||||
* @param aExplicitGridEnd the last line in the explicit grid
|
* @param aExplicitGridEnd the last line in the explicit grid
|
||||||
@ -361,7 +361,7 @@ protected:
|
|||||||
*/
|
*/
|
||||||
LineRange ResolveLineRange(const nsStyleGridLine& aStart,
|
LineRange ResolveLineRange(const nsStyleGridLine& aStart,
|
||||||
const nsStyleGridLine& aEnd,
|
const nsStyleGridLine& aEnd,
|
||||||
const nsTArray<nsTArray<nsString>>& aLineNameList,
|
const LineNameMap& aNameMap,
|
||||||
uint32_t GridNamedArea::* aAreaStart,
|
uint32_t GridNamedArea::* aAreaStart,
|
||||||
uint32_t GridNamedArea::* aAreaEnd,
|
uint32_t GridNamedArea::* aAreaEnd,
|
||||||
uint32_t aExplicitGridEnd,
|
uint32_t aExplicitGridEnd,
|
||||||
@ -376,7 +376,7 @@ protected:
|
|||||||
LineRange
|
LineRange
|
||||||
ResolveAbsPosLineRange(const nsStyleGridLine& aStart,
|
ResolveAbsPosLineRange(const nsStyleGridLine& aStart,
|
||||||
const nsStyleGridLine& aEnd,
|
const nsStyleGridLine& aEnd,
|
||||||
const nsTArray<nsTArray<nsString>>& aLineNameList,
|
const LineNameMap& aNameMap,
|
||||||
uint32_t GridNamedArea::* aAreaStart,
|
uint32_t GridNamedArea::* aAreaStart,
|
||||||
uint32_t GridNamedArea::* aAreaEnd,
|
uint32_t GridNamedArea::* aAreaEnd,
|
||||||
uint32_t aExplicitGridEnd,
|
uint32_t aExplicitGridEnd,
|
||||||
@ -389,9 +389,14 @@ protected:
|
|||||||
* with placement errors resolved. One or both positions may still
|
* with placement errors resolved. One or both positions may still
|
||||||
* be 'auto'.
|
* be 'auto'.
|
||||||
* @param aChild the grid item
|
* @param aChild the grid item
|
||||||
|
* @param aColLineNameMap for looking up explicit named column lines
|
||||||
|
* @param aRowLineNameMap for looking up explicit named row lines
|
||||||
* @param aStyle the StylePosition() for the grid container
|
* @param aStyle the StylePosition() for the grid container
|
||||||
*/
|
*/
|
||||||
GridArea PlaceDefinite(nsIFrame* aChild, const nsStylePosition* aStyle);
|
GridArea PlaceDefinite(nsIFrame* aChild,
|
||||||
|
const LineNameMap& aColLineNameMap,
|
||||||
|
const LineNameMap& aRowLineNameMap,
|
||||||
|
const nsStylePosition* aStyle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place aArea in the first column (in row aArea->mRows.mStart) starting at
|
* Place aArea in the first column (in row aArea->mRows.mStart) starting at
|
||||||
@ -452,9 +457,14 @@ protected:
|
|||||||
* a definite line (1-based) with placement errors resolved. One or both
|
* a definite line (1-based) with placement errors resolved. One or both
|
||||||
* positions may still be 'auto'.
|
* positions may still be 'auto'.
|
||||||
* @param aChild the abs.pos. grid item to place
|
* @param aChild the abs.pos. grid item to place
|
||||||
|
* @param aColLineNameMap for looking up explicit named column lines
|
||||||
|
* @param aRowLineNameMap for looking up explicit named row lines
|
||||||
* @param aStyle the StylePosition() for the grid container
|
* @param aStyle the StylePosition() for the grid container
|
||||||
*/
|
*/
|
||||||
GridArea PlaceAbsPos(nsIFrame* aChild, const nsStylePosition* aStyle);
|
GridArea PlaceAbsPos(nsIFrame* aChild,
|
||||||
|
const LineNameMap& aColLineNameMap,
|
||||||
|
const LineNameMap& aRowLineNameMap,
|
||||||
|
const nsStylePosition* aStyle);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place all child frames into the grid and expand the (implicit) grid as
|
* Place all child frames into the grid and expand the (implicit) grid as
|
||||||
@ -499,7 +509,7 @@ protected:
|
|||||||
typedef std::pair<int32_t, int32_t> LinePair;
|
typedef std::pair<int32_t, int32_t> LinePair;
|
||||||
LinePair ResolveLineRangeHelper(const nsStyleGridLine& aStart,
|
LinePair ResolveLineRangeHelper(const nsStyleGridLine& aStart,
|
||||||
const nsStyleGridLine& aEnd,
|
const nsStyleGridLine& aEnd,
|
||||||
const nsTArray<nsTArray<nsString>>& aLineNameList,
|
const LineNameMap& aNameMap,
|
||||||
uint32_t GridNamedArea::* aAreaStart,
|
uint32_t GridNamedArea::* aAreaStart,
|
||||||
uint32_t GridNamedArea::* aAreaEnd,
|
uint32_t GridNamedArea::* aAreaEnd,
|
||||||
uint32_t aExplicitGridEnd,
|
uint32_t aExplicitGridEnd,
|
||||||
|
Loading…
Reference in New Issue
Block a user