зеркало из https://github.com/mozilla/pjs.git
Use new flag defines
This commit is contained in:
Родитель
9832366872
Коммит
9088d3fb1e
|
@ -1157,7 +1157,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext,
|
|||
case NS_STYLE_DISPLAY_TABLE_CAPTION:
|
||||
// Have we already created a caption? If so, ignore this caption
|
||||
if (nsnull == captionFrame) {
|
||||
NS_NewAreaFrame(captionFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
NS_NewAreaFrame(captionFrame, 0);
|
||||
captionFrame->Init(*aPresContext, childContent, aNewFrame,
|
||||
aNewFrame, childStyleContext);
|
||||
// Process the caption's child content and set the initial child list
|
||||
|
@ -1324,7 +1324,7 @@ HTMLStyleSheetImpl::ConstructTableCellFrame(nsIPresContext* aPresContext,
|
|||
// Create an area frame that will format the cell's content
|
||||
nsIFrame* cellBodyFrame;
|
||||
|
||||
rv = NS_NewAreaFrame(cellBodyFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
rv = NS_NewAreaFrame(cellBodyFrame, 0);
|
||||
if (NS_FAILED(rv)) {
|
||||
aNewFrame->DeleteFrame(*aPresContext);
|
||||
aNewFrame = nsnull;
|
||||
|
@ -1475,7 +1475,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext,
|
|||
|
||||
// XXX Until we clean up how painting damage is handled, we need to use the
|
||||
// flag that says that this is the body...
|
||||
NS_NewAreaFrame(areaFrame, NS_BODY_THE_BODY);
|
||||
NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT);
|
||||
nsIFrame* parentFrame = scrollFrame ? scrollFrame : aRootFrame;
|
||||
areaFrame->Init(*aPresContext, aDocElement, parentFrame, parentFrame,
|
||||
styleContext);
|
||||
|
@ -1794,7 +1794,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
|
||||
// Create an area container for the frame
|
||||
nsIFrame* scrolledFrame;
|
||||
NS_NewAreaFrame(scrolledFrame, NS_BODY_SHRINK_WRAP);
|
||||
NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP);
|
||||
|
||||
// Initialize the frame and force it to have a view
|
||||
scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrollFrame,
|
||||
|
@ -1839,7 +1839,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
isAbsolutelyPositioned = PR_TRUE;
|
||||
|
||||
// Create an area frame
|
||||
NS_NewAreaFrame(aNewFrame, NS_BODY_SHRINK_WRAP);
|
||||
NS_NewAreaFrame(aNewFrame, NS_BLOCK_SHRINK_WRAP);
|
||||
aNewFrame->Init(*aPresContext, aContent, aAbsoluteItems.containingBlock,
|
||||
aParentFrame, aStyleContext);
|
||||
|
||||
|
@ -1867,7 +1867,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
(NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay))) {
|
||||
|
||||
// Create an area frame
|
||||
NS_NewAreaFrame(aNewFrame, NS_BODY_SHRINK_WRAP);
|
||||
NS_NewAreaFrame(aNewFrame, NS_BLOCK_SHRINK_WRAP);
|
||||
|
||||
// Initialize the frame
|
||||
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame,
|
||||
|
@ -1980,7 +1980,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
|
||||
case NS_STYLE_DISPLAY_TABLE_CAPTION:
|
||||
// XXX We should check for being inside of a table row frame...
|
||||
rv = NS_NewAreaFrame(aNewFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
rv = NS_NewAreaFrame(aNewFrame, 0);
|
||||
processChildren = PR_TRUE;
|
||||
break;
|
||||
|
||||
|
|
|
@ -123,7 +123,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
|
||||
NS_NewAreaFrame(mFirstChild, flags);
|
||||
mContentFrame = mFirstChild;
|
||||
|
||||
|
|
|
@ -506,7 +506,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
|
||||
NS_NewAreaFrame(mFirstChild, flags);
|
||||
|
||||
// Resolve style and initialize the frame
|
||||
|
|
|
@ -89,7 +89,7 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
|
||||
NS_NewAreaFrame(mFirstChild, flags);
|
||||
|
||||
// Resolve style and initialize the frame
|
||||
|
|
|
@ -443,7 +443,7 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
|
||||
// If this is really the body, force a repaint of the damage area
|
||||
if ((NS_BODY_THE_BODY & mFlags) && !damageArea.IsEmpty()) {
|
||||
if ((NS_BLOCK_DOCUMENT_ROOT & mFlags) && !damageArea.IsEmpty()) {
|
||||
Invalidate(damageArea);
|
||||
}
|
||||
|
||||
|
|
|
@ -428,9 +428,15 @@ nsBaseIBFrame::DeleteFrame(nsIPresContext& aPresContext)
|
|||
NS_IMETHODIMP
|
||||
nsBaseIBFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtr, "null ptr");
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kBlockFrameCID)) {
|
||||
nsBaseIBFrame* ib = this;
|
||||
*aInstancePtr = (void*) ib;
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBaseIBFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
|
@ -573,6 +579,9 @@ nsBaseIBFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Frame structure methods
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Reflow methods
|
||||
|
||||
|
@ -704,14 +713,8 @@ nsBaseIBFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
nsBlockReflowState state(aPresContext, aReflowState, aMetrics, lineLayout);
|
||||
if (NS_BODY_THE_BODY & mFlags) {
|
||||
// Because we use padding to provide some empty space around the
|
||||
// outside of the html body, we need to disable margin application
|
||||
// at the top and bottom.
|
||||
|
||||
// XXX revisit this when the HTML element is no longer the root of
|
||||
// the frame tree
|
||||
state.mIsMarginRoot = PR_FALSE;
|
||||
if (NS_BLOCK_MARGIN_ROOT & mFlags) {
|
||||
state.mIsMarginRoot = PR_TRUE;
|
||||
}
|
||||
if (lineLayout == &ll) {
|
||||
lineLayout->Init(&state);
|
||||
|
@ -830,7 +833,7 @@ nsBaseIBFrame::ComputeFinalSize(nsBlockReflowState& aState,
|
|||
// There are two options here. We either shrink wrap around our
|
||||
// contents or we fluff out to the maximum available width. Note:
|
||||
// We always shrink wrap when given an unconstrained width.
|
||||
if ((0 == (NS_BODY_SHRINK_WRAP & mFlags)) &&
|
||||
if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) &&
|
||||
!aState.mUnconstrainedWidth &&
|
||||
!compact) {
|
||||
// Fluff out to the max width if we aren't already that wide
|
||||
|
@ -3668,7 +3671,7 @@ nsBlockReflowState::AddFloater(nsPlaceholderFrame* aPlaceholder,
|
|||
nsHTMLReflowState reflowState(mPresContext, floater, *this, kidAvailSize);
|
||||
reflowState.lineLayout = nsnull;
|
||||
if ((nsnull == reflowCommand) || (floater != mNextRCFrame)) {
|
||||
// Stub out reflowCommand and repair reasin in the reflowState
|
||||
// Stub out reflowCommand and repair reason in the reflowState
|
||||
// when incremental reflow doesn't apply to the floater.
|
||||
reflowState.reflowCommand = nsnull;
|
||||
reflowState.reason = ((reason == eReflowReason_Initial) || aInitialReflow)
|
||||
|
|
|
@ -428,9 +428,15 @@ nsBaseIBFrame::DeleteFrame(nsIPresContext& aPresContext)
|
|||
NS_IMETHODIMP
|
||||
nsBaseIBFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtr, "null ptr");
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kBlockFrameCID)) {
|
||||
nsBaseIBFrame* ib = this;
|
||||
*aInstancePtr = (void*) ib;
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBaseIBFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
|
@ -573,6 +579,9 @@ nsBaseIBFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Frame structure methods
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Reflow methods
|
||||
|
||||
|
@ -704,14 +713,8 @@ nsBaseIBFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
nsBlockReflowState state(aPresContext, aReflowState, aMetrics, lineLayout);
|
||||
if (NS_BODY_THE_BODY & mFlags) {
|
||||
// Because we use padding to provide some empty space around the
|
||||
// outside of the html body, we need to disable margin application
|
||||
// at the top and bottom.
|
||||
|
||||
// XXX revisit this when the HTML element is no longer the root of
|
||||
// the frame tree
|
||||
state.mIsMarginRoot = PR_FALSE;
|
||||
if (NS_BLOCK_MARGIN_ROOT & mFlags) {
|
||||
state.mIsMarginRoot = PR_TRUE;
|
||||
}
|
||||
if (lineLayout == &ll) {
|
||||
lineLayout->Init(&state);
|
||||
|
@ -830,7 +833,7 @@ nsBaseIBFrame::ComputeFinalSize(nsBlockReflowState& aState,
|
|||
// There are two options here. We either shrink wrap around our
|
||||
// contents or we fluff out to the maximum available width. Note:
|
||||
// We always shrink wrap when given an unconstrained width.
|
||||
if ((0 == (NS_BODY_SHRINK_WRAP & mFlags)) &&
|
||||
if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) &&
|
||||
!aState.mUnconstrainedWidth &&
|
||||
!compact) {
|
||||
// Fluff out to the max width if we aren't already that wide
|
||||
|
@ -3668,7 +3671,7 @@ nsBlockReflowState::AddFloater(nsPlaceholderFrame* aPlaceholder,
|
|||
nsHTMLReflowState reflowState(mPresContext, floater, *this, kidAvailSize);
|
||||
reflowState.lineLayout = nsnull;
|
||||
if ((nsnull == reflowCommand) || (floater != mNextRCFrame)) {
|
||||
// Stub out reflowCommand and repair reasin in the reflowState
|
||||
// Stub out reflowCommand and repair reason in the reflowState
|
||||
// when incremental reflow doesn't apply to the floater.
|
||||
reflowState.reflowCommand = nsnull;
|
||||
reflowState.reason = ((reason == eReflowReason_Initial) || aInitialReflow)
|
||||
|
|
|
@ -428,9 +428,15 @@ nsBaseIBFrame::DeleteFrame(nsIPresContext& aPresContext)
|
|||
NS_IMETHODIMP
|
||||
nsBaseIBFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtr, "null ptr");
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kBlockFrameCID)) {
|
||||
nsBaseIBFrame* ib = this;
|
||||
*aInstancePtr = (void*) ib;
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBaseIBFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
|
@ -573,6 +579,9 @@ nsBaseIBFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Frame structure methods
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Reflow methods
|
||||
|
||||
|
@ -704,14 +713,8 @@ nsBaseIBFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
nsBlockReflowState state(aPresContext, aReflowState, aMetrics, lineLayout);
|
||||
if (NS_BODY_THE_BODY & mFlags) {
|
||||
// Because we use padding to provide some empty space around the
|
||||
// outside of the html body, we need to disable margin application
|
||||
// at the top and bottom.
|
||||
|
||||
// XXX revisit this when the HTML element is no longer the root of
|
||||
// the frame tree
|
||||
state.mIsMarginRoot = PR_FALSE;
|
||||
if (NS_BLOCK_MARGIN_ROOT & mFlags) {
|
||||
state.mIsMarginRoot = PR_TRUE;
|
||||
}
|
||||
if (lineLayout == &ll) {
|
||||
lineLayout->Init(&state);
|
||||
|
@ -830,7 +833,7 @@ nsBaseIBFrame::ComputeFinalSize(nsBlockReflowState& aState,
|
|||
// There are two options here. We either shrink wrap around our
|
||||
// contents or we fluff out to the maximum available width. Note:
|
||||
// We always shrink wrap when given an unconstrained width.
|
||||
if ((0 == (NS_BODY_SHRINK_WRAP & mFlags)) &&
|
||||
if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) &&
|
||||
!aState.mUnconstrainedWidth &&
|
||||
!compact) {
|
||||
// Fluff out to the max width if we aren't already that wide
|
||||
|
@ -3668,7 +3671,7 @@ nsBlockReflowState::AddFloater(nsPlaceholderFrame* aPlaceholder,
|
|||
nsHTMLReflowState reflowState(mPresContext, floater, *this, kidAvailSize);
|
||||
reflowState.lineLayout = nsnull;
|
||||
if ((nsnull == reflowCommand) || (floater != mNextRCFrame)) {
|
||||
// Stub out reflowCommand and repair reasin in the reflowState
|
||||
// Stub out reflowCommand and repair reason in the reflowState
|
||||
// when incremental reflow doesn't apply to the floater.
|
||||
reflowState.reflowCommand = nsnull;
|
||||
reflowState.reason = ((reason == eReflowReason_Initial) || aInitialReflow)
|
||||
|
|
|
@ -443,7 +443,7 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
|
||||
// If this is really the body, force a repaint of the damage area
|
||||
if ((NS_BODY_THE_BODY & mFlags) && !damageArea.IsEmpty()) {
|
||||
if ((NS_BLOCK_DOCUMENT_ROOT & mFlags) && !damageArea.IsEmpty()) {
|
||||
Invalidate(damageArea);
|
||||
}
|
||||
|
||||
|
|
|
@ -428,9 +428,15 @@ nsBaseIBFrame::DeleteFrame(nsIPresContext& aPresContext)
|
|||
NS_IMETHODIMP
|
||||
nsBaseIBFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtr, "null ptr");
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kBlockFrameCID)) {
|
||||
nsBaseIBFrame* ib = this;
|
||||
*aInstancePtr = (void*) ib;
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBaseIBFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
|
@ -573,6 +579,9 @@ nsBaseIBFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Frame structure methods
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Reflow methods
|
||||
|
||||
|
@ -704,14 +713,8 @@ nsBaseIBFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
nsBlockReflowState state(aPresContext, aReflowState, aMetrics, lineLayout);
|
||||
if (NS_BODY_THE_BODY & mFlags) {
|
||||
// Because we use padding to provide some empty space around the
|
||||
// outside of the html body, we need to disable margin application
|
||||
// at the top and bottom.
|
||||
|
||||
// XXX revisit this when the HTML element is no longer the root of
|
||||
// the frame tree
|
||||
state.mIsMarginRoot = PR_FALSE;
|
||||
if (NS_BLOCK_MARGIN_ROOT & mFlags) {
|
||||
state.mIsMarginRoot = PR_TRUE;
|
||||
}
|
||||
if (lineLayout == &ll) {
|
||||
lineLayout->Init(&state);
|
||||
|
@ -830,7 +833,7 @@ nsBaseIBFrame::ComputeFinalSize(nsBlockReflowState& aState,
|
|||
// There are two options here. We either shrink wrap around our
|
||||
// contents or we fluff out to the maximum available width. Note:
|
||||
// We always shrink wrap when given an unconstrained width.
|
||||
if ((0 == (NS_BODY_SHRINK_WRAP & mFlags)) &&
|
||||
if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) &&
|
||||
!aState.mUnconstrainedWidth &&
|
||||
!compact) {
|
||||
// Fluff out to the max width if we aren't already that wide
|
||||
|
@ -3668,7 +3671,7 @@ nsBlockReflowState::AddFloater(nsPlaceholderFrame* aPlaceholder,
|
|||
nsHTMLReflowState reflowState(mPresContext, floater, *this, kidAvailSize);
|
||||
reflowState.lineLayout = nsnull;
|
||||
if ((nsnull == reflowCommand) || (floater != mNextRCFrame)) {
|
||||
// Stub out reflowCommand and repair reasin in the reflowState
|
||||
// Stub out reflowCommand and repair reason in the reflowState
|
||||
// when incremental reflow doesn't apply to the floater.
|
||||
reflowState.reflowCommand = nsnull;
|
||||
reflowState.reason = ((reason == eReflowReason_Initial) || aInitialReflow)
|
||||
|
|
|
@ -428,9 +428,15 @@ nsBaseIBFrame::DeleteFrame(nsIPresContext& aPresContext)
|
|||
NS_IMETHODIMP
|
||||
nsBaseIBFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtr, "null ptr");
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kBlockFrameCID)) {
|
||||
nsBaseIBFrame* ib = this;
|
||||
*aInstancePtr = (void*) ib;
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBaseIBFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
|
@ -573,6 +579,9 @@ nsBaseIBFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Frame structure methods
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Reflow methods
|
||||
|
||||
|
@ -704,14 +713,8 @@ nsBaseIBFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
nsBlockReflowState state(aPresContext, aReflowState, aMetrics, lineLayout);
|
||||
if (NS_BODY_THE_BODY & mFlags) {
|
||||
// Because we use padding to provide some empty space around the
|
||||
// outside of the html body, we need to disable margin application
|
||||
// at the top and bottom.
|
||||
|
||||
// XXX revisit this when the HTML element is no longer the root of
|
||||
// the frame tree
|
||||
state.mIsMarginRoot = PR_FALSE;
|
||||
if (NS_BLOCK_MARGIN_ROOT & mFlags) {
|
||||
state.mIsMarginRoot = PR_TRUE;
|
||||
}
|
||||
if (lineLayout == &ll) {
|
||||
lineLayout->Init(&state);
|
||||
|
@ -830,7 +833,7 @@ nsBaseIBFrame::ComputeFinalSize(nsBlockReflowState& aState,
|
|||
// There are two options here. We either shrink wrap around our
|
||||
// contents or we fluff out to the maximum available width. Note:
|
||||
// We always shrink wrap when given an unconstrained width.
|
||||
if ((0 == (NS_BODY_SHRINK_WRAP & mFlags)) &&
|
||||
if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) &&
|
||||
!aState.mUnconstrainedWidth &&
|
||||
!compact) {
|
||||
// Fluff out to the max width if we aren't already that wide
|
||||
|
@ -3668,7 +3671,7 @@ nsBlockReflowState::AddFloater(nsPlaceholderFrame* aPlaceholder,
|
|||
nsHTMLReflowState reflowState(mPresContext, floater, *this, kidAvailSize);
|
||||
reflowState.lineLayout = nsnull;
|
||||
if ((nsnull == reflowCommand) || (floater != mNextRCFrame)) {
|
||||
// Stub out reflowCommand and repair reasin in the reflowState
|
||||
// Stub out reflowCommand and repair reason in the reflowState
|
||||
// when incremental reflow doesn't apply to the floater.
|
||||
reflowState.reflowCommand = nsnull;
|
||||
reflowState.reason = ((reason == eReflowReason_Initial) || aInitialReflow)
|
||||
|
|
|
@ -428,9 +428,15 @@ nsBaseIBFrame::DeleteFrame(nsIPresContext& aPresContext)
|
|||
NS_IMETHODIMP
|
||||
nsBaseIBFrame::QueryInterface(const nsIID& aIID, void** aInstancePtr)
|
||||
{
|
||||
NS_PRECONDITION(nsnull != aInstancePtr, "null ptr");
|
||||
if (NULL == aInstancePtr) {
|
||||
return NS_ERROR_NULL_POINTER;
|
||||
}
|
||||
if (aIID.Equals(kBlockFrameCID)) {
|
||||
nsBaseIBFrame* ib = this;
|
||||
*aInstancePtr = (void*) ib;
|
||||
return NS_OK;
|
||||
}
|
||||
return nsBaseIBFrameSuper::QueryInterface(aIID, aInstancePtr);
|
||||
}
|
||||
|
||||
|
@ -573,6 +579,9 @@ nsBaseIBFrame::FirstChild(nsIAtom* aListName, nsIFrame*& aFirstChild) const
|
|||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Frame structure methods
|
||||
|
||||
//////////////////////////////////////////////////////////////////////
|
||||
// Reflow methods
|
||||
|
||||
|
@ -704,14 +713,8 @@ nsBaseIBFrame::Reflow(nsIPresContext& aPresContext,
|
|||
}
|
||||
}
|
||||
nsBlockReflowState state(aPresContext, aReflowState, aMetrics, lineLayout);
|
||||
if (NS_BODY_THE_BODY & mFlags) {
|
||||
// Because we use padding to provide some empty space around the
|
||||
// outside of the html body, we need to disable margin application
|
||||
// at the top and bottom.
|
||||
|
||||
// XXX revisit this when the HTML element is no longer the root of
|
||||
// the frame tree
|
||||
state.mIsMarginRoot = PR_FALSE;
|
||||
if (NS_BLOCK_MARGIN_ROOT & mFlags) {
|
||||
state.mIsMarginRoot = PR_TRUE;
|
||||
}
|
||||
if (lineLayout == &ll) {
|
||||
lineLayout->Init(&state);
|
||||
|
@ -830,7 +833,7 @@ nsBaseIBFrame::ComputeFinalSize(nsBlockReflowState& aState,
|
|||
// There are two options here. We either shrink wrap around our
|
||||
// contents or we fluff out to the maximum available width. Note:
|
||||
// We always shrink wrap when given an unconstrained width.
|
||||
if ((0 == (NS_BODY_SHRINK_WRAP & mFlags)) &&
|
||||
if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) &&
|
||||
!aState.mUnconstrainedWidth &&
|
||||
!compact) {
|
||||
// Fluff out to the max width if we aren't already that wide
|
||||
|
@ -3668,7 +3671,7 @@ nsBlockReflowState::AddFloater(nsPlaceholderFrame* aPlaceholder,
|
|||
nsHTMLReflowState reflowState(mPresContext, floater, *this, kidAvailSize);
|
||||
reflowState.lineLayout = nsnull;
|
||||
if ((nsnull == reflowCommand) || (floater != mNextRCFrame)) {
|
||||
// Stub out reflowCommand and repair reasin in the reflowState
|
||||
// Stub out reflowCommand and repair reason in the reflowState
|
||||
// when incremental reflow doesn't apply to the floater.
|
||||
reflowState.reflowCommand = nsnull;
|
||||
reflowState.reason = ((reason == eReflowReason_Initial) || aInitialReflow)
|
||||
|
|
|
@ -123,7 +123,7 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
|
||||
NS_NewAreaFrame(mFirstChild, flags);
|
||||
mContentFrame = mFirstChild;
|
||||
|
||||
|
|
|
@ -506,7 +506,7 @@ nsHTMLButtonControlFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
|
||||
NS_NewAreaFrame(mFirstChild, flags);
|
||||
|
||||
// Resolve style and initialize the frame
|
||||
|
|
|
@ -355,7 +355,7 @@ nsLabelFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
|
||||
NS_NewAreaFrame(mFirstChild, flags);
|
||||
|
||||
// Resolve style and initialize the frame
|
||||
|
|
|
@ -89,7 +89,7 @@ nsLegendFrame::SetInitialChildList(nsIPresContext& aPresContext,
|
|||
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
|
||||
mInline = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay);
|
||||
|
||||
PRUint8 flags = (mInline) ? NS_BODY_SHRINK_WRAP : 0;
|
||||
PRUint8 flags = (mInline) ? NS_BLOCK_SHRINK_WRAP : 0;
|
||||
NS_NewAreaFrame(mFirstChild, flags);
|
||||
|
||||
// Resolve style and initialize the frame
|
||||
|
|
|
@ -1157,7 +1157,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext,
|
|||
case NS_STYLE_DISPLAY_TABLE_CAPTION:
|
||||
// Have we already created a caption? If so, ignore this caption
|
||||
if (nsnull == captionFrame) {
|
||||
NS_NewAreaFrame(captionFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
NS_NewAreaFrame(captionFrame, 0);
|
||||
captionFrame->Init(*aPresContext, childContent, aNewFrame,
|
||||
aNewFrame, childStyleContext);
|
||||
// Process the caption's child content and set the initial child list
|
||||
|
@ -1324,7 +1324,7 @@ HTMLStyleSheetImpl::ConstructTableCellFrame(nsIPresContext* aPresContext,
|
|||
// Create an area frame that will format the cell's content
|
||||
nsIFrame* cellBodyFrame;
|
||||
|
||||
rv = NS_NewAreaFrame(cellBodyFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
rv = NS_NewAreaFrame(cellBodyFrame, 0);
|
||||
if (NS_FAILED(rv)) {
|
||||
aNewFrame->DeleteFrame(*aPresContext);
|
||||
aNewFrame = nsnull;
|
||||
|
@ -1475,7 +1475,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext,
|
|||
|
||||
// XXX Until we clean up how painting damage is handled, we need to use the
|
||||
// flag that says that this is the body...
|
||||
NS_NewAreaFrame(areaFrame, NS_BODY_THE_BODY);
|
||||
NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT);
|
||||
nsIFrame* parentFrame = scrollFrame ? scrollFrame : aRootFrame;
|
||||
areaFrame->Init(*aPresContext, aDocElement, parentFrame, parentFrame,
|
||||
styleContext);
|
||||
|
@ -1794,7 +1794,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
|
||||
// Create an area container for the frame
|
||||
nsIFrame* scrolledFrame;
|
||||
NS_NewAreaFrame(scrolledFrame, NS_BODY_SHRINK_WRAP);
|
||||
NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP);
|
||||
|
||||
// Initialize the frame and force it to have a view
|
||||
scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrollFrame,
|
||||
|
@ -1839,7 +1839,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
isAbsolutelyPositioned = PR_TRUE;
|
||||
|
||||
// Create an area frame
|
||||
NS_NewAreaFrame(aNewFrame, NS_BODY_SHRINK_WRAP);
|
||||
NS_NewAreaFrame(aNewFrame, NS_BLOCK_SHRINK_WRAP);
|
||||
aNewFrame->Init(*aPresContext, aContent, aAbsoluteItems.containingBlock,
|
||||
aParentFrame, aStyleContext);
|
||||
|
||||
|
@ -1867,7 +1867,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
(NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay))) {
|
||||
|
||||
// Create an area frame
|
||||
NS_NewAreaFrame(aNewFrame, NS_BODY_SHRINK_WRAP);
|
||||
NS_NewAreaFrame(aNewFrame, NS_BLOCK_SHRINK_WRAP);
|
||||
|
||||
// Initialize the frame
|
||||
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame,
|
||||
|
@ -1980,7 +1980,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
|
||||
case NS_STYLE_DISPLAY_TABLE_CAPTION:
|
||||
// XXX We should check for being inside of a table row frame...
|
||||
rv = NS_NewAreaFrame(aNewFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
rv = NS_NewAreaFrame(aNewFrame, 0);
|
||||
processChildren = PR_TRUE;
|
||||
break;
|
||||
|
||||
|
|
|
@ -1157,7 +1157,7 @@ HTMLStyleSheetImpl::ConstructTableFrame(nsIPresContext* aPresContext,
|
|||
case NS_STYLE_DISPLAY_TABLE_CAPTION:
|
||||
// Have we already created a caption? If so, ignore this caption
|
||||
if (nsnull == captionFrame) {
|
||||
NS_NewAreaFrame(captionFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
NS_NewAreaFrame(captionFrame, 0);
|
||||
captionFrame->Init(*aPresContext, childContent, aNewFrame,
|
||||
aNewFrame, childStyleContext);
|
||||
// Process the caption's child content and set the initial child list
|
||||
|
@ -1324,7 +1324,7 @@ HTMLStyleSheetImpl::ConstructTableCellFrame(nsIPresContext* aPresContext,
|
|||
// Create an area frame that will format the cell's content
|
||||
nsIFrame* cellBodyFrame;
|
||||
|
||||
rv = NS_NewAreaFrame(cellBodyFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
rv = NS_NewAreaFrame(cellBodyFrame, 0);
|
||||
if (NS_FAILED(rv)) {
|
||||
aNewFrame->DeleteFrame(*aPresContext);
|
||||
aNewFrame = nsnull;
|
||||
|
@ -1475,7 +1475,7 @@ HTMLStyleSheetImpl::ConstructDocElementFrame(nsIPresContext* aPresContext,
|
|||
|
||||
// XXX Until we clean up how painting damage is handled, we need to use the
|
||||
// flag that says that this is the body...
|
||||
NS_NewAreaFrame(areaFrame, NS_BODY_THE_BODY);
|
||||
NS_NewAreaFrame(areaFrame, NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT);
|
||||
nsIFrame* parentFrame = scrollFrame ? scrollFrame : aRootFrame;
|
||||
areaFrame->Init(*aPresContext, aDocElement, parentFrame, parentFrame,
|
||||
styleContext);
|
||||
|
@ -1794,7 +1794,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
|
||||
// Create an area container for the frame
|
||||
nsIFrame* scrolledFrame;
|
||||
NS_NewAreaFrame(scrolledFrame, NS_BODY_SHRINK_WRAP);
|
||||
NS_NewAreaFrame(scrolledFrame, NS_BLOCK_SHRINK_WRAP);
|
||||
|
||||
// Initialize the frame and force it to have a view
|
||||
scrolledFrame->Init(*aPresContext, aContent, scrollFrame, scrollFrame,
|
||||
|
@ -1839,7 +1839,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
isAbsolutelyPositioned = PR_TRUE;
|
||||
|
||||
// Create an area frame
|
||||
NS_NewAreaFrame(aNewFrame, NS_BODY_SHRINK_WRAP);
|
||||
NS_NewAreaFrame(aNewFrame, NS_BLOCK_SHRINK_WRAP);
|
||||
aNewFrame->Init(*aPresContext, aContent, aAbsoluteItems.containingBlock,
|
||||
aParentFrame, aStyleContext);
|
||||
|
||||
|
@ -1867,7 +1867,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
(NS_STYLE_DISPLAY_LIST_ITEM == aDisplay->mDisplay))) {
|
||||
|
||||
// Create an area frame
|
||||
NS_NewAreaFrame(aNewFrame, NS_BODY_SHRINK_WRAP);
|
||||
NS_NewAreaFrame(aNewFrame, NS_BLOCK_SHRINK_WRAP);
|
||||
|
||||
// Initialize the frame
|
||||
aNewFrame->Init(*aPresContext, aContent, aParentFrame, aParentFrame,
|
||||
|
@ -1980,7 +1980,7 @@ HTMLStyleSheetImpl::ConstructFrameByDisplayType(nsIPresContext* aPresConte
|
|||
|
||||
case NS_STYLE_DISPLAY_TABLE_CAPTION:
|
||||
// XXX We should check for being inside of a table row frame...
|
||||
rv = NS_NewAreaFrame(aNewFrame, NS_BODY_NO_AUTO_MARGINS);
|
||||
rv = NS_NewAreaFrame(aNewFrame, 0);
|
||||
processChildren = PR_TRUE;
|
||||
break;
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче