From 28cab8ef6c11585e8852bcd453e20a62455b29a3 Mon Sep 17 00:00:00 2001 From: Robert O'Callahan Date: Tue, 27 Oct 2009 21:46:18 +1300 Subject: [PATCH] Backed out changeset 9f5177a978ac --- layout/generic/nsBlockFrame.cpp | 29 ++++++++++++++------------ layout/generic/nsInlineFrame.cpp | 16 ++++---------- layout/generic/nsInlineFrame.h | 5 +---- layout/generic/nsLineLayout.h | 12 +---------- layout/generic/nsTextFrameThebes.cpp | 9 +++++++- layout/reftests/bugs/523468-1-ref.html | 8 ------- layout/reftests/bugs/523468-1.html | 10 --------- layout/reftests/bugs/reftest.list | 3 +-- 8 files changed, 31 insertions(+), 61 deletions(-) delete mode 100644 layout/reftests/bugs/523468-1-ref.html delete mode 100644 layout/reftests/bugs/523468-1.html diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 2eb52c73118..3a89076fc45 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -3670,17 +3670,6 @@ nsBlockFrame::DoReflowInlineFrames(nsBlockReflowState& aState, printf("Line reflow status = %s\n", LineReflowStatusNames[lineReflowStatus]); } #endif - - if (aLineLayout.GetDirtyNextLine()) { - nsBlockInFlowLineIterator iter(this, aLine, PR_FALSE); - if (iter.Next() && iter.GetLine()->IsInline()) { - iter.GetLine()->MarkDirty(); - if (iter.GetContainer() != this) { - aState.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW; - } - } - } - *aLineReflowStatus = lineReflowStatus; return rv; @@ -3721,7 +3710,16 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState, NS_ENSURE_SUCCESS(rv, rv); if (frameReflowStatus & NS_FRAME_REFLOW_NEXTINFLOW) { - aLineLayout.SetDirtyNextLine(); + // we need to ensure that the frame's nextinflow gets reflowed. + aState.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW; + nsBlockFrame* ourNext = static_cast(GetNextInFlow()); + if (ourNext && aFrame->GetNextInFlow()) { + PRBool isValid; + nsBlockInFlowLineIterator iter(ourNext, aFrame->GetNextInFlow(), &isValid); + if (isValid) { + iter.GetLine()->MarkDirty(); + } + } } NS_ENSURE_SUCCESS(rv, rv); @@ -3808,7 +3806,12 @@ nsBlockFrame::ReflowInlineFrame(nsBlockReflowState& aState, if (NS_INLINE_IS_BREAK_AFTER(frameReflowStatus) && !aLineLayout.GetLineEndsInBR()) { - aLineLayout.SetDirtyNextLine(); + // Mark next line dirty in case SplitLine didn't end up + // pushing any frames. + nsLineList_iterator next = aLine.next(); + if (next != end_lines() && !next->IsBlock()) { + next->MarkDirty(); + } } } } diff --git a/layout/generic/nsInlineFrame.cpp b/layout/generic/nsInlineFrame.cpp index f5a6d6ca5fa..930c510a124 100644 --- a/layout/generic/nsInlineFrame.cpp +++ b/layout/generic/nsInlineFrame.cpp @@ -377,7 +377,6 @@ nsInlineFrame::Reflow(nsPresContext* aPresContext, InlineReflowState irs; irs.mPrevFrame = nsnull; irs.mLineContainer = lineContainer; - irs.mLineLayout = aReflowState.mLineLayout; irs.mNextInFlow = (nsInlineFrame*) GetNextInFlow(); irs.mSetParentPointer = lazilySetParentPointer; @@ -669,7 +668,7 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext, aStatus = NS_FRAME_NOT_COMPLETE | NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER | (aStatus & NS_INLINE_BREAK_TYPE_MASK); - PushFrames(aPresContext, aFrame, irs.mPrevFrame, irs); + PushFrames(aPresContext, aFrame, irs.mPrevFrame); } else { // Preserve reflow status when breaking-before our first child @@ -701,7 +700,7 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext, nsIFrame* nextFrame = aFrame->GetNextSibling(); if (nextFrame) { NS_FRAME_SET_INCOMPLETE(aStatus); - PushFrames(aPresContext, nextFrame, aFrame, irs); + PushFrames(aPresContext, nextFrame, aFrame); } else if (nsnull != GetNextInFlow()) { // We must return an incomplete status if there are more child @@ -735,7 +734,7 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext, if (!reflowingFirstLetter) { nsIFrame* nextFrame = aFrame->GetNextSibling(); if (nextFrame) { - PushFrames(aPresContext, nextFrame, aFrame, irs); + PushFrames(aPresContext, nextFrame, aFrame); } } } @@ -767,9 +766,6 @@ nsInlineFrame::PullOneFrame(nsPresContext* aPresContext, nextInFlow->mFrames.RemoveFirstChild(); mFrames.InsertFrame(this, irs.mPrevFrame, frame); isComplete = PR_FALSE; - if (irs.mLineLayout) { - irs.mLineLayout->SetDirtyNextLine(); - } nsHTMLContainerFrame::ReparentFrameView(aPresContext, frame, nextInFlow, this); break; } @@ -784,8 +780,7 @@ nsInlineFrame::PullOneFrame(nsPresContext* aPresContext, void nsInlineFrame::PushFrames(nsPresContext* aPresContext, nsIFrame* aFromChild, - nsIFrame* aPrevSibling, - InlineReflowState& aState) + nsIFrame* aPrevSibling) { NS_PRECONDITION(aFromChild, "null pointer"); NS_PRECONDITION(aPrevSibling, "pushing first child"); @@ -799,9 +794,6 @@ nsInlineFrame::PushFrames(nsPresContext* aPresContext, // Add the frames to our overflow list (let our next in flow drain // our overflow list when it is ready) SetOverflowFrames(aPresContext, mFrames.RemoveFramesAfter(aPrevSibling)); - if (aState.mLineLayout) { - aState.mLineLayout->SetDirtyNextLine(); - } } diff --git a/layout/generic/nsInlineFrame.h b/layout/generic/nsInlineFrame.h index aaed4326f34..d94c72a8822 100644 --- a/layout/generic/nsInlineFrame.h +++ b/layout/generic/nsInlineFrame.h @@ -154,7 +154,6 @@ protected: nsIFrame* mPrevFrame; nsInlineFrame* mNextInFlow; nsIFrame* mLineContainer; - nsLineLayout* mLineLayout; PRPackedBool mSetParentPointer; // when reflowing child frame first set its // parent frame pointer @@ -162,7 +161,6 @@ protected: mPrevFrame = nsnull; mNextInFlow = nsnull; mLineContainer = nsnull; - mLineLayout = nsnull; mSetParentPointer = PR_FALSE; } }; @@ -198,8 +196,7 @@ protected: virtual void PushFrames(nsPresContext* aPresContext, nsIFrame* aFromChild, - nsIFrame* aPrevSibling, - InlineReflowState& aState); + nsIFrame* aPrevSibling); }; diff --git a/layout/generic/nsLineLayout.h b/layout/generic/nsLineLayout.h index 04b535bffd1..1028e97d949 100644 --- a/layout/generic/nsLineLayout.h +++ b/layout/generic/nsLineLayout.h @@ -156,8 +156,7 @@ protected: #define LL_GOTLINEBOX 0x00001000 #define LL_INFIRSTLETTER 0x00002000 #define LL_HASBULLET 0x00004000 -#define LL_DIRTYNEXTLINE 0x00008000 -#define LL_LASTFLAG LL_DIRTYNEXTLINE +#define LL_LASTFLAG LL_HASBULLET void SetFlag(PRUint32 aFlag, PRBool aValue) { @@ -247,15 +246,6 @@ public: SetFlag(LL_INFIRSTLINE, aSetting); } - // Calling this during block reflow ensures that the next line of inlines - // will be marked dirty, if there is one. - void SetDirtyNextLine() { - SetFlag(LL_DIRTYNEXTLINE, PR_TRUE); - } - PRBool GetDirtyNextLine() { - return GetFlag(LL_DIRTYNEXTLINE); - } - //---------------------------------------- nsPresContext* mPresContext; diff --git a/layout/generic/nsTextFrameThebes.cpp b/layout/generic/nsTextFrameThebes.cpp index 21c0aae7b14..60e847a0472 100644 --- a/layout/generic/nsTextFrameThebes.cpp +++ b/layout/generic/nsTextFrameThebes.cpp @@ -5987,7 +5987,14 @@ nsTextFrame::SetLength(PRInt32 aLength, nsLineLayout* aLineLayout) // and ChildIsDirty to handle a range of frames would be worse. if (aLineLayout && (end != f->mContentOffset || (f->GetStateBits() & NS_FRAME_IS_DIRTY))) { - aLineLayout->SetDirtyNextLine(); + const nsLineList::iterator* line = aLineLayout->GetLine(); + nsBlockFrame* block = do_QueryFrame(aLineLayout->GetLineContainerFrame()); + if (line && block) { + nsLineList::iterator next = line->next(); + if (next != block->end_lines() && !next->IsBlock()) { + next->MarkDirty(); + } + } } if (end < f->mContentOffset) { diff --git a/layout/reftests/bugs/523468-1-ref.html b/layout/reftests/bugs/523468-1-ref.html deleted file mode 100644 index d396cde11f0..00000000000 --- a/layout/reftests/bugs/523468-1-ref.html +++ /dev/null @@ -1,8 +0,0 @@ - - - -c
-da
-b - - diff --git a/layout/reftests/bugs/523468-1.html b/layout/reftests/bugs/523468-1.html deleted file mode 100644 index 4d428d927d3..00000000000 --- a/layout/reftests/bugs/523468-1.html +++ /dev/null @@ -1,10 +0,0 @@ - - -a b - - - diff --git a/layout/reftests/bugs/reftest.list b/layout/reftests/bugs/reftest.list index 975a837d1e1..a07092e0da2 100644 --- a/layout/reftests/bugs/reftest.list +++ b/layout/reftests/bugs/reftest.list @@ -1330,6 +1330,5 @@ fails-if(MOZ_WIDGET_TOOLKIT!="cocoa") == 488692-1.html 488692-1-ref.html # needs == 521539-1.html 521539-1-ref.html == 520421-1.html 520421-1-ref.html == 521685-1.html 521685-1-ref.html -== 523096-1.html 523096-1-ref.html -== 523468-1.html 523468-1-ref.html == 524175-1.html 524175-1-ref.html +== 523096-1.html 523096-1-ref.html