Bug 1301258 - Part 1.5: Tweak some comments around change hints. r=dbaron
MozReview-Commit-ID: Gze6SFaXvSA
--- 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.
*