Bug 1274891 - Part 2: Replace nsChangeHint(0) with nsChangeHint::None. draft
authorBoris Chiou <boris.chiou@gmail.com>
Thu, 22 Dec 2016 13:29:23 +0800
changeset 453450 50d4f6df938aefa3230908918e44b36c478afff6
parent 453449 81fd4150d67311b92ea5b7ee1d8507ae352eb60d
child 453451 706a01301f5d5911403a75832c4d4c40078d5d83
push id39679
push userbmo:boris.chiou@gmail.com
push dateFri, 23 Dec 2016 15:19:32 +0000
bugs1274891
milestone53.0a1
Bug 1274891 - Part 2: Replace nsChangeHint(0) with nsChangeHint::None. Also, replace nsChangeHint::Empty with nsChangeHint::None. MozReview-Commit-ID: Fs7dJMFFZ2q
dom/animation/EffectCompositor.cpp
dom/animation/KeyframeEffectReadOnly.cpp
dom/base/Element.cpp
dom/base/nsDOMWindowUtils.cpp
dom/base/nsFrameLoader.cpp
dom/base/nsGenericDOMDataNode.cpp
dom/mathml/nsMathMLElement.cpp
dom/smil/nsSMILAnimationController.cpp
dom/xul/nsXULElement.cpp
layout/base/PresShell.cpp
layout/base/RestyleManager.cpp
layout/base/RestyleManagerBase.cpp
layout/base/RestyleTracker.cpp
layout/base/RestyleTracker.h
layout/base/ServoRestyleManager.cpp
layout/base/nsChangeHint.h
layout/base/nsPresContext.cpp
layout/base/nsPresContext.h
layout/style/nsHTMLStyleSheet.cpp
layout/style/nsStyleContext.cpp
layout/style/nsStyleStruct.cpp
layout/style/nsStyleStruct.h
--- a/dom/animation/EffectCompositor.cpp
+++ b/dom/animation/EffectCompositor.cpp
@@ -515,17 +515,18 @@ EffectCompositor::AddStyleUpdatesTo(Rest
                            mPresContext->RefreshDriver()->MostRecentRefresh());
 
       dom::Element* elementToRestyle =
         GetElementToRestyle(pseudoElem.mElement, pseudoElem.mPseudoType);
       if (elementToRestyle) {
         nsRestyleHint rshint = cascadeLevel == CascadeLevel::Transitions ?
                                eRestyle_CSSTransitions :
                                eRestyle_CSSAnimations;
-        aTracker.AddPendingRestyle(elementToRestyle, rshint, nsChangeHint(0));
+        aTracker.AddPendingRestyle(elementToRestyle, rshint,
+                                   nsChangeHint::None);
       }
     }
 
     elementSet.Clear();
     // Note: mElement pointers in elementsToRestyle might now dangle
   }
 }
 
--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -76,17 +76,17 @@ KeyframeEffectReadOnly::KeyframeEffectRe
   nsIDocument* aDocument,
   const Maybe<OwningAnimationTarget>& aTarget,
   AnimationEffectTimingReadOnly* aTiming,
   const KeyframeEffectParams& aOptions)
   : AnimationEffectReadOnly(aDocument, aTiming)
   , mTarget(aTarget)
   , mEffectOptions(aOptions)
   , mInEffectOnLastAnimationTimingUpdate(false)
