mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 03:15:11 +00:00
Bug 1286468 - Rename line related typedefs in nsBlockFrame. r=TYLin
MozReview-Commit-ID: Cz9R3D4NzMc --HG-- extra : rebase_source : 19da1e2a58abedf61fddd9c8e314830cf81a4602
This commit is contained in:
parent
10d4cdde8e
commit
a670e3349a
@ -6217,8 +6217,8 @@ nsLayoutUtils::GetFirstLinePosition(WritingMode aWM,
|
||||
return false;
|
||||
}
|
||||
|
||||
for (nsBlockFrame::const_line_iterator line = block->begin_lines(),
|
||||
line_end = block->end_lines();
|
||||
for (nsBlockFrame::ConstLineIterator line = block->begin_lines(),
|
||||
line_end = block->end_lines();
|
||||
line != line_end; ++line) {
|
||||
if (line->IsBlock()) {
|
||||
nsIFrame *kid = line->mFirstChild;
|
||||
@ -6256,8 +6256,8 @@ nsLayoutUtils::GetLastLineBaseline(WritingMode aWM,
|
||||
// No baseline. (We intentionally don't descend into scroll frames.)
|
||||
return false;
|
||||
|
||||
for (nsBlockFrame::const_reverse_line_iterator line = block->rbegin_lines(),
|
||||
line_end = block->rend_lines();
|
||||
for (nsBlockFrame::ConstReverseLineIterator line = block->rbegin_lines(),
|
||||
line_end = block->rend_lines();
|
||||
line != line_end; ++line) {
|
||||
if (line->IsBlock()) {
|
||||
nsIFrame *kid = line->mFirstChild;
|
||||
@ -6294,8 +6294,8 @@ CalculateBlockContentBEnd(WritingMode aWM, nsBlockFrame* aFrame)
|
||||
|
||||
nscoord contentBEnd = 0;
|
||||
|
||||
for (nsBlockFrame::line_iterator line = aFrame->begin_lines(),
|
||||
line_end = aFrame->end_lines();
|
||||
for (nsBlockFrame::LineIterator line = aFrame->begin_lines(),
|
||||
line_end = aFrame->end_lines();
|
||||
line != line_end; ++line) {
|
||||
if (line->IsBlock()) {
|
||||
nsIFrame* child = line->mFirstChild;
|
||||
|
@ -1347,7 +1347,7 @@ ReflowInput::CalculateHypotheticalPosition
|
||||
} else {
|
||||
NS_ASSERTION(iter.GetContainer() == blockFrame,
|
||||
"Found placeholder in wrong block!");
|
||||
nsBlockFrame::line_iterator lineBox = iter.GetLine();
|
||||
nsBlockFrame::LineIterator lineBox = iter.GetLine();
|
||||
|
||||
// How we determine the hypothetical box depends on whether the element
|
||||
// would have been inline-level or block-level
|
||||
|
@ -397,7 +397,7 @@ nsBlockFrame::List(FILE* out, const char* aPrefix, uint32_t aFlags) const
|
||||
|
||||
// Output the lines
|
||||
if (!mLines.empty()) {
|
||||
const_line_iterator line = begin_lines(), line_end = end_lines();
|
||||
ConstLineIterator line = begin_lines(), line_end = end_lines();
|
||||
for ( ; line != line_end; ++line) {
|
||||
line->List(out, pfx.get(), aFlags);
|
||||
}
|
||||
@ -409,8 +409,8 @@ nsBlockFrame::List(FILE* out, const char* aPrefix, uint32_t aFlags) const
|
||||
fprintf_stderr(out, "%sOverflow-lines %p/%p <\n", pfx.get(), overflowLines, &overflowLines->mFrames);
|
||||
nsCString nestedPfx(pfx);
|
||||
nestedPfx += " ";
|
||||
const_line_iterator line = overflowLines->mLines.begin(),
|
||||
line_end = overflowLines->mLines.end();
|
||||
ConstLineIterator line = overflowLines->mLines.begin(),
|
||||
line_end = overflowLines->mLines.end();
|
||||
for ( ; line != line_end; ++line) {
|
||||
line->List(out, nestedPfx.get(), aFlags);
|
||||
}
|
||||
@ -504,7 +504,7 @@ nsBlockFrame::GetCaretBaseline() const
|
||||
nsMargin bp = GetUsedBorderAndPadding();
|
||||
|
||||
if (!mLines.empty()) {
|
||||
const_line_iterator line = begin_lines();
|
||||
ConstLineIterator line = begin_lines();
|
||||
const nsLineBox* firstLine = line;
|
||||
if (firstLine->GetChildCount()) {
|
||||
return bp.top + firstLine->mFirstChild->GetCaretBaseline();
|
||||
@ -704,7 +704,7 @@ nsBlockFrame::GetMinISize(nsRenderingContext *aRenderingContext)
|
||||
InlineMinISizeData data;
|
||||
for (nsBlockFrame* curFrame = this; curFrame;
|
||||
curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
|
||||
for (line_iterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
|
||||
for (LineIterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
|
||||
line != line_end; ++line)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
@ -792,7 +792,7 @@ nsBlockFrame::GetPrefISize(nsRenderingContext *aRenderingContext)
|
||||
InlinePrefISizeData data;
|
||||
for (nsBlockFrame* curFrame = this; curFrame;
|
||||
curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
|
||||
for (line_iterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
|
||||
for (LineIterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
|
||||
line != line_end; ++line)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
@ -878,7 +878,7 @@ nsBlockFrame::GetPrefWidthTightBounds(nsRenderingContext* aRenderingContext,
|
||||
InlinePrefISizeData data;
|
||||
for (nsBlockFrame* curFrame = this; curFrame;
|
||||
curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
|
||||
for (line_iterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
|
||||
for (LineIterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
|
||||
line != line_end; ++line)
|
||||
{
|
||||
nscoord childX, childXMost;
|
||||
@ -1313,7 +1313,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||
nsSize containerSize = aMetrics.PhysicalSize();
|
||||
nscoord deltaX = containerSize.width - state.ContainerSize().width;
|
||||
if (deltaX != 0) {
|
||||
for (line_iterator line = begin_lines(), end = end_lines();
|
||||
for (LineIterator line = begin_lines(), end = end_lines();
|
||||
line != end; line++) {
|
||||
UpdateLineContainerSize(line, containerSize);
|
||||
}
|
||||
@ -1484,8 +1484,8 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
|
||||
bool
|
||||
nsBlockFrame::CheckForCollapsedBEndMarginFromClearanceLine()
|
||||
{
|
||||
line_iterator begin = begin_lines();
|
||||
line_iterator line = end_lines();
|
||||
LineIterator begin = begin_lines();
|
||||
LineIterator line = end_lines();
|
||||
|
||||
while (true) {
|
||||
if (begin == line) {
|
||||
@ -1719,7 +1719,7 @@ nsBlockFrame::ComputeOverflowAreas(const nsRect& aBounds,
|
||||
// the things that makes incremental reflow O(N^2).
|
||||
nsOverflowAreas areas(aBounds, aBounds);
|
||||
if (!ShouldApplyOverflowClipping(this, aDisplay)) {
|
||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
||||
for (LineIterator line = begin_lines(), line_end = end_lines();
|
||||
line != line_end;
|
||||
++line) {
|
||||
areas.UnionWith(line->GetOverflowAreas());
|
||||
@ -1757,7 +1757,7 @@ nsBlockFrame::UnionChildOverflow(nsOverflowAreas& aOverflowAreas)
|
||||
// get cached and re-used otherwise. Lines aren't exposed as normal
|
||||
// frame children, so calling UnionChildOverflow alone will end up
|
||||
// using the old cached values.
|
||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
||||
for (LineIterator line = begin_lines(), line_end = end_lines();
|
||||
line != line_end;
|
||||
++line) {
|
||||
nsRect bounds = line->GetPhysicalBounds();
|
||||
@ -1807,7 +1807,7 @@ void
|
||||
nsBlockFrame::LazyMarkLinesDirty()
|
||||
{
|
||||
if (GetStateBits() & NS_BLOCK_LOOK_FOR_DIRTY_FRAMES) {
|
||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
||||
for (LineIterator line = begin_lines(), line_end = end_lines();
|
||||
line != line_end; ++line) {
|
||||
int32_t n = line->GetChildCount();
|
||||
for (nsIFrame* lineFrame = line->mFirstChild;
|
||||
@ -1824,7 +1824,7 @@ nsBlockFrame::LazyMarkLinesDirty()
|
||||
}
|
||||
|
||||
void
|
||||
nsBlockFrame::MarkLineDirty(line_iterator aLine, const nsLineList* aLineList)
|
||||
nsBlockFrame::MarkLineDirty(LineIterator aLine, const nsLineList* aLineList)
|
||||
{
|
||||
// Mark aLine dirty
|
||||
aLine->MarkDirty();
|
||||
@ -1914,7 +1914,7 @@ nsBlockFrame::PrepareResizeReflow(BlockReflowInput& aState)
|
||||
}
|
||||
#endif
|
||||
|
||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
||||
for (LineIterator line = begin_lines(), line_end = end_lines();
|
||||
line != line_end;
|
||||
++line)
|
||||
{
|
||||
@ -1956,7 +1956,7 @@ nsBlockFrame::PrepareResizeReflow(BlockReflowInput& aState)
|
||||
}
|
||||
else {
|
||||
// Mark everything dirty
|
||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
||||
for (LineIterator line = begin_lines(), line_end = end_lines();
|
||||
line != line_end;
|
||||
++line)
|
||||
{
|
||||
@ -2124,7 +2124,7 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
||||
if (aState.mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE
|
||||
&& GetNextInFlow() && aState.mReflowInput.AvailableBSize() >
|
||||
GetLogicalSize().BSize(aState.mReflowInput.GetWritingMode())) {
|
||||
line_iterator lastLine = end_lines();
|
||||
LineIterator lastLine = end_lines();
|
||||
if (lastLine != begin_lines()) {
|
||||
--lastLine;
|
||||
lastLine->MarkDirty();
|
||||
@ -2145,7 +2145,7 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
||||
// We save up information about BR-clearance here
|
||||
StyleClear inlineFloatBreakType = aState.mFloatBreakType;
|
||||
|
||||
line_iterator line = begin_lines(), line_end = end_lines();
|
||||
LineIterator line = begin_lines(), line_end = end_lines();
|
||||
|
||||
// Reflow the lines that are already ours
|
||||
for ( ; line != line_end; ++line, aState.AdvanceToNextLine()) {
|
||||
@ -2509,7 +2509,7 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
|
||||
// line of my next-in-flow-chain. (But first, check that I
|
||||
// have any lines -- if I don't, just bail out of this
|
||||
// optimization.)
|
||||
line_iterator lineIter = this->end_lines();
|
||||
LineIterator lineIter = this->end_lines();
|
||||
if (lineIter != this->begin_lines()) {
|
||||
lineIter--; // I have lines; step back from dummy iterator to last line.
|
||||
nsBlockInFlowLineIterator bifLineIter(this, lineIter);
|
||||
@ -2763,7 +2763,7 @@ nsBlockFrame::DeleteLine(BlockReflowInput& aState,
|
||||
*/
|
||||
void
|
||||
nsBlockFrame::ReflowLine(BlockReflowInput& aState,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
bool* aKeepReflowGoing)
|
||||
{
|
||||
MOZ_ASSERT(aLine->GetChildCount(), "reflowing empty line");
|
||||
@ -2785,7 +2785,7 @@ nsBlockFrame::ReflowLine(BlockReflowInput& aState,
|
||||
|
||||
nsIFrame*
|
||||
nsBlockFrame::PullFrame(BlockReflowInput& aState,
|
||||
line_iterator aLine)
|
||||
LineIterator aLine)
|
||||
{
|
||||
// First check our remaining lines.
|
||||
if (end_lines() != aLine.next()) {
|
||||
@ -3058,7 +3058,7 @@ nsBlockFrame::CachedIsEmpty()
|
||||
return false;
|
||||
}
|
||||
|
||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
||||
for (LineIterator line = begin_lines(), line_end = end_lines();
|
||||
line != line_end;
|
||||
++line)
|
||||
{
|
||||
@ -3076,7 +3076,7 @@ nsBlockFrame::IsEmpty()
|
||||
return false;
|
||||
}
|
||||
|
||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
||||
for (LineIterator line = begin_lines(), line_end = end_lines();
|
||||
line != line_end;
|
||||
++line)
|
||||
{
|
||||
@ -3108,7 +3108,7 @@ nsBlockFrame::ShouldApplyBStartMargin(BlockReflowInput& aState,
|
||||
}
|
||||
|
||||
// Determine if this line is "essentially" the first line
|
||||
line_iterator line = begin_lines();
|
||||
LineIterator line = begin_lines();
|
||||
if (aState.mFlags.mHasLineAdjacentToTop) {
|
||||
line = aState.mLineAdjacentToTop;
|
||||
}
|
||||
@ -3134,7 +3134,7 @@ nsBlockFrame::ShouldApplyBStartMargin(BlockReflowInput& aState,
|
||||
|
||||
void
|
||||
nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
bool* aKeepReflowGoing)
|
||||
{
|
||||
NS_PRECONDITION(*aKeepReflowGoing, "bad caller");
|
||||
@ -3559,7 +3559,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
||||
}
|
||||
|
||||
if (aLine->SetCarriedOutBEndMargin(collapsedBEndMargin)) {
|
||||
line_iterator nextLine = aLine;
|
||||
LineIterator nextLine = aLine;
|
||||
++nextLine;
|
||||
if (nextLine != end_lines()) {
|
||||
nextLine->MarkPreviousMarginDirty();
|
||||
@ -3627,7 +3627,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
||||
nsLayoutUtils::GetAsBlock(nextFrame->GetParent());
|
||||
NS_ASSERTION(nifBlock,
|
||||
"A block's child's next in flow's parent must be a block!");
|
||||
for (line_iterator line = nifBlock->begin_lines(),
|
||||
for (LineIterator line = nifBlock->begin_lines(),
|
||||
line_end = nifBlock->end_lines(); line != line_end; ++line) {
|
||||
if (line->Contains(nextFrame)) {
|
||||
line->MarkDirty();
|
||||
@ -3731,7 +3731,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
|
||||
|
||||
void
|
||||
nsBlockFrame::ReflowInlineFrames(BlockReflowInput& aState,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
bool* aKeepReflowGoing)
|
||||
{
|
||||
*aKeepReflowGoing = true;
|
||||
@ -3806,7 +3806,7 @@ nsBlockFrame::ReflowInlineFrames(BlockReflowInput& aState,
|
||||
|
||||
void
|
||||
nsBlockFrame::PushTruncatedLine(BlockReflowInput& aState,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
bool* aKeepReflowGoing)
|
||||
{
|
||||
PushLines(aState, aLine.prev());
|
||||
@ -3817,7 +3817,7 @@ nsBlockFrame::PushTruncatedLine(BlockReflowInput& aState,
|
||||
void
|
||||
nsBlockFrame::DoReflowInlineFrames(BlockReflowInput& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
nsFlowAreaRect& aFloatAvailableSpace,
|
||||
nscoord& aAvailableSpaceHeight,
|
||||
nsFloatManager::SavedState*
|
||||
@ -4074,7 +4074,7 @@ nsBlockFrame::DoReflowInlineFrames(BlockReflowInput& aState,
|
||||
void
|
||||
nsBlockFrame::ReflowInlineFrame(BlockReflowInput& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
nsIFrame* aFrame,
|
||||
LineReflowStatus* aLineReflowStatus)
|
||||
{
|
||||
@ -4308,7 +4308,7 @@ CheckPlaceholderInLine(nsIFrame* aBlock, nsLineBox* aLine, nsFloatCache* aFC)
|
||||
void
|
||||
nsBlockFrame::SplitLine(BlockReflowInput& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
nsIFrame* aFrame,
|
||||
LineReflowStatus* aLineReflowStatus)
|
||||
{
|
||||
@ -4381,7 +4381,7 @@ nsBlockFrame::SplitLine(BlockReflowInput& aState,
|
||||
|
||||
bool
|
||||
nsBlockFrame::IsLastLine(BlockReflowInput& aState,
|
||||
line_iterator aLine)
|
||||
LineIterator aLine)
|
||||
{
|
||||
while (++aLine != end_lines()) {
|
||||
// There is another line
|
||||
@ -4397,7 +4397,7 @@ nsBlockFrame::IsLastLine(BlockReflowInput& aState,
|
||||
// Try our next-in-flows lines to answer the question
|
||||
nsBlockFrame* nextInFlow = (nsBlockFrame*) GetNextInFlow();
|
||||
while (nullptr != nextInFlow) {
|
||||
for (line_iterator line = nextInFlow->begin_lines(),
|
||||
for (LineIterator line = nextInFlow->begin_lines(),
|
||||
line_end = nextInFlow->end_lines();
|
||||
line != line_end;
|
||||
++line)
|
||||
@ -4415,7 +4415,7 @@ nsBlockFrame::IsLastLine(BlockReflowInput& aState,
|
||||
bool
|
||||
nsBlockFrame::PlaceLine(BlockReflowInput& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
nsFloatManager::SavedState *aFloatStateBeforeLine,
|
||||
LogicalRect& aFloatAvailableSpace,
|
||||
nscoord& aAvailableSpaceHeight,
|
||||
@ -4688,7 +4688,7 @@ nsBlockFrame::PushLines(BlockReflowInput& aState,
|
||||
// they are pulled up by our next-in-flow.
|
||||
|
||||
// XXXldb Can this get called O(N) times making the whole thing O(N^2)?
|
||||
for (line_iterator line = overflowLines->mLines.begin(),
|
||||
for (LineIterator line = overflowLines->mLines.begin(),
|
||||
line_end = overflowLines->mLines.end();
|
||||
line != line_end;
|
||||
++line)
|
||||
@ -5352,7 +5352,7 @@ nsBlockFrame::RemoveFloatFromFloatCache(nsIFrame* aFloat)
|
||||
{
|
||||
// Find which line contains the float, so we can update
|
||||
// the float cache.
|
||||
line_iterator line = begin_lines(), line_end = end_lines();
|
||||
LineIterator line = begin_lines(), line_end = end_lines();
|
||||
for ( ; line != line_end; ++line) {
|
||||
if (line->IsInline() && line->RemoveFloat(aFloat)) {
|
||||
break;
|
||||
@ -5451,7 +5451,7 @@ nsBlockFrame::TryAllLines(nsLineList::iterator* aIterator,
|
||||
}
|
||||
|
||||
nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
|
||||
line_iterator aLine)
|
||||
LineIterator aLine)
|
||||
: mFrame(aFrame), mLine(aLine), mLineList(&aFrame->mLines)
|
||||
{
|
||||
// This will assert if aLine isn't in mLines of aFrame:
|
||||
@ -5459,7 +5459,7 @@ nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
|
||||
}
|
||||
|
||||
nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
|
||||
line_iterator aLine, bool aInOverflow)
|
||||
LineIterator aLine, bool aInOverflow)
|
||||
: mFrame(aFrame), mLine(aLine),
|
||||
mLineList(aInOverflow ? &aFrame->GetOverflowLines()->mLines
|
||||
: &aFrame->mLines)
|
||||
@ -5507,15 +5507,15 @@ nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
|
||||
if (!child)
|
||||
return;
|
||||
|
||||
line_iterator line_end = aFrame->end_lines();
|
||||
LineIterator line_end = aFrame->end_lines();
|
||||
// Try to use the cursor if it exists, otherwise fall back to the first line
|
||||
if (nsLineBox* const cursor = aFrame->GetLineCursor()) {
|
||||
mLine = line_end;
|
||||
// Perform a simultaneous forward and reverse search starting from the
|
||||
// line cursor.
|
||||
nsBlockFrame::line_iterator line = aFrame->line(cursor);
|
||||
nsBlockFrame::reverse_line_iterator rline = aFrame->rline(cursor);
|
||||
nsBlockFrame::reverse_line_iterator rline_end = aFrame->rend_lines();
|
||||
nsBlockFrame::LineIterator line = aFrame->line(cursor);
|
||||
nsBlockFrame::ReverseLineIterator rline = aFrame->rline(cursor);
|
||||
nsBlockFrame::ReverseLineIterator rline_end = aFrame->rend_lines();
|
||||
// rline is positioned on the line containing 'cursor', so it's not
|
||||
// rline_end. So we can safely increment it (i.e. move it to one line
|
||||
// earlier) to start searching there.
|
||||
@ -5571,7 +5571,7 @@ nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
|
||||
} while (Next());
|
||||
}
|
||||
|
||||
nsBlockFrame::line_iterator
|
||||
nsBlockFrame::LineIterator
|
||||
nsBlockInFlowLineIterator::End()
|
||||
{
|
||||
return mLineList->end();
|
||||
@ -5580,7 +5580,7 @@ nsBlockInFlowLineIterator::End()
|
||||
bool
|
||||
nsBlockInFlowLineIterator::IsLastLineInList()
|
||||
{
|
||||
line_iterator end = End();
|
||||
LineIterator end = End();
|
||||
return mLine != end && mLine.next() == end;
|
||||
}
|
||||
|
||||
@ -5594,7 +5594,7 @@ nsBlockInFlowLineIterator::Next()
|
||||
bool
|
||||
nsBlockInFlowLineIterator::Prev()
|
||||
{
|
||||
line_iterator begin = mLineList->begin();
|
||||
LineIterator begin = mLineList->begin();
|
||||
if (mLine != begin) {
|
||||
--mLine;
|
||||
return true;
|
||||
@ -5628,7 +5628,7 @@ nsBlockInFlowLineIterator::Prev()
|
||||
bool
|
||||
nsBlockInFlowLineIterator::FindValidLine()
|
||||
{
|
||||
line_iterator end = mLineList->end();
|
||||
LineIterator end = mLineList->end();
|
||||
if (mLine != end)
|
||||
return true;
|
||||
bool currentlyInOverflowLines = GetInOverflow();
|
||||
@ -5742,7 +5742,7 @@ nsBlockFrame::DoRemoveFrame(nsIFrame* aDeletedFrame, uint32_t aFlags)
|
||||
// optimize away the line->Contains(next-in-flow) call below.
|
||||
bool isLastFrameOnLine = 1 == line->GetChildCount();
|
||||
if (!isLastFrameOnLine) {
|
||||
line_iterator next = line.next();
|
||||
LineIterator next = line.next();
|
||||
nsIFrame* lastFrame = next != line_end ?
|
||||
next->mFirstChild->GetPrevSibling() :
|
||||
(searchingOverflowList ? overflowLines->mFrames.LastChild() :
|
||||
@ -6246,7 +6246,7 @@ nsBlockFrame::FindTrailingClear()
|
||||
// find the break type of the last line
|
||||
for (nsIFrame* b = this; b; b = b->GetPrevInFlow()) {
|
||||
nsBlockFrame* block = static_cast<nsBlockFrame*>(b);
|
||||
line_iterator endLine = block->end_lines();
|
||||
LineIterator endLine = block->end_lines();
|
||||
if (endLine != block->begin_lines()) {
|
||||
--endLine;
|
||||
return endLine->GetBreakTypeAfter();
|
||||
@ -6350,7 +6350,7 @@ nsBlockFrame::RecoverFloats(nsFloatManager& aFloatManager, WritingMode aWM,
|
||||
}
|
||||
|
||||
// Recurse into our normal children
|
||||
for (nsBlockFrame::line_iterator line = begin_lines(); line != end_lines(); ++line) {
|
||||
for (nsBlockFrame::LineIterator line = begin_lines(); line != end_lines(); ++line) {
|
||||
if (line->IsBlock()) {
|
||||
RecoverFloatsFor(line->mFirstChild, aFloatManager, aWM, aContainerSize);
|
||||
}
|
||||
@ -6453,7 +6453,7 @@ static void DebugOutputDrawLine(int32_t aDepth, nsLineBox* aLine, bool aDrawn) {
|
||||
|
||||
static void
|
||||
DisplayLine(nsDisplayListBuilder* aBuilder, const nsRect& aLineArea,
|
||||
const nsRect& aDirtyRect, nsBlockFrame::line_iterator& aLine,
|
||||
const nsRect& aDirtyRect, nsBlockFrame::LineIterator& aLine,
|
||||
int32_t aDepth, int32_t& aDrawnLines, const nsDisplayListSet& aLists,
|
||||
nsBlockFrame* aFrame, TextOverflow* aTextOverflow) {
|
||||
// If the line's combined area (which includes child frames that
|
||||
@ -6560,10 +6560,10 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
// frame in our child list, it's also true for |this|.
|
||||
nsLineBox* cursor = aBuilder->ShouldDescendIntoFrame(this) ?
|
||||
nullptr : GetFirstLineContaining(aDirtyRect.y);
|
||||
line_iterator line_end = end_lines();
|
||||
LineIterator line_end = end_lines();
|
||||
|
||||
if (cursor) {
|
||||
for (line_iterator line = mLines.begin(cursor);
|
||||
for (LineIterator line = mLines.begin(cursor);
|
||||
line != line_end;
|
||||
++line) {
|
||||
nsRect lineArea = line->GetVisualOverflowArea();
|
||||
@ -6582,7 +6582,7 @@ nsBlockFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
|
||||
int32_t lineCount = 0;
|
||||
nscoord lastY = INT32_MIN;
|
||||
nscoord lastYMost = INT32_MIN;
|
||||
for (line_iterator line = begin_lines();
|
||||
for (LineIterator line = begin_lines();
|
||||
line != line_end;
|
||||
++line) {
|
||||
nsRect lineArea = line->GetVisualOverflowArea();
|
||||
@ -6713,7 +6713,7 @@ nsLineBox* nsBlockFrame::GetFirstLineContaining(nscoord y)
|
||||
FrameProperties props = Properties();
|
||||
|
||||
nsLineBox* property = props.Get(LineCursorProperty());
|
||||
line_iterator cursor = mLines.begin(property);
|
||||
LineIterator cursor = mLines.begin(property);
|
||||
nsRect cursorArea = cursor->GetVisualOverflowArea();
|
||||
|
||||
while ((cursorArea.IsEmpty() || cursorArea.YMost() > y)
|
||||
@ -6745,7 +6745,7 @@ nsBlockFrame::ChildIsDirty(nsIFrame* aChild)
|
||||
// The bullet lives in the first line, unless the first line has
|
||||
// height 0 and there is a second line, in which case it lives
|
||||
// in the second line.
|
||||
line_iterator bulletLine = begin_lines();
|
||||
LineIterator bulletLine = begin_lines();
|
||||
if (bulletLine != end_lines() && bulletLine->BSize() == 0 &&
|
||||
bulletLine != mLines.back()) {
|
||||
bulletLine = bulletLine.next();
|
||||
@ -7136,7 +7136,7 @@ nsBlockFrame::CheckFloats(BlockReflowInput& aState)
|
||||
|
||||
// Check that the float list is what we would have built
|
||||
AutoTArray<nsIFrame*, 8> lineFloats;
|
||||
for (line_iterator line = begin_lines(), line_end = end_lines();
|
||||
for (LineIterator line = begin_lines(), line_end = end_lines();
|
||||
line != line_end; ++line) {
|
||||
if (line->HasFloats()) {
|
||||
nsFloatCache* fc = line->GetFirstFloat();
|
||||
@ -7378,7 +7378,7 @@ nsBlockFrame::VerifyLines(bool aFinalCheckOK)
|
||||
// Add up the counts on each line. Also validate that IsFirstLine is
|
||||
// set properly.
|
||||
int32_t count = 0;
|
||||
line_iterator line, line_end;
|
||||
LineIterator line, line_end;
|
||||
for (line = begin_lines(), line_end = end_lines();
|
||||
line != line_end;
|
||||
++line) {
|
||||
@ -7421,8 +7421,8 @@ nsBlockFrame::VerifyLines(bool aFinalCheckOK)
|
||||
if (cursor) {
|
||||
FrameLines* overflowLines = GetOverflowLines();
|
||||
if (overflowLines) {
|
||||
line_iterator line = overflowLines->mLines.begin();
|
||||
line_iterator line_end = overflowLines->mLines.end();
|
||||
LineIterator line = overflowLines->mLines.begin();
|
||||
LineIterator line_end = overflowLines->mLines.end();
|
||||
for (; line != line_end; ++line) {
|
||||
if (line == cursor) {
|
||||
cursor = nullptr;
|
||||
@ -7492,8 +7492,8 @@ nsBlockFrame::VerifyOverflowSituation()
|
||||
}
|
||||
nsLineBox* cursor = flow->GetLineCursor();
|
||||
if (cursor) {
|
||||
line_iterator line = flow->begin_lines();
|
||||
line_iterator line_end = flow->end_lines();
|
||||
LineIterator line = flow->begin_lines();
|
||||
LineIterator line_end = flow->end_lines();
|
||||
for (; line != line_end && line != cursor; ++line)
|
||||
;
|
||||
if (line == line_end && overflowLines) {
|
||||
|
@ -83,21 +83,21 @@ public:
|
||||
NS_DECL_QUERYFRAME_TARGET(nsBlockFrame)
|
||||
NS_DECL_FRAMEARENA_HELPERS
|
||||
|
||||
typedef nsLineList::iterator line_iterator;
|
||||
typedef nsLineList::const_iterator const_line_iterator;
|
||||
typedef nsLineList::reverse_iterator reverse_line_iterator;
|
||||
typedef nsLineList::const_reverse_iterator const_reverse_line_iterator;
|
||||
typedef nsLineList::iterator LineIterator;
|
||||
typedef nsLineList::const_iterator ConstLineIterator;
|
||||
typedef nsLineList::reverse_iterator ReverseLineIterator;
|
||||
typedef nsLineList::const_reverse_iterator ConstReverseLineIterator;
|
||||
|
||||
line_iterator begin_lines() { return mLines.begin(); }
|
||||
line_iterator end_lines() { return mLines.end(); }
|
||||
const_line_iterator begin_lines() const { return mLines.begin(); }
|
||||
const_line_iterator end_lines() const { return mLines.end(); }
|
||||
reverse_line_iterator rbegin_lines() { return mLines.rbegin(); }
|
||||
reverse_line_iterator rend_lines() { return mLines.rend(); }
|
||||
const_reverse_line_iterator rbegin_lines() const { return mLines.rbegin(); }
|
||||
const_reverse_line_iterator rend_lines() const { return mLines.rend(); }
|
||||
line_iterator line(nsLineBox* aList) { return mLines.begin(aList); }
|
||||
reverse_line_iterator rline(nsLineBox* aList) { return mLines.rbegin(aList); }
|
||||
LineIterator begin_lines() { return mLines.begin(); }
|
||||
LineIterator end_lines() { return mLines.end(); }
|
||||
ConstLineIterator begin_lines() const { return mLines.begin(); }
|
||||
ConstLineIterator end_lines() const { return mLines.end(); }
|
||||
ReverseLineIterator rbegin_lines() { return mLines.rbegin(); }
|
||||
ReverseLineIterator rend_lines() { return mLines.rend(); }
|
||||
ConstReverseLineIterator rbegin_lines() const { return mLines.rbegin(); }
|
||||
ConstReverseLineIterator rend_lines() const { return mLines.rend(); }
|
||||
LineIterator line(nsLineBox* aList) { return mLines.begin(aList); }
|
||||
ReverseLineIterator rline(nsLineBox* aList) { return mLines.rbegin(aList); }
|
||||
|
||||
friend nsBlockFrame* NS_NewBlockFrame(nsIPresShell* aPresShell,
|
||||
nsStyleContext* aContext);
|
||||
@ -648,7 +648,7 @@ protected:
|
||||
* @param aKeepReflowGoing [OUT] indicates whether the caller should continue to reflow more lines
|
||||
*/
|
||||
void ReflowLine(BlockReflowInput& aState,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
bool* aKeepReflowGoing);
|
||||
|
||||
// Return false if it needs another reflow because of reduced space
|
||||
@ -656,7 +656,7 @@ protected:
|
||||
// return true otherwise.
|
||||
bool PlaceLine(BlockReflowInput& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
nsFloatManager::SavedState* aFloatStateBeforeLine,
|
||||
mozilla::LogicalRect& aFloatAvailableSpace, //in-out
|
||||
nscoord& aAvailableSpaceHeight, // in-out
|
||||
@ -676,11 +676,11 @@ protected:
|
||||
* @param aLine the line to mark dirty
|
||||
* @param aLineList the line list containing that line
|
||||
*/
|
||||
void MarkLineDirty(line_iterator aLine, const nsLineList* aLineList);
|
||||
void MarkLineDirty(LineIterator aLine, const nsLineList* aLineList);
|
||||
|
||||
// XXX where to go
|
||||
bool IsLastLine(BlockReflowInput& aState,
|
||||
line_iterator aLine);
|
||||
LineIterator aLine);
|
||||
|
||||
void DeleteLine(BlockReflowInput& aState,
|
||||
nsLineList::iterator aLine,
|
||||
@ -694,16 +694,16 @@ protected:
|
||||
nsIFrame* aChildFrame);
|
||||
|
||||
void ReflowBlockFrame(BlockReflowInput& aState,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
bool* aKeepGoing);
|
||||
|
||||
void ReflowInlineFrames(BlockReflowInput& aState,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
bool* aKeepLineGoing);
|
||||
|
||||
void DoReflowInlineFrames(BlockReflowInput& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
nsFlowAreaRect& aFloatAvailableSpace,
|
||||
nscoord& aAvailableSpaceHeight,
|
||||
nsFloatManager::SavedState*
|
||||
@ -714,7 +714,7 @@ protected:
|
||||
|
||||
void ReflowInlineFrame(BlockReflowInput& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
nsIFrame* aFrame,
|
||||
LineReflowStatus* aLineReflowStatus);
|
||||
|
||||
@ -763,12 +763,12 @@ protected:
|
||||
* flag aState.mReflowStatus as incomplete.
|
||||
*/
|
||||
void PushTruncatedLine(BlockReflowInput& aState,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
bool* aKeepReflowGoing);
|
||||
|
||||
void SplitLine(BlockReflowInput& aState,
|
||||
nsLineLayout& aLineLayout,
|
||||
line_iterator aLine,
|
||||
LineIterator aLine,
|
||||
nsIFrame* aFrame,
|
||||
LineReflowStatus* aLineReflowStatus);
|
||||
|
||||
@ -778,7 +778,7 @@ protected:
|
||||
* @return the pulled frame or nullptr
|
||||
*/
|
||||
nsIFrame* PullFrame(BlockReflowInput& aState,
|
||||
line_iterator aLine);
|
||||
LineIterator aLine);
|
||||
|
||||
/**
|
||||
* Try to pull a frame out of a line pointed at by aFromLine.
|
||||
@ -954,12 +954,12 @@ private:
|
||||
*/
|
||||
class nsBlockInFlowLineIterator {
|
||||
public:
|
||||
typedef nsBlockFrame::line_iterator line_iterator;
|
||||
typedef nsBlockFrame::LineIterator LineIterator;
|
||||
/**
|
||||
* Set up the iterator to point to aLine which must be a normal line
|
||||
* in aFrame (not an overflow line).
|
||||
*/
|
||||
nsBlockInFlowLineIterator(nsBlockFrame* aFrame, line_iterator aLine);
|
||||
nsBlockInFlowLineIterator(nsBlockFrame* aFrame, LineIterator aLine);
|
||||
/**
|
||||
* Set up the iterator to point to the first line found starting from
|
||||
* aFrame. Sets aFoundValidLine to false if there is no such line.
|
||||
@ -978,7 +978,7 @@ public:
|
||||
nsBlockInFlowLineIterator(nsBlockFrame* aFrame, nsIFrame* aFindFrame,
|
||||
bool* aFoundValidLine);
|
||||
|
||||
line_iterator GetLine() { return mLine; }
|
||||
LineIterator GetLine() { return mLine; }
|
||||
bool IsLastLineInList();
|
||||
nsBlockFrame* GetContainer() { return mFrame; }
|
||||
bool GetInOverflow() { return mLineList != &mFrame->mLines; }
|
||||
@ -992,7 +992,7 @@ public:
|
||||
/**
|
||||
* Returns the end-iterator of whatever line list we're in.
|
||||
*/
|
||||
line_iterator End();
|
||||
LineIterator End();
|
||||
|
||||
/**
|
||||
* Returns false if there are no more lines. After this has returned false,
|
||||
@ -1008,10 +1008,10 @@ public:
|
||||
private:
|
||||
friend class nsBlockFrame;
|
||||
// XXX nsBlockFrame uses this internally in one place. Try to remove it.
|
||||
nsBlockInFlowLineIterator(nsBlockFrame* aFrame, line_iterator aLine, bool aInOverflow);
|
||||
nsBlockInFlowLineIterator(nsBlockFrame* aFrame, LineIterator aLine, bool aInOverflow);
|
||||
|
||||
nsBlockFrame* mFrame;
|
||||
line_iterator mLine;
|
||||
LineIterator mLine;
|
||||
nsLineList* mLineList; // the line list mLine is in
|
||||
|
||||
/**
|
||||
|
@ -101,8 +101,8 @@ nsBlockReflowContext::ComputeCollapsedBStartMargin(const ReflowInput& aRI,
|
||||
// OK because our traversal is idempotent.
|
||||
for ( ;block; block = static_cast<nsBlockFrame*>(block->GetNextInFlow())) {
|
||||
for (int overflowLines = 0; overflowLines <= 1; ++overflowLines) {
|
||||
nsBlockFrame::line_iterator line;
|
||||
nsBlockFrame::line_iterator line_end;
|
||||
nsBlockFrame::LineIterator line;
|
||||
nsBlockFrame::LineIterator line_end;
|
||||
bool anyLines = true;
|
||||
if (overflowLines) {
|
||||
nsBlockFrame::FrameLines* frames = block->GetOverflowLines();
|
||||
|
@ -3977,7 +3977,7 @@ static FrameTarget DrillDownToSelectionFrame(nsIFrame* aFrame,
|
||||
// no valid FrameTarget on the line, it returns a null FrameTarget
|
||||
static FrameTarget GetSelectionClosestFrameForLine(
|
||||
nsBlockFrame* aParent,
|
||||
nsBlockFrame::line_iterator aLine,
|
||||
nsBlockFrame::LineIterator aLine,
|
||||
nsPoint aPoint,
|
||||
uint32_t aFlags)
|
||||
{
|
||||
@ -4044,8 +4044,8 @@ static FrameTarget GetSelectionClosestFrameForBlock(nsIFrame* aFrame,
|
||||
return FrameTarget::Null();
|
||||
|
||||
// This code searches for the correct line
|
||||
nsBlockFrame::line_iterator firstLine = bf->begin_lines();
|
||||
nsBlockFrame::line_iterator end = bf->end_lines();
|
||||
nsBlockFrame::LineIterator firstLine = bf->begin_lines();
|
||||
nsBlockFrame::LineIterator end = bf->end_lines();
|
||||
if (firstLine == end) {
|
||||
nsIContent *blockContent = aFrame->GetContent();
|
||||
if (blockContent) {
|
||||
@ -4054,8 +4054,8 @@ static FrameTarget GetSelectionClosestFrameForBlock(nsIFrame* aFrame,
|
||||
}
|
||||
return FrameTarget::Null();
|
||||
}
|
||||
nsBlockFrame::line_iterator curLine = firstLine;
|
||||
nsBlockFrame::line_iterator closestLine = end;
|
||||
nsBlockFrame::LineIterator curLine = firstLine;
|
||||
nsBlockFrame::LineIterator closestLine = end;
|
||||
// Convert aPoint into a LogicalPoint in the writing-mode of this block
|
||||
WritingMode wm = curLine->mWritingMode;
|
||||
LogicalPoint pt(wm, aPoint, curLine->mContainerSize);
|
||||
@ -4073,8 +4073,8 @@ static FrameTarget GetSelectionClosestFrameForBlock(nsIFrame* aFrame,
|
||||
}
|
||||
|
||||
if (closestLine == end) {
|
||||
nsBlockFrame::line_iterator prevLine = curLine.prev();
|
||||
nsBlockFrame::line_iterator nextLine = curLine;
|
||||
nsBlockFrame::LineIterator prevLine = curLine.prev();
|
||||
nsBlockFrame::LineIterator nextLine = curLine;
|
||||
// Avoid empty lines
|
||||
while (nextLine != end && nextLine->IsEmpty())
|
||||
++nextLine;
|
||||
|
@ -1451,7 +1451,7 @@ BuildTextRuns(DrawTarget* aDrawTarget, nsTextFrame* aForFrame,
|
||||
NS_ASSERTION(backIterator.GetContainer() == block,
|
||||
"Someone lied to us about the block");
|
||||
}
|
||||
nsBlockFrame::line_iterator startLine = backIterator.GetLine();
|
||||
nsBlockFrame::LineIterator startLine = backIterator.GetLine();
|
||||
|
||||
// Find a line where we can start building text runs. We choose the last line
|
||||
// where:
|
||||
@ -1473,7 +1473,7 @@ BuildTextRuns(DrawTarget* aDrawTarget, nsTextFrame* aForFrame,
|
||||
bool mayBeginInTextRun = true;
|
||||
while (true) {
|
||||
forwardIterator = backIterator;
|
||||
nsBlockFrame::line_iterator line = backIterator.GetLine();
|
||||
nsBlockFrame::LineIterator line = backIterator.GetLine();
|
||||
if (!backIterator.Prev() || backIterator.GetLine()->IsBlock()) {
|
||||
mayBeginInTextRun = false;
|
||||
break;
|
||||
@ -1519,7 +1519,7 @@ BuildTextRuns(DrawTarget* aDrawTarget, nsTextFrame* aForFrame,
|
||||
bool seenStartLine = false;
|
||||
uint32_t linesAfterStartLine = 0;
|
||||
do {
|
||||
nsBlockFrame::line_iterator line = forwardIterator.GetLine();
|
||||
nsBlockFrame::LineIterator line = forwardIterator.GetLine();
|
||||
if (line->IsBlock())
|
||||
break;
|
||||
line->SetInvalidateTextRuns(false);
|
||||
@ -5093,7 +5093,7 @@ LazyGetLineBaselineOffset(nsIFrame* aChildFrame, nsBlockFrame* aBlockFrame)
|
||||
nsIFrame::LineBaselineOffset(), &offsetFound);
|
||||
|
||||
if (!offsetFound) {
|
||||
for (nsBlockFrame::line_iterator line = aBlockFrame->begin_lines(),
|
||||
for (nsBlockFrame::LineIterator line = aBlockFrame->begin_lines(),
|
||||
line_end = aBlockFrame->end_lines();
|
||||
line != line_end; line++) {
|
||||
if (line->IsInline()) {
|
||||
|
@ -4740,7 +4740,7 @@ SVGTextFrame::AdjustChunksForLineBreaks()
|
||||
nsBlockFrame* block = nsLayoutUtils::GetAsBlock(PrincipalChildList().FirstChild());
|
||||
NS_ASSERTION(block, "expected block frame");
|
||||
|
||||
nsBlockFrame::line_iterator line = block->begin_lines();
|
||||
nsBlockFrame::LineIterator line = block->begin_lines();
|
||||
|
||||
CharIterator it(this, CharIterator::eOriginal);
|
||||
while (!it.AtEnd() && line != block->end_lines()) {
|
||||
|
Loading…
Reference in New Issue
Block a user