From 2c483f51056db4e6f207f7b48a4995d4ee0cc0ed Mon Sep 17 00:00:00 2001 From: "roc+@cs.cmu.edu" Date: Thu, 9 Aug 2007 21:41:00 -0700 Subject: [PATCH] Backing out fix for bug 385607 due to bustage and Tp regressions --- layout/generic/nsBlockFrame.cpp | 29 +--------------------------- layout/generic/nsIFrame.h | 7 +------ layout/generic/nsLineBox.h | 10 ---------- layout/generic/nsTextFrameThebes.cpp | 8 +++----- 4 files changed, 5 insertions(+), 49 deletions(-) diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 4a30faed18b..a7c52880349 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -605,10 +605,6 @@ static void ReparentFrame(nsIFrame* aFrame, nsIFrame* aOldParent, ////////////////////////////////////////////////////////////////////// // Reflow methods -// If MarkIntrinsicWidthsDirty took a parameter indicating which child frame's -// subtree was causing intrinsic widths to be dirtied, we might be able to use it -// to call SetInvalidateTextRuns from here instead of scattered in other -// places in this file. /* virtual */ void nsBlockFrame::MarkIntrinsicWidthsDirty() { @@ -668,7 +664,6 @@ nsBlockFrame::GetMinWidth(nsIRenderingContext *aRenderingContext) } // XXX Bug NNNNNN Should probably handle percentage text-indent. - data.line = &line; nsIFrame *kid = line->mFirstChild; for (PRInt32 i = 0, i_end = line->GetChildCount(); i != i_end; ++i, kid = kid->GetNextSibling()) { @@ -740,7 +735,6 @@ nsBlockFrame::GetPrefWidth(nsIRenderingContext *aRenderingContext) } // XXX Bug NNNNNN Should probably handle percentage text-indent. - data.line = &line; nsIFrame *kid = line->mFirstChild; for (PRInt32 i = 0, i_end = line->GetChildCount(); i != i_end; ++i, kid = kid->GetNextSibling()) { @@ -4809,19 +4803,12 @@ nsBlockFrame::AddFrames(nsIFrame* aFrameList, prevSibLine->SetChildCount(prevSibLine->GetChildCount() - rem); prevSibLine->MarkDirty(); } - // Force the lines next to where we're inserting content to regenerate - // their textruns - prevSibLine->SetInvalidateTextRuns(PR_TRUE); - if (prevSibLine.next() != end_lines()) { - prevSibLine.next()->SetInvalidateTextRuns(PR_TRUE); - } // Now (partially) join the sibling lists together aPrevSibling->SetNextSibling(aFrameList); } else if (! mLines.empty()) { prevSiblingNextFrame = mLines.front()->mFirstChild; - mLines.front()->SetInvalidateTextRuns(PR_TRUE); } // Walk through the new frames being added and update the line data @@ -5150,10 +5137,6 @@ found_frame:; NS_ERROR("can't find deleted frame in lines"); return NS_ERROR_FAILURE; } - - if (line != mLines.front()) { - line.prev()->SetInvalidateTextRuns(PR_TRUE); - } if (prevSibling && !prevSibling->GetNextSibling()) { // We must have found the first frame in the overflow line list. So @@ -5166,8 +5149,6 @@ found_frame:; NS_ASSERTION(this == aDeletedFrame->GetParent(), "messed up delete code"); NS_ASSERTION(line->Contains(aDeletedFrame), "frame not in line"); - line->SetInvalidateTextRuns(PR_TRUE); - // If the frame being deleted is the last one on the line then // optimize away the line->Contains(next-in-flow) call below. PRBool isLastFrameOnLine = (1 == line->GetChildCount() || @@ -5315,10 +5296,6 @@ found_frame:; } } - if (line.next() != line_end) { - line.next()->SetInvalidateTextRuns(PR_TRUE); - } - #ifdef DEBUG VerifyLines(PR_TRUE); #endif @@ -6051,12 +6028,8 @@ nsBlockFrame::ChildIsDirty(nsIFrame* aChild) } else { // Mark the line containing the child frame dirty. line_iterator fline = FindLineFor(aChild); - if (fline != end_lines()) { - // An inline descendant might have been added or removed, so we should - // reconstruct textruns. - fline->SetInvalidateTextRuns(PR_TRUE); + if (fline != end_lines()) MarkLineDirty(fline); - } } nsBlockFrameSuper::ChildIsDirty(aChild); diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 92e0fdbcfe9..537b8b43e96 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -92,7 +92,6 @@ class nsDisplayListSet; class nsDisplayList; class gfxSkipChars; class gfxSkipCharsIterator; -class nsLineList_iterator; struct nsPeekOffsetStruct; struct nsPoint; @@ -1140,16 +1139,12 @@ public: */ struct InlineIntrinsicWidthData { InlineIntrinsicWidthData() - : line(nsnull) - , prevLines(0) + : prevLines(0) , currentLine(0) , skipWhitespace(PR_TRUE) , trailingWhitespace(0) {} - // The line. This may be null if the inlines are not associated with a block. - const nsLineList_iterator* line; - // The maximum intrinsic width for all previous lines. nscoord prevLines; diff --git a/layout/generic/nsLineBox.h b/layout/generic/nsLineBox.h index bb032a4a0af..faa97e01ec2 100644 --- a/layout/generic/nsLineBox.h +++ b/layout/generic/nsLineBox.h @@ -305,15 +305,6 @@ public: return mFlags.mLineWrapped; } - // mInvalidateTextRuns bit - void SetInvalidateTextRuns(PRBool aOn) { - NS_ASSERTION((PR_FALSE==aOn || PR_TRUE==aOn), "somebody is playing fast and loose with bools and bits!"); - mFlags.mInvalidateTextRuns = aOn; - } - PRBool GetInvalidateTextRuns() const { - return mFlags.mInvalidateTextRuns; - } - // mResizeReflowOptimizationDisabled bit void DisableResizeReflowOptimization() { mFlags.mResizeReflowOptimizationDisabled = PR_TRUE; @@ -496,7 +487,6 @@ public: PRUint32 mBlock : 1; PRUint32 mImpactedByFloat : 1; PRUint32 mLineWrapped: 1; - PRUint32 mInvalidateTextRuns : 1; PRUint32 mResizeReflowOptimizationDisabled: 1; // default 0 = means that the opt potentially applies to this line. 1 = never skip reflowing this line for a resize reflow PRUint32 mEmptyCacheValid: 1; PRUint32 mEmptyCacheState: 1; diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index 081fd6bcde9..bf119a54d1a 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -1197,8 +1197,6 @@ BuildTextRuns(nsIRenderingContext* aRC, nsTextFrame* aForFrame, NS_ASSERTION(line != endLines && !line->IsBlock(), "Where is this frame anyway??"); nsIFrame* child = line->mFirstChild; do { - line->SetInvalidateTextRuns(PR_FALSE); - scanner.SetAtStartOfLine(); scanner.SetCommonAncestorWithLastFrame(nsnull); PRInt32 i; @@ -1960,7 +1958,7 @@ nsTextFrame::EnsureTextRun(nsIRenderingContext* aRC, nsIFrame* aLineContainer, const nsLineList::iterator* aLine, PRUint32* aFlowEndInTextRun) { - if (mTextRun && aLine && !(*aLine)->GetInvalidateTextRuns()) { + if (mTextRun) { if (mTextRun->GetExpirationState()->IsTracked()) { gTextRuns->MarkUsed(mTextRun); } @@ -4960,7 +4958,7 @@ nsTextFrame::AddInlineMinWidthForFlow(nsIRenderingContext *aRenderingContext, { PRUint32 flowEndInTextRun; gfxSkipCharsIterator iter = - EnsureTextRun(aRenderingContext, nsnull, aData->line, &flowEndInTextRun); + EnsureTextRun(aRenderingContext, nsnull, nsnull, &flowEndInTextRun); if (!mTextRun) return; @@ -5058,7 +5056,7 @@ nsTextFrame::AddInlinePrefWidthForFlow(nsIRenderingContext *aRenderingContext, { PRUint32 flowEndInTextRun; gfxSkipCharsIterator iter = - EnsureTextRun(aRenderingContext, nsnull, aData->line, &flowEndInTextRun); + EnsureTextRun(aRenderingContext, nsnull, nsnull, &flowEndInTextRun); if (!mTextRun) return;