From b4a6f7263647ac43efc76e7e7b20bcded4422e08 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Thu, 13 Feb 2003 19:06:18 +0000 Subject: [PATCH] Dynamic changes to border-collapse should produce the right hint. Bug 191794, r=bernd, sr=dbaron, a=asa git-svn-id: svn://10.0.0.236/trunk@137776 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/shared/src/nsStyleStruct.cpp | 11 +++++++++-- mozilla/layout/style/nsStyleStruct.cpp | 11 +++++++++-- 2 files changed, 18 insertions(+), 4 deletions(-) diff --git a/mozilla/content/shared/src/nsStyleStruct.cpp b/mozilla/content/shared/src/nsStyleStruct.cpp index 90474e8d897..49e83428e16 100644 --- a/mozilla/content/shared/src/nsStyleStruct.cpp +++ b/mozilla/content/shared/src/nsStyleStruct.cpp @@ -931,8 +931,15 @@ nsStyleTableBorder::nsStyleTableBorder(const nsStyleTableBorder& aSource) nsChangeHint nsStyleTableBorder::CalcDifference(const nsStyleTableBorder& aOther) const { - if ((mBorderCollapse == aOther.mBorderCollapse) && - (mCaptionSide == aOther.mCaptionSide) && + // Border-collapse changes need a reframe, because we use a different frame + // class for table cells in the collapsed border model. This is used to + // conserve memory when using the separated border model (collapsed borders + // require extra state to be stored). + if (mBorderCollapse != aOther.mBorderCollapse) { + return NS_STYLE_HINT_FRAMECHANGE; + } + + if ((mCaptionSide == aOther.mCaptionSide) && (mBorderSpacingX == aOther.mBorderSpacingX) && (mBorderSpacingY == aOther.mBorderSpacingY)) { if (mEmptyCells == aOther.mEmptyCells) diff --git a/mozilla/layout/style/nsStyleStruct.cpp b/mozilla/layout/style/nsStyleStruct.cpp index 90474e8d897..49e83428e16 100644 --- a/mozilla/layout/style/nsStyleStruct.cpp +++ b/mozilla/layout/style/nsStyleStruct.cpp @@ -931,8 +931,15 @@ nsStyleTableBorder::nsStyleTableBorder(const nsStyleTableBorder& aSource) nsChangeHint nsStyleTableBorder::CalcDifference(const nsStyleTableBorder& aOther) const { - if ((mBorderCollapse == aOther.mBorderCollapse) && - (mCaptionSide == aOther.mCaptionSide) && + // Border-collapse changes need a reframe, because we use a different frame + // class for table cells in the collapsed border model. This is used to + // conserve memory when using the separated border model (collapsed borders + // require extra state to be stored). + if (mBorderCollapse != aOther.mBorderCollapse) { + return NS_STYLE_HINT_FRAMECHANGE; + } + + if ((mCaptionSide == aOther.mCaptionSide) && (mBorderSpacingX == aOther.mBorderSpacingX) && (mBorderSpacingY == aOther.mBorderSpacingY)) { if (mEmptyCells == aOther.mEmptyCells)