diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index d52132619f6..766ca678d10 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -111,6 +111,8 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext, mBlock = aBlock; mSpaceManager = aSpaceManager; mBlockIsPseudo = aBlock->IsPseudoFrame(); + mBlockIsListItem = PR_FALSE; + mListPositionOutside = PR_FALSE; mCurrentLine = nsnull; mPrevKidFrame = nsnull; @@ -1023,6 +1025,19 @@ nsBlockFrame::InitializeState(nsIPresContext* aPresContext, } NS_RELEASE(tag); + // Setup list flags in block reflow state if this block is a list + // item. + nsStyleDisplay* myDisplay = (nsStyleDisplay*) + mStyleContext->GetData(eStyleStruct_Display); + if (NS_STYLE_DISPLAY_LIST_ITEM == myDisplay->mDisplay) { + aState.mBlockIsListItem = PR_TRUE; + nsStyleList* myList = (nsStyleList*) + mStyleContext->GetData(eStyleStruct_List); + if (NS_STYLE_LIST_STYLE_POSITION_OUTSIDE == myList->mListStylePosition) { + aState.mListPositionOutside = PR_TRUE; + } + } + return rv; } @@ -1218,6 +1233,17 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, nsBlockReflowState state; nsresult rv = NS_OK; + if (eReflowReason_Initial == aReflowState.reason) { + NS_ASSERTION(0 != (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + rv = ProcessInitialReflow(aPresContext); + if (NS_OK != rv) { + return rv; + } + } + else { + NS_ASSERTION(0 == (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + } + aStatus = NS_FRAME_COMPLETE; rv = InitializeState(aPresContext, aSpaceManager, aReflowState.maxSize, aDesiredSize.maxElementSize, state); diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp index d52132619f6..766ca678d10 100644 --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -111,6 +111,8 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext, mBlock = aBlock; mSpaceManager = aSpaceManager; mBlockIsPseudo = aBlock->IsPseudoFrame(); + mBlockIsListItem = PR_FALSE; + mListPositionOutside = PR_FALSE; mCurrentLine = nsnull; mPrevKidFrame = nsnull; @@ -1023,6 +1025,19 @@ nsBlockFrame::InitializeState(nsIPresContext* aPresContext, } NS_RELEASE(tag); + // Setup list flags in block reflow state if this block is a list + // item. + nsStyleDisplay* myDisplay = (nsStyleDisplay*) + mStyleContext->GetData(eStyleStruct_Display); + if (NS_STYLE_DISPLAY_LIST_ITEM == myDisplay->mDisplay) { + aState.mBlockIsListItem = PR_TRUE; + nsStyleList* myList = (nsStyleList*) + mStyleContext->GetData(eStyleStruct_List); + if (NS_STYLE_LIST_STYLE_POSITION_OUTSIDE == myList->mListStylePosition) { + aState.mListPositionOutside = PR_TRUE; + } + } + return rv; } @@ -1218,6 +1233,17 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, nsBlockReflowState state; nsresult rv = NS_OK; + if (eReflowReason_Initial == aReflowState.reason) { + NS_ASSERTION(0 != (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + rv = ProcessInitialReflow(aPresContext); + if (NS_OK != rv) { + return rv; + } + } + else { + NS_ASSERTION(0 == (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + } + aStatus = NS_FRAME_COMPLETE; rv = InitializeState(aPresContext, aSpaceManager, aReflowState.maxSize, aDesiredSize.maxElementSize, state); diff --git a/layout/generic/nsBlockReflowState.h b/layout/generic/nsBlockReflowState.h index d52132619f6..766ca678d10 100644 --- a/layout/generic/nsBlockReflowState.h +++ b/layout/generic/nsBlockReflowState.h @@ -111,6 +111,8 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext, mBlock = aBlock; mSpaceManager = aSpaceManager; mBlockIsPseudo = aBlock->IsPseudoFrame(); + mBlockIsListItem = PR_FALSE; + mListPositionOutside = PR_FALSE; mCurrentLine = nsnull; mPrevKidFrame = nsnull; @@ -1023,6 +1025,19 @@ nsBlockFrame::InitializeState(nsIPresContext* aPresContext, } NS_RELEASE(tag); + // Setup list flags in block reflow state if this block is a list + // item. + nsStyleDisplay* myDisplay = (nsStyleDisplay*) + mStyleContext->GetData(eStyleStruct_Display); + if (NS_STYLE_DISPLAY_LIST_ITEM == myDisplay->mDisplay) { + aState.mBlockIsListItem = PR_TRUE; + nsStyleList* myList = (nsStyleList*) + mStyleContext->GetData(eStyleStruct_List); + if (NS_STYLE_LIST_STYLE_POSITION_OUTSIDE == myList->mListStylePosition) { + aState.mListPositionOutside = PR_TRUE; + } + } + return rv; } @@ -1218,6 +1233,17 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, nsBlockReflowState state; nsresult rv = NS_OK; + if (eReflowReason_Initial == aReflowState.reason) { + NS_ASSERTION(0 != (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + rv = ProcessInitialReflow(aPresContext); + if (NS_OK != rv) { + return rv; + } + } + else { + NS_ASSERTION(0 == (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + } + aStatus = NS_FRAME_COMPLETE; rv = InitializeState(aPresContext, aSpaceManager, aReflowState.maxSize, aDesiredSize.maxElementSize, state); diff --git a/layout/html/base/src/nsBlockFrame.cpp b/layout/html/base/src/nsBlockFrame.cpp index d52132619f6..766ca678d10 100644 --- a/layout/html/base/src/nsBlockFrame.cpp +++ b/layout/html/base/src/nsBlockFrame.cpp @@ -111,6 +111,8 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext, mBlock = aBlock; mSpaceManager = aSpaceManager; mBlockIsPseudo = aBlock->IsPseudoFrame(); + mBlockIsListItem = PR_FALSE; + mListPositionOutside = PR_FALSE; mCurrentLine = nsnull; mPrevKidFrame = nsnull; @@ -1023,6 +1025,19 @@ nsBlockFrame::InitializeState(nsIPresContext* aPresContext, } NS_RELEASE(tag); + // Setup list flags in block reflow state if this block is a list + // item. + nsStyleDisplay* myDisplay = (nsStyleDisplay*) + mStyleContext->GetData(eStyleStruct_Display); + if (NS_STYLE_DISPLAY_LIST_ITEM == myDisplay->mDisplay) { + aState.mBlockIsListItem = PR_TRUE; + nsStyleList* myList = (nsStyleList*) + mStyleContext->GetData(eStyleStruct_List); + if (NS_STYLE_LIST_STYLE_POSITION_OUTSIDE == myList->mListStylePosition) { + aState.mListPositionOutside = PR_TRUE; + } + } + return rv; } @@ -1218,6 +1233,17 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, nsBlockReflowState state; nsresult rv = NS_OK; + if (eReflowReason_Initial == aReflowState.reason) { + NS_ASSERTION(0 != (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + rv = ProcessInitialReflow(aPresContext); + if (NS_OK != rv) { + return rv; + } + } + else { + NS_ASSERTION(0 == (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + } + aStatus = NS_FRAME_COMPLETE; rv = InitializeState(aPresContext, aSpaceManager, aReflowState.maxSize, aDesiredSize.maxElementSize, state); diff --git a/layout/html/base/src/nsBlockReflowState.cpp b/layout/html/base/src/nsBlockReflowState.cpp index d52132619f6..766ca678d10 100644 --- a/layout/html/base/src/nsBlockReflowState.cpp +++ b/layout/html/base/src/nsBlockReflowState.cpp @@ -111,6 +111,8 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext, mBlock = aBlock; mSpaceManager = aSpaceManager; mBlockIsPseudo = aBlock->IsPseudoFrame(); + mBlockIsListItem = PR_FALSE; + mListPositionOutside = PR_FALSE; mCurrentLine = nsnull; mPrevKidFrame = nsnull; @@ -1023,6 +1025,19 @@ nsBlockFrame::InitializeState(nsIPresContext* aPresContext, } NS_RELEASE(tag); + // Setup list flags in block reflow state if this block is a list + // item. + nsStyleDisplay* myDisplay = (nsStyleDisplay*) + mStyleContext->GetData(eStyleStruct_Display); + if (NS_STYLE_DISPLAY_LIST_ITEM == myDisplay->mDisplay) { + aState.mBlockIsListItem = PR_TRUE; + nsStyleList* myList = (nsStyleList*) + mStyleContext->GetData(eStyleStruct_List); + if (NS_STYLE_LIST_STYLE_POSITION_OUTSIDE == myList->mListStylePosition) { + aState.mListPositionOutside = PR_TRUE; + } + } + return rv; } @@ -1218,6 +1233,17 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, nsBlockReflowState state; nsresult rv = NS_OK; + if (eReflowReason_Initial == aReflowState.reason) { + NS_ASSERTION(0 != (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + rv = ProcessInitialReflow(aPresContext); + if (NS_OK != rv) { + return rv; + } + } + else { + NS_ASSERTION(0 == (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + } + aStatus = NS_FRAME_COMPLETE; rv = InitializeState(aPresContext, aSpaceManager, aReflowState.maxSize, aDesiredSize.maxElementSize, state); diff --git a/layout/html/base/src/nsBlockReflowState.h b/layout/html/base/src/nsBlockReflowState.h index d52132619f6..766ca678d10 100644 --- a/layout/html/base/src/nsBlockReflowState.h +++ b/layout/html/base/src/nsBlockReflowState.h @@ -111,6 +111,8 @@ nsBlockReflowState::Initialize(nsIPresContext* aPresContext, mBlock = aBlock; mSpaceManager = aSpaceManager; mBlockIsPseudo = aBlock->IsPseudoFrame(); + mBlockIsListItem = PR_FALSE; + mListPositionOutside = PR_FALSE; mCurrentLine = nsnull; mPrevKidFrame = nsnull; @@ -1023,6 +1025,19 @@ nsBlockFrame::InitializeState(nsIPresContext* aPresContext, } NS_RELEASE(tag); + // Setup list flags in block reflow state if this block is a list + // item. + nsStyleDisplay* myDisplay = (nsStyleDisplay*) + mStyleContext->GetData(eStyleStruct_Display); + if (NS_STYLE_DISPLAY_LIST_ITEM == myDisplay->mDisplay) { + aState.mBlockIsListItem = PR_TRUE; + nsStyleList* myList = (nsStyleList*) + mStyleContext->GetData(eStyleStruct_List); + if (NS_STYLE_LIST_STYLE_POSITION_OUTSIDE == myList->mListStylePosition) { + aState.mListPositionOutside = PR_TRUE; + } + } + return rv; } @@ -1218,6 +1233,17 @@ nsBlockFrame::Reflow(nsIPresContext* aPresContext, nsBlockReflowState state; nsresult rv = NS_OK; + if (eReflowReason_Initial == aReflowState.reason) { + NS_ASSERTION(0 != (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + rv = ProcessInitialReflow(aPresContext); + if (NS_OK != rv) { + return rv; + } + } + else { + NS_ASSERTION(0 == (NS_FRAME_FIRST_REFLOW & mState), "bad mState"); + } + aStatus = NS_FRAME_COMPLETE; rv = InitializeState(aPresContext, aSpaceManager, aReflowState.maxSize, aDesiredSize.maxElementSize, state);