-  , mCumulativeChangeHint(nsChangeHint(0))
+  , mCumulativeChangeHint(nsChangeHint::None)
 {
 }
 
 JSObject*
 KeyframeEffectReadOnly::WrapObject(JSContext* aCx,
                                    JS::Handle<JSObject*> aGivenProto)
 {
   return KeyframeEffectReadOnlyBinding::Wrap(aCx, this, aGivenProto);
@@ -1415,17 +1415,17 @@ CreateStyleContextForAnimationValue(nsCS
 
   return styleContext.forget();
 }
 
 void
 KeyframeEffectReadOnly::CalculateCumulativeChangeHint(
   nsStyleContext *aStyleContext)
 {
-  mCumulativeChangeHint = nsChangeHint(0);
+  mCumulativeChangeHint = nsChangeHint::None;
 
   for (const AnimationProperty& property : mProperties) {
     for (const AnimationPropertySegment& segment : property.mSegments) {
       // In case composite operation is not 'replace', we can't throttle
       // animations which will not cause any layout changes on invisible
       // elements because we can't calculate the change hint for such properties
       // until we compose it.
       if (segment.mFromComposite != CompositeOperation::Replace ||
@@ -1440,17 +1440,17 @@ KeyframeEffectReadOnly::CalculateCumulat
       RefPtr<nsStyleContext> toContext =
         CreateStyleContextForAnimationValue(property.mProperty,
                                             segment.mToValue, aStyleContext);
 
       uint32_t equalStructs = 0;
       uint32_t samePointerStructs = 0;
       nsChangeHint changeHint =
         fromContext->CalcStyleDifference(toContext,
-                                         nsChangeHint(0),
+                                         nsChangeHint::None,
                                          &equalStructs,
                                          &samePointerStructs);
 
       mCumulativeChangeHint |= changeHint;
     }
   }
 }
 
--- a/dom/base/Element.cpp
+++ b/dom/base/Element.cpp
@@ -2024,17 +2024,17 @@ Element::IsAttributeMapped(const nsIAtom
 {
   return false;
 }
 
 nsChangeHint
 Element::GetAttributeChangeHint(const nsIAtom* aAttribute,
                                 int32_t aModType) const
 {
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 bool
 Element::FindAttributeDependence(const nsIAtom* aAttribute,
                                  const MappedAttributeEntry* const aMaps[],
                                  uint32_t aMapCount)
 {
   for (uint32_t mapindex = 0; mapindex < aMapCount; ++mapindex) {
--- a/dom/base/nsDOMWindowUtils.cpp
+++ b/dom/base/nsDOMWindowUtils.cpp
@@ -3803,17 +3803,17 @@ nsDOMWindowUtils::GetCompositorAPZTestDa
 NS_IMETHODIMP
 nsDOMWindowUtils::PostRestyleSelfEvent(nsIDOMElement* aElement)
 {
   nsCOMPtr<Element> element = do_QueryInterface(aElement);
   if (!element) {
     return NS_ERROR_INVALID_ARG;
   }
 
-  nsLayoutUtils::PostRestyleEvent(element, eRestyle_Self, nsChangeHint(0));
+  nsLayoutUtils::PostRestyleEvent(element, eRestyle_Self, nsChangeHint::None);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsDOMWindowUtils::GetMediaSuspend(uint32_t* aSuspend)
 {
   nsCOMPtr<nsPIDOMWindowOuter> window = do_QueryReferent(mWindow);
   NS_ENSURE_STATE(window);
--- a/dom/base/nsFrameLoader.cpp
+++ b/dom/base/nsFrameLoader.cpp
@@ -1179,17 +1179,17 @@ nsFrameLoader::MarginsChanged(uint32_t a
   mDocShell->SetMarginWidth(aMarginWidth);
   mDocShell->SetMarginHeight(aMarginHeight);
 
   // Trigger a restyle if there's a prescontext
   // FIXME: This could do something much less expensive.
   RefPtr<nsPresContext> presContext;
   mDocShell->GetPresContext(getter_AddRefs(presContext));
   if (presContext)
-    presContext->RebuildAllStyleData(nsChangeHint(0), eRestyle_Subtree);
+    presContext->RebuildAllStyleData(nsChangeHint::None, eRestyle_Subtree);
 }
 
 bool
 nsFrameLoader::ShowRemoteFrame(const ScreenIntSize& size,
                                nsSubDocumentFrame *aFrame)
 {
   PROFILER_LABEL_FUNC(js::ProfileEntry::Category::GRAPHICS);
   NS_ASSERTION(IsRemoteFrame(), "ShowRemote only makes sense on remote frames.");
--- a/dom/base/nsGenericDOMDataNode.cpp
+++ b/dom/base/nsGenericDOMDataNode.cpp
@@ -1101,17 +1101,17 @@ nsGenericDOMDataNode::IsAttributeMapped(
   return false;
 }
 
 nsChangeHint
 nsGenericDOMDataNode::GetAttributeChangeHint(const nsIAtom* aAttribute,
                                              int32_t aModType) const
 {
   NS_NOTREACHED("Shouldn't be calling this!");
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 size_t
 nsGenericDOMDataNode::SizeOfExcludingThis(MallocSizeOf aMallocSizeOf) const
 {
   size_t n = nsIContent::SizeOfExcludingThis(aMallocSizeOf);
   n += mText.SizeOfExcludingThis(aMallocSizeOf);
   return n;
--- a/dom/mathml/nsMathMLElement.cpp
+++ b/dom/mathml/nsMathMLElement.cpp
@@ -116,17 +116,17 @@ nsMathMLElement::BindToTree(nsIDocument*
       doc->EnsureOnDemandBuiltInUASheet(cache->MathMLSheet());
 
       // Rebuild style data for the presshell, because style system
       // optimizations may have taken place assuming MathML was disabled.
       // (See nsRuleNode::CheckSpecifiedProperties.)
       nsCOMPtr<nsIPresShell> shell = doc->GetShell();
       if (shell) {
         shell->GetPresContext()->
-          PostRebuildAllStyleDataEvent(nsChangeHint(0), eRestyle_Subtree);
+          PostRebuildAllStyleDataEvent(nsChangeHint::None, eRestyle_Subtree);
       }
     }
   }
 
   return rv;
 }
 
 void
--- a/dom/smil/nsSMILAnimationController.cpp
+++ b/dom/smil/nsSMILAnimationController.cpp
@@ -734,17 +734,17 @@ nsSMILAnimationController::AddStyleUpdat
     }
 
     // mIsCSS true means that the rules are the ones returned from
     // Element::GetSMILOverrideStyleDeclaration (via nsSMILCSSProperty objects),
     // and mIsCSS false means the rules are nsSMILMappedAttribute objects
     // returned from nsSVGElement::GetAnimatedContentStyleRule.
     nsRestyleHint rshint = key.mIsCSS ? eRestyle_StyleAttribute_Animations
                                       : eRestyle_SVGAttrAnimations;
-    aTracker.AddPendingRestyle(key.mElement, rshint, nsChangeHint(0));
+    aTracker.AddPendingRestyle(key.mElement, rshint, nsChangeHint::None);
   }
 
   mMightHavePendingStyleUpdates = false;
 }
 
 //----------------------------------------------------------------------
 // Add/remove child time containers
 
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -1453,17 +1453,17 @@ nsXULElement::WalkContentStyleRules(nsRu
 {
     return NS_OK;
 }
 
 nsChangeHint
 nsXULElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
                                      int32_t aModType) const
 {
-    nsChangeHint retval(nsChangeHint(0));
+    nsChangeHint retval(nsChangeHint::None);
 
     if (aAttribute == nsGkAtoms::value &&
         (aModType == nsIDOMMutationEvent::REMOVAL ||
          aModType == nsIDOMMutationEvent::ADDITION)) {
       if (IsAnyOfXULElements(nsGkAtoms::label, nsGkAtoms::description))
         // Label and description dynamically morph between a normal
         // block and a cropping single-line XUL text frame.  If the
         // value attribute is being added or removed, then we need to
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -2925,17 +2925,17 @@ nsIPresShell::PostRecreateFramesFor(Elem
 void
 nsIPresShell::RestyleForAnimation(Element* aElement, nsRestyleHint aHint)
 {
   // Now that we no longer have separate non-animation and animation
   // restyles, this method having a distinct identity is less important,
   // but it still seems useful to offer as a "more public" API and as a
   // chokepoint for these restyles to go through.
   mPresContext->RestyleManager()->PostRestyleEvent(aElement, aHint,
-                                                   nsChangeHint(0));
+                                                   nsChangeHint::None);
 }
 
 void
 nsIPresShell::SetForwardingContainer(const WeakPtr<nsDocShell> &aContainer)
 {
   mForwardingContainer = aContainer;
 }
 
@@ -4239,17 +4239,17 @@ PresShell::DocumentStatesChanged(nsIDocu
     return;
   }
 
   if (mDidInitialize &&
       styleSet->HasDocumentStateDependentStyle(mDocument->GetRootElement(),
                                                aStateMask)) {
     mPresContext->RestyleManager()->PostRestyleEvent(mDocument->GetRootElement(),
                                                      eRestyle_Subtree,
-                                                     nsChangeHint(0));
+                                                     nsChangeHint::None);
     VERIFY_STYLE_TREE;
   }
 
   if (aStateMask.HasState(NS_DOCUMENT_STATE_WINDOW_INACTIVE)) {
     nsIFrame* root = mFrameConstructor->GetRootFrame();
     if (root) {
       root->SchedulePaint();
     }
@@ -4525,21 +4525,21 @@ nsIPresShell::RestyleForCSSRuleChanges()
     mStyleSet->AsServo()->NoteStyleSheetsChanged();
   }
 
   if (scopeRoots.IsEmpty()) {
     // If scopeRoots is empty, we know that mStylesHaveChanged was true at
     // the beginning of this function, and that we need to restyle the whole
     // document.
     restyleManager->PostRestyleEvent(root, eRestyle_Subtree,
-                                     nsChangeHint(0));
+                                     nsChangeHint::None);
   } else {
     for (Element* scopeRoot : scopeRoots) {
       restyleManager->PostRestyleEvent(scopeRoot, eRestyle_Subtree,
-                                       nsChangeHint(0));
+                                       nsChangeHint::None);
     }
   }
 }
 
 void
 PresShell::RecordStyleSheetChange(StyleSheet* aStyleSheet)
 {
   // too bad we can't check that the update is UPDATE_STYLE
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -83,17 +83,17 @@ ElementTagToString(dom::Element* aElemen
 #endif
 
 RestyleManager::RestyleManager(nsPresContext* aPresContext)
   : RestyleManagerBase(aPresContext)
   , mDoRebuildAllStyleData(false)
   , mInRebuildAllStyleData(false)
   , mSkipAnimationRules(false)
   , mHavePendingNonAnimationRestyles(false)
-  , mRebuildAllExtraHint(nsChangeHint(0))
+  , mRebuildAllExtraHint(nsChangeHint::None)
   , mRebuildAllRestyleHint(nsRestyleHint(0))
   , mAnimationGeneration(0)
   , mReframingStyleContexts(nullptr)
   , mAnimationsWithDestroyedFrame(nullptr)
   , mPendingRestyles(ELEMENT_HAS_PENDING_RESTYLE |
                      ELEMENT_IS_POTENTIAL_RESTYLE_ROOT |
                      ELEMENT_IS_CONDITIONAL_RESTYLE_ANCESTOR)
   , mIsProcessingRestyles(false)
@@ -278,17 +278,17 @@ RestyleManager::AttributeWillChange(Elem
   nsRestyleHint rshint =
     StyleSet()->HasAttributeDependentStyle(aElement,
                                            aNameSpaceID,
                                            aAttribute,
                                            aModType,
                                            false,
                                            aNewValue,
                                            rsdata);
-  PostRestyleEvent(aElement, rshint, nsChangeHint(0), &rsdata);
+  PostRestyleEvent(aElement, rshint, nsChangeHint::None, &rsdata);
 }
 
 // Forwarded nsIMutationObserver method, to handle restyling (and
 // passing the notification to the frame).
 void
 RestyleManager::AttributeChanged(Element* aElement,
                                  int32_t aNameSpaceID,
                                  nsIAtom* aAttribute,
@@ -392,17 +392,17 @@ RestyleManager::RestyleForEmptyChange(El
   // In some cases (:empty + E, :empty ~ E), a change in the content of
   // an element requires restyling its parent's siblings.
   nsRestyleHint hint = eRestyle_Subtree;
   nsIContent* grandparent = aContainer->GetParent();
   if (grandparent &&
       (grandparent->GetFlags() & NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS)) {
     hint = nsRestyleHint(hint | eRestyle_LaterSiblings);
   }
-  PostRestyleEvent(aContainer, hint, nsChangeHint(0));
+  PostRestyleEvent(aContainer, hint, nsChangeHint::None);
 }
 
 void
 RestyleManager::RestyleForAppend(nsIContent* aContainer,
                                  nsIContent* aFirstNewContent)
 {
   // The container cannot be a document, but might be a ShadowRoot.
   if (!aContainer->IsElement()) {
@@ -441,28 +441,29 @@ RestyleManager::RestyleForAppend(nsICont
     }
     if (wasEmpty) {
       RestyleForEmptyChange(container);
       return;
     }
   }
 
   if (selectorFlags & NODE_HAS_SLOW_SELECTOR) {
-    PostRestyleEvent(container, eRestyle_Subtree, nsChangeHint(0));
+    PostRestyleEvent(container, eRestyle_Subtree, nsChangeHint::None);
     // Restyling the container is the most we can do here, so we're done.
     return;
   }
 
   if (selectorFlags & NODE_HAS_EDGE_CHILD_SELECTOR) {
     // restyle the last element child before this node
     for (nsIContent* cur = aFirstNewContent->GetPreviousSibling();
          cur;
          cur = cur->GetPreviousSibling()) {
       if (cur->IsElement()) {
-        PostRestyleEvent(cur->AsElement(), eRestyle_Subtree, nsChangeHint(0));
+        PostRestyleEvent(cur->AsElement(), eRestyle_Subtree,
+                         nsChangeHint::None);
         break;
       }
     }
   }
 }
 
 // Needed since we can't use PostRestyleEvent on non-elements (with
 // eRestyle_LaterSiblings or nsRestyleHint(eRestyle_Subtree |
@@ -472,17 +473,17 @@ RestyleSiblingsStartingWith(RestyleManag
                             nsIContent* aStartingSibling /* may be null */)
 {
   for (nsIContent* sibling = aStartingSibling; sibling;
        sibling = sibling->GetNextSibling()) {
     if (sibling->IsElement()) {
       aRestyleManager->
         PostRestyleEvent(sibling->AsElement(),
                          nsRestyleHint(eRestyle_Subtree | eRestyle_LaterSiblings),
-                         nsChangeHint(0));
+                         nsChangeHint::None);
       break;
     }
   }
 }
 
 // Restyling for a ContentInserted or CharacterDataChanged notification.
 // This could be used for ContentRemoved as well if we got the
 // notification before the removal happened (and sometimes
@@ -525,17 +526,17 @@ RestyleManager::RestyleForInsertOrChange
     }
     if (wasEmpty) {
       RestyleForEmptyChange(container);
       return;
     }
   }
 
   if (selectorFlags & NODE_HAS_SLOW_SELECTOR) {
-    PostRestyleEvent(container, eRestyle_Subtree, nsChangeHint(0));
+    PostRestyleEvent(container, eRestyle_Subtree, nsChangeHint::None);
     // Restyling the container is the most we can do here, so we're done.
     return;
   }
 
   if (selectorFlags & NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS) {
     // Restyle all later siblings.
     RestyleSiblingsStartingWith(this, aChild->GetNextSibling());
   }
@@ -548,34 +549,34 @@ RestyleManager::RestyleForInsertOrChange
          content = content->GetNextSibling()) {
       if (content == aChild) {
         passedChild = true;
         continue;
       }
       if (content->IsElement()) {
         if (passedChild) {
           PostRestyleEvent(content->AsElement(), eRestyle_Subtree,
-                           nsChangeHint(0));
+                           nsChangeHint::None);
         }
         break;
       }
     }
     // restyle the previously-last element child if it is before this node
     passedChild = false;
     for (nsIContent* content = container->GetLastChild();
          content;
          content = content->GetPreviousSibling()) {
       if (content == aChild) {
         passedChild = true;
         continue;
       }
       if (content->IsElement()) {
         if (passedChild) {
           PostRestyleEvent(content->AsElement(), eRestyle_Subtree,
-                           nsChangeHint(0));
+                           nsChangeHint::None);
         }
         break;
       }
     }
   }
 }
 
 void
