Backout fix for bug 523468 due to crashing tests

This commit is contained in:
Robert O'Callahan 2009-10-27 21:46:39 +13:00
commit 7143e4ece9
8 changed files with 31 additions and 61 deletions

View File

@ -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<nsBlockFrame*>(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();
}
}
}
}

View File

@ -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();
}
}

View File

@ -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);
};

View File

@ -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;

View File

@ -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) {

View File

@ -1,8 +0,0 @@
<!DOCTYPE html>
<html>
<body>
c<br>
da<br>
b
</body>
</html>

View File

@ -1,10 +0,0 @@
<!DOCTYPE HTML>
<html style="width:1px">
<body><span><span id="y"></span>a b</span>
<script>
var y = document.getElementById("y");
document.documentElement.offsetHeight;
y.appendChild(document.createTextNode("c d"));
</script>
</body>
</html>

View File

@ -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