Bug 1287728 - part1: explicitly define default value for RestyleResult.
After explicitly define default value for RestyleResult, we have a value
starting from 0 now. So, we can drop the explicity numbering.
MozReview-Commit-ID: 1UlpkUT6mAL
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -3259,17 +3259,17 @@ ElementRestyler::Restyle(nsRestyleHint a
// TEMPORARY (until bug 918064): Call RestyleSelf for each
// continuation or block-in-inline sibling.
// We must make a single decision on how to process this frame and
// its descendants, yet RestyleSelf might return different RestyleResult
// values for the different same-style continuations. |result| is our
// overall decision.
- RestyleResult result = RestyleResult(0);
+ RestyleResult result = eRestyleResult_None;
uint32_t swappedStructs = 0;
nsRestyleHint thisRestyleHint = aRestyleHint;
bool haveMoreContinuations = false;
for (nsIFrame* f = mFrame; f; ) {
RestyleResult thisResult =
RestyleSelf(f, thisRestyleHint, &swappedStructs, swaps);
@@ -5189,15 +5189,16 @@ ElementRestyler::RestyleResultToString(R
break;
case eRestyleResult_Continue:
result.AssignLiteral("eRestyleResult_Continue");
break;
case eRestyleResult_ContinueAndForceDescendants:
result.AssignLiteral("eRestyleResult_ContinueAndForceDescendants");
break;
default:
- result.AppendPrintf("RestyleResult(%d)", aRestyleResult);
+ MOZ_ASSERT(aRestyleResult == eRestyleResult_None,
+ "Unexpected RestyleResult");
}
return result;
}
#endif
} // namespace mozilla
--- a/layout/base/RestyleManager.h
+++ b/layout/base/RestyleManager.h
@@ -666,19 +666,21 @@ private:
inline nsStyleSet* StyleSet() const;
// Enum for the result of RestyleSelf, which indicates whether the
// restyle procedure should continue to the children, and how.
//
// These values must be ordered so that later values imply that all
// the work of the earlier values is also done.
enum RestyleResult {
+ // default initial value
+ eRestyleResult_None,
// we left the old style context on the frame; do not restyle children
- eRestyleResult_Stop = 1,
+ eRestyleResult_Stop,
// we got a new style context on this frame, but we know that children
// do not depend on the changed values; do not restyle children
eRestyleResult_StopWithStyleChange,
// continue restyling children
eRestyleResult_Continue,