Bug 1116037 part 10 - Remove mColumnCount from nsRubyBaseContainerFrame. r=dbaron

--HG--
extra : source : 36096895ec5437c5f9cf6c97d6085bfeae8654c7
This commit is contained in:
Xidorn Quan 2014-12-30 10:05:54 +11:00
Родитель eb1ae2b722
Коммит 09350f0596
2 изменённых файлов: 13 добавлений и 7 удалений

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

@ -464,13 +464,16 @@ nsRubyBaseContainerFrame::ReflowColumns(const ReflowState& aReflowState,
nsReflowStatus reflowStatus = NS_FRAME_COMPLETE;
aStatus = NS_FRAME_COMPLETE;
mColumnCount = 0;
uint32_t columnIndex = 0;
RubyColumn column;
column.mTextFrames.SetCapacity(rtcCount);
RubyColumnEnumerator e(this, aReflowState.mTextContainers);
for (; !e.AtEnd(); e.Next()) {
e.GetColumn(column);
icoord += ReflowOneColumn(aReflowState, column, reflowStatus);
icoord += ReflowOneColumn(aReflowState, columnIndex, column, reflowStatus);
if (!NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
columnIndex++;
}
if (NS_INLINE_IS_BREAK(reflowStatus)) {
break;
}
@ -491,7 +494,10 @@ nsRubyBaseContainerFrame::ReflowColumns(const ReflowState& aReflowState,
// No more frames can be pulled.
break;
}
icoord += ReflowOneColumn(aReflowState, column, reflowStatus);
icoord += ReflowOneColumn(aReflowState, columnIndex, column, reflowStatus);
if (!NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
columnIndex++;
}
}
if (!e.AtEnd() && NS_INLINE_IS_BREAK_AFTER(reflowStatus)) {
@ -506,7 +512,7 @@ nsRubyBaseContainerFrame::ReflowColumns(const ReflowState& aReflowState,
}
if (NS_INLINE_IS_BREAK_BEFORE(reflowStatus)) {
if (!mColumnCount || !aReflowState.mAllowLineBreak) {
if (!columnIndex || !aReflowState.mAllowLineBreak) {
// If no column has been placed yet, or we have any span,
// the whole container should be in the next line.
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
@ -539,6 +545,7 @@ nsRubyBaseContainerFrame::ReflowColumns(const ReflowState& aReflowState,
nscoord
nsRubyBaseContainerFrame::ReflowOneColumn(const ReflowState& aReflowState,
uint32_t aColumnIndex,
const RubyColumn& aColumn,
nsReflowStatus& aStatus)
{
@ -644,10 +651,9 @@ nsRubyBaseContainerFrame::ReflowOneColumn(const ReflowState& aReflowState,
}
}
mColumnCount++;
if (aReflowState.mAllowLineBreak &&
baseReflowState.mLineLayout->NotifyOptionalBreakPosition(
this, mColumnCount, icoord <= baseReflowState.AvailableISize(),
this, aColumnIndex + 1, icoord <= baseReflowState.AvailableISize(),
gfxBreakPriority::eNormalBreak)) {
aStatus = NS_INLINE_LINE_BREAK_AFTER(aStatus);
}

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

@ -77,6 +77,7 @@ protected:
nscoord ReflowColumns(const ReflowState& aReflowState,
nsReflowStatus& aStatus);
nscoord ReflowOneColumn(const ReflowState& aReflowState,
uint32_t aColumnIndex,
const mozilla::RubyColumn& aColumn,
nsReflowStatus& aStatus);
nscoord ReflowSpans(const ReflowState& aReflowState);
@ -91,7 +92,6 @@ protected:
bool& aIsComplete);
nscoord mBaseline;
uint32_t mColumnCount;
};
#endif /* nsRubyBaseContainerFrame_h___ */