@@ -618,17 +619,17 @@ RestyleManager::ContentRemoved(nsINode* 
     }
     if (isEmpty) {
       RestyleForEmptyChange(container);
       return;
     }
   }
 
   if (selectorFlags & NODE_HAS_SLOW_SELECTOR) {
-    PostRestyleEvent(container, eRestyle_Subtree, nsChangeHint(0));
+    PostRestyleEvent(container, eRestyle_Subtree, nsChangeHint::None);
     // Restyling the container is the most we can do here, so we're done.
     return;
   }
 
   if (selectorFlags & NODE_HAS_SLOW_SELECTOR_LATER_SIBLINGS) {
     // Restyle all later siblings.
     RestyleSiblingsStartingWith(this, aFollowingSibling);
   }
@@ -641,29 +642,30 @@ RestyleManager::ContentRemoved(nsINode* 
          content = content->GetNextSibling()) {
       if (content == aFollowingSibling) {
         reachedFollowingSibling = true;
         // do NOT continue here; we might want to restyle this node
       }
       if (content->IsElement()) {
         if (reachedFollowingSibling) {
           PostRestyleEvent(content->AsElement(), eRestyle_Subtree,
-                           nsChangeHint(0));
+                           nsChangeHint::None);
         }
         break;
       }
     }
     // restyle the now-last element child if it was before aOldChild
     reachedFollowingSibling = (aFollowingSibling == nullptr);
     for (nsIContent* content = container->GetLastChild();
          content;
          content = content->GetPreviousSibling()) {
       if (content->IsElement()) {
         if (reachedFollowingSibling) {
-          PostRestyleEvent(content->AsElement(), eRestyle_Subtree, nsChangeHint(0));
+          PostRestyleEvent(content->AsElement(), eRestyle_Subtree,
+                           nsChangeHint::None);
         }
         break;
       }
       if (content == aFollowingSibling) {
         reachedFollowingSibling = true;
       }
     }
   }
@@ -724,17 +726,17 @@ RestyleManager::StartRebuildAllStyleData
   // so we can recalculate while maintaining rule tree immutability
   nsresult rv = StyleSet()->BeginReconstruct();
   if (NS_FAILED(rv)) {
     MOZ_CRASH("unable to rebuild style data");
   }
 
   nsRestyleHint restyleHint = mRebuildAllRestyleHint;
   nsChangeHint changeHint = mRebuildAllExtraHint;
-  mRebuildAllExtraHint = nsChangeHint(0);
+  mRebuildAllExtraHint = nsChangeHint::None;
   mRebuildAllRestyleHint = nsRestyleHint(0);
 
   restyleHint |= eRestyle_ForceDescendants;
 
   if (!(restyleHint & eRestyle_Subtree) &&
       (restyleHint & ~(eRestyle_Force | eRestyle_ForceDescendants))) {
     // We want this hint to apply to the root node's primary frame
     // rather than the root frame, since it's the primary frame that has
@@ -742,17 +744,17 @@ RestyleManager::StartRebuildAllStyleData
     // primary frame whose mContent is the root node but which have
     // different styles).  If we use up the hint for one of the
     // ancestors that we hit first, then we'll fail to do the restyling
     // we need to do.
     Element* root = PresContext()->Document()->GetRootElement();
     if (root) {
       // If the root element is gone, dropping the hint on the floor
       // should be fine.
-      aRestyleTracker.AddPendingRestyle(root, restyleHint, nsChangeHint(0));
+      aRestyleTracker.AddPendingRestyle(root, restyleHint, nsChangeHint::None);
     }
     restyleHint = nsRestyleHint(0);
   }
 
   // Recalculate all of the style contexts for the document, from the
   // root frame.  We can't do this with a change hint, since we can't
   // post a change hint for the root frame.
   // Note that we can ignore the return value of ComputeStyleChangeFor
