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.
This commit is contained in:
Francis Dominic Fajardo 2025-06-26 22:23:46 +08:00 committed by roytam1
commit d14972602f
2 changed files with 15 additions and 1 deletions

View file

@ -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;
}

View file

@ -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