Bug 1301258 - Part 1.5: Tweak some comments around change hints. r=dbaron draft
authorCameron McCormack <cam@mcc.id.au>
Mon, 20 Mar 2017 16:29:32 +0800
changeset 501418 802e532de182f62af71d982d5e2153831fd60109
parent 501417 426b656b5aafc0bd72fdcfd1e1849f20f6752b92
child 501419 737b1bc24a1a5b5f25e5517db26235ed8a27a7a0
push id49976
push userbmo:cam@mcc.id.au
push dateMon, 20 Mar 2017 08:30:15 +0000
reviewersdbaron
bugs1301258
milestone55.0a1
Bug 1301258 - Part 1.5: Tweak some comments around change hints. r=dbaron MozReview-Commit-ID: Gze6SFaXvSA
layout/base/GeckoRestyleManager.cpp
layout/base/nsChangeHint.h
--- a/layout/base/GeckoRestyleManager.cpp
+++ b/layout/base/GeckoRestyleManager.cpp
@@ -1303,19 +1303,19 @@ ElementRestyler::CaptureChange(nsStyleCo
                (ourChange & nsChangeHint_NeedReflow),
                "Reflow hint bits set without actually asking for a reflow");
 
   LOG_RESTYLE("CaptureChange, ourChange = %s, aChangeToAssume = %s",
               GeckoRestyleManager::ChangeHintToString(ourChange).get(),
               GeckoRestyleManager::ChangeHintToString(aChangeToAssume).get());
   LOG_RESTYLE_INDENT();
 
-  // nsChangeHint_UpdateEffects is inherited, but it can be set due to changes
-  // in inherited properties (fill and stroke).  Avoid propagating it into
-  // text nodes.
+  // nsChangeHint_UpdateEffects is not handled for descendants, but it can be
+  // set due to changes in inherited properties (fill and stroke).  Avoid
+  // propagating it into text nodes.
   if ((ourChange & nsChangeHint_UpdateEffects) &&
       mContent && !mContent->IsElement()) {
     ourChange &= ~nsChangeHint_UpdateEffects;
   }
 
   ourChange |= aChangeToAssume;
   if (!NS_IsHintSubset(ourChange, mHintsHandled)) {
     mHintsHandled |= ourChange;
--- a/layout/base/nsChangeHint.h
+++ b/layout/base/nsChangeHint.h
@@ -28,22 +28,23 @@ enum nsChangeHint {
   // just do a FrameNeedsReflow.
   nsChangeHint_NeedReflow = 1 << 1,
 
   // Invalidate intrinsic widths on the frame's ancestors.  Must not be set
   // without setting nsChangeHint_NeedReflow.
   nsChangeHint_ClearAncestorIntrinsics = 1 << 2,
 
   // Invalidate intrinsic widths on the frame's descendants.  Must not be set
-  // without also setting nsChangeHint_ClearAncestorIntrinsics.
+  // without also setting nsChangeHint_ClearAncestorIntrinsics,
+  // nsChangeHint_NeedDirtyReflow and nsChangeHint_NeedReflow.
   nsChangeHint_ClearDescendantIntrinsics = 1 << 3,
 
   // Force unconditional reflow of all descendants.  Must not be set without
-  // setting nsChangeHint_NeedReflow, but is independent of both the
-  // Clear*Intrinsics flags.
+  // setting nsChangeHint_NeedReflow, but can be set regardless of whether the
+  // Clear*Intrinsics flags are set.
   nsChangeHint_NeedDirtyReflow = 1 << 4,
 
   // change requires view to be updated, if there is one (e.g., clip:).
   // Updates all descendants (including following placeholders to out-of-flows).
   nsChangeHint_SyncFrameView = 1 << 5,
 
   // The currently shown mouse cursor needs to be updated
   nsChangeHint_UpdateCursor = 1 << 6,
@@ -180,22 +181,24 @@ enum nsChangeHint {
   /**
    * This will cause rendering observers to be invalidated.
    */
   nsChangeHint_InvalidateRenderingObservers = 1 << 22,
 
   /**
    * Indicates that the reflow changes the size or position of the
    * element, and thus the reflow must start from at least the frame's
-   * parent.
+   * parent.  Must be not be set without also setting nsChangeHint_NeedReflow
+   * and nsChangeHint_ClearAncestorIntrinsics.
    */
   nsChangeHint_ReflowChangesSizeOrPosition = 1 << 23,
 
   /**
    * Indicates that the style changes the computed BSize --- e.g. 'height'.
+   * Must not be set without also setting nsChangeHint_NeedReflow.
    */
   nsChangeHint_UpdateComputedBSize = 1 << 24,
 
   /**
    * Indicates that the 'opacity' property changed between 1 and non-1.
    *
    * Used as extra data for handling UpdateOpacityLayer hints.
    *