Issue #1705 - Part 1: Rename nsChangeHint_CSSOverflowChange to *ScrollbarChange.

Prepare for scrollbar-width which should trigger the same kind of change.
This commit is contained in:
Moonchild 2021-01-06 10:35:21 +00:00 • committed by roytam1
commit e993607a88
3 changed files with 7 additions and 7 deletions

View file

@ -171,7 +171,7 @@ RestyleManagerBase::ChangeHintToString(nsChangeHint aHint)
"NeutralChange", "InvalidateRenderingObservers", "NeutralChange", "InvalidateRenderingObservers",
"ReflowChangesSizeOrPosition", "UpdateComputedBSize", "ReflowChangesSizeOrPosition", "UpdateComputedBSize",
"UpdateUsesOpacity", "UpdateBackgroundPosition", "UpdateUsesOpacity", "UpdateBackgroundPosition",
"AddOrRemoveTransform", "CSSOverflowChange", "AddOrRemoveTransform", "ScrollbarChange",
}; };
static_assert(nsChangeHint_AllHints == (1 << ArrayLength(names)) - 1, static_assert(nsChangeHint_AllHints == (1 << ArrayLength(names)) - 1,
"Name list doesn't match change hints."); "Name list doesn't match change hints.");
@ -1111,11 +1111,11 @@ if (!mDestroyedFrames) {
nsPresContext* presContext = PresContext(); nsPresContext* presContext = PresContext();
nsCSSFrameConstructor* frameConstructor = presContext->FrameConstructor(); nsCSSFrameConstructor* frameConstructor = presContext->FrameConstructor();
// Handle nsChangeHint_CSSOverflowChange, by either updating the // Handle nsChangeHint_ScrollbarChange, by either updating the
// scrollbars on the viewport, or upgrading the change hint to frame-reconstruct. // scrollbars on the viewport, or upgrading the change hint to frame-reconstruct.
for (nsStyleChangeData& data : aChangeList) { for (nsStyleChangeData& data : aChangeList) {
if (data.mHint & nsChangeHint_CSSOverflowChange) { if (data.mHint & nsChangeHint_ScrollbarChange) {
data.mHint &= ~nsChangeHint_CSSOverflowChange; data.mHint &= ~nsChangeHint_ScrollbarChange;
bool doReconstruct = true; // assume the worst bool doReconstruct = true; // assume the worst
// Only bother with this if we're html/body, since: // Only bother with this if we're html/body, since:

View file

@ -225,7 +225,7 @@ enum nsChangeHint {
* scrollframe, this is instead equivalent to nsChangeHint_AllReflowHints * scrollframe, this is instead equivalent to nsChangeHint_AllReflowHints
* (because the viewport always has an associated scrollframe). * (because the viewport always has an associated scrollframe).
*/ */
nsChangeHint_CSSOverflowChange = 1 << 28, nsChangeHint_ScrollbarChange = 1 << 28,
// IMPORTANT NOTE: When adding new hints, consider whether you need // IMPORTANT NOTE: When adding new hints, consider whether you need
// to add them to NS_HintsNotHandledForDescendantsIn() below. Please // to add them to NS_HintsNotHandledForDescendantsIn() below. Please
@ -316,7 +316,7 @@ inline nsChangeHint operator^=(nsChangeHint& aLeft, nsChangeHint aRight)
nsChangeHint_UpdatePostTransformOverflow | \ nsChangeHint_UpdatePostTransformOverflow | \
nsChangeHint_UpdateParentOverflow | \ nsChangeHint_UpdateParentOverflow | \
nsChangeHint_ChildrenOnlyTransform | \ nsChangeHint_ChildrenOnlyTransform | \
nsChangeHint_CSSOverflowChange | \ nsChangeHint_ScrollbarChange | \
nsChangeHint_RecomputePosition | \ nsChangeHint_RecomputePosition | \
nsChangeHint_UpdateContainingBlock | \ nsChangeHint_UpdateContainingBlock | \
nsChangeHint_AddOrRemoveTransform | \ nsChangeHint_AddOrRemoveTransform | \

View file

@ -3264,7 +3264,7 @@ nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const
if (mOverflowX != aNewData.mOverflowX if (mOverflowX != aNewData.mOverflowX
|| mOverflowY != aNewData.mOverflowY) { || mOverflowY != aNewData.mOverflowY) {
hint |= nsChangeHint_CSSOverflowChange; hint |= nsChangeHint_ScrollbarChange;
} }
/* Note: When mScrollBehavior, mScrollSnapTypeX, mScrollSnapTypeY, /* Note: When mScrollBehavior, mScrollSnapTypeX, mScrollSnapTypeY,