Bug 1566945 - Pass line box through to nsBlockFrame::AddFrames. r=dholbert

Differential Revision: https://phabricator.services.mozilla.com/D38391

--HG--
extra : moz-landing-system : lando
This commit is contained in:
L. David Baron 2019-07-17 23:34:46 +00:00
parent ff6518fe62
commit ab4b067e89
2 changed files with 11 additions and 6 deletions

View File

@ -5013,7 +5013,7 @@ bool nsBlockFrame::DrainOverflowLines() {
mLines.splice(mLines.begin(), overflowLines->mLines);
NS_ASSERTION(overflowLines->mLines.empty(), "splice should empty list");
delete overflowLines;
AddFrames(ocContinuations, mFrames.LastChild());
AddFrames(ocContinuations, mFrames.LastChild(), nullptr);
didFindOverflow = true;
}
}
@ -5339,7 +5339,7 @@ void nsBlockFrame::AppendFrames(ChildListID aListID, nsFrameList& aFrameList) {
GetParent()->AddStateBits(NS_STATE_SVG_TEXT_CORRESPONDENCE_DIRTY);
}
AddFrames(aFrameList, lastKid);
AddFrames(aFrameList, lastKid, nullptr);
if (aListID != kNoReflowPrincipalList) {
PresShell()->FrameNeedsReflow(
this, IntrinsicDirty::TreeChange,
@ -5375,7 +5375,7 @@ void nsBlockFrame::InsertFrames(ChildListID aListID, nsIFrame* aPrevFrame,
printf("\n");
#endif
AddFrames(aFrameList, aPrevFrame);
AddFrames(aFrameList, aPrevFrame, aPrevFrameLine);
if (aListID != kNoReflowPrincipalList) {
PresShell()->FrameNeedsReflow(
this, IntrinsicDirty::TreeChange,
@ -5436,7 +5436,8 @@ static bool ShouldPutNextSiblingOnNewLine(nsIFrame* aLastFrame) {
return false;
}
void nsBlockFrame::AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling) {
void nsBlockFrame::AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling,
const nsLineList::iterator* aPrevSiblingLine) {
// Clear our line cursor, since our lines may change.
ClearLineCursor();
@ -7027,7 +7028,7 @@ void nsBlockFrame::SetInitialChildList(ChildListID aListID,
"NS_BLOCK_HAS_FIRST_LETTER_STYLE state out of sync");
#endif
AddFrames(aChildList, nullptr);
AddFrames(aChildList, nullptr, nullptr);
} else {
nsContainerFrame::SetInitialChildList(aListID, aChildList);
}

View File

@ -485,8 +485,12 @@ class nsBlockFrame : public nsContainerFrame {
* contains aPrevSibling and add aFrameList after aPrevSibling on that line.
* New lines are created as necessary to handle block data in aFrameList.
* This function will clear aFrameList.
*
* aPrevSiblingLine, if present, must be the line containing aPrevSibling.
* Providing it will make this function faster.
*/
void AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling);
void AddFrames(nsFrameList& aFrameList, nsIFrame* aPrevSibling,
const nsLineList::iterator* aPrevSiblingLine);
/**
* Perform Bidi resolution on this frame