зеркало из https://github.com/mozilla/gecko-dev.git
Bug 775624 Part 21 - Remove NS_FRAME_NOT_COMPLETE. r=dholbert
To preserve the semantics, Reset() is called to clear other bits in the status prior to set the incomplete bit. Though some of them might not be necessary. MozReview-Commit-ID: InNDwcpp28A --HG-- extra : rebase_source : 833e44a5dbb447d82c67f715cd5b0b2e97a5c62d
This commit is contained in:
Родитель
19c8d3d9bf
Коммит
f19bfc4b93
|
@ -6759,13 +6759,12 @@ nsFrame::IsFrameTreeTooDeep(const ReflowInput& aReflowInput,
|
|||
aMetrics.mCarriedOutBEndMargin.Zero();
|
||||
aMetrics.mOverflowAreas.Clear();
|
||||
|
||||
aStatus.Reset();
|
||||
if (GetNextInFlow()) {
|
||||
// Reflow depth might vary between reflows, so we might have
|
||||
// successfully reflowed and split this frame before. If so, we
|
||||
// shouldn't delete its continuations.
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
} else {
|
||||
aStatus = NS_FRAME_COMPLETE;
|
||||
aStatus.SetIncomplete();
|
||||
}
|
||||
|
||||
return true;
|
||||
|
|
|
@ -370,7 +370,6 @@ private:
|
|||
};
|
||||
|
||||
#define NS_FRAME_COMPLETE 0 // Note: not a bit!
|
||||
#define NS_FRAME_NOT_COMPLETE 0x1
|
||||
|
||||
#define NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics) \
|
||||
aStatus.UpdateTruncated(aReflowInput, aMetrics);
|
||||
|
@ -2349,7 +2348,7 @@ public:
|
|||
* frame state will be cleared.
|
||||
*
|
||||
* XXX This doesn't make sense. If the frame is reflowed but not complete, then
|
||||
* the status should be NS_FRAME_NOT_COMPLETE and not NS_FRAME_COMPLETE
|
||||
* the status should have mIncomplete bit set.
|
||||
* XXX Don't we want the semantics to dictate that we only call this once for
|
||||
* a given reflow?
|
||||
*/
|
||||
|
|
|
@ -1012,7 +1012,8 @@ nsImageFrame::Reflow(nsPresContext* aPresContext,
|
|||
// our desired height was greater than 0, so to avoid infinite
|
||||
// splitting, use 1 pixel as the min
|
||||
aMetrics.Height() = std::max(nsPresContext::CSSPixelsToAppUnits(1), aReflowInput.AvailableHeight());
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
}
|
||||
|
||||
aMetrics.SetOverflowAreasToDesiredBounds();
|
||||
|
|
|
@ -720,7 +720,8 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
|
|||
#endif
|
||||
if (nullptr == frame) {
|
||||
if (!isComplete) {
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
|
|
@ -9545,8 +9545,10 @@ nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth,
|
|||
}
|
||||
|
||||
// Compute reflow status
|
||||
aStatus = contentLength == maxContentLength
|
||||
? NS_FRAME_COMPLETE : NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
if (contentLength != maxContentLength) {
|
||||
aStatus.SetIncomplete();
|
||||
}
|
||||
|
||||
if (charsFit == 0 && length > 0 && !usedHyphenation) {
|
||||
// Couldn't place any text
|
||||
|
|
|
@ -3098,7 +3098,8 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
|||
tfoot->SetRepeatable(false);
|
||||
}
|
||||
PushChildren(rowGroups, childX);
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
break;
|
||||
}
|
||||
|
||||
|
@ -3194,7 +3195,8 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
|||
else if (tfoot && tfoot->IsRepeatable()) {
|
||||
tfoot->SetRepeatable(false);
|
||||
}
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
PushChildren(rowGroups, childX + 1);
|
||||
aLastChildReflowed = kidFrame;
|
||||
break;
|
||||
|
@ -3209,7 +3211,8 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
|
|||
else if (tfoot && tfoot->IsRepeatable()) {
|
||||
tfoot->SetRepeatable(false);
|
||||
}
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
PushChildren(rowGroups, childX);
|
||||
aLastChildReflowed = prevKidFrame;
|
||||
break;
|
||||
|
|
|
@ -937,7 +937,8 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
|
|||
// allow the table to determine if/how the table needs to be rebalanced
|
||||
// If any of the cells are not complete, then we're not complete
|
||||
if (status.IsIncomplete()) {
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
}
|
||||
} else {
|
||||
if (iCoord != origKidNormalPosition.I(wm)) {
|
||||
|
@ -1026,7 +1027,8 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
|
|||
iCoord += kidFrame->ISize(wm);
|
||||
|
||||
if (kidFrame->GetNextInFlow()) {
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
}
|
||||
}
|
||||
ConsiderChildOverflow(aDesiredSize.mOverflowAreas, kidFrame);
|
||||
|
|
|
@ -1218,7 +1218,8 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
|||
// Push the row frame that follows
|
||||
nsTableRowFrame* nextRowFrame = rowFrame->GetNextRow();
|
||||
if (nextRowFrame) {
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
}
|
||||
aDesiredSize.Height() += rowMetrics.Height();
|
||||
if (prevRowFrame)
|
||||
|
@ -1249,7 +1250,8 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
|||
spanningRowBottom = prevRowFrame->GetNormalRect().YMost();
|
||||
lastRowThisPage = prevRowFrame;
|
||||
isTopOfPage = (lastRowThisPage == firstRowThisPage) && aReflowInput.mFlags.mIsTopOfPage;
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
}
|
||||
else {
|
||||
// We can't push children, so let our parent reflow us again with more space
|
||||
|
@ -1289,7 +1291,8 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
|||
contRow = nullptr;
|
||||
nsTableRowFrame* oldLastRowThisPage = lastRowThisPage;
|
||||
lastRowThisPage = rowBefore;
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
|
||||
// Call SplitSpanningCells again with rowBefore as the last row on the page
|
||||
SplitSpanningCells(*aPresContext, aReflowInput, *aTableFrame,
|
||||
|
@ -1320,7 +1323,8 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
|||
else {
|
||||
aDesiredSize.Height() = std::max(aDesiredSize.Height(), bMost);
|
||||
if (contRow) {
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
}
|
||||
}
|
||||
if (aStatus.IsIncomplete() && !contRow) {
|
||||
|
@ -1338,7 +1342,8 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
|
|||
nsTableRowFrame* nextRow = rowFrame->GetNextRow();
|
||||
if (nextRow && nsTableFrame::PageBreakAfter(rowFrame, nextRow)) {
|
||||
PushChildren(nextRow, rowFrame);
|
||||
aStatus = NS_FRAME_NOT_COMPLETE;
|
||||
aStatus.Reset();
|
||||
aStatus.SetIncomplete();
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -1391,7 +1396,7 @@ nsTableRowGroupFrame::Reflow(nsPresContext* aPresContext,
|
|||
// not paginated ... we can't split across columns yet.
|
||||
if (aReflowInput.mFlags.mTableIsSplittable &&
|
||||
NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableHeight() &&
|
||||
(aStatus == NS_FRAME_NOT_COMPLETE || splitDueToPageBreak ||
|
||||
(aStatus.IsIncomplete() || splitDueToPageBreak ||
|
||||
aDesiredSize.Height() > aReflowInput.AvailableHeight())) {
|
||||
// Nope, find a place to split the row group
|
||||
bool specialReflow = (bool)aReflowInput.mFlags.mSpecialBSizeReflow;
|
||||
|
|
Загрузка…
Ссылка в новой задаче