From d14972602fc4259af20e79f7aca29833cfece851 Mon Sep 17 00:00:00 2001 From: Francis Dominic Fajardo Date: Thu, 26 Jun 2025 22:23:46 +0800 Subject: [PATCH] Issue #2764 - Fix several properties to return NeutralChange hint This excludes the removal of the mBorderImageOutset change condition from triggering a repaint which doesn't make sense. --- layout/style/nsStyleStruct.cpp | 13 +++++++++++++ layout/style/nsStyleStruct.h | 3 ++- 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index 523e3426d7..77eb659377 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -547,6 +547,15 @@ nsStyleBorder::CalcDifference(const nsStyleBorder& aNewData) const return nsChangeHint_NeutralChange; } + // mBorderImage* fields are checked only when border-image is not 'none'. + if (mBorderImageSource != aNewData.mBorderImageSource || + mBorderImageRepeatH != aNewData.mBorderImageRepeatH || + mBorderImageRepeatV != aNewData.mBorderImageRepeatV || + mBorderImageSlice != aNewData.mBorderImageSlice || + mBorderImageWidth != aNewData.mBorderImageWidth) { + return nsChangeHint_NeutralChange; + } + return nsChangeHint(0); } @@ -4054,6 +4063,10 @@ nsStyleUIReset::CalcDifference(const nsStyleUIReset& aNewData) const hint |= nsChangeHint_ScrollbarChange; } + if (!hint && mIMEMode != aNewData.mIMEMode) { + hint |= nsChangeHint_NeutralChange; + } + return hint; } diff --git a/layout/style/nsStyleStruct.h b/layout/style/nsStyleStruct.h index 6bdff04185..edecefdf08 100644 --- a/layout/style/nsStyleStruct.h +++ b/layout/style/nsStyleStruct.h @@ -3252,7 +3252,8 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleUIReset nsChangeHint CalcDifference(const nsStyleUIReset& aNewData) const; static nsChangeHint MaxDifference() { return nsChangeHint_ReconstructFrame | - NS_STYLE_HINT_REFLOW; + NS_STYLE_HINT_REFLOW | + nsChangeHint_NeutralChange; } static nsChangeHint DifferenceAlwaysHandledForDescendants() { // CalcDifference never returns the reflow hints that are sometimes