--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -68,18 +68,18 @@ static const char16_t kDiscCharacter = 0
using namespace mozilla;
using namespace mozilla::css;
using namespace mozilla::dom;
using namespace mozilla::layout;
typedef nsAbsoluteContainingBlock::AbsPosReflowFlags AbsPosReflowFlags;
static void MarkAllDescendantLinesDirty(nsBlockFrame* aBlock)
{
- nsLineList::iterator line = aBlock->begin_lines();
- nsLineList::iterator endLine = aBlock->end_lines();
+ nsLineList::iterator line = aBlock->BeginLine();
+ nsLineList::iterator endLine = aBlock->EndLine();
while (line != endLine) {
if (line->IsBlock()) {
nsIFrame* f = line->mFirstChild;
nsBlockFrame* bf = nsLayoutUtils::GetAsBlock(f);
if (bf) {
MarkAllDescendantLinesDirty(bf);
}
}
@@ -112,18 +112,18 @@ static void MarkSameFloatManagerLinesDir
static bool BlockHasAnyFloats(nsIFrame* aFrame)
{
nsBlockFrame* block = nsLayoutUtils::GetAsBlock(aFrame);
if (!block)
return false;
if (block->GetChildList(nsIFrame::kFloatList).FirstChild())
return true;
- nsLineList::iterator line = block->begin_lines();
- nsLineList::iterator endLine = block->end_lines();
+ nsLineList::iterator line = block->BeginLine();
+ nsLineList::iterator endLine = block->EndLine();
while (line != endLine) {
if (line->IsBlock() && BlockHasAnyFloats(line->mFirstChild))
return true;
++line;
}
return false;
}
@@ -392,17 +392,17 @@ nsBlockFrame::List(FILE* out, const char
fprintf_stderr(out, "%s<\n", str.get());
nsCString pfx(aPrefix);
pfx += " ";
// Output the lines
if (!mLines.empty()) {
- ConstLineIterator line = begin_lines(), line_end = end_lines();
+ ConstLineIterator line = BeginLine(), line_end = EndLine();
for ( ; line != line_end; ++line) {
line->List(out, pfx.get(), aFlags);
}
}
// Output the overflow lines.
const FrameLines* overflowLines = GetOverflowLines();
if (overflowLines && !overflowLines->mLines.empty()) {
@@ -499,17 +499,17 @@ nsBlockFrame::GetLogicalBaseline(Writing
nscoord
nsBlockFrame::GetCaretBaseline() const
{
nsRect contentRect = GetContentRect();
nsMargin bp = GetUsedBorderAndPadding();
if (!mLines.empty()) {
- ConstLineIterator line = begin_lines();
+ ConstLineIterator line = BeginLine();
const nsLineBox* firstLine = line;
if (firstLine->GetChildCount()) {
return bp.top + firstLine->mFirstChild->GetCaretBaseline();
}
}
float inflation = nsLayoutUtils::FontSizeInflationFor(this);
RefPtr<nsFontMetrics> fm =
nsLayoutUtils::GetFontMetricsForFrame(this, inflation);
@@ -699,17 +699,17 @@ nsBlockFrame::GetMinISize(nsRenderingCon
if (RenumberList()) {
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
}
if (GetStateBits() & NS_BLOCK_NEEDS_BIDI_RESOLUTION)
ResolveBidi();
InlineMinISizeData data;
for (nsBlockFrame* curFrame = this; curFrame;
curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
- for (LineIterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
+ for (LineIterator line = curFrame->BeginLine(), line_end = curFrame->EndLine();
line != line_end; ++line)
{
#ifdef DEBUG
if (gNoisyIntrinsic) {
IndentBy(stdout, gNoiseIndent);
printf("line (%s%s)\n",
line->IsBlock() ? "block" : "inline",
line->IsEmpty() ? ", empty" : "");
@@ -718,17 +718,17 @@ nsBlockFrame::GetMinISize(nsRenderingCon
#endif
if (line->IsBlock()) {
data.ForceBreak();
data.mCurrentLine = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
line->mFirstChild, nsLayoutUtils::MIN_ISIZE);
data.ForceBreak();
} else {
if (!curFrame->GetPrevContinuation() &&
- line == curFrame->begin_lines()) {
+ line == curFrame->BeginLine()) {
// Only add text-indent if it has no percentages; using a
// percentage basis of 0 unconditionally would give strange
// behavior for calc(10%-3px).
const nsStyleCoord &indent = StyleText()->mTextIndent;
if (indent.ConvertsToLength())
data.mCurrentLine += nsRuleNode::ComputeCoordPercentCalc(indent, 0);
}
// XXX Bug NNNNNN Should probably handle percentage text-indent.
@@ -787,17 +787,17 @@ nsBlockFrame::GetPrefISize(nsRenderingCo
if (RenumberList()) {
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
}
if (GetStateBits() & NS_BLOCK_NEEDS_BIDI_RESOLUTION)
ResolveBidi();
InlinePrefISizeData data;
for (nsBlockFrame* curFrame = this; curFrame;
curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
- for (LineIterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
+ for (LineIterator line = curFrame->BeginLine(), line_end = curFrame->EndLine();
line != line_end; ++line)
{
#ifdef DEBUG
if (gNoisyIntrinsic) {
IndentBy(stdout, gNoiseIndent);
printf("line (%s%s)\n",
line->IsBlock() ? "block" : "inline",
line->IsEmpty() ? ", empty" : "");
@@ -808,17 +808,17 @@ nsBlockFrame::GetPrefISize(nsRenderingCo
if (!data.mLineIsEmpty || BlockCanIntersectFloats(line->mFirstChild)) {
data.ForceBreak();
}
data.mCurrentLine = nsLayoutUtils::IntrinsicForContainer(aRenderingContext,
line->mFirstChild, nsLayoutUtils::PREF_ISIZE);
data.ForceBreak();
} else {
if (!curFrame->GetPrevContinuation() &&
- line == curFrame->begin_lines()) {
+ line == curFrame->BeginLine()) {
// Only add text-indent if it has no percentages; using a
// percentage basis of 0 unconditionally would give strange
// behavior for calc(10%-3px).
const nsStyleCoord &indent = StyleText()->mTextIndent;
if (indent.ConvertsToLength()) {
nscoord length = indent.ToLength();
if (length != 0) {
data.mCurrentLine += length;
@@ -873,30 +873,30 @@ nsBlockFrame::GetPrefWidthTightBounds(ns
*aX = 0;
*aXMost = 0;
nsresult rv;
InlinePrefISizeData data;
for (nsBlockFrame* curFrame = this; curFrame;
curFrame = static_cast<nsBlockFrame*>(curFrame->GetNextContinuation())) {
- for (LineIterator line = curFrame->begin_lines(), line_end = curFrame->end_lines();
+ for (LineIterator line = curFrame->BeginLine(), line_end = curFrame->EndLine();
line != line_end; ++line)
{
nscoord childX, childXMost;
if (line->IsBlock()) {
data.ForceBreak();
rv = line->mFirstChild->GetPrefWidthTightBounds(aRenderingContext,
&childX, &childXMost);
NS_ENSURE_SUCCESS(rv, rv);
*aX = std::min(*aX, childX);
*aXMost = std::max(*aXMost, childXMost);
} else {
if (!curFrame->GetPrevContinuation() &&
- line == curFrame->begin_lines()) {
+ line == curFrame->BeginLine()) {
// Only add text-indent if it has no percentages; using a
// percentage basis of 0 unconditionally would give strange
// behavior for calc(10%-3px).
const nsStyleCoord &indent = StyleText()->mTextIndent;
if (indent.ConvertsToLength()) {
data.mCurrentLine += nsRuleNode::ComputeCoordPercentCalc(indent, 0);
}
}
@@ -1308,17 +1308,17 @@ nsBlockFrame::Reflow(nsPresContext*
// logical direction progresses in a negative physical direction, and
// therefore block-dir coordinate conversion depends on knowing the width
// of the coordinate space in order to translate between the logical and
// physical origins.
if (wm.IsVerticalRL()) {
nsSize containerSize = aMetrics.PhysicalSize();
nscoord deltaX = containerSize.width - state.ContainerSize().width;
if (deltaX != 0) {
- for (LineIterator line = begin_lines(), end = end_lines();
+ for (LineIterator line = BeginLine(), end = EndLine();
line != end; line++) {
UpdateLineContainerSize(line, containerSize);
}
for (nsIFrame* f : mFloats) {
nsPoint physicalDelta(deltaX, 0);
f->MovePositionBy(physicalDelta);
}
nsFrameList* bulletList = GetOutsideBulletList();
@@ -1479,18 +1479,18 @@ nsBlockFrame::Reflow(nsPresContext*
#endif
NS_FRAME_SET_TRUNCATION(aStatus, (*reflowInput), aMetrics);
}
bool
nsBlockFrame::CheckForCollapsedBEndMarginFromClearanceLine()
{
- LineIterator begin = begin_lines();
- LineIterator line = end_lines();
+ LineIterator begin = BeginLine();
+ LineIterator line = EndLine();
while (true) {
if (begin == line) {
return false;
}
--line;
if (line->BSize() != 0 || !line->CachedIsEmpty()) {
return false;
@@ -1714,17 +1714,17 @@ nsBlockFrame::ComputeOverflowAreas(const
nscoord aBEndEdgeOfChildren,
nsOverflowAreas& aOverflowAreas)
{
// Compute the overflow areas of our children
// XXX_perf: This can be done incrementally. It is currently one of
// the things that makes incremental reflow O(N^2).
nsOverflowAreas areas(aBounds, aBounds);
if (!ShouldApplyOverflowClipping(this, aDisplay)) {
- for (LineIterator line = begin_lines(), line_end = end_lines();
+ for (LineIterator line = BeginLine(), line_end = EndLine();
line != line_end;
++line) {
areas.UnionWith(line->GetOverflowAreas());
}
// Factor an outside bullet in; normally the bullet will be factored into
// the line-box's overflow areas. However, if the line is a block
// line then it won't; if there are no lines, it won't. So just
@@ -1752,17 +1752,17 @@ nsBlockFrame::ComputeOverflowAreas(const
void
nsBlockFrame::UnionChildOverflow(nsOverflowAreas& aOverflowAreas)
{
// We need to update the overflow areas of lines manually, as they
// 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 (LineIterator line = begin_lines(), line_end = end_lines();
+ for (LineIterator line = BeginLine(), line_end = EndLine();
line != line_end;
++line) {
nsRect bounds = line->GetPhysicalBounds();
nsOverflowAreas lineAreas(bounds, bounds);
int32_t n = line->GetChildCount();
for (nsIFrame* lineFrame = line->mFirstChild;
n > 0; lineFrame = lineFrame->GetNextSibling(), --n) {
@@ -1802,17 +1802,17 @@ nsBlockFrame::ComputeCustomOverflow(nsOv
ClearLineCursor();
return nsContainerFrame::ComputeCustomOverflow(aOverflowAreas);
}
void
nsBlockFrame::LazyMarkLinesDirty()
{
if (GetStateBits() & NS_BLOCK_LOOK_FOR_DIRTY_FRAMES) {
- for (LineIterator line = begin_lines(), line_end = end_lines();
+ for (LineIterator line = BeginLine(), line_end = EndLine();
line != line_end; ++line) {
int32_t n = line->GetChildCount();
for (nsIFrame* lineFrame = line->mFirstChild;
n > 0; lineFrame = lineFrame->GetNextSibling(), --n) {
if (NS_SUBTREE_DIRTY(lineFrame)) {
// NOTE: MarkLineDirty does more than just marking the line dirty.
MarkLineDirty(line, &mLines);
break;
@@ -1909,17 +1909,17 @@ nsBlockFrame::PrepareResizeReflow(BlockR
#ifdef DEBUG
if (gNoisyReflow) {
IndentBy(stdout, gNoiseIndent);
ListTag(stdout);
printf(": trying to avoid marking all lines dirty\n");
}
#endif
- for (LineIterator line = begin_lines(), line_end = end_lines();
+ for (LineIterator line = BeginLine(), line_end = EndLine();
line != line_end;
++line)
{
// We let child blocks make their own decisions the same
// way we are here.
bool isLastLine = line == mLines.back() && !GetNextInFlow();
if (line->IsBlock() ||
line->HasFloats() ||
@@ -1937,31 +1937,31 @@ nsBlockFrame::PrepareResizeReflow(BlockR
line.get(), line->IsImpactedByFloat() ? "" : "not ");
}
#endif
#ifdef DEBUG
if (gNoisyReflow && !line->IsDirty()) {
IndentBy(stdout, gNoiseIndent + 1);
printf("skipped: line=%p next=%p %s %s%s%s breakTypeBefore/After=%s/%s xmost=%d\n",
static_cast<void*>(line.get()),
- static_cast<void*>((line.next() != end_lines() ? line.next().get() : nullptr)),
+ static_cast<void*>((line.next() != EndLine() ? line.next().get() : nullptr)),
line->IsBlock() ? "block" : "inline",
line->HasBreakAfter() ? "has-break-after " : "",
line->HasFloats() ? "has-floats " : "",
line->IsImpactedByFloat() ? "impacted " : "",
line->BreakTypeToString(line->GetBreakTypeBefore()),
line->BreakTypeToString(line->GetBreakTypeAfter()),
line->IEnd());
}
#endif
}
}
else {
// Mark everything dirty
- for (LineIterator line = begin_lines(), line_end = end_lines();
+ for (LineIterator line = BeginLine(), line_end = EndLine();
line != line_end;
++line)
{
line->MarkDirty();
}
}
}
@@ -2119,18 +2119,18 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
(aState.mReflowInput.IsBResize() &&
(GetStateBits() & NS_FRAME_CONTAINS_RELATIVE_BSIZE));
// Reflow our last line if our availableBSize has increased
// so that we (and our last child) pull up content as necessary
if (aState.mReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE
&& GetNextInFlow() && aState.mReflowInput.AvailableBSize() >
GetLogicalSize().BSize(aState.mReflowInput.GetWritingMode())) {
- LineIterator lastLine = end_lines();
- if (lastLine != begin_lines()) {
+ LineIterator lastLine = EndLine();
+ if (lastLine != BeginLine()) {
--lastLine;
lastLine->MarkDirty();
}
}
// the amount by which we will slide the current line if it is not
// dirty
nscoord deltaBCoord = 0;
@@ -2140,17 +2140,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
bool needToRecoverState = false;
// Float continuations were reflowed in ReflowPushedFloats
bool reflowedFloat = mFloats.NotEmpty() &&
(mFloats.FirstChild()->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT);
bool lastLineMovedUp = false;
// We save up information about BR-clearance here
StyleClear inlineFloatBreakType = aState.mFloatBreakType;
- LineIterator line = begin_lines(), line_end = end_lines();
+ LineIterator line = BeginLine(), line_end = EndLine();
// Reflow the lines that are already ours
for ( ; line != line_end; ++line, aState.AdvanceToNextLine()) {
DumpLine(aState, line, deltaBCoord, 0);
#ifdef DEBUG
AutoNoisyIndenter indent2(gNoisyReflow);
#endif
@@ -2358,17 +2358,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
// block was and is adjacent to the block-start and empty).
//
// If the line is empty now, we can't reliably tell if the line was empty
// before, so we just assume it was and do nextLine->MarkPreviousMarginDirty.
// This means the checks in 4) are redundant; if the line is empty now
// we don't need to check 4), but if the line is not empty now and we're sure
// it wasn't empty before, any adjacency and clearance changes are irrelevant
// to the result of nextLine->ShouldApplyBStartMargin.
- if (line.next() != end_lines()) {
+ if (line.next() != EndLine()) {
bool maybeWasEmpty = oldB == line.next()->BStart();
bool isEmpty = line->CachedIsEmpty();
if (maybeReflowingForFirstTime /*1*/ ||
(isEmpty || maybeWasEmpty) /*2/3/4*/) {
line.next()->MarkPreviousMarginDirty();
// since it's marked dirty, nobody will care about |deltaBCoord|
}
}
@@ -2504,18 +2504,18 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
!lastLineMovedUp &&
!(GetStateBits() & NS_FRAME_IS_DIRTY) &&
!reflowedFloat)) {
// We'll place lineIter at the last line of this block, so that
// nsBlockInFlowLineIterator::Next() will take us to the first
// 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.)
- LineIterator lineIter = this->end_lines();
- if (lineIter != this->begin_lines()) {
+ LineIterator lineIter = this->EndLine();
+ if (lineIter != this->BeginLine()) {
lineIter--; // I have lines; step back from dummy iterator to last line.
nsBlockInFlowLineIterator bifLineIter(this, lineIter);
// Check for next-in-flow-chain's first line.
// (First, see if there is such a line, and second, see if it's clean)
if (!bifLineIter.Next() ||
!bifLineIter.GetLine()->IsDirty()) {
skipPull=true;
@@ -2576,17 +2576,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
NS_ASSERTION(aState.mPrevChild || mLines.empty(), "should have a prevchild here");
NS_ASSERTION(aState.mPrevChild == mFrames.LastChild(),
"Incorrect aState.mPrevChild before inserting line at end");
// Shift pulledLine's frames into our mFrames list.
mFrames.AppendFrames(nullptr, pulledFrames);
// Add line to our line list, and set its last child as our new prev-child
- line = mLines.before_insert(end_lines(), pulledLine);
+ line = mLines.before_insert(EndLine(), pulledLine);
aState.mPrevChild = mFrames.LastChild();
// Reparent floats whose placeholders are in the line.
ReparentFloats(pulledLine->mFirstChild, nextInFlow, true);
DumpLine(aState, pulledLine, deltaBCoord, 0);
#ifdef DEBUG
AutoNoisyIndenter indent2(gNoisyReflow);
@@ -2594,17 +2594,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
if (aState.mPresContext->HasPendingInterrupt()) {
MarkLineDirtyForInterrupt(line);
} else {
// Now reflow it and any lines that it makes during it's reflow
// (we have to loop here because reflowing the line may cause a new
// line to be created; see SplitLine's callers for examples of
// when this happens).
- while (line != end_lines()) {
+ while (line != EndLine()) {
ReflowLine(aState, line, &keepGoing);
if (aState.mReflowInput.WillReflowAgainForClearance()) {
line->MarkDirty();
keepGoing = false;
NS_FRAME_SET_INCOMPLETE(aState.mReflowStatus);
break;
}
@@ -2783,17 +2783,17 @@ nsBlockFrame::ReflowLine(BlockReflowInpu
}
}
nsIFrame*
nsBlockFrame::PullFrame(BlockReflowInput& aState,
LineIterator aLine)
{
// First check our remaining lines.
- if (end_lines() != aLine.next()) {
+ if (EndLine() != aLine.next()) {
return PullFrameFrom(aLine, this, aLine.next());
}
NS_ASSERTION(!GetOverflowLines(),
"Our overflow lines should have been removed at the start of reflow");
// Try each next-in-flow.
nsBlockFrame* nextInFlow = aState.mNextInFlow;
@@ -3053,17 +3053,17 @@ nsBlockFrame::IsSelfEmpty()
bool
nsBlockFrame::CachedIsEmpty()
{
if (!IsSelfEmpty()) {
return false;
}
- for (LineIterator line = begin_lines(), line_end = end_lines();
+ for (LineIterator line = BeginLine(), line_end = EndLine();
line != line_end;
++line)
{
if (!line->CachedIsEmpty())
return false;
}
return true;
@@ -3071,17 +3071,17 @@ nsBlockFrame::CachedIsEmpty()
bool
nsBlockFrame::IsEmpty()
{
if (!IsSelfEmpty()) {
return false;
}
- for (LineIterator line = begin_lines(), line_end = end_lines();
+ for (LineIterator line = BeginLine(), line_end = EndLine();
line != line_end;
++line)
{
if (!line->IsEmpty())
return false;
}
return true;
@@ -3103,17 +3103,17 @@ nsBlockFrame::ShouldApplyBStartMargin(Bl
// If we aren't at the start block-coordinate then something of non-zero
// height must have been placed. Therefore the childs block-start margin
// applies.
aState.mFlags.mShouldApplyBStartMargin = true;
return true;
}
// Determine if this line is "essentially" the first line
- LineIterator line = begin_lines();
+ LineIterator line = BeginLine();
if (aState.mFlags.mHasLineAdjacentToTop) {
line = aState.mLineAdjacentToTop;
}
while (line != aLine) {
if (!line->CachedIsEmpty() || line->HasClearance()) {
// A line which precedes aLine is non-empty, or has clearance,
// so therefore the block-start margin applies.
aState.mFlags.mShouldApplyBStartMargin = true;
@@ -3556,17 +3556,17 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
if (!NS_FRAME_IS_FULLY_COMPLETE(frameReflowStatus) &&
ShouldAvoidBreakInside(aState.mReflowInput)) {
*aKeepReflowGoing = false;
}
if (aLine->SetCarriedOutBEndMargin(collapsedBEndMargin)) {
LineIterator nextLine = aLine;
++nextLine;
- if (nextLine != end_lines()) {
+ if (nextLine != EndLine()) {
nextLine->MarkPreviousMarginDirty();
}
}
aLine->SetOverflowAreas(overflowAreas);
if (*aKeepReflowGoing) {
// Some of the child block fit
@@ -3622,18 +3622,18 @@ nsBlockFrame::ReflowBlockFrame(BlockRefl
// else one of our own overflow lines. In the latter case
// the line is already marked dirty, so just handle the
// first case.
if (!madeContinuation) {
nsBlockFrame* nifBlock =
nsLayoutUtils::GetAsBlock(nextFrame->GetParent());
NS_ASSERTION(nifBlock,
"A block's child's next in flow's parent must be a block!");
- for (LineIterator line = nifBlock->begin_lines(),
- line_end = nifBlock->end_lines(); line != line_end; ++line) {
+ for (LineIterator line = nifBlock->BeginLine(),
+ line_end = nifBlock->EndLine(); line != line_end; ++line) {
if (line->Contains(nextFrame)) {
line->MarkDirty();
break;
}
}
}
}
*aKeepReflowGoing = false;
@@ -3898,17 +3898,17 @@ nsBlockFrame::DoReflowInlineFrames(Block
for (i = 0; LineReflowStatus::OK == lineReflowStatus && i < aLine->GetChildCount();
i++, frame = frame->GetNextSibling()) {
ReflowInlineFrame(aState, aLineLayout, aLine, frame, &lineReflowStatus);
if (LineReflowStatus::OK != lineReflowStatus) {
// It is possible that one or more of next lines are empty
// (because of DeleteNextInFlowChild). If so, delete them now
// in case we are finished.
++aLine;
- while ((aLine != end_lines()) && (0 == aLine->GetChildCount())) {
+ while ((aLine != EndLine()) && (0 == aLine->GetChildCount())) {
// XXX Is this still necessary now that DeleteNextInFlowChild
// uses DoRemoveFrame?
nsLineBox *toremove = aLine;
aLine = mLines.erase(aLine);
NS_ASSERTION(nullptr == toremove->mFirstChild, "bad empty line");
FreeLineBox(toremove);
}
--aLine;
@@ -4378,32 +4378,32 @@ nsBlockFrame::SplitLine(BlockReflowInput
#endif
}
}
bool
nsBlockFrame::IsLastLine(BlockReflowInput& aState,
LineIterator aLine)
{
- while (++aLine != end_lines()) {
+ while (++aLine != EndLine()) {
// There is another line
if (0 != aLine->GetChildCount()) {
// If the next line is a block line then this line is the last in a
// group of inline lines.
return aLine->IsBlock();
}
// The next line is empty, try the next one
}
// XXX Not sure about this part
// Try our next-in-flows lines to answer the question
nsBlockFrame* nextInFlow = (nsBlockFrame*) GetNextInFlow();
while (nullptr != nextInFlow) {
- for (LineIterator line = nextInFlow->begin_lines(),
- line_end = nextInFlow->end_lines();
+ for (LineIterator line = nextInFlow->BeginLine(),
+ line_end = nextInFlow->EndLine();
line != line_end;
++line)
{
if (0 != line->GetChildCount())
return line->IsBlock();
}
nextInFlow = (nsBlockFrame*) nextInFlow->GetNextInFlow();
}
@@ -4630,19 +4630,19 @@ nsBlockFrame::PushLines(BlockReflowInput
{
// NOTE: aLineBefore is always a normal line, not an overflow line.
// The following expression will assert otherwise.
DebugOnly<bool> check = aLineBefore == mLines.begin();
nsLineList::iterator overBegin(aLineBefore.next());
// PushTruncatedPlaceholderLine sometimes pushes the first line. Ugh.
- bool firstLine = overBegin == begin_lines();
-
- if (overBegin != end_lines()) {
+ bool firstLine = overBegin == BeginLine();
+
+ if (overBegin != EndLine()) {
// Remove floats in the lines from mFloats
nsFrameList floats;
CollectFloats(overBegin->mFirstChild, floats, true);
if (floats.NotEmpty()) {
#ifdef DEBUG
for (nsIFrame* f : floats) {
MOZ_ASSERT(!(f->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT),
@@ -4673,17 +4673,17 @@ nsBlockFrame::PushLines(BlockReflowInput
lineBeforeLastFrame = f ? f->GetPrevSibling() : mFrames.LastChild();
NS_ASSERTION(!f || lineBeforeLastFrame == aLineBefore->LastChild(),
"unexpected line frames");
}
nsFrameList pushedFrames = mFrames.RemoveFramesAfter(lineBeforeLastFrame);
overflowLines->mFrames.InsertFrames(nullptr, nullptr, pushedFrames);
overflowLines->mLines.splice(overflowLines->mLines.begin(), mLines,
- overBegin, end_lines());
+ overBegin, EndLine());
NS_ASSERTION(!overflowLines->mLines.empty(), "should not be empty");
// this takes ownership but it won't delete it immediately so we
// can keep using it.
SetOverflowLines(overflowLines);
// Mark all the overflow lines dirty so that they get reflowed when
// they are pulled up by our next-in-flow.
@@ -5347,17 +5347,17 @@ nsBlockFrame::AddFrames(nsFrameList& aFr
#endif
}
void
nsBlockFrame::RemoveFloatFromFloatCache(nsIFrame* aFloat)
{
// Find which line contains the float, so we can update
// the float cache.
- LineIterator line = begin_lines(), line_end = end_lines();
+ LineIterator line = BeginLine(), line_end = EndLine();
for ( ; line != line_end; ++line) {
if (line->IsInline() && line->RemoveFloat(aFloat)) {
break;
}
}
}
void
@@ -5450,32 +5450,32 @@ nsBlockFrame::TryAllLines(nsLineList::it
}
}
nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
LineIterator aLine)
: mFrame(aFrame), mLine(aLine), mLineList(&aFrame->mLines)
{
// This will assert if aLine isn't in mLines of aFrame:
- DebugOnly<bool> check = aLine == mFrame->begin_lines();
+ DebugOnly<bool> check = aLine == mFrame->BeginLine();
}
nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
LineIterator aLine, bool aInOverflow)
: mFrame(aFrame), mLine(aLine),
mLineList(aInOverflow ? &aFrame->GetOverflowLines()->mLines
: &aFrame->mLines)
{
}
nsBlockInFlowLineIterator::nsBlockInFlowLineIterator(nsBlockFrame* aFrame,
bool* aFoundValidLine)
: mFrame(aFrame), mLineList(&aFrame->mLines)
{
- mLine = aFrame->begin_lines();
+ mLine = aFrame->BeginLine();
*aFoundValidLine = FindValidLine();
}
static nsIFrame*
FindChildContaining(nsBlockFrame* aFrame, nsIFrame* aFindFrame)
{
NS_ASSERTION(aFrame, "must have frame");
nsIFrame* child;
@@ -5502,25 +5502,25 @@ nsBlockInFlowLineIterator::nsBlockInFlow
: mFrame(aFrame), mLineList(&aFrame->mLines)
{
*aFoundValidLine = false;
nsIFrame* child = FindChildContaining(aFrame, aFindFrame);
if (!child)
return;
- LineIterator line_end = aFrame->end_lines();
+ LineIterator line_end = aFrame->EndLine();
// 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::LineIterator line = aFrame->line(cursor);
- nsBlockFrame::ReverseLineIterator rline = aFrame->rline(cursor);
- nsBlockFrame::ReverseLineIterator rline_end = aFrame->rend_lines();
+ nsBlockFrame::LineIterator line = aFrame->BeginLineFrom(cursor);
+ nsBlockFrame::ReverseLineIterator rline = aFrame->RBeginLineFrom(cursor);
+ nsBlockFrame::ReverseLineIterator rline_end = aFrame->REndLine();
// 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.
++rline;
while (line != line_end || rline != rline_end) {
if (line != line_end) {
if (line->Contains(child)) {
mLine = line;
@@ -5539,17 +5539,17 @@ nsBlockInFlowLineIterator::nsBlockInFlow
if (mLine != line_end) {
*aFoundValidLine = true;
if (mLine != cursor) {
aFrame->Properties().Set(nsBlockFrame::LineCursorProperty(), mLine);
}
return;
}
} else {
- for (mLine = aFrame->begin_lines(); mLine != line_end; ++mLine) {
+ for (mLine = aFrame->BeginLine(); mLine != line_end; ++mLine) {
if (mLine->Contains(child)) {
*aFoundValidLine = true;
return;
}
}
}
// Didn't find the line
MOZ_ASSERT(mLine == line_end, "mLine should be line_end at this point");
@@ -6241,18 +6241,18 @@ nsBlockFrame::ReflowFloat(BlockReflowInp
}
StyleClear
nsBlockFrame::FindTrailingClear()
{
// find the break type of the last line
for (nsIFrame* b = this; b; b = b->GetPrevInFlow()) {
nsBlockFrame* block = static_cast<nsBlockFrame*>(b);
- LineIterator endLine = block->end_lines();
- if (endLine != block->begin_lines()) {
+ LineIterator endLine = block->EndLine();
+ if (endLine != block->BeginLine()) {
--endLine;
return endLine->GetBreakTypeAfter();
}
}
return StyleClear::None;
}
void
@@ -6345,17 +6345,17 @@ nsBlockFrame::RecoverFloats(nsFloatManag
// Recurse into our overflow container children
for (nsIFrame* oc = GetChildList(kOverflowContainersList).FirstChild();
oc; oc = oc->GetNextSibling()) {
RecoverFloatsFor(oc, aFloatManager, aWM, aContainerSize);
}
// Recurse into our normal children
- for (nsBlockFrame::LineIterator line = begin_lines(); line != end_lines(); ++line) {
+ for (nsBlockFrame::LineIterator line = BeginLine(); line != EndLine(); ++line) {
if (line->IsBlock()) {
RecoverFloatsFor(line->mFirstChild, aFloatManager, aWM, aContainerSize);
}
}
}
void
nsBlockFrame::RecoverFloatsFor(nsIFrame* aFrame,
@@ -6555,17 +6555,17 @@ nsBlockFrame::BuildDisplayList(nsDisplay
// it might skip lines that contain placeholders but don't themselves
// intersect with the dirty area.
// In particular, we really want to check ShouldDescendIntoFrame()
// on all our child frames, but that might be expensive. So we
// approximate it by checking it on |this|; if it's true for any
// frame in our child list, it's also true for |this|.
nsLineBox* cursor = aBuilder->ShouldDescendIntoFrame(this) ?
nullptr : GetFirstLineContaining(aDirtyRect.y);
- LineIterator line_end = end_lines();
+ LineIterator line_end = EndLine();
if (cursor) {
for (LineIterator line = mLines.begin(cursor);
line != line_end;
++line) {
nsRect lineArea = line->GetVisualOverflowArea();
if (!lineArea.IsEmpty()) {
// Because we have a cursor, the combinedArea.ys are non-decreasing.
@@ -6577,17 +6577,17 @@ nsBlockFrame::BuildDisplayList(nsDisplay
linesDisplayListCollection, this, textOverflow.get());
}
}
} else {
bool nonDecreasingYs = true;
int32_t lineCount = 0;
nscoord lastY = INT32_MIN;
nscoord lastYMost = INT32_MIN;
- for (LineIterator line = begin_lines();
+ for (LineIterator line = BeginLine();
line != line_end;
++line) {
nsRect lineArea = line->GetVisualOverflowArea();
DisplayLine(aBuilder, lineArea, aDirtyRect, line, depth, drawnLines,
linesDisplayListCollection, this, textOverflow.get());
if (!lineArea.IsEmpty()) {
if (lineArea.y < lastY
|| lineArea.YMost() < lastYMost) {
@@ -6740,23 +6740,23 @@ nsBlockFrame::ChildIsDirty(nsIFrame* aCh
// See if the child is absolutely positioned
if (aChild->GetStateBits() & NS_FRAME_OUT_OF_FLOW &&
aChild->IsAbsolutelyPositioned()) {
// do nothing
} else if (aChild == GetOutsideBullet()) {
// 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.
- LineIterator bulletLine = begin_lines();
- if (bulletLine != end_lines() && bulletLine->BSize() == 0 &&
+ LineIterator bulletLine = BeginLine();
+ if (bulletLine != EndLine() && bulletLine->BSize() == 0 &&
bulletLine != mLines.back()) {
bulletLine = bulletLine.next();
}
- if (bulletLine != end_lines()) {
+ if (bulletLine != EndLine()) {
MarkLineDirty(bulletLine, &mLines);
}
// otherwise we have an empty line list, and ReflowDirtyLines
// will handle reflowing the bullet.
} else {
// Note that we should go through our children to mark lines dirty
// before the next reflow. Doing it now could make things O(N^2)
// since finding the right line is O(N).
@@ -7131,17 +7131,17 @@ nsBlockFrame::CheckFloats(BlockReflowInp
#ifdef DEBUG
// If any line is still dirty, that must mean we're going to reflow this
// block again soon (e.g. because we bailed out after noticing that
// clearance was imposed), so don't worry if the floats are out of sync.
bool anyLineDirty = false;
// Check that the float list is what we would have built
AutoTArray<nsIFrame*, 8> lineFloats;
- for (LineIterator line = begin_lines(), line_end = end_lines();
+ for (LineIterator line = BeginLine(), line_end = EndLine();
line != line_end; ++line) {
if (line->HasFloats()) {
nsFloatCache* fc = line->GetFirstFloat();
while (fc) {
lineFloats.AppendElement(fc->mFloat);
fc = fc->Next();
}
}
@@ -7374,17 +7374,17 @@ nsBlockFrame::VerifyLines(bool aFinalChe
}
nsLineBox* cursor = GetLineCursor();
// Add up the counts on each line. Also validate that IsFirstLine is
// set properly.
int32_t count = 0;
LineIterator line, line_end;
- for (line = begin_lines(), line_end = end_lines();
+ for (line = BeginLine(), line_end = EndLine();
line != line_end;
++line) {
if (line == cursor) {
cursor = nullptr;
}
if (aFinalCheckOK) {
MOZ_ASSERT(line->GetChildCount(), "empty line");
if (line->IsBlock()) {
@@ -7399,17 +7399,17 @@ nsBlockFrame::VerifyLines(bool aFinalChe
nsIFrame* frame = mLines.front()->mFirstChild;
while (frame) {
frameCount++;
frame = frame->GetNextSibling();
}
NS_ASSERTION(count == frameCount, "bad line list");
// Next: test that each line has right number of frames on it
- for (line = begin_lines(), line_end = end_lines();
+ for (line = BeginLine(), line_end = EndLine();
line != line_end;
) {
count = line->GetChildCount();
frame = line->mFirstChild;
while (--count >= 0) {
frame = frame->GetNextSibling();
}
++line;
@@ -7487,18 +7487,18 @@ nsBlockFrame::VerifyOverflowSituation()
NS_ASSERTION(overflowLines->mLines.front()->mFirstChild,
"bad overflow lines");
NS_ASSERTION(overflowLines->mLines.front()->mFirstChild ==
overflowLines->mFrames.FirstChild(),
"bad overflow frames / lines");
}
nsLineBox* cursor = flow->GetLineCursor();
if (cursor) {
- LineIterator line = flow->begin_lines();
- LineIterator line_end = flow->end_lines();
+ LineIterator line = flow->BeginLine();
+ LineIterator line_end = flow->EndLine();
for (; line != line_end && line != cursor; ++line)
;
if (line == line_end && overflowLines) {
line = overflowLines->mLines.begin();
line_end = overflowLines->mLines.end();
for (; line != line_end && line != cursor; ++line)
;
}