From cc7a3bb0f1ed2c2013278b7f055415cd8e189307 Mon Sep 17 00:00:00 2001 From: "bzbarsky%mit.edu" Date: Sat, 22 May 2004 05:50:12 +0000 Subject: [PATCH] Use a reflow (without forced repaint) hint for position struct changes. Bug 243882, r+sr=roc git-svn-id: svn://10.0.0.236/trunk@156752 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/shared/src/nsStyleStruct.cpp | 10 +++++++--- mozilla/layout/style/nsStyleStruct.cpp | 10 +++++++--- 2 files changed, 14 insertions(+), 6 deletions(-) diff --git a/mozilla/content/shared/src/nsStyleStruct.cpp b/mozilla/content/shared/src/nsStyleStruct.cpp index ffce9f2c096..7761a7b414e 100644 --- a/mozilla/content/shared/src/nsStyleStruct.cpp +++ b/mozilla/content/shared/src/nsStyleStruct.cpp @@ -860,6 +860,10 @@ nsStylePosition::nsStylePosition(const nsStylePosition& aSource) nsChangeHint nsStylePosition::CalcDifference(const nsStylePosition& aOther) const { + if (mZIndex != aOther.mZIndex) { + return NS_STYLE_HINT_REFLOW; + } + if ((mOffset == aOther.mOffset) && (mWidth == aOther.mWidth) && (mMinWidth == aOther.mMinWidth) && @@ -867,10 +871,10 @@ nsChangeHint nsStylePosition::CalcDifference(const nsStylePosition& aOther) cons (mHeight == aOther.mHeight) && (mMinHeight == aOther.mMinHeight) && (mMaxHeight == aOther.mMaxHeight) && - (mBoxSizing == aOther.mBoxSizing) && - (mZIndex == aOther.mZIndex)) + (mBoxSizing == aOther.mBoxSizing)) return NS_STYLE_HINT_NONE; - return NS_STYLE_HINT_REFLOW; + + return nsChangeHint_ReflowFrame; } // -------------------- diff --git a/mozilla/layout/style/nsStyleStruct.cpp b/mozilla/layout/style/nsStyleStruct.cpp index ffce9f2c096..7761a7b414e 100644 --- a/mozilla/layout/style/nsStyleStruct.cpp +++ b/mozilla/layout/style/nsStyleStruct.cpp @@ -860,6 +860,10 @@ nsStylePosition::nsStylePosition(const nsStylePosition& aSource) nsChangeHint nsStylePosition::CalcDifference(const nsStylePosition& aOther) const { + if (mZIndex != aOther.mZIndex) { + return NS_STYLE_HINT_REFLOW; + } + if ((mOffset == aOther.mOffset) && (mWidth == aOther.mWidth) && (mMinWidth == aOther.mMinWidth) && @@ -867,10 +871,10 @@ nsChangeHint nsStylePosition::CalcDifference(const nsStylePosition& aOther) cons (mHeight == aOther.mHeight) && (mMinHeight == aOther.mMinHeight) && (mMaxHeight == aOther.mMaxHeight) && - (mBoxSizing == aOther.mBoxSizing) && - (mZIndex == aOther.mZIndex)) + (mBoxSizing == aOther.mBoxSizing)) return NS_STYLE_HINT_NONE; - return NS_STYLE_HINT_REFLOW; + + return nsChangeHint_ReflowFrame; } // --------------------