Bug 1169440 patch 2 - Rename style struct MaxDifferenceNeverInherited to DifferenceAlwaysHandledForDescendants. r=heycam

This was added in bug 897763, but the current name no longer makes sense
in the context of the renaming in 2d8810ba0412 (bug 779968, patch 4).

(I think the old name was also missing a negation -- it meant hints that
were never *non*-inherited.)
This commit is contained in:
L. David Baron 2015-06-20 21:54:15 -07:00
parent 6f0d2d8830
commit da43a0d66f
2 changed files with 65 additions and 49 deletions

View File

@ -846,15 +846,15 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther,
if (this##struct_) { \
const nsStyle##struct_* other##struct_ = aOther->Style##struct_(); \
nsChangeHint maxDifference = nsStyle##struct_::MaxDifference(); \
nsChangeHint maxDifferenceNeverInherited = \
nsStyle##struct_::MaxDifferenceNeverInherited(); \
nsChangeHint differenceAlwaysHandledForDescendants = \
nsStyle##struct_::DifferenceAlwaysHandledForDescendants(); \
if (this##struct_ == other##struct_) { \
/* The very same struct, so we know that there will be no */ \
/* differences. */ \
*aEqualStructs |= NS_STYLE_INHERIT_BIT(struct_); \
} else if (compare || \
(NS_SubtractHint(maxDifference, \
maxDifferenceNeverInherited) & \
differenceAlwaysHandledForDescendants) & \
aParentHintsNotHandledForDescendants)) { \
nsChangeHint difference = \
this##struct_->CalcDifference(*other##struct_); \
@ -1266,7 +1266,7 @@ nsStyleContext::CombineVisitedColors(nscolor *aColors, bool aLinkIsVisited)
nsStyleContext::AssertStyleStructMaxDifferenceValid()
{
#define STYLE_STRUCT(name, checkdata_cb) \
MOZ_ASSERT(NS_IsHintSubset(nsStyle##name::MaxDifferenceNeverInherited(), \
MOZ_ASSERT(NS_IsHintSubset(nsStyle##name::DifferenceAlwaysHandledForDescendants(), \
nsStyle##name::MaxDifference()));
#include "nsStyleStructList.h"
#undef STYLE_STRUCT

View File

@ -91,9 +91,10 @@ public:
return NS_CombineHint(NS_STYLE_HINT_REFLOW,
nsChangeHint_NeutralChange);
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -338,7 +339,7 @@ struct nsStyleColor {
static nsChangeHint MaxDifference() {
return NS_STYLE_HINT_VISUAL;
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics at all.
return nsChangeHint(0);
@ -376,7 +377,7 @@ struct nsStyleBackground {
NS_CombineHint(NS_STYLE_HINT_VISUAL,
nsChangeHint_NeutralChange));
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics at all.
return nsChangeHint(0);
@ -611,9 +612,9 @@ struct nsStyleMargin {
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference can return both nsChangeHint_ClearAncestorIntrinsics and
// nsChangeHint_NeedReflow as inherited hints.
// nsChangeHint_NeedReflow as hints not handled for descendants.
return nsChangeHint(0);
}
@ -654,9 +655,9 @@ struct nsStylePadding {
return NS_SubtractHint(NS_STYLE_HINT_REFLOW,
nsChangeHint_ClearDescendantIntrinsics);
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference can return nsChangeHint_ClearAncestorIntrinsics as an
// inherited hint.
// hint not handled for descendants.
return nsChangeHint(0);
}
@ -844,9 +845,10 @@ struct nsStyleBorder {
NS_CombineHint(nsChangeHint_BorderStyleNoneChange,
nsChangeHint_NeutralChange));
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -1079,7 +1081,7 @@ struct nsStyleOutline {
NS_CombineHint(nsChangeHint_RepaintFrame,
nsChangeHint_NeutralChange));
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics at all.
return nsChangeHint(0);
@ -1172,9 +1174,10 @@ struct nsStyleList {
return NS_CombineHint(NS_STYLE_HINT_FRAMECHANGE,
nsChangeHint_NeutralChange);
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -1347,9 +1350,9 @@ struct nsStylePosition {
nsChangeHint(nsChangeHint_RecomputePosition |
nsChangeHint_UpdateParentOverflow));
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference can return both nsChangeHint_ClearAncestorIntrinsics and
// nsChangeHint_NeedReflow as inherited hints.
// nsChangeHint_NeedReflow as hints not handled for descendants.
return nsChangeHint(0);
}
@ -1586,9 +1589,10 @@ struct nsStyleTextReset {
NS_STYLE_HINT_REFLOW |
nsChangeHint_UpdateSubtreeOverflow);
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -1623,9 +1627,10 @@ struct nsStyleText {
static nsChangeHint MaxDifference() {
return NS_STYLE_HINT_FRAMECHANGE;
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -1814,9 +1819,10 @@ struct nsStyleVisibility {
static nsChangeHint MaxDifference() {
return NS_STYLE_HINT_FRAMECHANGE;
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -2049,9 +2055,9 @@ struct nsStyleDisplay {
nsChangeHint_AddOrRemoveTransform |
nsChangeHint_NeutralChange);
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference can return both nsChangeHint_ClearAncestorIntrinsics and
// nsChangeHint_NeedReflow as inherited hints.
// nsChangeHint_NeedReflow as hints not handled for descendants.
return nsChangeHint(0);
}
@ -2302,9 +2308,10 @@ struct nsStyleTable {
static nsChangeHint MaxDifference() {
return NS_STYLE_HINT_FRAMECHANGE;
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -2332,9 +2339,10 @@ struct nsStyleTableBorder {
static nsChangeHint MaxDifference() {
return NS_STYLE_HINT_FRAMECHANGE;
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -2430,9 +2438,10 @@ struct nsStyleQuotes {
static nsChangeHint MaxDifference() {
return NS_STYLE_HINT_FRAMECHANGE;
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -2504,9 +2513,10 @@ struct nsStyleContent {
static nsChangeHint MaxDifference() {
return NS_STYLE_HINT_FRAMECHANGE;
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -2616,9 +2626,10 @@ struct nsStyleUIReset {
static nsChangeHint MaxDifference() {
return NS_STYLE_HINT_FRAMECHANGE;
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -2679,9 +2690,10 @@ struct nsStyleUserInterface {
NS_CombineHint(nsChangeHint_UpdateCursor,
nsChangeHint_NeutralChange));
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -2723,9 +2735,10 @@ struct nsStyleXUL {
static nsChangeHint MaxDifference() {
return NS_STYLE_HINT_FRAMECHANGE;
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -2759,9 +2772,10 @@ struct nsStyleColumn {
return NS_CombineHint(NS_STYLE_HINT_FRAMECHANGE,
nsChangeHint_NeutralChange);
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -2852,9 +2866,10 @@ struct nsStyleSVG {
NS_CombineHint(nsChangeHint_NeedReflow, nsChangeHint_NeedDirtyReflow)), // XXX remove nsChangeHint_NeedDirtyReflow: bug 876085
nsChangeHint_RepaintFrame);
}
static nsChangeHint MaxDifferenceNeverInherited() {
// CalcDifference never returns nsChangeHint_NeedReflow as an inherited hint
// and never returns nsChangeHint_ClearAncestorIntrinsics at all.
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow as a hint
// not handled for descendants, and never returns
// nsChangeHint_ClearAncestorIntrinsics at all.
return nsChangeHint_NeedReflow;
}
@ -3132,9 +3147,10 @@ struct nsStyleSVGReset {
return NS_CombineHint(nsChangeHint_UpdateEffects,
NS_CombineHint(nsChangeHint_UpdateOverflow, NS_STYLE_HINT_REFLOW));
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics as inherited hints.
// nsChangeHint_ClearAncestorIntrinsics as hints not handled for
// descendants.
return NS_CombineHint(nsChangeHint_NeedReflow,
nsChangeHint_ClearAncestorIntrinsics);
}
@ -3181,7 +3197,7 @@ struct nsStyleVariables {
static nsChangeHint MaxDifference() {
return nsChangeHint(0);
}
static nsChangeHint MaxDifferenceNeverInherited() {
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns nsChangeHint_NeedReflow or
// nsChangeHint_ClearAncestorIntrinsics at all.
return nsChangeHint(0);