@@ -1265,17 +1267,17 @@ RestyleManager::ReparentStyleContext(nsI
 #endif
 
       // Make sure to call CalcStyleDifference so that the new context ends
       // up resolving all the structs the old context resolved.
       if (!copyFromContinuation) {
         uint32_t equalStructs;
         uint32_t samePointerStructs;
         DebugOnly<nsChangeHint> styleChange =
-          oldContext->CalcStyleDifference(newContext, nsChangeHint(0),
+          oldContext->CalcStyleDifference(newContext, nsChangeHint::None,
                                           &equalStructs,
                                           &samePointerStructs);
         // The style change is always 0 because we have the same rulenode and
         // CalcStyleDifference optimizes us away.  That's OK, though:
         // reparenting should never trigger a frame reconstruct, and whenever
         // it's happening we already plan to reflow and repaint the frames.
         NS_ASSERTION(!(styleChange & nsChangeHint::ReconstructFrame),
                      "Our frame tree is likely to be bogus!");
@@ -1332,17 +1334,17 @@ RestyleManager::ReparentStyleContext(nsI
           if (newExtraContext != oldExtraContext) {
             // Make sure to call CalcStyleDifference so that the new
             // context ends up resolving all the structs the old context
             // resolved.
             uint32_t equalStructs;
             uint32_t samePointerStructs;
             DebugOnly<nsChangeHint> styleChange =
               oldExtraContext->CalcStyleDifference(newExtraContext,
-                                                   nsChangeHint(0),
+                                                   nsChangeHint::None,
                                                    &equalStructs,
                                                    &samePointerStructs);
             // The style change is always 0 because we have the same
             // rulenode and CalcStyleDifference optimizes us away.  That's
             // OK, though: reparenting should never trigger a frame
             // reconstruct, and whenever it's happening we already plan to
             // reflow and repaint the frames.
             NS_ASSERTION(!(styleChange & nsChangeHint::ReconstructFrame),
@@ -1378,18 +1380,18 @@ ElementRestyler::ElementRestyler(nsPresC
   , mFrame(aFrame)
   , mParentContent(nullptr)
     // XXXldb Why does it make sense to use aParentContent?  (See
     // comment above assertion at start of ElementRestyler::Restyle.)
   , mContent(mFrame->GetContent() ? mFrame->GetContent() : mParentContent)
   , mChangeList(aChangeList)
   , mHintsHandled(aHintsHandledByAncestors &
                   ~NS_HintsNotHandledForDescendantsIn(aHintsHandledByAncestors))
-  , mParentFrameHintsNotHandledForDescendants(nsChangeHint(0))
-  , mHintsNotHandledForDescendants(nsChangeHint(0))
+  , mParentFrameHintsNotHandledForDescendants(nsChangeHint::None)
+  , mHintsNotHandledForDescendants(nsChangeHint::None)
   , mRestyleTracker(aRestyleTracker)
   , mSelectorsForDescendants(aSelectorsForDescendants)
   , mTreeMatchContext(aTreeMatchContext)
   , mResolvedChild(nullptr)
   , mContextsToClear(aContextsToClear)
   , mSwappedStructOwners(aSwappedStructOwners)
   , mIsRootOfRestyle(true)
 #ifdef ACCESSIBILITY
@@ -1414,17 +1416,17 @@ ElementRestyler::ElementRestyler(const E
     // XXXldb Why does it make sense to use aParentContent?  (See
     // comment above assertion at start of ElementRestyler::Restyle.)
   , mContent(mFrame->GetContent() ? mFrame->GetContent() : mParentContent)
   , mChangeList(aParentRestyler.mChangeList)
   , mHintsHandled(aParentRestyler.mHintsHandled &
                   ~NS_HintsNotHandledForDescendantsIn(aParentRestyler.mHintsHandled))
   , mParentFrameHintsNotHandledForDescendants(
       aParentRestyler.mHintsNotHandledForDescendants)
-  , mHintsNotHandledForDescendants(nsChangeHint(0))
+  , mHintsNotHandledForDescendants(nsChangeHint::None)
   , mRestyleTracker(aParentRestyler.mRestyleTracker)
   , mSelectorsForDescendants(aParentRestyler.mSelectorsForDescendants)
   , mTreeMatchContext(aParentRestyler.mTreeMatchContext)
   , mResolvedChild(nullptr)
   , mContextsToClear(aParentRestyler.mContextsToClear)
   , mSwappedStructOwners(aParentRestyler.mSwappedStructOwners)
   , mIsRootOfRestyle(false)
 #ifdef ACCESSIBILITY
@@ -1463,17 +1465,17 @@ ElementRestyler::ElementRestyler(ParentC
     // comment above assertion at start of ElementRestyler::Restyle.)
   , mContent(mFrame->GetContent() ? mFrame->GetContent() : mParentContent)
   , mChangeList(aParentRestyler.mChangeList)
   , mHintsHandled(aParentRestyler.mHintsHandled &
                   ~NS_HintsNotHandledForDescendantsIn(aParentRestyler.mHintsHandled))
   , mParentFrameHintsNotHandledForDescendants(
       // assume the worst
       nsChangeHint_Hints_NotHandledForDescendants)
-  , mHintsNotHandledForDescendants(nsChangeHint(0))
+  , mHintsNotHandledForDescendants(nsChangeHint::None)
   , mRestyleTracker(aParentRestyler.mRestyleTracker)
   , mSelectorsForDescendants(aParentRestyler.mSelectorsForDescendants)
   , mTreeMatchContext(aParentRestyler.mTreeMatchContext)
   , mResolvedChild(nullptr)
   , mContextsToClear(aParentRestyler.mContextsToClear)
   , mSwappedStructOwners(aParentRestyler.mSwappedStructOwners)
   , mIsRootOfRestyle(false)
 #ifdef ACCESSIBILITY
@@ -1503,18 +1505,18 @@ ElementRestyler::ElementRestyler(nsPresC
                                    aSwappedStructOwners)
   : mPresContext(aPresContext)
   , mFrame(nullptr)
   , mParentContent(nullptr)
   , mContent(aContent)
   , mChangeList(aChangeList)
   , mHintsHandled(aHintsHandledByAncestors &
                   ~NS_HintsNotHandledForDescendantsIn(aHintsHandledByAncestors))
-  , mParentFrameHintsNotHandledForDescendants(nsChangeHint(0))
-  , mHintsNotHandledForDescendants(nsChangeHint(0))
+  , mParentFrameHintsNotHandledForDescendants(nsChangeHint::None)
+  , mHintsNotHandledForDescendants(nsChangeHint::None)
   , mRestyleTracker(aRestyleTracker)
   , mSelectorsForDescendants(aSelectorsForDescendants)
   , mTreeMatchContext(aTreeMatchContext)
   , mResolvedChild(nullptr)
   , mContextsToClear(aContextsToClear)
   , mSwappedStructOwners(aSwappedStructOwners)
   , mIsRootOfRestyle(true)
 #ifdef ACCESSIBILITY
@@ -1530,17 +1532,17 @@ void
 ElementRestyler::AddLayerChangesForAnimation()
 {
   // Bug 847286 - We should have separate animation generation counters
   // on layers for transitions and animations and use != comparison below
   // rather than a > comparison.
   uint64_t frameGeneration =
     RestyleManager::GetAnimationGenerationForFrame(mFrame);
 
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
   for (const LayerAnimationInfo::Record& layerInfo :
          LayerAnimationInfo::sRecords) {
     Layer* layer =
       FrameLayerBuilder::GetDedicatedLayer(mFrame, layerInfo.mLayerType);
     if (layer && frameGeneration > layer->GetAnimationGeneration()) {
       // If we have a transform layer but don't have any transform style, we
       // probably just removed the transform but haven't destroyed the layer
       // yet. In this case we will add the appropriate change hint
@@ -1881,28 +1883,28 @@ ElementRestyler::ConditionallyRestyle(El
     if (SelectorMatchesForRestyle(aElement)) {
       LOG_RESTYLE("element has existing restyle data and matches a selector");
       rshint |= eRestyle_Self;
     } else {
       LOG_RESTYLE("element has existing restyle data but doesn't match selectors");
     }
     RestyleHintData data;
     data.mSelectorsForDescendants = mSelectorsForDescendants;
-    mRestyleTracker.AddPendingRestyle(aElement, rshint, nsChangeHint(0), &data,
-                                      Some(aRestyleRoot));
+    mRestyleTracker.AddPendingRestyle(aElement, rshint, nsChangeHint::None,
+                                      &data, Some(aRestyleRoot));
     return true;
   }
 
   if (SelectorMatchesForRestyle(aElement)) {
     LOG_RESTYLE("element has no restyle data but matches a selector");
     RestyleHintData data;
     data.mSelectorsForDescendants = mSelectorsForDescendants;
     mRestyleTracker.AddPendingRestyle(aElement,
                                       eRestyle_Self | eRestyle_SomeDescendants,
-                                      nsChangeHint(0), &data,
+                                      nsChangeHint::None, &data,
                                       Some(aRestyleRoot));
     return true;
   }
 
   return false;
 }
 
 bool
@@ -2178,17 +2180,18 @@ ElementRestyler::Restyle(nsRestyleHint a
   // transform has been removed first.
   AddLayerChangesForAnimation();
 
   if (haveMoreContinuations && hintToRestore) {
     // If we have more continuations with different style (e.g., because
     // we're inside a ::first-letter or ::first-line), put the restyle
     // hint back.
     mRestyleTracker.AddPendingRestyleToTable(mContent->AsElement(),
-                                             hintToRestore, nsChangeHint(0));
+                                             hintToRestore,
+                                             nsChangeHint::None);
   }
 
   if (result == RestyleResult::eStop) {
     MOZ_ASSERT(mFrame->StyleContext() == oldContext,
                "frame should have been left with its old style context");
 
     nsIFrame* unused;
     nsStyleContext* newParent = mFrame->GetParentStyleContext(&unused);
@@ -2705,17 +2708,17 @@ ElementRestyler::RestyleSelf(nsIFrame* a
   if (!mIsRootOfRestyle) {
     canStopWithStyleChange = false;
   }
 
   // Look at the frame and its current style context for conditions
   // that would change our RestyleResult.
   ComputeRestyleResultFromFrame(aSelf, result, canStopWithStyleChange);
 
-  nsChangeHint assumeDifferenceHint = nsChangeHint(0);
+  nsChangeHint assumeDifferenceHint = nsChangeHint::None;
   RefPtr<nsStyleContext> oldContext = aSelf->StyleContext();
   nsStyleSet* styleSet = StyleSet();
 
 #ifdef ACCESSIBILITY
   mWasFrameVisible = nsIPresShell::IsAccessibilityActive() ?
     oldContext->StyleVisibility()->IsVisible() : false;
 #endif
 
@@ -2944,17 +2947,17 @@ ElementRestyler::RestyleSelf(nsIFrame* a
 
     if (copyFromContinuation) {
       // In theory we should know whether there was any style data difference,
       // since we would have calculated that in the previous call to
       // RestyleSelf, so until we perform only one restyling per chain-of-
       // same-style continuations (bug 918064), we need to check again here to
       // determine whether it is safe to stop restyling.
       if (result == RestyleResult::eStop) {
-        oldContext->CalcStyleDifference(newContext, nsChangeHint(0),
+        oldContext->CalcStyleDifference(newContext, nsChangeHint::None,
                                         &equalStructs,
                                         &samePointerStructs);
         if (equalStructs != NS_STYLE_INHERIT_MASK) {
           // At least one struct had different data in it, so we must
           // continue restyling children.
           LOG_RESTYLE_CONTINUE("there is different style data: %s",
                       RestyleManager::StructNamesToString(
                         ~equalStructs & NS_STYLE_INHERIT_MASK).get());
--- a/layout/base/RestyleManagerBase.cpp
+++ b/layout/base/RestyleManagerBase.cpp
@@ -33,17 +33,17 @@ RestyleManagerBase::ContentStateChangedI
                                                 nsRestyleHint* aOutRestyleHint)
 {
   MOZ_ASSERT(aOutChangeHint);
   MOZ_ASSERT(aOutRestyleHint);
 
   StyleSetHandle styleSet = PresContext()->StyleSet();
   NS_ASSERTION(styleSet, "couldn't get style set");
 
-  *aOutChangeHint = nsChangeHint(0);
+  *aOutChangeHint = nsChangeHint::None;
   // Any change to a content state that affects which frames we construct
   // must lead to a frame reconstruct here if we already have a frame.
   // Note that we never decide through non-CSS means to not create frames
   // based on content states, so if we already don't have a frame we don't
   // need to force a reframe -- if it's needed, the HasStateDependentStyle
   // call will handle things.
   nsIFrame* primaryFrame = aElement->GetPrimaryFrame();
   CSSPseudoElementType pseudoType = CSSPseudoElementType::NotPseudo;
@@ -200,17 +200,17 @@ RestyleManagerBase::ChangeHintToString(n
   }
   if (rest) {
     if (any) {
       result.AppendLiteral(" | ");
     }
     result.AppendPrintf("0x%0x", rest);
   } else {
     if (!any) {
-      result.AppendLiteral("nsChangeHint(0)");
+      result.AppendLiteral("nsChangeHint::None");
     }
   }
   return result;
 }
 #endif
 
 void
 RestyleManagerBase::PostRestyleEventInternal(bool aForLazyConstruction)
--- a/layout/base/RestyleTracker.cpp
+++ b/layout/base/RestyleTracker.cpp
@@ -188,17 +188,17 @@ RestyleTracker::DoProcessRestyles()
                sibling;
                sibling = sibling->GetNextSibling()) {
             if (sibling->IsElement()) {
               LOG_RESTYLE("adding pending restyle for %s due to "
                           "eRestyle_LaterSiblings hint on %s",
                           FrameTagToString(sibling->AsElement()).get(),
                           FrameTagToString(element->AsElement()).get());
               if (AddPendingRestyle(sibling->AsElement(), eRestyle_Subtree,
-                                    nsChangeHint(0))) {
+                                    nsChangeHint::None)) {
                   // Nothing else to do here; we'll handle the following
                   // siblings when we get to |sibling| in laterSiblingArr.
                 break;
               }
             }
           }
         }
 
@@ -426,17 +426,17 @@ RestyleTracker::GetRestyleData(Element* 
     // case, it's fine for us to have a non-empty mDescendants, since
     // we know that RebuildAllStyleData adds eRestyle_ForceDescendants
     // and we're guaranteed we'll restyle the entire tree.
     NS_ASSERTION(mRestyleManager->InRebuildAllStyleData() ||
                  aData->mDescendants.IsEmpty(),
                  "expected descendants to be handled by now");
 
     RestyleData* newData = new RestyleData;
-    newData->mChangeHint = nsChangeHint(0);
+    newData->mChangeHint = nsChangeHint::None;
     newData->mRestyleHint = eRestyle_LaterSiblings;
     mPendingRestyles.Put(aElement, newData);
     aElement->UnsetFlags(RootBit());
     aData->mRestyleHint =
       nsRestyleHint(aData->mRestyleHint & ~eRestyle_LaterSiblings);
   } else {
     aElement->UnsetFlags(mRestyleBits);
   }
--- a/layout/base/RestyleTracker.h
+++ b/layout/base/RestyleTracker.h
@@ -106,17 +106,17 @@ public:
     nsRestyleHint mRestyleHint;        // What we want to restyle
     nsChangeHint mChangeHint;          // The minimal change hint for "self"
     RestyleHintData mRestyleHintData;  // Data associated with mRestyleHint
   };
 
   struct RestyleData : Hints {
     RestyleData() {
       mRestyleHint = nsRestyleHint(0);
-      mChangeHint = nsChangeHint(0);
+      mChangeHint = nsChangeHint::None;
     }
 
     RestyleData(nsRestyleHint aRestyleHint, nsChangeHint aChangeHint,
                 const RestyleHintData* aRestyleHintData) {
       mRestyleHint = aRestyleHint;
       mChangeHint = aChangeHint;
       if (aRestyleHintData) {
         mRestyleHintData = *aRestyleHintData;
--- a/layout/base/ServoRestyleManager.cpp
+++ b/layout/base/ServoRestyleManager.cpp
@@ -459,17 +459,17 @@ ServoRestyleManager::AttributeChanged(El
                                       nsIAtom* aAttribute, int32_t aModType,
                                       const nsAttrValue* aOldValue)
 {
 #ifdef DEBUG
   ServoElementSnapshot* snapshot = Servo_Element_GetSnapshot(aElement);
   MOZ_ASSERT_IF(snapshot, snapshot->HasAttrs());
 #endif
   if (aAttribute == nsGkAtoms::style) {
-    PostRestyleEvent(aElement, eRestyle_StyleAttribute, nsChangeHint(0));
+    PostRestyleEvent(aElement, eRestyle_StyleAttribute, nsChangeHint::None);
   }
 }
 
 nsresult
 ServoRestyleManager::ReparentStyleContext(nsIFrame* aFrame)
 {
   NS_WARNING("stylo: ServoRestyleManager::ReparentStyleContext not implemented");
   return NS_OK;
--- a/layout/base/nsChangeHint.h
+++ b/layout/base/nsChangeHint.h
@@ -14,17 +14,17 @@
 #include "nsTArray.h"
 
 struct nsCSSSelector;
 
 // Defines for various style related constants
 
 typedef uint32_t nsChangeHintTypeBase;
 enum class nsChangeHint : nsChangeHintTypeBase {
-  Empty = 0,
+  None = 0,
 
   // change was visual only (e.g., COLOR=)
   // Invalidates all descendant frames (including following
   // placeholders to out-of-flow frames).
   RepaintFrame = 1 << 0,
 
   // For reflow, we want flags to give us arbitrary FrameNeedsReflow behavior.
   // just do a FrameNeedsReflow.
@@ -160,17 +160,17 @@ enum class nsChangeHint : nsChangeHintTy
   /**
    * This will schedule an invalidating paint. This is useful if something
    * has changed which will be invalidated by DLBI.
    */
   SchedulePaint = 1 << 20,
 
   /**
    * A hint reflecting that style data changed with no change handling
-   * behavior.  We need to return this, rather than nsChangeHint(0),
+   * behavior.  We need to return this, rather than nsChangeHint::None,
    * so that certain optimizations that manipulate the style context tree are
    * correct.
    *
    * nsChangeHint::NeutralChange must be returned by CalcDifference on a given
    * style struct if the data in the style structs are meaningfully different
    * and if no other change hints are returned.  If any other change hints are
    * set, then nsChangeHint::NeutralChange need not also be included, but it is
    * safe to do so.  (An example of style structs having non-meaningfully
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -748,17 +748,17 @@ nsPresContext::UpdateAfterPreferencesCha
   // update the presShell: tell it to set the preference style rules up
   if (mShell) {
     mShell->UpdatePreferenceStyles();
   }
 
   InvalidatePaintedLayers();
   mDeviceContext->FlushFontCache();
 
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
 
   if (mPrefChangePendingNeedsReflow) {
     hint |= NS_STYLE_HINT_REFLOW;
   }
 
   // Preferences require rerunning selector matching because we rebuild
   // the pref style sheet for some preference changes.
   RebuildAllStyleData(hint, eRestyle_Subtree);
@@ -1301,17 +1301,17 @@ nsPresContext::SetFullZoom(float aZoom)
 }
 
 void
 nsPresContext::SetOverrideDPPX(float aDPPX)
 {
   mOverrideDPPX = aDPPX;
 
   if (HasCachedStyleData()) {
-    MediaFeatureValuesChanged(nsRestyleHint(0), nsChangeHint(0));
+    MediaFeatureValuesChanged(nsRestyleHint(0), nsChangeHint::None);
   }
 }
 
 gfxSize
 nsPresContext::ScreenSizeInchesForFontInflation(bool* aChanged)
 {
   if (aChanged) {
     *aChanged = false;
@@ -1682,17 +1682,17 @@ nsPresContext::SysColorChangedInternal()
   }
 
   // Reset default background and foreground colors for the document since
   // they may be using system colors
   GetDocumentColorPreferences();
 
   // The system color values are computed to colors in the style data,
   // so normal style data comparison is sufficient here.
-  RebuildAllStyleData(nsChangeHint(0), nsRestyleHint(0));
+  RebuildAllStyleData(nsChangeHint::None, nsRestyleHint(0));
 }
 
 void
 nsPresContext::UIResolutionChanged()
 {
   if (!mPendingUIResolutionChanged) {
     nsCOMPtr<nsIRunnable> ev =
       NewRunnableMethod(this, &nsPresContext::UIResolutionChangedInternal);
@@ -1778,26 +1778,26 @@ nsPresContext::EmulateMedium(const nsASt
   nsIAtom* previousMedium = Medium();
   mIsEmulatingMedia = true;
 
   nsAutoString mediaType;
   nsContentUtils::ASCIIToLower(aMediaType, mediaType);
 
   mMediaEmulated = NS_Atomize(mediaType);
   if (mMediaEmulated != previousMedium && mShell) {
-    MediaFeatureValuesChanged(nsRestyleHint(0), nsChangeHint(0));
+    MediaFeatureValuesChanged(nsRestyleHint(0), nsChangeHint::None);
   }
 }
 
 void nsPresContext::StopEmulatingMedium()
 {
   nsIAtom* previousMedium = Medium();
   mIsEmulatingMedia = false;
   if (Medium() != previousMedium) {
-    MediaFeatureValuesChanged(nsRestyleHint(0), nsChangeHint(0));
+    MediaFeatureValuesChanged(nsRestyleHint(0), nsChangeHint::None);
   }
 }
 
 void
 nsPresContext::RebuildAllStyleData(nsChangeHint aExtraHint,
                                    nsRestyleHint aRestyleHint)
 {
   if (!mShell) {
@@ -2081,17 +2081,18 @@ nsPresContext::UserFontSetUpdated(gfxUse
     return;
   }
 
   // Special case - if either the 'ex' or 'ch' units are used, these
   // depend upon font metrics. Updating this information requires
   // rebuilding the rule tree from the top, avoiding the reuse of cached
   // data even when no style rules have changed.
   if (UsesExChUnits()) {
-    PostRebuildAllStyleDataEvent(nsChangeHint(0), eRestyle_ForceDescendants);
+    PostRebuildAllStyleDataEvent(nsChangeHint::None,
+                                 eRestyle_ForceDescendants);
   }
 
   // Iterate over the frame tree looking for frames associated with the
   // downloadable font family in question. If a frame's nsStyleFont has
   // the name, check the font group associated with the metrics to see if
   // it contains that specific font (i.e. the one chosen within the family
   // given the weight, width, and slant from the nsStyleFont). If it does,
   // mark that frame dirty and skip inspecting its descendants.
@@ -2160,17 +2161,17 @@ nsPresContext::EnsureSafeToHandOutCSSRul
     return;
   }
 
   if (!styleSet->EnsureUniqueInnerOnCSSSheets()) {
     // Nothing to do.
     return;
   }
 
-  RebuildAllStyleData(nsChangeHint(0), eRestyle_Subtree);
+  RebuildAllStyleData(nsChangeHint::None, eRestyle_Subtree);
 }
 
 void
 nsPresContext::FireDOMPaintEvent(nsInvalidateRequestList* aList, uint64_t aTransactionId)
 {
   nsPIDOMWindowInner* ourWindow = mDocument->GetInnerWindow();
   if (!ourWindow)
     return;
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -284,24 +284,25 @@ public:
    *  * eRestyle_Subtree to force rebuilding of style data with
    *    rerunning of selector matching
    *
    * For aChangeHint, see RestyleManager::RebuildAllStyleData.  (Passing
    * a nonzero aChangeHint forces rebuilding style data even if
    * nsRestyleHint(0) is passed.)
    */
   void MediaFeatureValuesChanged(nsRestyleHint aRestyleHint,
-                                 nsChangeHint aChangeHint = nsChangeHint(0));
+                                 nsChangeHint aChangeHint = nsChangeHint::None);
   /**
    * Calls MediaFeatureValuesChanged for this pres context and all descendant
    * subdocuments that have a pres context. This should be used for media
    * features that must be updated in all subdocuments e.g. display-mode.
    */
   void MediaFeatureValuesChangedAllDocuments(nsRestyleHint aRestyleHint,
-                                             nsChangeHint aChangeHint = nsChangeHint(0));
+                                             nsChangeHint aChangeHint =
+                                               nsChangeHint::None);
 
   void PostMediaFeatureValuesChangedEvent();
   void HandleMediaFeatureValuesChangedEvent();
   void FlushPendingMediaFeatureValuesChanged() {
     if (mPendingMediaFeatureValuesChanged)
       MediaFeatureValuesChanged(nsRestyleHint(0));
   }
 
--- a/layout/style/nsHTMLStyleSheet.cpp
+++ b/layout/style/nsHTMLStyleSheet.cpp
@@ -493,17 +493,17 @@ nsHTMLStyleSheet::ImplLinkColorSetter(Re
 
   aRule->mColor = aColor;
   // Now make sure we restyle any links that might need it.  This
   // shouldn't happen often, so just rebuilding everything is ok.
   if (mDocument && mDocument->GetShell()) {
     Element* root = mDocument->GetRootElement();
     if (root) {
       mDocument->GetShell()->GetPresContext()->RestyleManager()->
-        PostRestyleEvent(root, eRestyle_Subtree, nsChangeHint(0));
+        PostRestyleEvent(root, eRestyle_Subtree, nsChangeHint::None);
     }
   }
   return NS_OK;
 }
 
 nsresult
 nsHTMLStyleSheet::SetLinkColor(nscolor aColor)
 {
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -974,17 +974,17 @@ nsStyleContext::CalcStyleDifferenceInter
                              nsChangeHint_Hints_NotHandledForDescendants),
              "caller is passing inherited hints, but shouldn't be");
 
   static_assert(nsStyleStructID_Length <= 32,
                 "aEqualStructs is not big enough");
 
   *aEqualStructs = 0;
 
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
   NS_ENSURE_TRUE(aNewContext, hint);
   // We must always ensure that we populate the structs on the new style
   // context that are filled in on the old context, so that if we get
   // two style changes in succession, the second of which causes a real
   // style change, the PeekStyleData doesn't return null (implying that
   // nobody ever looked at that struct's data).  In other words, we
   // can't skip later structs if we get a big change up front, because
   // we could later get a small change in one of those structs that we
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -201,17 +201,17 @@ nsStyleFont::CalcDifference(const nsStyl
   if (mGenericID != aNewData.mGenericID ||
       mScriptLevel != aNewData.mScriptLevel ||
       mScriptUnconstrainedSize != aNewData.mScriptUnconstrainedSize ||
       mScriptMinSize != aNewData.mScriptMinSize ||
       mScriptSizeMultiplier != aNewData.mScriptSizeMultiplier) {
     return nsChangeHint::NeutralChange;
   }
 
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 /* static */ nscoord
 nsStyleFont::ZoomText(StyleStructContext aContext, nscoord aSize)
 {
   // aSize can be negative (e.g.: calc(-1px)) so we can't assert that here.
   // The caller is expected deal with that.
   return NSToCoordTruncClamped(float(aSize) * aContext.TextZoom());
@@ -261,17 +261,17 @@ nsStyleMargin::Destroy(nsPresContext* aC
   aContext->PresShell()->
     FreeByObjectID(eArenaObjectID_nsStyleMargin, this);
 }
 
 nsChangeHint
 nsStyleMargin::CalcDifference(const nsStyleMargin& aNewData) const
 {
   if (mMargin == aNewData.mMargin) {
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
   // Margin differences can't affect descendant intrinsic sizes and
   // don't need to force children to reflow.
   return nsChangeHint::NeedReflow |
          nsChangeHint::ReflowChangesSizeOrPosition |
          nsChangeHint::ClearAncestorIntrinsics;
 }
 
@@ -296,17 +296,17 @@ nsStylePadding::Destroy(nsPresContext* a
   aContext->PresShell()->
     FreeByObjectID(eArenaObjectID_nsStylePadding, this);
 }
 
 nsChangeHint
 nsStylePadding::CalcDifference(const nsStylePadding& aNewData) const
 {
   if (mPadding == aNewData.mPadding) {
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
   // Padding differences can't affect descendant intrinsic sizes, but do need
   // to force children to reflow so that we can reposition them, since their
   // offsets are from our frame bounds but our content rect's position within
   // those bounds is moving.
   // FIXME: It would be good to return a weaker hint here that doesn't
   // force reflow of all descendants, but the hint would need to force
   // reflow of the frame's children (see how
@@ -524,17 +524,17 @@ nsStyleBorder::CalcDifference(const nsSt
 
   // mBorder is the specified border value.  Changes to this don't
   // need any change processing, since we operate on the computed
   // border values instead.
   if (mBorder != aNewData.mBorder) {
     return nsChangeHint::NeutralChange;
   }
 
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 nsStyleOutline::nsStyleOutline(StyleStructContext aContext)
   : mOutlineWidth((StaticPresData::Get()
                      ->GetBorderWidthTable())[NS_STYLE_BORDER_WIDTH_MEDIUM])
   , mOutlineOffset(0)
   , mOutlineColor(StyleComplexColor::CurrentColor())
   , mOutlineStyle(NS_STYLE_BORDER_STYLE_NONE)
@@ -592,17 +592,17 @@ nsStyleOutline::CalcDifference(const nsS
   }
 
   if (mOutlineWidth != aNewData.mOutlineWidth ||
       mOutlineOffset != aNewData.mOutlineOffset ||
       mTwipsPerPixel != aNewData.mTwipsPerPixel) {
     return nsChangeHint::NeutralChange;
   }
 
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 // --------------------
 // nsStyleList
 //
 nsStyleList::nsStyleList(StyleStructContext aContext)
   : mListStylePosition(NS_STYLE_LIST_STYLE_POSITION_OUTSIDE)
   , mCounterStyle(aContext.BuildCounterStyle(NS_LITERAL_STRING("disc")))
@@ -699,17 +699,17 @@ nsStyleList::CalcDifference(const nsStyl
     return nsChangeHint::ReconstructFrame;
   }
   if (mListStylePosition != aNewData.mListStylePosition) {
     return nsChangeHint::ReconstructFrame;
   }
   if (DefinitelyEqualImages(mListStyleImage, aNewData.mListStyleImage) &&
       mCounterStyle == aNewData.mCounterStyle) {
     if (mImageRegion.IsEqualInterior(aNewData.mImageRegion)) {
-      return nsChangeHint(0);
+      return nsChangeHint::None;
     }
     if (mImageRegion.width == aNewData.mImageRegion.width &&
         mImageRegion.height == aNewData.mImageRegion.height) {
       return NS_STYLE_HINT_VISUAL;
     }
   }
   return NS_STYLE_HINT_REFLOW;
 }
@@ -758,17 +758,17 @@ nsStyleXUL::CalcDifference(const nsStyle
 {
   if (mBoxAlign == aNewData.mBoxAlign &&
       mBoxDirection == aNewData.mBoxDirection &&
       mBoxFlex == aNewData.mBoxFlex &&
       mBoxOrient == aNewData.mBoxOrient &&
       mBoxPack == aNewData.mBoxPack &&
       mBoxOrdinal == aNewData.mBoxOrdinal &&
       mStretchStack == aNewData.mStretchStack) {
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
   if (mBoxOrdinal != aNewData.mBoxOrdinal) {
     return nsChangeHint::ReconstructFrame;
   }
   return NS_STYLE_HINT_REFLOW;
 }
 
 // --------------------
@@ -834,17 +834,17 @@ nsStyleColumn::CalcDifference(const nsSt
 
   // XXX Is it right that we never check mTwipsPerPixel to return a
   // non-nsChangeHint::NeutralChange hint?
   if (mColumnRuleWidth != aNewData.mColumnRuleWidth ||
       mTwipsPerPixel != aNewData.mTwipsPerPixel) {
     return nsChangeHint::NeutralChange;
   }
 
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 // --------------------
 // nsStyleSVG
 //
 nsStyleSVG::nsStyleSVG(StyleStructContext aContext)
   : mFill(eStyleSVGPaintType_Color) // Will be initialized to NS_RGB(0, 0, 0)
   , mStroke(eStyleSVGPaintType_None)
@@ -909,17 +909,17 @@ PaintURIChanged(const nsStyleSVGPaint& a
   return aPaint1.Type() == eStyleSVGPaintType_Server &&
          !DefinitelyEqualURIs(aPaint1.GetPaintServer(),
                               aPaint2.GetPaintServer());
 }
 
 nsChangeHint
 nsStyleSVG::CalcDifference(const nsStyleSVG& aNewData) const
 {
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
 
   if (!DefinitelyEqualURIs(mMarkerEnd, aNewData.mMarkerEnd) ||
       !DefinitelyEqualURIs(mMarkerMid, aNewData.mMarkerMid) ||
       !DefinitelyEqualURIs(mMarkerStart, aNewData.mMarkerStart)) {
     // Markers currently contribute to SVGGeometryFrame::mRect,
     // so we need a reflow as well as a repaint. No intrinsic sizes need
     // to change, so nsChangeHint::NeedReflow is sufficient.
     return nsChangeHint::UpdateEffects |
@@ -1168,17 +1168,17 @@ nsStyleSVGReset::FinishStyle(nsPresConte
   MOZ_ASSERT(aPresContext->StyleSet()->IsServo());
 
   mMask.ResolveImages(aPresContext);
 }
 
 nsChangeHint
 nsStyleSVGReset::CalcDifference(const nsStyleSVGReset& aNewData) const
 {
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
 
   if (mClipPath != aNewData.mClipPath) {
     hint |= nsChangeHint::UpdateEffects |
             nsChangeHint::RepaintFrame;
     // clip-path changes require that we update the PreEffectsBBoxProperty,
     // which is done during overflow computation.
     hint |= nsChangeHint::UpdateOverflow;
   }
@@ -1458,17 +1458,17 @@ IsAutonessEqual(const nsStyleSides& aSid
   }
   return true;
 }
 
 nsChangeHint
 nsStylePosition::CalcDifference(const nsStylePosition& aNewData,
                                 const nsStyleVisibility* aOldStyleVisibility) const
 {
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
 
   // Changes to "z-index" require a repaint.
   if (mZIndex != aNewData.mZIndex) {
     hint |= nsChangeHint::RepaintFrame;
   }
 
   // Changes to "object-fit" & "object-position" require a repaint.  They
   // may also require a reflow, if we have a nsSubDocumentFrame, so that we
@@ -1701,17 +1701,17 @@ nsStyleTable::nsStyleTable(const nsStyle
 
 nsChangeHint
 nsStyleTable::CalcDifference(const nsStyleTable& aNewData) const
 {
   if (mSpan != aNewData.mSpan ||
       mLayoutStrategy != aNewData.mLayoutStrategy) {
     return nsChangeHint::ReconstructFrame;
   }
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 // -----------------------
 // nsStyleTableBorder
 
 nsStyleTableBorder::nsStyleTableBorder(StyleStructContext aContext)
   : mBorderSpacingCol(0)
   , mBorderSpacingRow(0)
@@ -1747,17 +1747,17 @@ nsStyleTableBorder::CalcDifference(const
   if (mBorderCollapse != aNewData.mBorderCollapse) {
     return nsChangeHint::ReconstructFrame;
   }
 
   if ((mCaptionSide == aNewData.mCaptionSide) &&
       (mBorderSpacingCol == aNewData.mBorderSpacingCol) &&
       (mBorderSpacingRow == aNewData.mBorderSpacingRow)) {
     if (mEmptyCells == aNewData.mEmptyCells) {
-      return nsChangeHint(0);
+      return nsChangeHint::None;
     }
     return NS_STYLE_HINT_VISUAL;
   } else {
     return NS_STYLE_HINT_REFLOW;
   }
 }
 
 // --------------------
@@ -1775,17 +1775,17 @@ nsStyleColor::nsStyleColor(const nsStyle
 {
   MOZ_COUNT_CTOR(nsStyleColor);
 }
 
 nsChangeHint
 nsStyleColor::CalcDifference(const nsStyleColor& aNewData) const
 {
   if (mColor == aNewData.mColor) {
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
   return nsChangeHint::RepaintFrame;
 }
 
 // --------------------
 // nsStyleGradient
 //
 bool
@@ -2496,17 +2496,17 @@ nsStyleImageLayers::nsStyleImageLayers(c
     mCompositeCount = std::max(mCompositeCount, count);
   }
 }
 
 nsChangeHint
 nsStyleImageLayers::CalcDifference(const nsStyleImageLayers& aNewLayers,
                                    nsStyleImageLayers::LayerType aType) const
 {
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
 
   const nsStyleImageLayers& moreLayers =
     mImageCount > aNewLayers.mImageCount ?
       *this : aNewLayers;
   const nsStyleImageLayers& lessLayers =
     mImageCount > aNewLayers.mImageCount ?
       aNewLayers : *this;
 
@@ -2805,17 +2805,17 @@ nsStyleImageLayers::Layer::operator==(co
          mMaskMode == aOther.mMaskMode &&
          mComposite == aOther.mComposite &&
          DefinitelyEqualURIs(mSourceURI, aOther.mSourceURI);
 }
 
 nsChangeHint
 nsStyleImageLayers::Layer::CalcDifference(const nsStyleImageLayers::Layer& aNewLayer) const
 {
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
   if (!DefinitelyEqualURIs(mSourceURI, aNewLayer.mSourceURI)) {
     hint |= nsChangeHint::RepaintFrame | nsChangeHint::UpdateEffects;
 
     // If Layer::mSourceURI links to a SVG mask, it has a fragment. Not vice
     // versa. Here are examples of URI contains a fragment, two of them link
     // to a SVG mask:
     //   mask:url(a.svg#maskID); // The fragment of this URI is an ID of a mask
     //                           // element in a.svg.
@@ -2908,17 +2908,17 @@ nsStyleBackground::FinishStyle(nsPresCon
   MOZ_ASSERT(aPresContext->StyleSet()->IsServo());
 
   mImage.ResolveImages(aPresContext);
 }
 
 nsChangeHint
 nsStyleBackground::CalcDifference(const nsStyleBackground& aNewData) const
 {
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
   if (mBackgroundColor != aNewData.mBackgroundColor) {
     hint |= nsChangeHint::RepaintFrame;
   }
 
   hint |= mImage.CalcDifference(aNewData.mImage,
                                 nsStyleImageLayers::LayerType::Background);
 
   return hint;
@@ -3196,17 +3196,17 @@ nsStyleDisplay::nsStyleDisplay(const nsS
   , mShapeOutside(aSource.mShapeOutside)
 {
   MOZ_COUNT_CTOR(nsStyleDisplay);
 }
 
 nsChangeHint
 nsStyleDisplay::CalcDifference(const nsStyleDisplay& aNewData) const
 {
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
 
   if (!DefinitelyEqualURIsAndPrincipal(mBinding, aNewData.mBinding)
       || mPosition != aNewData.mPosition
       || mDisplay != aNewData.mDisplay
       || mContain != aNewData.mContain
       || (mFloat == StyleFloat::None) != (aNewData.mFloat == StyleFloat::None)
       || mOverflowX != aNewData.mOverflowX
       || mOverflowY != aNewData.mOverflowY
@@ -3293,17 +3293,17 @@ nsStyleDisplay::CalcDifference(const nsS
      * If so, we need to recompute its overflow rect (which probably changed
      * if the transform changed) and to redraw within the bounds of that new
      * overflow rect.
      *
      * If the property isn't present in either style struct, we still do the
      * comparisons but turn all the resulting change hints into
      * nsChangeHint::NeutralChange.
      */
-    nsChangeHint transformHint = nsChangeHint(0);
+    nsChangeHint transformHint = nsChangeHint::None;
 
     if (!mSpecifiedTransform != !aNewData.mSpecifiedTransform ||
         (mSpecifiedTransform &&
          *mSpecifiedTransform != *aNewData.mSpecifiedTransform)) {
       transformHint |= nsChangeHint::UpdateTransformLayer;
 
       if (mSpecifiedTransform &&
           aNewData.mSpecifiedTransform) {
@@ -3447,17 +3447,17 @@ nsStyleVisibility::nsStyleVisibility(con
   , mColorAdjust(aSource.mColorAdjust)
 {
   MOZ_COUNT_CTOR(nsStyleVisibility);
 }
 
 nsChangeHint
 nsStyleVisibility::CalcDifference(const nsStyleVisibility& aNewData) const
 {
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
 
   if (mDirection != aNewData.mDirection || mWritingMode != aNewData.mWritingMode) {
     // It's important that a change in mWritingMode results in frame
     // reconstruction, because it may affect intrinsic size (see
     // nsSubDocumentFrame::GetIntrinsicISize/BSize).
     hint |= nsChangeHint::ReconstructFrame;
   } else {
     if ((mImageOrientation != aNewData.mImageOrientation)) {
@@ -3652,17 +3652,17 @@ nsStyleContent::CalcDifference(const nsS
   // a simple reflow will not pick up different text or different image URLs,
   // since we set all that up in the CSSFrameConstructor
   if (mContents != aNewData.mContents ||
       mIncrements != aNewData.mIncrements ||
       mResets != aNewData.mResets) {
     return nsChangeHint::ReconstructFrame;
   }
 
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 // --------------------
 // nsStyleTextReset
 //
 
 nsStyleTextReset::nsStyleTextReset(StyleStructContext aContext)
   : mTextDecorationLine(NS_STYLE_TEXT_DECORATION_LINE_NONE)
@@ -3709,17 +3709,17 @@ nsStyleTextReset::CalcDifference(const n
   if (mTextDecorationColor != aNewData.mTextDecorationColor) {
     return nsChangeHint::RepaintFrame;
   }
 
   if (mTextOverflow != aNewData.mTextOverflow) {
     return nsChangeHint::RepaintFrame;
   }
 
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 // Returns true if the given shadow-arrays are equal.
 static bool
 AreShadowArraysEqual(nsCSSShadowArray* lhs,
                      nsCSSShadowArray* rhs)
 {
   if (lhs == rhs) {
@@ -3853,17 +3853,17 @@ nsStyleText::CalcDifference(const nsStyl
   if (HasTextEmphasis() != aNewData.HasTextEmphasis() ||
       (HasTextEmphasis() &&
        mTextEmphasisPosition != aNewData.mTextEmphasisPosition)) {
     // Text emphasis position change could affect line height calculation.
     return nsChangeHint_AllReflowHints |
            nsChangeHint::RepaintFrame;
   }
 
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
 
   // text-rendering changes require a reflow since they change SVG
   // frames' rects.
   if (mTextRendering != aNewData.mTextRendering) {
     hint |= nsChangeHint::NeedReflow |
             nsChangeHint::NeedDirtyReflow | // XXX remove me: bug 876085
             nsChangeHint::RepaintFrame;
   }
@@ -3890,17 +3890,17 @@ nsStyleText::CalcDifference(const nsStyl
   if (bool(hint)) {
     return hint;
   }
 
   if (mTextEmphasisPosition != aNewData.mTextEmphasisPosition) {
     return nsChangeHint::NeutralChange;
   }
 
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 LogicalSide
 nsStyleText::TextEmphasisSide(WritingMode aWM) const
 {
   MOZ_ASSERT(
     (!(mTextEmphasisPosition & NS_STYLE_TEXT_EMPHASIS_POSITION_LEFT) !=
      !(mTextEmphasisPosition & NS_STYLE_TEXT_EMPHASIS_POSITION_RIGHT)) &&
@@ -4000,17 +4000,17 @@ nsStyleUserInterface::FinishStyle(nsPres
       cursor.mImage->Resolve(aPresContext);
     }
   }
 }
 
 nsChangeHint
 nsStyleUserInterface::CalcDifference(const nsStyleUserInterface& aNewData) const
 {
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
   if (mCursor != aNewData.mCursor) {
     hint |= nsChangeHint::UpdateCursor;
   }
 
   // We could do better. But it wouldn't be worth it, URL-specified cursors are
   // rare.
   if (mCursorImages != aNewData.mCursorImages) {
     hint |= nsChangeHint::UpdateCursor;
@@ -4089,17 +4089,17 @@ nsStyleUIReset::CalcDifference(const nsS
   if (mUserSelect != aNewData.mUserSelect) {
     return NS_STYLE_HINT_VISUAL;
   }
 
   if (mWindowDragging != aNewData.mWindowDragging) {
     return nsChangeHint::SchedulePaint;
   }
 
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 //-----------------------
 // nsStyleVariables
 //
 
 nsStyleVariables::nsStyleVariables(StyleStructContext aContext)
 {
@@ -4115,17 +4115,17 @@ nsStyleVariables::nsStyleVariables(const
 nsStyleVariables::~nsStyleVariables()
 {
   MOZ_COUNT_DTOR(nsStyleVariables);
 }
 
 nsChangeHint
 nsStyleVariables::CalcDifference(const nsStyleVariables& aNewData) const
 {
-  return nsChangeHint(0);
+  return nsChangeHint::None;
 }
 
 //-----------------------
 // nsStyleEffects
 //
 
 nsStyleEffects::nsStyleEffects(StyleStructContext aContext)
   : mBoxShadow(nullptr)
@@ -4151,17 +4151,17 @@ nsStyleEffects::nsStyleEffects(const nsS
 nsStyleEffects::~nsStyleEffects()
 {
   MOZ_COUNT_DTOR(nsStyleEffects);
 }
 
 nsChangeHint
 nsStyleEffects::CalcDifference(const nsStyleEffects& aNewData) const
 {
-  nsChangeHint hint = nsChangeHint(0);
+  nsChangeHint hint = nsChangeHint::None;
 
   if (!AreShadowArraysEqual(mBoxShadow, aNewData.mBoxShadow)) {
     // Update overflow regions & trigger DLBI to be sure it's noticed.
     // Also request a repaint, since it's possible that only the color
     // of the shadow is changing (and UpdateOverflow/SchedulePaint won't
     // repaint for that, since they won't know what needs invalidating.)
     hint |= nsChangeHint::UpdateOverflow |
             nsChangeHint::SchedulePaint |
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -571,17 +571,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
 
   nsChangeHint CalcDifference(const nsStyleColor& aNewData) const;
   static nsChangeHint MaxDifference() {
     return nsChangeHint::RepaintFrame;
   }
   static nsChangeHint DifferenceAlwaysHandledForDescendants() {
     // CalcDifference never returns the reflow hints that are sometimes
     // handled for descendants at all.
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
 
   void* operator new(size_t sz, nsStyleColor* aSelf) { return aSelf; }
   void* operator new(size_t sz, nsPresContext* aContext) {
     return aContext->PresShell()->
       AllocateByObjectID(mozilla::eArenaObjectID_nsStyleColor, sz);
   }
   void Destroy(nsPresContext* aContext) {
@@ -928,17 +928,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
      return nsChangeHint::UpdateEffects |
             nsChangeHint::RepaintFrame |
             nsChangeHint::UpdateBackgroundPosition |
             nsChangeHint::NeutralChange;
   }
   static nsChangeHint DifferenceAlwaysHandledForDescendants() {
     // CalcDifference never returns the reflow hints that are sometimes
     // handled for descendants at all.
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
 
   // True if this background is completely transparent.
   bool IsTransparent() const;
 
   // We have to take slower codepaths for fixed background attachment,
   // but we don't want to do that when there's no image.
   // Not inline because it uses an nsCOMPtr<imgIRequest>
@@ -980,17 +980,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   static nsChangeHint MaxDifference() {
     return nsChangeHint::NeedReflow |
            nsChangeHint::ReflowChangesSizeOrPosition |
            nsChangeHint::ClearAncestorIntrinsics;
   }
   static nsChangeHint DifferenceAlwaysHandledForDescendants() {
     // CalcDifference can return all of the reflow hints sometimes not
     // handled for descendants as hints not handled for descendants.
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
 
   bool GetMargin(nsMargin& aMargin) const
   {
     if (!mMargin.ConvertsToLength()) {
       return false;
     }
 
@@ -1032,17 +1032,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
     // CalcDifference can return nsChangeHint::ClearAncestorIntrinsics as
     // a hint not handled for descendants.  We could (and perhaps
     // should) return nsChangeHint::NeedReflow and
     // nsChangeHint::ReflowChangesSizeOrPosition as always handled for
     // descendants, but since they're always returned in conjunction
     // with nsChangeHint::ClearAncestorIntrinsics (which is not), it
     // won't ever lead to any optimization in
     // nsStyleContext::CalcStyleDifference.
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
 
   nsStyleSides  mPadding;         // [reset] coord, percent, calc
 
   bool IsWidthDependent() const {
     return !mPadding.ConvertsToLength();
   }
 
@@ -1468,17 +1468,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
     return nsChangeHint::UpdateOverflow |
            nsChangeHint::SchedulePaint |
            nsChangeHint::RepaintFrame |
            nsChangeHint::NeutralChange;
   }
   static nsChangeHint DifferenceAlwaysHandledForDescendants() {
     // CalcDifference never returns the reflow hints that are sometimes
     // handled for descendants at all.
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
 
   nsStyleCorners  mOutlineRadius; // [reset] coord, percent, calc
 
   // This is the specified value of outline-width, but with length values
   // computed to absolute.  mActualOutlineWidth stores the outline-width
   // value used by layout.  (We must store mOutlineWidth for the same
   // style struct resolution reasons that we do nsStyleBorder::mBorder;
@@ -1769,17 +1769,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
            nsChangeHint::RecomputePosition |
            nsChangeHint::UpdateParentOverflow |
            nsChangeHint::UpdateComputedBSize;
   }
   static nsChangeHint DifferenceAlwaysHandledForDescendants() {
     // CalcDifference can return all of the reflow hints that are
     // sometimes handled for descendants as hints not handled for
     // descendants.
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
 
   /**
    * Return the used value for 'align-self' given our parent StyleContext
    * aParent (or null for the root).
    */
   uint8_t UsedAlignSelf(nsStyleContext* aParent) const;
 
@@ -2783,17 +2783,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
            nsChangeHint::UpdateContainingBlock |
            nsChangeHint::AddOrRemoveTransform |
            nsChangeHint::NeutralChange;
   }
   static nsChangeHint DifferenceAlwaysHandledForDescendants() {
     // CalcDifference can return all of the reflow hints that are
     // sometimes handled for descendants as hints not handled for
     // descendants.
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
 
   // We guarantee that if mBinding is non-null, so are mBinding->GetURI() and
   // mBinding->mOriginPrincipal.
   RefPtr<mozilla::css::URLValue> mBinding; // [reset]
   mozilla::StyleDisplay mDisplay;          // [reset] see nsStyleConsts.h StyleDisplay
   mozilla::StyleDisplay mOriginalDisplay;  // [reset] saved mDisplay for
                                            //         position:absolute/fixed
@@ -3086,17 +3086,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
 
   nsChangeHint CalcDifference(const nsStyleTable& aNewData) const;
   static nsChangeHint MaxDifference() {
     return nsChangeHint::ReconstructFrame;
   }
   static nsChangeHint DifferenceAlwaysHandledForDescendants() {
     // CalcDifference never returns the reflow hints that are sometimes
     // handled for descendants as hints not handled for descendants.
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
 
   uint8_t       mLayoutStrategy;// [reset] see nsStyleConsts.h NS_STYLE_TABLE_LAYOUT_*
   int32_t       mSpan;          // [reset] the number of columns spanned by a colgroup or col
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleTableBorder
 {
@@ -3817,22 +3817,22 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
   void Destroy(nsPresContext* aContext) {
     this->~nsStyleVariables();
     aContext->PresShell()->
       FreeByObjectID(mozilla::eArenaObjectID_nsStyleVariables, this);
   }
 
   nsChangeHint CalcDifference(const nsStyleVariables& aNewData) const;
   static nsChangeHint MaxDifference() {
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
   static nsChangeHint DifferenceAlwaysHandledForDescendants() {
     // CalcDifference never returns nsChangeHint::NeedReflow or
     // nsChangeHint::ClearAncestorIntrinsics at all.
-    return nsChangeHint(0);
+    return nsChangeHint::None;
   }
 
   mozilla::CSSVariableValues mVariables;
 };
 
 struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleEffects
 {
   explicit nsStyleEffects(StyleStructContext aContext);