--- a/dom/animation/KeyframeEffectReadOnly.cpp
+++ b/dom/animation/KeyframeEffectReadOnly.cpp
@@ -1425,17 +1425,17 @@ KeyframeEffectReadOnly::CalculateCumulat
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 ||
segment.mToComposite != CompositeOperation::Replace) {
- mCumulativeChangeHint = ~nsChangeHint_Hints_CanIgnoreIfNotVisible;
+ mCumulativeChangeHint = ~nsChangeHint::CanIgnoreIfNotVisibleHints;
return;
}
RefPtr<nsStyleContext> fromContext =
CreateStyleContextForAnimationValue(property.mProperty,
segment.mFromValue, aStyleContext);
RefPtr<nsStyleContext> toContext =
CreateStyleContextForAnimationValue(property.mProperty,
@@ -1491,17 +1491,17 @@ KeyframeEffectReadOnly::CanIgnoreIfNotVi
nsPresContext* presContext = GetPresContext();
if (!presContext || presContext->StyleSet()->IsServo()) {
return false;
}
// FIXME: For further sophisticated optimization we need to check
// change hint on the segment corresponding to computedTiming.progress.
return NS_IsHintSubset(
- mCumulativeChangeHint, nsChangeHint_Hints_CanIgnoreIfNotVisible);
+ mCumulativeChangeHint, nsChangeHint::CanIgnoreIfNotVisibleHints);
}
void
KeyframeEffectReadOnly::MaybeUpdateFrameForCompositor()
{
nsIFrame* frame = GetAnimationFrame();
if (!frame) {
return;
--- a/dom/base/Location.cpp
+++ b/dom/base/Location.cpp
@@ -794,17 +794,17 @@ Location::Reload(bool aForceget)
// page since some sites may use this trick to work around gecko
// reflow bugs, and this should have the same effect.
nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
nsIPresShell *shell;
nsPresContext *pcx;
if (doc && (shell = doc->GetShell()) && (pcx = shell->GetPresContext())) {
- pcx->RebuildAllStyleData(NS_STYLE_HINT_REFLOW, eRestyle_Subtree);
+ pcx->RebuildAllStyleData(nsChangeHint::ReflowHints, eRestyle_Subtree);
}
return NS_OK;
}
if (webNav) {
uint32_t reloadFlags = nsIWebNavigation::LOAD_FLAGS_NONE;
--- a/dom/base/nsHistory.cpp
+++ b/dom/base/nsHistory.cpp
@@ -189,17 +189,17 @@ nsHistory::Go(int32_t aDelta, ErrorResul
// trick to work around gecko reflow bugs, and this should have
// the same effect.
nsCOMPtr<nsIDocument> doc = window->GetExtantDoc();
nsIPresShell *shell;
nsPresContext *pcx;
if (doc && (shell = doc->GetShell()) && (pcx = shell->GetPresContext())) {
- pcx->RebuildAllStyleData(NS_STYLE_HINT_REFLOW, eRestyle_Subtree);
+ pcx->RebuildAllStyleData(nsChangeHint::ReflowHints, eRestyle_Subtree);
}
return;
}
}
nsCOMPtr<nsISHistory> session_history = GetSessionHistory();
nsCOMPtr<nsIWebNavigation> webnav(do_QueryInterface(session_history));
--- a/dom/html/HTMLCanvasElement.cpp
+++ b/dom/html/HTMLCanvasElement.cpp
@@ -595,20 +595,20 @@ nsChangeHint
HTMLCanvasElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
int32_t aModType) const
{
nsChangeHint retval =
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::width ||
aAttribute == nsGkAtoms::height)
{
- retval |= NS_STYLE_HINT_REFLOW;
+ retval |= nsChangeHint::ReflowHints;
} else if (aAttribute == nsGkAtoms::moz_opaque)
{
- retval |= NS_STYLE_HINT_VISUAL;
+ retval |= nsChangeHint::VisualHints;
}
return retval;
}
bool
HTMLCanvasElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
--- a/dom/html/HTMLFrameSetElement.cpp
+++ b/dom/html/HTMLFrameSetElement.cpp
@@ -73,17 +73,17 @@ HTMLFrameSetElement::SetAttr(int32_t aNa
{
nsresult rv;
/* The main goal here is to see whether the _number_ of rows or
* columns has changed. If it has, we need to reframe; otherwise
* we want to reflow. So we set mCurrentRowColHint here, then call
* nsGenericHTMLElement::SetAttr, which will end up calling
* GetAttributeChangeHint and notifying layout with that hint.
* Once nsGenericHTMLElement::SetAttr returns, we want to go back to our
- * normal hint, which is NS_STYLE_HINT_REFLOW.
+ * normal hint, which is nsChangeHint::ReflowHints.
*/
if (aAttribute == nsGkAtoms::rows && aNameSpaceID == kNameSpaceID_None) {
int32_t oldRows = mNumRows;
ParseRowCol(aValue, mNumRows, &mRowSpecs);
if (mNumRows != oldRows) {
mCurrentRowColHint = nsChangeHint::ReconstructFrame;
}
@@ -94,17 +94,17 @@ HTMLFrameSetElement::SetAttr(int32_t aNa
if (mNumCols != oldCols) {
mCurrentRowColHint = nsChangeHint::ReconstructFrame;
}
}
rv = nsGenericHTMLElement::SetAttr(aNameSpaceID, aAttribute, aPrefix,
aValue, aNotify);
- mCurrentRowColHint = NS_STYLE_HINT_REFLOW;
+ mCurrentRowColHint = nsChangeHint::ReflowHints;
return rv;
}
nsresult
HTMLFrameSetElement::GetRowSpec(int32_t *aNumValues,
const nsFramesetSpec** aSpecs)
{
--- a/dom/html/HTMLFrameSetElement.h
+++ b/dom/html/HTMLFrameSetElement.h
@@ -47,17 +47,17 @@ class OnBeforeUnloadEventHandlerNonNull;
class HTMLFrameSetElement final : public nsGenericHTMLElement,
public nsIDOMHTMLFrameSetElement
{
public:
explicit HTMLFrameSetElement(already_AddRefed<mozilla::dom::NodeInfo>& aNodeInfo)
: nsGenericHTMLElement(aNodeInfo),
mNumRows(0),
mNumCols(0),
- mCurrentRowColHint(NS_STYLE_HINT_REFLOW)
+ mCurrentRowColHint(nsChangeHint::ReflowHints)
{
SetHasWeirdParserInsertionMode();
}
NS_IMPL_FROMCONTENT_HTML_WITH_TAG(HTMLFrameSetElement, frameset)
// nsISupports
NS_DECL_ISUPPORTS_INHERITED
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -5835,20 +5835,20 @@ HTMLInputElement::GetAttributeChangeHint
retval |= nsChangeHint::ReconstructFrame;
} else if (mType == NS_FORM_INPUT_IMAGE &&
(aAttribute == nsGkAtoms::alt ||
aAttribute == nsGkAtoms::value)) {
// We might need to rebuild our alt text. Just go ahead and
// reconstruct our frame. This should be quite rare..
retval |= nsChangeHint::ReconstructFrame;
} else if (aAttribute == nsGkAtoms::value) {
- retval |= NS_STYLE_HINT_REFLOW;
+ retval |= nsChangeHint::ReflowHints;
} else if (aAttribute == nsGkAtoms::size &&
IsSingleLineTextControl(false)) {
- retval |= NS_STYLE_HINT_REFLOW;
+ retval |= nsChangeHint::ReflowHints;
} else if (PlaceholderApplies() && aAttribute == nsGkAtoms::placeholder) {
retval |= nsChangeHint::ReconstructFrame;
}
return retval;
}
NS_IMETHODIMP_(bool)
HTMLInputElement::IsAttributeMapped(const nsIAtom* aAttribute) const
--- a/dom/html/HTMLLegendElement.cpp
+++ b/dom/html/HTMLLegendElement.cpp
@@ -60,17 +60,17 @@ HTMLLegendElement::ParseAttribute(int32_
nsChangeHint
HTMLLegendElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
int32_t aModType) const
{
nsChangeHint retval =
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::align) {
- retval |= NS_STYLE_HINT_REFLOW;
+ retval |= nsChangeHint::ReflowHints;
}
return retval;
}
nsresult
HTMLLegendElement::SetAttr(int32_t aNameSpaceID, nsIAtom* aAttribute,
nsIAtom* aPrefix, const nsAString& aValue,
bool aNotify)
--- a/dom/html/HTMLOptionElement.cpp
+++ b/dom/html/HTMLOptionElement.cpp
@@ -169,17 +169,17 @@ nsChangeHint
HTMLOptionElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
int32_t aModType) const
{
nsChangeHint retval =
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::label ||
aAttribute == nsGkAtoms::text) {
- retval |= NS_STYLE_HINT_REFLOW;
+ retval |= nsChangeHint::ReflowHints;
}
return retval;
}
nsresult
HTMLOptionElement::BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
nsAttrValueOrString* aValue,
bool aNotify)
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -457,17 +457,17 @@ HTMLTextAreaElement::MapAttributesIntoRu
nsChangeHint
HTMLTextAreaElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
int32_t aModType) const
{
nsChangeHint retval =
nsGenericHTMLFormElementWithState::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::rows ||
aAttribute == nsGkAtoms::cols) {
- retval |= NS_STYLE_HINT_REFLOW;
+ retval |= nsChangeHint::ReflowHints;
} else if (aAttribute == nsGkAtoms::wrap) {
retval |= nsChangeHint::ReconstructFrame;
} else if (aAttribute == nsGkAtoms::placeholder) {
retval |= nsChangeHint::ReconstructFrame;
}
return retval;
}
--- a/dom/xul/nsXULElement.cpp
+++ b/dom/xul/nsXULElement.cpp
@@ -1471,17 +1471,17 @@ nsXULElement::GetAttributeChangeHint(con
// details.)
retval = nsChangeHint::ReconstructFrame;
} else {
// if left or top changes we reflow. This will happen in xul
// containers that manage positioned children such as a stack.
if (nsGkAtoms::left == aAttribute || nsGkAtoms::top == aAttribute ||
nsGkAtoms::right == aAttribute || nsGkAtoms::bottom == aAttribute ||
nsGkAtoms::start == aAttribute || nsGkAtoms::end == aAttribute)
- retval = NS_STYLE_HINT_REFLOW;
+ retval = nsChangeHint::ReflowHints;
}
return retval;
}
NS_IMETHODIMP_(bool)
nsXULElement::IsAttributeMapped(const nsIAtom* aAttribute) const
{
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -1446,17 +1446,17 @@ ElementRestyler::ElementRestyler(const E
// mHintsHandled already includes nsChangeHint::AllReflowHints we
// don't want to pass that on to the out-of-flow reresolve, since
// that can lead to the out-of-flow not getting reflowed when it
// should be (eg a reresolve starting at <body> that involves
// reflowing the <body> would miss reflowing fixed-pos nodes that
// also need reflow). In the cases when the out-of-flow _is_ a
// geometric descendant of a frame we already have a reflow hint
// for, reflow coalescing should keep us from doing the work twice.
- mHintsHandled &= ~nsChangeHint_AllReflowHints;
+ mHintsHandled &= ~nsChangeHint::AllReflowHints;
}
}
ElementRestyler::ElementRestyler(ParentContextFromChildFrame,
const ElementRestyler& aParentRestyler,
nsIFrame* aFrame)
: mPresContext(aParentRestyler.mPresContext)
, mFrame(aFrame)
@@ -1464,17 +1464,17 @@ ElementRestyler::ElementRestyler(ParentC
// 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(
// assume the worst
- nsChangeHint_Hints_NotHandledForDescendants)
+ NS_CHANGE_HINT_NOT_HANDLED_FOR_DESCENDANTS)
, mHintsNotHandledForDescendants(nsChangeHint::None)
, mRestyleTracker(aParentRestyler.mRestyleTracker)
, mSelectorsForDescendants(aParentRestyler.mSelectorsForDescendants)
, mTreeMatchContext(aParentRestyler.mTreeMatchContext)
, mResolvedChild(nullptr)
, mContextsToClear(aParentRestyler.mContextsToClear)
, mSwappedStructOwners(aParentRestyler.mSwappedStructOwners)
, mIsRootOfRestyle(false)
@@ -1595,17 +1595,17 @@ ElementRestyler::CaptureChange(nsStyleCo
NS_ASSERTION(aOldContext->GetPseudoType() == aNewContext->GetPseudoType(),
"old and new style contexts should have the same pseudo");
nsChangeHint ourChange =
aOldContext->CalcStyleDifference(aNewContext,
mParentFrameHintsNotHandledForDescendants,
aEqualStructs,
aSamePointerStructs);
- NS_ASSERTION(!(ourChange & nsChangeHint_AllReflowHints) ||
+ NS_ASSERTION(!(ourChange & nsChangeHint::AllReflowHints) ||
(ourChange & nsChangeHint::NeedReflow),
"Reflow hint bits set without actually asking for a reflow");
LOG_RESTYLE("CaptureChange, ourChange = %s, aChangeToAssume = %s",
RestyleManager::ChangeHintToString(ourChange).get(),
RestyleManager::ChangeHintToString(aChangeToAssume).get());
LOG_RESTYLE_INDENT();
@@ -2762,17 +2762,17 @@ ElementRestyler::RestyleSelf(nsIFrame* a
result = RestyleResult::eContinue;
canStopWithStyleChange = false;
}
if (providerFrame != aSelf->GetParent()) {
// We don't actually know what the parent style context's
// non-inherited hints were, so assume the worst.
mParentFrameHintsNotHandledForDescendants =
- nsChangeHint_Hints_NotHandledForDescendants;
+ NS_CHANGE_HINT_NOT_HANDLED_FOR_DESCENDANTS;
}
LOG_RESTYLE("parentContext = %p", parentContext);
// do primary context
RefPtr<nsStyleContext> newContext;
nsIFrame* prevContinuation =
GetPrevContinuationWithPossiblySameStyle(aSelf);
--- a/layout/base/RestyleManagerBase.cpp
+++ b/layout/base/RestyleManagerBase.cpp
@@ -159,37 +159,37 @@ RestyleManagerBase::ChangeHintToString(n
static_assert(static_cast<nsChangeHintTypeBase>(nsChangeHint::AllChangeHints)
== (1 << ArrayLength(names)) - 1,
"Name list doesn't match change hints.");
uint32_t hint = static_cast<nsChangeHintTypeBase>(aHint) &
((1 << ArrayLength(names)) - 1);
uint32_t rest = static_cast<nsChangeHintTypeBase>(aHint) &
~((1 << ArrayLength(names)) - 1);
if (hint == static_cast<nsChangeHintTypeBase>(
- nsChangeHint_Hints_NotHandledForDescendants)) {
- result.AppendLiteral("nsChangeHint_Hints_NotHandledForDescendants");
+ NS_CHANGE_HINT_NOT_HANDLED_FOR_DESCENDANTS)) {
+ result.AppendLiteral("NS_CHANGE_HINT_NOT_HANDLED_FOR_DESCENDANTS");
hint = 0;
any = true;
} else {
const uint32_t reflowHint =
- static_cast<nsChangeHintTypeBase>(NS_STYLE_HINT_REFLOW);
+ static_cast<nsChangeHintTypeBase>(nsChangeHint::ReflowHints);
const uint32_t allReflowHint =
- static_cast<nsChangeHintTypeBase>(nsChangeHint_AllReflowHints);
+ static_cast<nsChangeHintTypeBase>(nsChangeHint::AllReflowHints);
const uint32_t visualHint =
- static_cast<nsChangeHintTypeBase>(NS_STYLE_HINT_VISUAL);
+ static_cast<nsChangeHintTypeBase>(nsChangeHint::VisualHints);
if ((hint & reflowHint) == reflowHint) {
- result.AppendLiteral("NS_STYLE_HINT_REFLOW");
+ result.AppendLiteral("nsChangeHint::ReflowHints");
hint = hint & ~reflowHint;
any = true;
} else if ((hint & allReflowHint) == allReflowHint) {
- result.AppendLiteral("nsChangeHint_AllReflowHints");
+ result.AppendLiteral("nsChangeHint::AllReflowHints");
hint = hint & ~allReflowHint;
any = true;
} else if ((hint & visualHint) == visualHint) {
- result.AppendLiteral("NS_STYLE_HINT_VISUAL");
+ result.AppendLiteral("nsChangeHint::VisualHints");
hint = hint & ~visualHint;
any = true;
}
}
for (uint32_t i = 0; i < ArrayLength(names); i++) {
if (hint & (1 << i)) {
if (any) {
result.AppendLiteral(" | ");
@@ -1096,17 +1096,17 @@ RestyleManagerBase::ProcessRestyledFrame
bool didUpdateCursor = false;
for (const nsStyleChangeData& data : aChangeList) {
nsIFrame* frame = data.mFrame;
nsIContent* content = data.mContent;
nsChangeHint hint = data.mHint;
bool didReflowThisFrame = false;
- NS_ASSERTION(!(hint & nsChangeHint_AllReflowHints) ||
+ NS_ASSERTION(!(hint & nsChangeHint::AllReflowHints) ||
(hint & nsChangeHint::NeedReflow),
"Reflow hint bits set without actually asking for a reflow");
// skip any frame that has been destroyed due to a ripple effect
if (frame && !propTable->Get(frame, ChangeListProperty())) {
continue;
}
--- a/layout/base/nsChangeHint.h
+++ b/layout/base/nsChangeHint.h
@@ -226,16 +226,32 @@ enum class nsChangeHint : nsChangeHintTy
// to add them to NS_HintsNotHandledForDescendantsIn() below. Please
// also add them to RestyleManager::ChangeHintToString and modify
// nsChangeHint::AllChangeHints below accordingly.
/**
* Dummy hint value for all hints. It exists for compile time check.
*/
AllChangeHints = (1 << 28) - 1,
+
+ /*
+ * Useful unions:
+ */
+ VisualHints = RepaintFrame | SyncFrameView | SchedulePaint,
+ AllReflowHints = NeedReflow |
+ ReflowChangesSizeOrPosition |
+ ClearAncestorIntrinsics |
+ ClearDescendantIntrinsics |
+ NeedDirtyReflow,
+ ReflowHints = VisualHints | AllReflowHints,
+ CanIgnoreIfNotVisibleHints = VisualHints |
+ NeutralChange |
+ UpdateOpacityLayer |
+ UpdateTransformLayer |
+ UpdateUsesOpacity,
};
MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(nsChangeHint)
// Redefine these operators to return nothing. This will catch any use
// of these operators on hints. We should not be using these operators
// on nsChangeHints
inline void operator<(nsChangeHint s1, nsChangeHint s2) {}
@@ -257,35 +273,35 @@ inline bool NS_IsHintSubset(nsChangeHint
* We have an optimization when processing change hints which prevents
* us from visiting the descendants of a node when a hint on that node
* is being processed. This optimization does not apply in some of the
* cases where applying a hint to an element does not necessarily result
* in the same hint being handled on the descendants.
*/
// The most hints that NS_HintsNotHandledForDescendantsIn could possibly return:
-#define nsChangeHint_Hints_NotHandledForDescendants nsChangeHint( \
- nsChangeHint::UpdateTransformLayer | \
- nsChangeHint::UpdateEffects | \
- nsChangeHint::InvalidateRenderingObservers | \
- nsChangeHint::UpdateOpacityLayer | \
- nsChangeHint::UpdateOverflow | \
- nsChangeHint::UpdatePostTransformOverflow | \
- nsChangeHint::UpdateParentOverflow | \
- nsChangeHint::ChildrenOnlyTransform | \
- nsChangeHint::RecomputePosition | \
- nsChangeHint::UpdateContainingBlock | \
- nsChangeHint::AddOrRemoveTransform | \
- nsChangeHint::BorderStyleNoneChange | \
- nsChangeHint::NeedReflow | \
- nsChangeHint::ReflowChangesSizeOrPosition | \
- nsChangeHint::ClearAncestorIntrinsics | \
- nsChangeHint::UpdateComputedBSize | \
- nsChangeHint::UpdateUsesOpacity | \
- nsChangeHint::UpdateBackgroundPosition)
+#define NS_CHANGE_HINT_NOT_HANDLED_FOR_DESCENDANTS \
+ nsChangeHint(nsChangeHint::UpdateTransformLayer | \
+ nsChangeHint::UpdateEffects | \
+ nsChangeHint::InvalidateRenderingObservers | \
+ nsChangeHint::UpdateOpacityLayer | \
+ nsChangeHint::UpdateOverflow | \
+ nsChangeHint::UpdatePostTransformOverflow | \
+ nsChangeHint::UpdateParentOverflow | \
+ nsChangeHint::ChildrenOnlyTransform | \
+ nsChangeHint::RecomputePosition | \
+ nsChangeHint::UpdateContainingBlock | \
+ nsChangeHint::AddOrRemoveTransform | \
+ nsChangeHint::BorderStyleNoneChange | \
+ nsChangeHint::NeedReflow | \
+ nsChangeHint::ReflowChangesSizeOrPosition | \
+ nsChangeHint::ClearAncestorIntrinsics | \
+ nsChangeHint::UpdateComputedBSize | \
+ nsChangeHint::UpdateUsesOpacity | \
+ nsChangeHint::UpdateBackgroundPosition)
inline nsChangeHint NS_HintsNotHandledForDescendantsIn(nsChangeHint aChangeHint) {
nsChangeHint result = aChangeHint & (
nsChangeHint::UpdateTransformLayer |
nsChangeHint::UpdateEffects |
nsChangeHint::InvalidateRenderingObservers |
nsChangeHint::UpdateOpacityLayer |
nsChangeHint::UpdateOverflow |
@@ -318,43 +334,22 @@ inline nsChangeHint NS_HintsNotHandledFo
if (!NS_IsHintSubset(nsChangeHint::ClearDescendantIntrinsics, aChangeHint) &&
NS_IsHintSubset(nsChangeHint::ClearAncestorIntrinsics, aChangeHint)) {
// If ClearDescendantIntrinsics is *not* set, then
// ClearAncestorIntrinsics is a non-inherited hint.
result |= nsChangeHint::ClearAncestorIntrinsics;
}
MOZ_ASSERT(NS_IsHintSubset(result,
- nsChangeHint_Hints_NotHandledForDescendants),
+ NS_CHANGE_HINT_NOT_HANDLED_FOR_DESCENDANTS),
"something is inconsistent");
return result;
}
-// Redefine the old NS_STYLE_HINT constants in terms of the new hint structure
-#define NS_STYLE_HINT_VISUAL \
- nsChangeHint(nsChangeHint::RepaintFrame | \
- nsChangeHint::SyncFrameView | \
- nsChangeHint::SchedulePaint)
-#define nsChangeHint_AllReflowHints \
- nsChangeHint(nsChangeHint::NeedReflow | \
- nsChangeHint::ReflowChangesSizeOrPosition| \
- nsChangeHint::ClearAncestorIntrinsics | \
- nsChangeHint::ClearDescendantIntrinsics | \
- nsChangeHint::NeedDirtyReflow)
-#define NS_STYLE_HINT_REFLOW \
- nsChangeHint(NS_STYLE_HINT_VISUAL | nsChangeHint_AllReflowHints)
-
-#define nsChangeHint_Hints_CanIgnoreIfNotVisible \
- nsChangeHint(NS_STYLE_HINT_VISUAL | \
- nsChangeHint::NeutralChange | \
- nsChangeHint::UpdateOpacityLayer | \
- nsChangeHint::UpdateTransformLayer | \
- nsChangeHint::UpdateUsesOpacity)
-
/**
* |nsRestyleHint| is a bitfield for the result of
* |HasStateDependentStyle| and |HasAttributeDependentStyle|. When no
* restyling is necessary, use |nsRestyleHint(0)|.
*
* Without eRestyle_Force or eRestyle_ForceDescendants, the restyling process
* can stop processing at a frame when it detects no style changes and it is
* known that the styles of the subtree beneath it will not change, leaving
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -630,17 +630,18 @@ nsPresContext::AppUnitsPerDevPixelChange
InvalidatePaintedLayers();
if (mDeviceContext) {
mDeviceContext->FlushFontCache();
}
if (HasCachedStyleData()) {
// All cached style data must be recomputed.
- MediaFeatureValuesChanged(eRestyle_ForceDescendants, NS_STYLE_HINT_REFLOW);
+ MediaFeatureValuesChanged(eRestyle_ForceDescendants,
+ nsChangeHint::ReflowHints);
}
mCurAppUnitsPerDevPixel = AppUnitsPerDevPixel();
}
void
nsPresContext::PreferenceChanged(const char* aPrefName)
{
@@ -751,17 +752,17 @@ nsPresContext::UpdateAfterPreferencesCha
}
InvalidatePaintedLayers();
mDeviceContext->FlushFontCache();
nsChangeHint hint = nsChangeHint::None;
if (mPrefChangePendingNeedsReflow) {
- hint |= NS_STYLE_HINT_REFLOW;
+ hint |= nsChangeHint::ReflowHints;
}
// Preferences require rerunning selector matching because we rebuild
// the pref style sheet for some preference changes.
RebuildAllStyleData(hint, eRestyle_Subtree);
}
nsresult
@@ -996,17 +997,17 @@ nsPresContext::DetachShell()
}
}
void
nsPresContext::DoChangeCharSet(const nsCString& aCharSet)
{
UpdateCharSet(aCharSet);
mDeviceContext->FlushFontCache();
- RebuildAllStyleData(NS_STYLE_HINT_REFLOW, nsRestyleHint(0));
+ RebuildAllStyleData(nsChangeHint::ReflowHints, nsRestyleHint(0));
}
void
nsPresContext::UpdateCharSet(const nsCString& aCharSet)
{
if (mLangService) {
mLanguage = mLangService->LookupCharSet(aCharSet);
// this will be a language group (or script) code rather than a true language code
@@ -1644,17 +1645,17 @@ nsPresContext::ThemeChangedInternal()
nsCSSRuleProcessor::FreeSystemMetrics();
// Changes to system metrics can change media queries on them, or
// :-moz-system-metric selectors (which requires eRestyle_Subtree).
// Changes in theme can change system colors (whose changes are
// properly reflected in computed style data), system fonts (whose
// changes are not), and -moz-appearance (whose changes likewise are
// not), so we need to reflow.
- MediaFeatureValuesChanged(eRestyle_Subtree, NS_STYLE_HINT_REFLOW);
+ MediaFeatureValuesChanged(eRestyle_Subtree, nsChangeHint::ReflowHints);
// Recursively notify all remote leaf descendants that the
// system theme has changed.
nsContentUtils::CallOnAllRemoteChildren(mDocument->GetWindow(),
NotifyThemeChanged, nullptr);
}
void
@@ -2072,17 +2073,18 @@ nsPresContext::UserFontSetUpdated(gfxUse
// xxx - until the Linux platform font list is always used, use full
// restyle to force updates with gfxPangoFontGroup usage
// Note: this method is called without a font when rules in the userfont set
// are updated, which may occur during reflow as a result of the lazy
// initialization of the userfont set. It would be better to avoid a full
// restyle but until this method is only called outside of reflow, schedule a
// full restyle in these cases.
if (!usePlatformFontList || !aUpdatedFont) {
- PostRebuildAllStyleDataEvent(NS_STYLE_HINT_REFLOW, eRestyle_ForceDescendants);
+ PostRebuildAllStyleDataEvent(nsChangeHint::ReflowHints,
+ eRestyle_ForceDescendants);
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()) {
@@ -2112,17 +2114,17 @@ nsPresContext::FlushCounterStyles()
// Still in its initial state, no need to clean.
return;
}
if (mCounterStylesDirty) {
bool changed = mCounterStyleManager->NotifyRuleChanged();
if (changed) {
PresShell()->NotifyCounterStylesAreDirty();
- PostRebuildAllStyleDataEvent(NS_STYLE_HINT_REFLOW,
+ PostRebuildAllStyleDataEvent(nsChangeHint::ReflowHints,
eRestyle_ForceDescendants);
}
mCounterStylesDirty = false;
}
}
void
nsPresContext::RebuildCounterStyles()
--- a/layout/base/nsPresContext.h
+++ b/layout/base/nsPresContext.h
@@ -556,17 +556,17 @@ public:
if (aZoom == mTextZoom)
return;
mTextZoom = aZoom;
if (HasCachedStyleData()) {
// Media queries could have changed, since we changed the meaning
// of 'em' units in them.
MediaFeatureValuesChanged(eRestyle_ForceDescendants,
- NS_STYLE_HINT_REFLOW);
+ nsChangeHint::ReflowHints);
}
}
/**
* Get the minimum font size for the specified language. If aLanguage
* is nullptr, then the document's language is used. This combines
* the language-specific global preference with the per-presentation
* base minimum font size.
@@ -592,17 +592,17 @@ public:
if (aMinFontSize == mBaseMinFontSize)
return;
mBaseMinFontSize = aMinFontSize;
if (HasCachedStyleData()) {
// Media queries could have changed, since we changed the meaning
// of 'em' units in them.
MediaFeatureValuesChanged(eRestyle_ForceDescendants,
- NS_STYLE_HINT_REFLOW);
+ nsChangeHint::ReflowHints);
}
}
float GetFullZoom() { return mFullZoom; }
void SetFullZoom(float aZoom);
float GetOverrideDPPX() { return mOverrideDPPX; }
void SetOverrideDPPX(float aDPPX);
--- a/layout/base/nsStyleChangeList.cpp
+++ b/layout/base/nsStyleChangeList.cpp
@@ -25,17 +25,17 @@ nsStyleChangeList::AppendChange(nsIFrame
// XXXbz we should make this take Element instead of nsIContent
MOZ_ASSERT(!aContent || aContent->IsElement() ||
// display:contents elements posts the changes for their children:
(aFrame && aContent->GetParent() &&
aFrame->PresContext()->FrameManager()->
GetDisplayContentsStyleFor(aContent->GetParent())),
"Shouldn't be trying to restyle non-elements directly, "
"except if it's a display:contents child");
- MOZ_ASSERT(!(aHint & nsChangeHint_AllReflowHints) ||
+ MOZ_ASSERT(!(aHint & nsChangeHint::AllReflowHints) ||
(aHint & nsChangeHint::NeedReflow),
"Reflow hint bits set without actually asking for a reflow");
// Filter out all other changes for same content
if (!IsEmpty() && (aHint & nsChangeHint::ReconstructFrame)) {
if (aContent) {
// NOTE: This is captured by reference to please static analysis.
// Capturing it by value as a pointer should be fine in this case.
--- a/layout/mathml/nsMathMLmtableFrame.cpp
+++ b/layout/mathml/nsMathMLmtableFrame.cpp
@@ -947,17 +947,17 @@ void
nsMathMLmtableFrame::RestyleTable()
{
// re-sync MathML specific style data that may have changed
MapAllAttributesIntoCSS(this);
// Explicitly request a re-resolve and reflow in our subtree to pick up any changes
PresContext()->RestyleManager()->
PostRestyleEvent(mContent->AsElement(), eRestyle_Subtree,
- nsChangeHint_AllReflowHints);
+ nsChangeHint::AllReflowHints);
}
nscoord
nsMathMLmtableFrame::GetColSpacing(int32_t aColIndex)
{
if (mUseCSSSpacing) {
return nsTableFrame::GetColSpacing(aColIndex);
}
--- a/layout/style/ServoBindings.cpp
+++ b/layout/style/ServoBindings.cpp
@@ -249,17 +249,17 @@ nsChangeHint
Gecko_CalcStyleDifference(nsStyleContext* aOldStyleContext,
ServoComputedValuesBorrowed aComputedValues)
{
MOZ_ASSERT(aOldStyleContext);
MOZ_ASSERT(aComputedValues);
// Pass the safe thing, which causes us to miss a potential optimization. See
// bug 1289863.
- nsChangeHint forDescendants = nsChangeHint_Hints_NotHandledForDescendants;
+ nsChangeHint forDescendants = NS_CHANGE_HINT_NOT_HANDLED_FOR_DESCENDANTS;
// Eventually, we should compute things out of these flags like
// ElementRestyler::RestyleSelf does and pass the result to the caller to
// potentially halt traversal. See bug 1289868.
uint32_t equalStructs, samePointerStructs;
nsChangeHint result =
aOldStyleContext->CalcStyleDifference(aComputedValues,
forDescendants,
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -966,17 +966,17 @@ nsStyleContext::CalcStyleDifferenceInter
nsChangeHint aParentHintsNotHandledForDescendants,
uint32_t* aEqualStructs,
uint32_t* aSamePointerStructs)
{
PROFILER_LABEL("nsStyleContext", "CalcStyleDifference",
js::ProfileEntry::Category::CSS);
MOZ_ASSERT(NS_IsHintSubset(aParentHintsNotHandledForDescendants,
- nsChangeHint_Hints_NotHandledForDescendants),
+ NS_CHANGE_HINT_NOT_HANDLED_FOR_DESCENDANTS),
"caller is passing inherited hints, but shouldn't be");
static_assert(nsStyleStructID_Length <= 32,
"aEqualStructs is not big enough");
*aEqualStructs = 0;
nsChangeHint hint = nsChangeHint::None;
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -189,17 +189,17 @@ nsStyleFont::CalcDifference(const nsStyl
"expected mAllowZoom to be the same on both nsStyleFonts");
if (mSize != aNewData.mSize ||
mFont != aNewData.mFont ||
mLanguage != aNewData.mLanguage ||
mExplicitLanguage != aNewData.mExplicitLanguage ||
mMathVariant != aNewData.mMathVariant ||
mMathDisplay != aNewData.mMathDisplay ||
mMinFontSizeRatio != aNewData.mMinFontSizeRatio) {
- return NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReflowHints;
}
// XXX Should any of these cause a non-nsChangeHint::NeutralChange change?
if (mGenericID != aNewData.mGenericID ||
mScriptLevel != aNewData.mScriptLevel ||
mScriptUnconstrainedSize != aNewData.mScriptUnconstrainedSize ||
mScriptMinSize != aNewData.mScriptMinSize ||
mScriptSizeMultiplier != aNewData.mScriptSizeMultiplier) {
@@ -306,17 +306,17 @@ nsStylePadding::CalcDifference(const nsS
// 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
// ReflowInput::InitResizeFlags initializes the inline-resize flag).
- return NS_STYLE_HINT_REFLOW &
+ return nsChangeHint::ReflowHints &
~nsChangeHint::ClearDescendantIntrinsics;
}
nsStyleBorder::nsStyleBorder(StyleStructContext aContext)
: mBorderColors(nullptr)
, mBorderImageFill(NS_STYLE_BORDER_IMAGE_SLICE_NOFILL)
, mBorderImageRepeatH(NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH)
, mBorderImageRepeatV(NS_STYLE_BORDER_IMAGE_REPEAT_STRETCH)
@@ -462,17 +462,17 @@ nsStyleBorder::CalcDifference(const nsSt
// force reflow of all descendants, but the hint would need to force
// reflow of the frame's children (see how
// ReflowInput::InitResizeFlags initializes the inline-resize flag).
if (mTwipsPerPixel != aNewData.mTwipsPerPixel ||
GetComputedBorder() != aNewData.GetComputedBorder() ||
mFloatEdge != aNewData.mFloatEdge ||
mBorderImageOutset != aNewData.mBorderImageOutset ||
mBoxDecorationBreak != aNewData.mBoxDecorationBreak) {
- return NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReflowHints;
}
NS_FOR_CSS_SIDES(ix) {
// See the explanation in nsChangeHint.h of
// nsChangeHint::BorderStyleNoneChange .
// Furthermore, even though we know *this* side is 0 width, just
// assume a repaint hint for some other change rather than bother
// tracking this result through the rest of the function.
@@ -703,20 +703,20 @@ nsStyleList::CalcDifference(const nsStyl
}
if (DefinitelyEqualImages(mListStyleImage, aNewData.mListStyleImage) &&
mCounterStyle == aNewData.mCounterStyle) {
if (mImageRegion.IsEqualInterior(aNewData.mImageRegion)) {
return nsChangeHint::None;
}
if (mImageRegion.width == aNewData.mImageRegion.width &&
mImageRegion.height == aNewData.mImageRegion.height) {
- return NS_STYLE_HINT_VISUAL;
+ return nsChangeHint::VisualHints;
}
}
- return NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReflowHints;
}
StaticRefPtr<nsStyleQuoteValues>
nsStyleList::sInitialQuotes;
StaticRefPtr<nsStyleQuoteValues>
nsStyleList::sNoneQuotes;
@@ -763,17 +763,17 @@ nsStyleXUL::CalcDifference(const nsStyle
mBoxPack == aNewData.mBoxPack &&
mBoxOrdinal == aNewData.mBoxOrdinal &&
mStretchStack == aNewData.mStretchStack) {
return nsChangeHint::None;
}
if (mBoxOrdinal != aNewData.mBoxOrdinal) {
return nsChangeHint::ReconstructFrame;
}
- return NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReflowHints;
}
// --------------------
// nsStyleColumn
//
/* static */ const uint32_t nsStyleColumn::kMaxColumnCount;
nsStyleColumn::nsStyleColumn(StyleStructContext aContext)
@@ -818,23 +818,23 @@ nsStyleColumn::CalcDifference(const nsSt
// some edge cases where the column count gets smaller and content overflows.
// XXX not ideal
return nsChangeHint::ReconstructFrame;
}
if (mColumnWidth != aNewData.mColumnWidth ||
mColumnGap != aNewData.mColumnGap ||
mColumnFill != aNewData.mColumnFill) {
- return NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReflowHints;
}
if (GetComputedColumnRuleWidth() != aNewData.GetComputedColumnRuleWidth() ||
mColumnRuleStyle != aNewData.mColumnRuleStyle ||
mColumnRuleColor != aNewData.mColumnRuleColor) {
- return NS_STYLE_HINT_VISUAL;
+ return nsChangeHint::VisualHints;
}
// 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;
}
@@ -1179,18 +1179,18 @@ nsStyleSVGReset::CalcDifference(const ns
hint |= nsChangeHint::UpdateEffects |
nsChangeHint::RepaintFrame;
// clip-path changes require that we update the PreEffectsBBoxProperty,
// which is done during overflow computation.
hint |= nsChangeHint::UpdateOverflow;
}
if (mDominantBaseline != aNewData.mDominantBaseline) {
- // XXXjwatt: why NS_STYLE_HINT_REFLOW? Isn't that excessive?
- hint |= NS_STYLE_HINT_REFLOW;
+ // XXXjwatt: why nsChangeHint::ReflowHints? Isn't that excessive?
+ hint |= nsChangeHint::ReflowHints;
} else if (mVectorEffect != aNewData.mVectorEffect) {
// Stroke currently affects SVGGeometryFrame::mRect, and
// vector-effect affect stroke. As a result we need to reflow if
// vector-effect changes in order to have SVGGeometryFrame::
// ReflowSVG called to update its mRect. No intrinsic sizes need
// to change so nsChangeHint::NeedReflow is sufficient.
hint |= nsChangeHint::NeedReflow |
nsChangeHint::NeedDirtyReflow | // XXX remove me: bug 876085
@@ -1483,69 +1483,69 @@ nsStylePosition::CalcDifference(const ns
// "order" impacts both layout order and stacking order, so we need both a
// reflow and a repaint when it changes. (Technically, we only need a
// reflow if we're in a multi-line flexbox (which we can't be sure about,
// since that's determined by styling on our parent) -- there, "order" can
// affect which flex line we end up on, & hence can affect our sizing by
// changing the group of flex items we're competing with for space.)
return hint |
nsChangeHint::RepaintFrame |
- nsChangeHint_AllReflowHints;
+ nsChangeHint::AllReflowHints;
}
if (mBoxSizing != aNewData.mBoxSizing) {
// Can affect both widths and heights; just a bad scene.
- return hint | nsChangeHint_AllReflowHints;
+ return hint | nsChangeHint::AllReflowHints;
}
// Properties that apply to flex items:
// XXXdholbert These should probably be more targeted (bug 819536)
if (mAlignSelf != aNewData.mAlignSelf ||
mFlexBasis != aNewData.mFlexBasis ||
mFlexGrow != aNewData.mFlexGrow ||
mFlexShrink != aNewData.mFlexShrink) {
- return hint | nsChangeHint_AllReflowHints;
+ return hint | nsChangeHint::AllReflowHints;
}
// Properties that apply to flex containers:
// - flex-direction can swap a flex container between vertical & horizontal.
// - align-items can change the sizing of a flex container & the positioning
// of its children.
// - flex-wrap changes whether a flex container's children are wrapped, which
// impacts their sizing/positioning and hence impacts the container's size.
if (mAlignItems != aNewData.mAlignItems ||
mFlexDirection != aNewData.mFlexDirection ||
mFlexWrap != aNewData.mFlexWrap) {
- return hint | nsChangeHint_AllReflowHints;
+ return hint | nsChangeHint::AllReflowHints;
}
// Properties that apply to grid containers:
// FIXME: only for grid containers
// (ie. 'display: grid' or 'display: inline-grid')
if (mGridTemplateColumns != aNewData.mGridTemplateColumns ||
mGridTemplateRows != aNewData.mGridTemplateRows ||
mGridTemplateAreas != aNewData.mGridTemplateAreas ||
mGridAutoColumnsMin != aNewData.mGridAutoColumnsMin ||
mGridAutoColumnsMax != aNewData.mGridAutoColumnsMax ||
mGridAutoRowsMin != aNewData.mGridAutoRowsMin ||
mGridAutoRowsMax != aNewData.mGridAutoRowsMax ||
mGridAutoFlow != aNewData.mGridAutoFlow) {
- return hint | nsChangeHint_AllReflowHints;
+ return hint | nsChangeHint::AllReflowHints;
}
// Properties that apply to grid items:
// FIXME: only for grid items
// (ie. parent frame is 'display: grid' or 'display: inline-grid')
if (mGridColumnStart != aNewData.mGridColumnStart ||
mGridColumnEnd != aNewData.mGridColumnEnd ||
mGridRowStart != aNewData.mGridRowStart ||
mGridRowEnd != aNewData.mGridRowEnd ||
mGridColumnGap != aNewData.mGridColumnGap ||
mGridRowGap != aNewData.mGridRowGap) {
- return hint | nsChangeHint_AllReflowHints;
+ return hint | nsChangeHint::AllReflowHints;
}
// Changing 'justify-content/items/self' might affect the positioning,
// but it won't affect any sizing.
if (mJustifyContent != aNewData.mJustifyContent ||
mJustifyItems != aNewData.mJustifyItems ||
mJustifySelf != aNewData.mJustifySelf) {
hint |= nsChangeHint::NeedReflow;
@@ -1587,17 +1587,17 @@ nsStylePosition::CalcDifference(const ns
nsChangeHint::UpdateComputedBSize |
nsChangeHint::ReflowChangesSizeOrPosition;
}
if (isVertical ? heightChanged : widthChanged) {
// None of our inline-size differences can affect descendant
// intrinsic sizes and none of them need to force children to
// reflow.
- hint |= nsChangeHint_AllReflowHints &
+ hint |= nsChangeHint::AllReflowHints &
~(nsChangeHint::ClearDescendantIntrinsics |
nsChangeHint::NeedDirtyReflow);
}
} else {
if (widthChanged || heightChanged) {
hint |= nsChangeHint::NeutralChange;
}
}
@@ -1609,17 +1609,17 @@ nsStylePosition::CalcDifference(const ns
// right now.
// Don't try to handle changes between "auto" and non-auto efficiently;
// that's tricky to do and will hardly ever be able to avoid a reflow.
if (mOffset != aNewData.mOffset) {
if (IsAutonessEqual(mOffset, aNewData.mOffset)) {
hint |= nsChangeHint::RecomputePosition |
nsChangeHint::UpdateParentOverflow;
} else {
- hint |= nsChangeHint_AllReflowHints;
+ hint |= nsChangeHint::AllReflowHints;
}
}
return hint;
}
/* static */ bool
nsStylePosition::WidthCoordDependsOnContainer(const nsStyleCoord &aCoord)
{
@@ -1749,19 +1749,19 @@ nsStyleTableBorder::CalcDifference(const
}
if ((mCaptionSide == aNewData.mCaptionSide) &&
(mBorderSpacingCol == aNewData.mBorderSpacingCol) &&
(mBorderSpacingRow == aNewData.mBorderSpacingRow)) {
if (mEmptyCells == aNewData.mEmptyCells) {
return nsChangeHint::None;
}
- return NS_STYLE_HINT_VISUAL;
+ return nsChangeHint::VisualHints;
} else {
- return NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReflowHints;
}
}
// --------------------
// nsStyleColor
//
nsStyleColor::nsStyleColor(StyleStructContext aContext)
@@ -3243,37 +3243,37 @@ nsStyleDisplay::CalcDifference(const nsS
// values such as 'none'.) We need to reframe since we want to use
// nsTextControlFrame instead of nsNumberControlFrame if the author
// specifies 'textfield'.
return nsChangeHint::ReconstructFrame;
}
if (mFloat != aNewData.mFloat) {
// Changing which side we float on doesn't affect descendants directly
- hint |= nsChangeHint_AllReflowHints &
+ hint |= nsChangeHint::AllReflowHints &
~(nsChangeHint::ClearDescendantIntrinsics |
nsChangeHint::NeedDirtyReflow);
}
if (mVerticalAlign != aNewData.mVerticalAlign) {
// XXX Can this just be AllReflowHints + RepaintFrame, and be included in
// the block below?
- hint |= NS_STYLE_HINT_REFLOW;
+ hint |= nsChangeHint::ReflowHints;
}
// XXX the following is conservative, for now: changing float breaking shouldn't
// necessarily require a repaint, reflow should suffice.
if (mBreakType != aNewData.mBreakType
|| mBreakInside != aNewData.mBreakInside
|| mBreakBefore != aNewData.mBreakBefore
|| mBreakAfter != aNewData.mBreakAfter
|| mAppearance != aNewData.mAppearance
|| mOrient != aNewData.mOrient
|| mOverflowClipBox != aNewData.mOverflowClipBox) {
- hint |= nsChangeHint_AllReflowHints |
+ hint |= nsChangeHint::AllReflowHints |
nsChangeHint::RepaintFrame;
}
if (mIsolation != aNewData.mIsolation) {
hint |= nsChangeHint::RepaintFrame;
}
/* If we've added or removed the transform property, we need to reconstruct the frame to add
@@ -3456,29 +3456,29 @@ nsStyleVisibility::CalcDifference(const
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)) {
- hint |= nsChangeHint_AllReflowHints |
+ hint |= nsChangeHint::AllReflowHints |
nsChangeHint::RepaintFrame;
}
if (mVisible != aNewData.mVisible) {
if ((NS_STYLE_VISIBILITY_COLLAPSE == mVisible) ||
(NS_STYLE_VISIBILITY_COLLAPSE == aNewData.mVisible)) {
- hint |= NS_STYLE_HINT_REFLOW;
+ hint |= nsChangeHint::ReflowHints;
} else {
- hint |= NS_STYLE_HINT_VISUAL;
+ hint |= nsChangeHint::VisualHints;
}
}
if (mTextOrientation != aNewData.mTextOrientation) {
- hint |= NS_STYLE_HINT_REFLOW;
+ hint |= nsChangeHint::ReflowHints;
}
if (mImageRendering != aNewData.mImageRendering) {
hint |= nsChangeHint::RepaintFrame;
}
if (mColorAdjust != aNewData.mColorAdjust) {
// color-adjust only affects media where dynamic changes can't happen.
hint |= nsChangeHint::NeutralChange;
}
@@ -3687,17 +3687,17 @@ nsStyleTextReset::~nsStyleTextReset()
}
nsChangeHint
nsStyleTextReset::CalcDifference(const nsStyleTextReset& aNewData) const
{
if (mUnicodeBidi != aNewData.mUnicodeBidi ||
mInitialLetterSink != aNewData.mInitialLetterSink ||
mInitialLetterSize != aNewData.mInitialLetterSize) {
- return NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReflowHints;
}
if (mTextDecorationLine != aNewData.mTextDecorationLine ||
mTextDecorationStyle != aNewData.mTextDecorationStyle) {
// Changes to our text-decoration line can impact our overflow area &
// also our descendants' overflow areas (particularly for text-frame
// descendants). So, we update those areas & trigger a repaint.
return nsChangeHint::RepaintFrame |
@@ -3842,24 +3842,24 @@ nsStyleText::CalcDifference(const nsStyl
(mRubyAlign != aNewData.mRubyAlign) ||
(mRubyPosition != aNewData.mRubyPosition) ||
(mTextSizeAdjust != aNewData.mTextSizeAdjust) ||
(mLetterSpacing != aNewData.mLetterSpacing) ||
(mLineHeight != aNewData.mLineHeight) ||
(mTextIndent != aNewData.mTextIndent) ||
(mWordSpacing != aNewData.mWordSpacing) ||
(mTabSize != aNewData.mTabSize)) {
- return NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReflowHints;
}
if (HasTextEmphasis() != aNewData.HasTextEmphasis() ||
(HasTextEmphasis() &&
mTextEmphasisPosition != aNewData.mTextEmphasisPosition)) {
// Text emphasis position change could affect line height calculation.
- return nsChangeHint_AllReflowHints |
+ return nsChangeHint::AllReflowHints |
nsChangeHint::RepaintFrame;
}
nsChangeHint hint = nsChangeHint::None;
// text-rendering changes require a reflow since they change SVG
// frames' rects.
if (mTextRendering != aNewData.mTextRendering) {
@@ -4020,17 +4020,17 @@ nsStyleUserInterface::CalcDifference(con
// SVGGeometryFrame's mRect depends on stroke _and_ on the value
// of pointer-events. See SVGGeometryFrame::ReflowSVG's use of
// GetHitTestFlags. (Only a reflow, no visual change.)
hint |= nsChangeHint::NeedReflow |
nsChangeHint::NeedDirtyReflow; // XXX remove me: bug 876085
}
if (mUserModify != aNewData.mUserModify) {
- hint |= NS_STYLE_HINT_VISUAL;
+ hint |= nsChangeHint::VisualHints;
}
if (mUserInput != aNewData.mUserInput) {
if (StyleUserInput::None == mUserInput ||
StyleUserInput::None == aNewData.mUserInput) {
hint |= nsChangeHint::ReconstructFrame;
} else {
hint |= nsChangeHint::NeutralChange;
@@ -4079,20 +4079,20 @@ nsStyleUIReset::CalcDifference(const nsS
// ignore mIMEMode
if (mForceBrokenImageIcon != aNewData.mForceBrokenImageIcon) {
return nsChangeHint::ReconstructFrame;
}
if (mWindowShadow != aNewData.mWindowShadow) {
// We really need just an nsChangeHint::SyncFrameView, except
// on an ancestor of the frame, so we get that by doing a
// reflow.
- return NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReflowHints;
}
if (mUserSelect != aNewData.mUserSelect) {
- return NS_STYLE_HINT_VISUAL;
+ return nsChangeHint::VisualHints;
}
if (mWindowDragging != aNewData.mWindowDragging) {
return nsChangeHint::SchedulePaint;
}
return nsChangeHint::None;
}
@@ -4164,17 +4164,17 @@ nsStyleEffects::CalcDifference(const nsS
// 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 |
nsChangeHint::RepaintFrame;
}
if (mClipFlags != aNewData.mClipFlags) {
- hint |= nsChangeHint_AllReflowHints |
+ hint |= nsChangeHint::AllReflowHints |
nsChangeHint::RepaintFrame;
}
if (!mClip.IsEqualInterior(aNewData.mClip)) {
// If the clip has changed, we just need to update overflow areas. DLBI
// will handle the invalidation.
hint |= nsChangeHint::UpdateOverflow |
nsChangeHint::SchedulePaint;
--- a/layout/style/nsStyleStruct.h
+++ b/layout/style/nsStyleStruct.h
@@ -160,17 +160,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
explicit nsStyleFont(StyleStructContext aContext);
~nsStyleFont() {
MOZ_COUNT_DTOR(nsStyleFont);
}
void FinishStyle(nsPresContext* aPresContext) {}
nsChangeHint CalcDifference(const nsStyleFont& aNewData) const;
static nsChangeHint MaxDifference() {
- return NS_STYLE_HINT_REFLOW | nsChangeHint::NeutralChange;
+ return nsChangeHint::ReflowHints | nsChangeHint::NeutralChange;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
nsChangeHint::ReflowChangesSizeOrPosition |
nsChangeHint::ClearAncestorIntrinsics;
}
@@ -1021,17 +1021,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStylePadding, sz);
}
void Destroy(nsPresContext* aContext);
nsChangeHint CalcDifference(const nsStylePadding& aNewData) const;
static nsChangeHint MaxDifference() {
- return NS_STYLE_HINT_REFLOW & ~nsChangeHint::ClearDescendantIntrinsics;
+ return nsChangeHint::ReflowHints & ~nsChangeHint::ClearDescendantIntrinsics;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// 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
@@ -1231,17 +1231,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleBorder, sz);
}
void Destroy(nsPresContext* aContext);
nsChangeHint CalcDifference(const nsStyleBorder& aNewData) const;
static nsChangeHint MaxDifference() {
- return NS_STYLE_HINT_REFLOW |
+ return nsChangeHint::ReflowHints |
nsChangeHint::UpdateOverflow |
nsChangeHint::BorderStyleNoneChange |
nsChangeHint::NeutralChange;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
@@ -1534,17 +1534,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
void Destroy(nsPresContext* aContext) {
this->~nsStyleList();
aContext->PresShell()->
FreeByObjectID(mozilla::eArenaObjectID_nsStyleList, this);
}
nsChangeHint CalcDifference(const nsStyleList& aNewData) const;
static nsChangeHint MaxDifference() {
- return nsChangeHint::ReconstructFrame | NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReconstructFrame | nsChangeHint::ReflowHints;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
nsChangeHint::ReflowChangesSizeOrPosition |
nsChangeHint::ClearAncestorIntrinsics;
}
@@ -1759,17 +1759,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
this->~nsStylePosition();
aContext->PresShell()->
FreeByObjectID(mozilla::eArenaObjectID_nsStylePosition, this);
}
nsChangeHint CalcDifference(const nsStylePosition& aNewData,
const nsStyleVisibility* aOldStyleVisibility) const;
static nsChangeHint MaxDifference() {
- return NS_STYLE_HINT_REFLOW |
+ return nsChangeHint::ReflowHints |
nsChangeHint::NeutralChange |
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
@@ -2002,17 +2002,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
// nsStyleContext::HasTextDecorationLines.
bool HasTextDecorationLines() const {
return mTextDecorationLine != NS_STYLE_TEXT_DECORATION_LINE_NONE &&
mTextDecorationLine != NS_STYLE_TEXT_DECORATION_LINE_OVERRIDE_ALL;
}
nsChangeHint CalcDifference(const nsStyleTextReset& aNewData) const;
static nsChangeHint MaxDifference() {
- return NS_STYLE_HINT_REFLOW | nsChangeHint::UpdateSubtreeOverflow;
+ return nsChangeHint::ReflowHints | nsChangeHint::UpdateSubtreeOverflow;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
nsChangeHint::ReflowChangesSizeOrPosition |
nsChangeHint::ClearAncestorIntrinsics;
}
@@ -2043,17 +2043,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
this->~nsStyleText();
aContext->PresShell()->
FreeByObjectID(mozilla::eArenaObjectID_nsStyleText, this);
}
nsChangeHint CalcDifference(const nsStyleText& aNewData) const;
static nsChangeHint MaxDifference() {
return nsChangeHint::ReconstructFrame |
- NS_STYLE_HINT_REFLOW |
+ nsChangeHint::ReflowHints |
nsChangeHint::UpdateSubtreeOverflow |
nsChangeHint::NeutralChange;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
nsChangeHint::ReflowChangesSizeOrPosition |
@@ -2262,17 +2262,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
this->~nsStyleVisibility();
aContext->PresShell()->
FreeByObjectID(mozilla::eArenaObjectID_nsStyleVisibility, this);
}
nsChangeHint CalcDifference(const nsStyleVisibility& aNewData) const;
static nsChangeHint MaxDifference() {
return nsChangeHint::ReconstructFrame |
- NS_STYLE_HINT_REFLOW |
+ nsChangeHint::ReflowHints |
nsChangeHint::NeutralChange;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
nsChangeHint::ReflowChangesSizeOrPosition |
nsChangeHint::ClearAncestorIntrinsics;
@@ -2771,17 +2771,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
aContext->PresShell()->
FreeByObjectID(mozilla::eArenaObjectID_nsStyleDisplay, this);
}
nsChangeHint CalcDifference(const nsStyleDisplay& aNewData) const;
static nsChangeHint MaxDifference() {
// All the parts of FRAMECHANGE are present in CalcDifference.
return nsChangeHint::ReconstructFrame |
- NS_STYLE_HINT_REFLOW |
+ nsChangeHint::ReflowHints |
nsChangeHint::UpdateTransformLayer |
nsChangeHint::UpdateOverflow |
nsChangeHint::UpdatePostTransformOverflow |
nsChangeHint::UpdateContainingBlock |
nsChangeHint::AddOrRemoveTransform |
nsChangeHint::NeutralChange;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
@@ -3113,17 +3113,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
void Destroy(nsPresContext* aContext) {
this->~nsStyleTableBorder();
aContext->PresShell()->
FreeByObjectID(mozilla::eArenaObjectID_nsStyleTableBorder, this);
}
nsChangeHint CalcDifference(const nsStyleTableBorder& aNewData) const;
static nsChangeHint MaxDifference() {
- return nsChangeHint::ReconstructFrame | NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReconstructFrame | nsChangeHint::ReflowHints;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
nsChangeHint::ReflowChangesSizeOrPosition |
nsChangeHint::ClearAncestorIntrinsics;
}
@@ -3217,17 +3217,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
void* operator new(size_t sz, nsPresContext* aContext) {
return aContext->PresShell()->
AllocateByObjectID(mozilla::eArenaObjectID_nsStyleContent, sz);
}
void Destroy(nsPresContext* aContext);
nsChangeHint CalcDifference(const nsStyleContent& aNewData) const;
static nsChangeHint MaxDifference() {
- return nsChangeHint::ReconstructFrame | NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReconstructFrame | nsChangeHint::ReflowHints;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
nsChangeHint::ReflowChangesSizeOrPosition |
nsChangeHint::ClearAncestorIntrinsics;
}
@@ -3301,17 +3301,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
void Destroy(nsPresContext* aContext) {
this->~nsStyleUIReset();
aContext->PresShell()->
FreeByObjectID(mozilla::eArenaObjectID_nsStyleUIReset, this);
}
nsChangeHint CalcDifference(const nsStyleUIReset& aNewData) const;
static nsChangeHint MaxDifference() {
- return nsChangeHint::ReconstructFrame | NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReconstructFrame | nsChangeHint::ReflowHints;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
nsChangeHint::ReflowChangesSizeOrPosition |
nsChangeHint::ClearAncestorIntrinsics;
}
@@ -3364,19 +3364,19 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
FreeByObjectID(mozilla::eArenaObjectID_nsStyleUserInterface, this);
}
nsChangeHint CalcDifference(const nsStyleUserInterface& aNewData) const;
static nsChangeHint MaxDifference() {
return nsChangeHint::ReconstructFrame |
nsChangeHint::NeedReflow |
nsChangeHint::NeedDirtyReflow |
- NS_STYLE_HINT_VISUAL |
nsChangeHint::UpdateCursor |
- nsChangeHint::NeutralChange;
+ nsChangeHint::NeutralChange |
+ nsChangeHint::VisualHints;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow;
}
mozilla::StyleUserInput mUserInput; // [inherited]
@@ -3405,17 +3405,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
void Destroy(nsPresContext* aContext) {
this->~nsStyleXUL();
aContext->PresShell()->
FreeByObjectID(mozilla::eArenaObjectID_nsStyleXUL, this);
}
nsChangeHint CalcDifference(const nsStyleXUL& aNewData) const;
static nsChangeHint MaxDifference() {
- return nsChangeHint::ReconstructFrame | NS_STYLE_HINT_REFLOW;
+ return nsChangeHint::ReconstructFrame | nsChangeHint::ReflowHints;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
nsChangeHint::ReflowChangesSizeOrPosition |
nsChangeHint::ClearAncestorIntrinsics;
}
@@ -3445,17 +3445,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
this->~nsStyleColumn();
aContext->PresShell()->
FreeByObjectID(mozilla::eArenaObjectID_nsStyleColumn, this);
}
nsChangeHint CalcDifference(const nsStyleColumn& aNewData) const;
static nsChangeHint MaxDifference() {
return nsChangeHint::ReconstructFrame |
- NS_STYLE_HINT_REFLOW |
+ nsChangeHint::ReflowHints |
nsChangeHint::NeutralChange;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
nsChangeHint::ReflowChangesSizeOrPosition |
nsChangeHint::ClearAncestorIntrinsics;
@@ -3765,17 +3765,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
nsChangeHint CalcDifference(const nsStyleSVGReset& aNewData) const;
static nsChangeHint MaxDifference() {
return nsChangeHint::UpdateEffects |
nsChangeHint::UpdateOverflow |
nsChangeHint::NeutralChange |
nsChangeHint::RepaintFrame |
nsChangeHint::UpdateBackgroundPosition |
- NS_STYLE_HINT_REFLOW;
+ nsChangeHint::ReflowHints;
}
static nsChangeHint DifferenceAlwaysHandledForDescendants() {
// CalcDifference never returns the reflow hints that are sometimes
// handled for descendants as hints not handled for descendants.
return nsChangeHint::NeedReflow |
nsChangeHint::ReflowChangesSizeOrPosition |
nsChangeHint::ClearAncestorIntrinsics;
}
@@ -3848,17 +3848,17 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsSt
void Destroy(nsPresContext* aContext) {
this->~nsStyleEffects();
aContext->PresShell()->
FreeByObjectID(mozilla::eArenaObjectID_nsStyleEffects, this);
}
nsChangeHint CalcDifference(const nsStyleEffects& aNewData) const;
static nsChangeHint MaxDifference() {
- return nsChangeHint_AllReflowHints |
+ return nsChangeHint::AllReflowHints |
nsChangeHint::UpdateOverflow |
nsChangeHint::SchedulePaint |
nsChangeHint::RepaintFrame |
nsChangeHint::UpdateOpacityLayer |
nsChangeHint::UpdateUsesOpacity |
nsChangeHint::UpdateContainingBlock |
nsChangeHint::UpdateEffects |
nsChangeHint::NeutralChange;