issue style change reflow also at the table caption when there is a style change reflow

that is targeted at the inner table frame. This is currently necessary due to bizarre
style contetxt relationsship between inner and outer table frame, bug 222846 r/sr=bzbarsky
This commit is contained in:
bmlk%gmx.de 2003-11-09 11:35:52 +00:00
Родитель 79578e623e
Коммит 6f183845ad
4 изменённых файлов: 46 добавлений и 12 удалений

Просмотреть файл

@ -552,7 +552,7 @@ GetContainingBlockSize(const nsHTMLReflowState& aOuterRS)
void
nsTableOuterFrame::InvalidateDamage(nsIPresContext* aPresContext,
PRUint8 aCaptionSide,
nsSize& aOuterSize,
const nsSize& aOuterSize,
PRBool aInnerChanged,
PRBool aCaptionChanged,
nsRect* aOldOverflowArea)
@ -1258,7 +1258,8 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext,
nsMargin& aMarginNoAuto,
nsMargin& aPadding,
nsReflowReason aReflowReason,
nsReflowStatus& aStatus)
nsReflowStatus& aStatus,
PRBool* aNeedToReflowCaption)
{
if (!aPresContext) ABORT1(NS_ERROR_NULL_POINTER);
aMargin = aPadding = nsMargin(0,0,0,0);
@ -1318,6 +1319,16 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext,
aAvailWidth = aOuterRS.availableWidth;
}
}
// see if we need to reflow the caption in addition
if (aNeedToReflowCaption && !*aNeedToReflowCaption &&
mInnerTableFrame == aChildFrame) {
nsHTMLReflowCommand* command = childRS.path->mReflowCommand;
if (command) {
nsReflowType type;
command->GetType(type);
*aNeedToReflowCaption = eReflowType_StyleChanged == type;
}
}
// use the current position as a best guess for placement
nsPoint childPt = aChildFrame->GetPosition();
@ -1676,9 +1687,14 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
&capMin, innerMargin, innerPadding);
nsresult rv = OuterReflowChild(aPresContext, mInnerTableFrame, aOuterRS, innerMet,
availWidth, innerSize, innerMargin, innerMarginNoAuto, innerPadding,
reflowReason, aStatus);
reflowReason, aStatus, &reflowCaption);
if (NS_FAILED(rv)) return rv;
if (eReflowReason_StyleChange != reflowReason && reflowCaption) {
// inner table frame was target for a style change reflow issue a style
// change reflow for the caption too.
reflowReason = eReflowReason_StyleChange;
}
nsPoint innerOrigin(0,0);
nsMargin captionMargin(0,0,0,0);
nsMargin captionMarginNoAuto(0,0,0,0);

Просмотреть файл

@ -377,7 +377,8 @@ protected:
nsMargin& aMarginNoAuto,
nsMargin& aPadding,
nsReflowReason aReflowReason,
nsReflowStatus& aStatus);
nsReflowStatus& aStatus,
PRBool* aNeedToReflowCaption = nsnull);
// Set the reflow metrics, aInnerMarginNoAuto is aInnerMargin, but with
// auto margins set to 0
@ -394,7 +395,7 @@ protected:
void InvalidateDamage(nsIPresContext* aPresContext,
PRUint8 aCaptionSide,
nsSize& aOuterSize,
const nsSize& aOuterSize,
PRBool aInnerChanged,
PRBool aCaptionChanged,
nsRect* aOldOverflowArea);

Просмотреть файл

@ -552,7 +552,7 @@ GetContainingBlockSize(const nsHTMLReflowState& aOuterRS)
void
nsTableOuterFrame::InvalidateDamage(nsIPresContext* aPresContext,
PRUint8 aCaptionSide,
nsSize& aOuterSize,
const nsSize& aOuterSize,
PRBool aInnerChanged,
PRBool aCaptionChanged,
nsRect* aOldOverflowArea)
@ -1258,7 +1258,8 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext,
nsMargin& aMarginNoAuto,
nsMargin& aPadding,
nsReflowReason aReflowReason,
nsReflowStatus& aStatus)
nsReflowStatus& aStatus,
PRBool* aNeedToReflowCaption)
{
if (!aPresContext) ABORT1(NS_ERROR_NULL_POINTER);
aMargin = aPadding = nsMargin(0,0,0,0);
@ -1318,6 +1319,16 @@ nsTableOuterFrame::OuterReflowChild(nsIPresContext* aPresContext,
aAvailWidth = aOuterRS.availableWidth;
}
}
// see if we need to reflow the caption in addition
if (aNeedToReflowCaption && !*aNeedToReflowCaption &&
mInnerTableFrame == aChildFrame) {
nsHTMLReflowCommand* command = childRS.path->mReflowCommand;
if (command) {
nsReflowType type;
command->GetType(type);
*aNeedToReflowCaption = eReflowType_StyleChanged == type;
}
}
// use the current position as a best guess for placement
nsPoint childPt = aChildFrame->GetPosition();
@ -1676,9 +1687,14 @@ nsTableOuterFrame::IR_InnerTableReflow(nsIPresContext* aPresContext,
&capMin, innerMargin, innerPadding);
nsresult rv = OuterReflowChild(aPresContext, mInnerTableFrame, aOuterRS, innerMet,
availWidth, innerSize, innerMargin, innerMarginNoAuto, innerPadding,
reflowReason, aStatus);
reflowReason, aStatus, &reflowCaption);
if (NS_FAILED(rv)) return rv;
if (eReflowReason_StyleChange != reflowReason && reflowCaption) {
// inner table frame was target for a style change reflow issue a style
// change reflow for the caption too.
reflowReason = eReflowReason_StyleChange;
}
nsPoint innerOrigin(0,0);
nsMargin captionMargin(0,0,0,0);
nsMargin captionMarginNoAuto(0,0,0,0);

Просмотреть файл

@ -377,7 +377,8 @@ protected:
nsMargin& aMarginNoAuto,
nsMargin& aPadding,
nsReflowReason aReflowReason,
nsReflowStatus& aStatus);
nsReflowStatus& aStatus,
PRBool* aNeedToReflowCaption = nsnull);
// Set the reflow metrics, aInnerMarginNoAuto is aInnerMargin, but with
// auto margins set to 0
@ -394,7 +395,7 @@ protected:
void InvalidateDamage(nsIPresContext* aPresContext,
PRUint8 aCaptionSide,
nsSize& aOuterSize,
const nsSize& aOuterSize,
PRBool aInnerChanged,
PRBool aCaptionChanged,
nsRect* aOldOverflowArea);