--- a/dom/html/HTMLCanvasElement.cpp
+++ b/dom/html/HTMLCanvasElement.cpp
@@ -588,20 +588,20 @@ nsChangeHint
HTMLCanvasElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
int32_t aModType) const
{
nsChangeHint retval =
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::width ||
aAttribute == nsGkAtoms::height)
{
- NS_UpdateHint(retval, NS_STYLE_HINT_REFLOW);
+ retval |= NS_STYLE_HINT_REFLOW;
} else if (aAttribute == nsGkAtoms::moz_opaque)
{
- NS_UpdateHint(retval, NS_STYLE_HINT_VISUAL);
+ retval |= NS_STYLE_HINT_VISUAL;
}
return retval;
}
bool
HTMLCanvasElement::ParseAttribute(int32_t aNamespaceID,
nsIAtom* aAttribute,
const nsAString& aValue,
--- a/dom/html/HTMLDetailsElement.cpp
+++ b/dom/html/HTMLDetailsElement.cpp
@@ -61,17 +61,17 @@ HTMLDetailsElement::GetFirstSummary() co
nsChangeHint
HTMLDetailsElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
int32_t aModType) const
{
nsChangeHint hint =
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::open) {
- NS_UpdateHint(hint, nsChangeHint_ReconstructFrame);
+ hint |= nsChangeHint_ReconstructFrame;
}
return hint;
}
nsresult
HTMLDetailsElement::BeforeSetAttr(int32_t aNameSpaceID, nsIAtom* aName,
nsAttrValueOrString* aValue, bool aNotify)
{
--- a/dom/html/HTMLFrameSetElement.cpp
+++ b/dom/html/HTMLFrameSetElement.cpp
@@ -190,17 +190,17 @@ HTMLFrameSetElement::ParseAttribute(int3
nsChangeHint
HTMLFrameSetElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
int32_t aModType) const
{
nsChangeHint retval =
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::rows ||
aAttribute == nsGkAtoms::cols) {
- NS_UpdateHint(retval, mCurrentRowColHint);
+ retval |= mCurrentRowColHint;
}
return retval;
}
/**
* Translate a "rows" or "cols" spec into an array of nsFramesetSpecs
*/
nsresult
--- a/dom/html/HTMLImageElement.cpp
+++ b/dom/html/HTMLImageElement.cpp
@@ -350,21 +350,21 @@ HTMLImageElement::MapAttributesIntoRule(
nsChangeHint
HTMLImageElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
int32_t aModType) const
{
nsChangeHint retval =
nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::usemap ||
aAttribute == nsGkAtoms::ismap) {
- NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
+ retval |= NS_STYLE_HINT_FRAMECHANGE;
} else if (aAttribute == nsGkAtoms::alt) {
if (aModType == nsIDOMMutationEvent::ADDITION ||
aModType == nsIDOMMutationEvent::REMOVAL) {
- NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
+ retval |= NS_STYLE_HINT_FRAMECHANGE;
}
}
return retval;
}
NS_IMETHODIMP_(bool)
HTMLImageElement::IsAttributeMapped(const nsIAtom* aAttribute) const
{
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -4949,30 +4949,30 @@ HTMLInputElement::GetAttributeChangeHint
int32_t aModType) const
{
nsChangeHint retval =
nsGenericHTMLFormElementWithState::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::type ||
// The presence or absence of the 'directory' attribute determines what
// buttons we show for type=file.
aAttribute == nsGkAtoms::directory) {
- NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
+ retval |= NS_STYLE_HINT_FRAMECHANGE;
} 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..
- NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
+ retval |= NS_STYLE_HINT_FRAMECHANGE;
} else if (aAttribute == nsGkAtoms::value) {
- NS_UpdateHint(retval, NS_STYLE_HINT_REFLOW);
+ retval |= NS_STYLE_HINT_REFLOW;
} else if (aAttribute == nsGkAtoms::size &&
IsSingleLineTextControl(false)) {
- NS_UpdateHint(retval, NS_STYLE_HINT_REFLOW);
+ retval |= NS_STYLE_HINT_REFLOW;
} else if (PlaceholderApplies() && aAttribute == nsGkAtoms::placeholder) {
- NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
+ retval |= NS_STYLE_HINT_FRAMECHANGE;
}
return retval;
}
NS_IMETHODIMP_(bool)
HTMLInputElement::IsAttributeMapped(const nsIAtom* aAttribute) const
{
static const MappedAttributeEntry attributes[] = {
--- 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) {
- NS_UpdateHint(retval, NS_STYLE_HINT_REFLOW);
+ retval |= NS_STYLE_HINT_REFLOW;
}
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) {
- NS_UpdateHint(retval, NS_STYLE_HINT_REFLOW);
+ retval |= NS_STYLE_HINT_REFLOW;
}
return retval;
}
nsresult
HTMLOptionElement::BeforeSetAttr(int32_t aNamespaceID, nsIAtom* aName,
nsAttrValueOrString* aValue,
bool aNotify)
--- a/dom/html/HTMLSelectElement.cpp
+++ b/dom/html/HTMLSelectElement.cpp
@@ -1408,17 +1408,17 @@ HTMLSelectElement::MapAttributesIntoRule
nsChangeHint
HTMLSelectElement::GetAttributeChangeHint(const nsIAtom* aAttribute,
int32_t aModType) const
{
nsChangeHint retval =
nsGenericHTMLFormElementWithState::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::multiple ||
aAttribute == nsGkAtoms::size) {
- NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
+ retval |= NS_STYLE_HINT_FRAMECHANGE;
}
return retval;
}
NS_IMETHODIMP_(bool)
HTMLSelectElement::IsAttributeMapped(const nsIAtom* aAttribute) const
{
static const MappedAttributeEntry* const map[] = {
--- a/dom/html/HTMLTextAreaElement.cpp
+++ b/dom/html/HTMLTextAreaElement.cpp
@@ -431,21 +431,21 @@ 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) {
- NS_UpdateHint(retval, NS_STYLE_HINT_REFLOW);
+ retval |= NS_STYLE_HINT_REFLOW;
} else if (aAttribute == nsGkAtoms::wrap) {
- NS_UpdateHint(retval, nsChangeHint_ReconstructFrame);
+ retval |= nsChangeHint_ReconstructFrame;
} else if (aAttribute == nsGkAtoms::placeholder) {
- NS_UpdateHint(retval, NS_STYLE_HINT_FRAMECHANGE);
+ retval |= NS_STYLE_HINT_FRAMECHANGE;
}
return retval;
}
NS_IMETHODIMP_(bool)
HTMLTextAreaElement::IsAttributeMapped(const nsIAtom* aAttribute) const
{
static const MappedAttributeEntry attributes[] = {
--- a/dom/svg/SVGTransformableElement.cpp
+++ b/dom/svg/SVGTransformableElement.cpp
@@ -54,17 +54,17 @@ SVGTransformableElement::GetAttributeCha
int32_t aModType) const
{
nsChangeHint retval =
nsSVGElement::GetAttributeChangeHint(aAttribute, aModType);
if (aAttribute == nsGkAtoms::transform ||
aAttribute == nsGkAtoms::mozAnimateMotionDummyAttr) {
nsIFrame* frame =
const_cast<SVGTransformableElement*>(this)->GetPrimaryFrame();
- NS_UpdateHint(retval, nsChangeHint_InvalidateRenderingObservers);
+ retval |= nsChangeHint_InvalidateRenderingObservers;
if (!frame || (frame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) {
return retval;
}
bool isAdditionOrRemoval = false;
if (aModType == nsIDOMMutationEvent::ADDITION ||
aModType == nsIDOMMutationEvent::REMOVAL) {
isAdditionOrRemoval = true;
@@ -76,21 +76,21 @@ SVGTransformableElement::GetAttributeCha
!mTransforms->HadTransformBeforeLastBaseValChange()) {
// New or old value is empty; this is effectively addition or removal.
isAdditionOrRemoval = true;
}
}
if (isAdditionOrRemoval) {
// Reconstruct the frame tree to handle stacking context changes:
- NS_UpdateHint(retval, nsChangeHint_ReconstructFrame);
+ retval |= nsChangeHint_ReconstructFrame;
} else {
// We just assume the old and new transforms are different.
- NS_UpdateHint(retval, nsChangeHint_UpdatePostTransformOverflow |
- nsChangeHint_UpdateTransformLayer);
+ retval |= nsChangeHint_UpdatePostTransformOverflow |
+ nsChangeHint_UpdateTransformLayer;
}
}
return retval;
}
bool
SVGTransformableElement::IsEventAttributeName(nsIAtom* aName)
{
--- a/dom/svg/nsSVGElement.cpp
+++ b/dom/svg/nsSVGElement.cpp
@@ -878,17 +878,17 @@ nsSVGElement::GetAttributeChangeHint(con
nsChangeHint retval =
nsSVGElementBase::GetAttributeChangeHint(aAttribute, aModType);
nsCOMPtr<SVGTests> tests = do_QueryObject(const_cast<nsSVGElement*>(this));
if (tests && tests->IsConditionalProcessingAttribute(aAttribute)) {
// It would be nice to only reconstruct the frame if the value returned by
// SVGTests::PassesConditionalProcessingTests has changed, but we don't
// know that
- NS_UpdateHint(retval, nsChangeHint_ReconstructFrame);
+ retval |= nsChangeHint_ReconstructFrame;
}
return retval;
}
bool
nsSVGElement::IsNodeOfType(uint32_t aFlags) const
{
return !(aFlags & ~eCONTENT);
--- a/layout/base/RestyleManager.cpp
+++ b/layout/base/RestyleManager.cpp
@@ -788,17 +788,17 @@ RestyleManager::ProcessRestyledFrames(ns
if ((hint & nsChangeHint_UpdateContainingBlock) && frame &&
!(hint & nsChangeHint_ReconstructFrame)) {
if (NeedToReframeForAddingOrRemovingTransform(frame) ||
frame->GetType() == nsGkAtoms::fieldSetFrame ||
frame->GetContentInsertionFrame() != frame) {
// The frame has positioned children that need to be reparented, or
// it can't easily be converted to/from being an abs-pos container correctly.
- NS_UpdateHint(hint, nsChangeHint_ReconstructFrame);
+ hint |= nsChangeHint_ReconstructFrame;
} else {
for (nsIFrame *cont = frame; cont;
cont = nsLayoutUtils::GetNextContinuationOrIBSplitSibling(cont)) {
// Normally frame construction would set state bits as needed,
// but we're not going to reconstruct the frame so we need to set them.
// It's because we need to set this state on each affected frame
// that we can't coalesce nsChangeHint_UpdateContainingBlock hints up
// to ancestors (i.e. it can't be an inherited change hint).
@@ -1058,17 +1058,17 @@ RestyleManager::RestyleElement(Element*
ResolveStyleFor(aElement, nullptr /* == oldContext->GetParent() */);
if (oldContext->StyleFont()->mFont.size !=
newContext->StyleFont()->mFont.size) {
// The basis for 'rem' units has changed.
mRebuildAllRestyleHint |= aRestyleHint;
if (aRestyleHint & eRestyle_SomeDescendants) {
mRebuildAllRestyleHint |= eRestyle_Subtree;
}
- NS_UpdateHint(mRebuildAllExtraHint, aMinHint);
+ mRebuildAllExtraHint |= aMinHint;
StartRebuildAllStyleData(aRestyleTracker);
return;
}
}
}
if (aMinHint & nsChangeHint_ReconstructFrame) {
FrameConstructor()->RecreateFramesForContent(aElement, false,
@@ -1207,17 +1207,17 @@ RestyleManager::ContentStateChanged(nsIC
uint8_t app = primaryFrame->StyleDisplay()->mAppearance;
if (app) {
nsITheme *theme = mPresContext->GetTheme();
if (theme && theme->ThemeSupportsWidget(mPresContext,
primaryFrame, app)) {
bool repaint = false;
theme->WidgetStateChanged(primaryFrame, app, nullptr, &repaint, nullptr);
if (repaint) {
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_RepaintFrame;
}
}
}
}
pseudoType = primaryFrame->StyleContext()->GetPseudoType();
primaryFrame->ContentStatesChanged(aStateMask);
@@ -1243,17 +1243,17 @@ RestyleManager::ContentStateChanged(nsIC
if (aStateMask.HasState(NS_EVENT_STATE_HOVER) && rshint != 0) {
++mHoverGeneration;
}
if (aStateMask.HasState(NS_EVENT_STATE_VISITED)) {
// Exposing information to the page about whether the link is
// visited or not isn't really something we can worry about here.
// FIXME: We could probably do this a bit better.
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_RepaintFrame;
}
PostRestyleEvent(aElement, rshint, hint);
return NS_OK;
}
// Forwarded nsIMutationObserver method, to handle restyling.
void
@@ -1337,17 +1337,17 @@ RestyleManager::AttributeChanged(Element
const nsStyleDisplay* disp = primaryFrame->StyleDisplay();
if (disp->mAppearance) {
nsITheme *theme = mPresContext->GetTheme();
if (theme && theme->ThemeSupportsWidget(mPresContext, primaryFrame, disp->mAppearance)) {
bool repaint = false;
theme->WidgetStateChanged(primaryFrame, disp->mAppearance, aAttribute,
&repaint, aOldValue);
if (repaint)
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_RepaintFrame;
}
}
// let the frame deal with it now, so we don't have to deal later
primaryFrame->AttributeChanged(aNameSpaceID, aAttribute, aModType);
// XXXwaterson should probably check for IB split siblings
// here, and propagate the AttributeChanged notification to
// them, as well. Currently, inline frames don't do anything on
@@ -1647,17 +1647,17 @@ RestyleManager::RebuildAllStyleData(nsCh
{
NS_ASSERTION(!(aExtraHint & nsChangeHint_ReconstructFrame),
"Should not reconstruct the root of the frame tree. "
"Use ReconstructDocElementHierarchy instead.");
MOZ_ASSERT(!(aRestyleHint & ~(eRestyle_Subtree | eRestyle_ForceDescendants)),
"the only bits allowed in aRestyleHint are eRestyle_Subtree and "
"eRestyle_ForceDescendants");
- NS_UpdateHint(mRebuildAllExtraHint, aExtraHint);
+ mRebuildAllExtraHint |= aExtraHint;
mRebuildAllRestyleHint |= aRestyleHint;
// Processing the style changes could cause a flush that propagates to
// the parent frame and thus destroys the pres shell, so we must hold
// a reference.
nsCOMPtr<nsIPresShell> presShell = mPresContext->GetPresShell();
if (!presShell || !presShell->GetRootFrame()) {
mDoRebuildAllStyleData = false;
@@ -1964,17 +1964,17 @@ RestyleManager::PostRebuildAllStyleDataE
NS_ASSERTION(!(aExtraHint & nsChangeHint_ReconstructFrame),
"Should not reconstruct the root of the frame tree. "
"Use ReconstructDocElementHierarchy instead.");
MOZ_ASSERT(!(aRestyleHint & eRestyle_SomeDescendants),
"PostRebuildAllStyleDataEvent does not handle "
"eRestyle_SomeDescendants");
mDoRebuildAllStyleData = true;
- NS_UpdateHint(mRebuildAllExtraHint, aExtraHint);
+ mRebuildAllExtraHint |= aExtraHint;
mRebuildAllRestyleHint |= aRestyleHint;
// Get a restyle event posted if necessary
PostRestyleEventInternal(false);
}
#ifdef DEBUG
static void
@@ -2744,17 +2744,17 @@ ElementRestyler::AddLayerChangesForAnima
// (nsChangeHint_UpdateContainingBlock) when we compare style contexts
// so we can skip adding any change hint here. (If we *were* to add
// nsChangeHint_UpdateTransformLayer, ApplyRenderingChangeToTree would
// complain that we're updating a transform layer without a transform).
if (layerInfo.mLayerType == nsDisplayItem::TYPE_TRANSFORM &&
!mFrame->StyleDisplay()->HasTransformStyle()) {
continue;
}
- NS_UpdateHint(hint, layerInfo.mChangeHint);
+ hint |= layerInfo.mChangeHint;
}
}
if (hint) {
mChangeList->AppendChange(mFrame, mContent, hint);
}
}
void
@@ -2790,28 +2790,29 @@ ElementRestyler::CaptureChange(nsStyleCo
// nsChangeHint_UpdateEffects is inherited, 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;
}
- NS_UpdateHint(ourChange, aChangeToAssume);
- if (NS_UpdateHint(mHintsHandled, ourChange)) {
+ ourChange |= aChangeToAssume;
+ if (!NS_IsHintSubset(ourChange, mHintsHandled)) {
+ mHintsHandled |= ourChange;
if (!(ourChange & nsChangeHint_ReconstructFrame) || mContent) {
LOG_RESTYLE("appending change %s",
RestyleManager::ChangeHintToString(ourChange).get());
mChangeList->AppendChange(mFrame, mContent, ourChange);
} else {
LOG_RESTYLE("change has already been handled");
}
}
- NS_UpdateHint(mHintsNotHandledForDescendants,
- NS_HintsNotHandledForDescendantsIn(ourChange));
+ mHintsNotHandledForDescendants |=
+ NS_HintsNotHandledForDescendantsIn(ourChange);
LOG_RESTYLE("mHintsNotHandledForDescendants = %s",
RestyleManager::ChangeHintToString(mHintsNotHandledForDescendants).get());
}
class MOZ_RAII AutoSelectorArrayTruncater final
{
public:
explicit AutoSelectorArrayTruncater(
@@ -3265,17 +3266,18 @@ ElementRestyler::Restyle(nsRestyleHint a
// and we post a restyle from the transition manager while
// computing style for the outer frame (to be computed after the
// descendants have been resolved), we don't want to consume it
// for the inner frame.
mContent->GetPrimaryFrame() == mFrame) {
mContent->OwnerDoc()->FlushPendingLinkUpdates();
nsAutoPtr<RestyleTracker::RestyleData> restyleData;
if (mRestyleTracker.GetRestyleData(mContent->AsElement(), restyleData)) {
- if (NS_UpdateHint(mHintsHandled, restyleData->mChangeHint)) {
+ if (!NS_IsHintSubset(restyleData->mChangeHint, mHintsHandled)) {
+ mHintsHandled |= restyleData->mChangeHint;
mChangeList->AppendChange(mFrame, mContent, restyleData->mChangeHint);
}
mSelectorsForDescendants.AppendElements(
restyleData->mRestyleHintData.mSelectorsForDescendants);
hintToRestore = restyleData->mRestyleHint;
hintDataToRestore = Move(restyleData->mRestyleHintData);
aRestyleHint = nsRestyleHint(aRestyleHint | restyleData->mRestyleHint);
descendants.SwapElements(restyleData->mDescendants);
@@ -3998,17 +4000,17 @@ ElementRestyler::RestyleSelf(nsIFrame* a
pseudoTag == nsCSSPseudoElements::after) {
// XXX what other pseudos do we need to treat like this?
newContext = styleSet->ProbePseudoElementStyle(element,
pseudoType,
parentContext,
mTreeMatchContext);
if (!newContext) {
// This pseudo should no longer exist; gotta reframe
- NS_UpdateHint(mHintsHandled, nsChangeHint_ReconstructFrame);
+ mHintsHandled |= nsChangeHint_ReconstructFrame;
mChangeList->AppendChange(aSelf, element,
nsChangeHint_ReconstructFrame);
// We're reframing anyway; just keep the same context
newContext = oldContext;
#ifdef DEBUG
// oldContext's parent might have had its style structs swapped out
// with parentContext, so to avoid any assertions that might
// otherwise trigger in oldContext's parent's destructor, we set a
@@ -4734,17 +4736,17 @@ ElementRestyler::MaybeReframeForPseudo(C
nsIContent* aContent,
nsStyleContext* aStyleContext)
{
if (MustReframeForPseudo(aPseudoType, aGenConParentFrame, aFrame, aContent,
aStyleContext)) {
// Have to create the new ::before/::after frame.
LOG_RESTYLE("MaybeReframeForPseudo, appending "
"nsChangeHint_ReconstructFrame");
- NS_UpdateHint(mHintsHandled, nsChangeHint_ReconstructFrame);
+ mHintsHandled |= nsChangeHint_ReconstructFrame;
mChangeList->AppendChange(aFrame, aContent, nsChangeHint_ReconstructFrame);
}
}
bool
ElementRestyler::MustReframeForPseudo(CSSPseudoElementType aPseudoType,
nsIFrame* aGenConParentFrame,
nsIFrame* aFrame,
--- a/layout/base/RestyleTracker.h
+++ b/layout/base/RestyleTracker.h
@@ -460,17 +460,17 @@ RestyleTracker::AddPendingRestyleToTable
mPendingRestyles.Put(aElement, rd);
return false;
}
bool hadRestyleLaterSiblings =
(existingData->mRestyleHint & eRestyle_LaterSiblings) != 0;
existingData->mRestyleHint =
nsRestyleHint(existingData->mRestyleHint | aRestyleHint);
- NS_UpdateHint(existingData->mChangeHint, aMinChangeHint);
+ existingData->mChangeHint |= aMinChangeHint;
if (aRestyleHintData) {
existingData->mRestyleHintData.mSelectorsForDescendants
.AppendElements(aRestyleHintData->mSelectorsForDescendants);
}
return hadRestyleLaterSiblings;
}
--- a/layout/base/nsChangeHint.h
+++ b/layout/base/nsChangeHint.h
@@ -215,25 +215,16 @@ inline void operator<(nsChangeHint s1, n
inline void operator>(nsChangeHint s1, nsChangeHint s2) {}
inline void operator!=(nsChangeHint s1, nsChangeHint s2) {}
inline void operator==(nsChangeHint s1, nsChangeHint s2) {}
inline void operator<=(nsChangeHint s1, nsChangeHint s2) {}
inline void operator>=(nsChangeHint s1, nsChangeHint s2) {}
// Operators on nsChangeHints
-// Merge the "src" hint into the "dst" hint
-// Returns true iff the destination changed
-inline bool NS_UpdateHint(nsChangeHint& aDest, nsChangeHint aSrc) {
- nsChangeHint r = (nsChangeHint)(aDest | aSrc);
- bool changed = (int)r != (int)aDest;
- aDest = r;
- return changed;
-}
-
// Returns true iff the second hint contains all the hints of the first hint
inline bool NS_IsHintSubset(nsChangeHint aSubset, nsChangeHint aSuperSet) {
return (aSubset & aSuperSet) == aSubset;
}
// The functions below need an integral type to cast to to avoid
// infinite recursion.
typedef decltype(nsChangeHint(0) + nsChangeHint(0)) nsChangeHint_size_t;
@@ -321,32 +312,32 @@ inline nsChangeHint NS_HintsNotHandledFo
nsChangeHint_UpdateComputedBSize |
nsChangeHint_UpdateUsesOpacity | \
nsChangeHint_UpdateBackgroundPosition));
if (!NS_IsHintSubset(nsChangeHint_NeedDirtyReflow, aChangeHint)) {
if (NS_IsHintSubset(nsChangeHint_NeedReflow, aChangeHint)) {
// If NeedDirtyReflow is *not* set, then NeedReflow is a
// non-inherited hint.
- NS_UpdateHint(result, nsChangeHint_NeedReflow);
+ result |= nsChangeHint_NeedReflow;
}
if (NS_IsHintSubset(nsChangeHint_ReflowChangesSizeOrPosition,
aChangeHint)) {
// If NeedDirtyReflow is *not* set, then ReflowChangesSizeOrPosition is a
// non-inherited hint.
- NS_UpdateHint(result, nsChangeHint_ReflowChangesSizeOrPosition);
+ result |= nsChangeHint_ReflowChangesSizeOrPosition;
}
}
if (!NS_IsHintSubset(nsChangeHint_ClearDescendantIntrinsics, aChangeHint) &&
NS_IsHintSubset(nsChangeHint_ClearAncestorIntrinsics, aChangeHint)) {
// If ClearDescendantIntrinsics is *not* set, then
// ClearAncestorIntrinsics is a non-inherited hint.
- NS_UpdateHint(result, nsChangeHint_ClearAncestorIntrinsics);
+ result |= nsChangeHint_ClearAncestorIntrinsics;
}
MOZ_ASSERT(NS_IsHintSubset(result,
nsChangeHint_Hints_NotHandledForDescendants),
"something is inconsistent");
return result;
}
--- a/layout/base/nsPresContext.cpp
+++ b/layout/base/nsPresContext.cpp
@@ -763,17 +763,17 @@ nsPresContext::UpdateAfterPreferencesCha
}
InvalidatePaintedLayers();
mDeviceContext->FlushFontCache();
nsChangeHint hint = nsChangeHint(0);
if (mPrefChangePendingNeedsReflow) {
- NS_UpdateHint(hint, NS_STYLE_HINT_REFLOW);
+ 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);
}
nsresult
--- a/layout/base/nsStyleChangeList.cpp
+++ b/layout/base/nsStyleChangeList.cpp
@@ -83,17 +83,17 @@ nsStyleChangeList::AppendChange(nsIFrame
}
}
}
}
}
int32_t last = mCount - 1;
if ((0 < mCount) && aFrame && (aFrame == mArray[last].mFrame)) { // same as last frame
- NS_UpdateHint(mArray[last].mHint, aHint);
+ mArray[last].mHint |= aHint;
}
else {
if (mCount == mArraySize) {
int32_t newSize = mArraySize + kGrowArrayBy;
nsStyleChangeData* newArray = new nsStyleChangeData[newSize];
if (newArray) {
memcpy(newArray, mArray, mCount * sizeof(nsStyleChangeData));
if (mArray != mBuffer) {
--- a/layout/style/nsStyleContext.cpp
+++ b/layout/style/nsStyleContext.cpp
@@ -936,17 +936,17 @@ nsStyleContext::CalcStyleDifference(nsSt
} else if (compare || \
((maxDifference & ~differenceAlwaysHandledForDescendants) & \
aParentHintsNotHandledForDescendants)) { \
nsChangeHint difference = \
this##struct_->CalcDifference(*other##struct_ EXTRA_DIFF_ARGS); \
NS_ASSERTION(NS_IsHintSubset(difference, maxDifference), \
"CalcDifference() returned bigger hint than " \
"MaxDifference()"); \
- NS_UpdateHint(hint, difference); \
+ hint |= difference; \
if (!difference) { \
*aEqualStructs |= NS_STYLE_INHERIT_BIT(struct_); \
} \
} else { \
/* We still must call CalcDifference to see if there were any */ \
/* changes so that we can set *aEqualStructs appropriately. */ \
nsChangeHint difference = \
this##struct_->CalcDifference(*other##struct_ EXTRA_DIFF_ARGS); \
@@ -1049,17 +1049,17 @@ nsStyleContext::CalcStyleDifference(nsSt
// here, we add nsChangeHint_RepaintFrame hints (the maximum for
// things that can depend on :visited) for the properties on which we
// call GetVisitedDependentColor.
nsStyleContext *thisVis = GetStyleIfVisited(),
*otherVis = aOther->GetStyleIfVisited();
if (!thisVis != !otherVis) {
// One style context has a style-if-visited and the other doesn't.
// Presume a difference.
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_RepaintFrame;
} else if (thisVis && !NS_IsHintSubset(nsChangeHint_RepaintFrame, hint)) {
// Both style contexts have a style-if-visited.
bool change = false;
// NB: Calling Peek on |this|, not |thisVis|, since callers may look
// at a struct on |this| without looking at the same struct on
// |thisVis| (including this function if we skip one of these checks
// due to change being true already or due to the old style context
@@ -1166,17 +1166,17 @@ nsStyleContext::CalcStyleDifference(nsSt
const nsStyleSVG *otherVisSVG = otherVis->StyleSVG();
if (thisVisSVG->mFill != otherVisSVG->mFill ||
thisVisSVG->mStroke != otherVisSVG->mStroke) {
change = true;
}
}
if (change) {
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_RepaintFrame;
}
}
return hint & ~nsChangeHint_NeutralChange;
}
#ifdef DEBUG
void nsStyleContext::List(FILE* out, int32_t aIndent, bool aListDescendants)
--- a/layout/style/nsStyleStruct.cpp
+++ b/layout/style/nsStyleStruct.cpp
@@ -911,59 +911,58 @@ nsChangeHint nsStyleSVG::CalcDifference(
nsChangeHint hint = nsChangeHint(0);
if (!EqualURIs(mMarkerEnd, aOther.mMarkerEnd) ||
!EqualURIs(mMarkerMid, aOther.mMarkerMid) ||
!EqualURIs(mMarkerStart, aOther.mMarkerStart)) {
// Markers currently contribute to nsSVGPathGeometryFrame::mRect,
// so we need a reflow as well as a repaint. No intrinsic sizes need
// to change, so nsChangeHint_NeedReflow is sufficient.
- NS_UpdateHint(hint, nsChangeHint_UpdateEffects);
- NS_UpdateHint(hint, nsChangeHint_NeedReflow);
- NS_UpdateHint(hint, nsChangeHint_NeedDirtyReflow); // XXX remove me: bug 876085
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
- return hint;
+ return nsChangeHint_UpdateEffects |
+ nsChangeHint_NeedReflow |
+ nsChangeHint_NeedDirtyReflow | // XXX remove me: bug 876085
+ nsChangeHint_RepaintFrame;
}
if (mFill != aOther.mFill ||
mStroke != aOther.mStroke ||
mFillOpacity != aOther.mFillOpacity ||
mStrokeOpacity != aOther.mStrokeOpacity) {
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_RepaintFrame;
if (HasStroke() != aOther.HasStroke() ||
(!HasStroke() && HasFill() != aOther.HasFill())) {
// Frame bounds and overflow rects depend on whether we "have" fill or
// stroke. Whether we have stroke or not just changed, or else we have no
// stroke (in which case whether we have fill or not is significant to frame
// bounds) and whether we have fill or not just changed. In either case we
// need to reflow so the frame rect is updated.
// XXXperf this is a waste on non nsSVGPathGeometryFrames.
- NS_UpdateHint(hint, nsChangeHint_NeedReflow);
- NS_UpdateHint(hint, nsChangeHint_NeedDirtyReflow); // XXX remove me: bug 876085
+ hint |= nsChangeHint_NeedReflow |
+ nsChangeHint_NeedDirtyReflow; // XXX remove me: bug 876085
}
if (PaintURIChanged(mFill, aOther.mFill) ||
PaintURIChanged(mStroke, aOther.mStroke)) {
- NS_UpdateHint(hint, nsChangeHint_UpdateEffects);
+ hint |= nsChangeHint_UpdateEffects;
}
}
// Stroke currently contributes to nsSVGPathGeometryFrame::mRect, so
// we need a reflow here. No intrinsic sizes need to change, so
// nsChangeHint_NeedReflow is sufficient.
// Note that stroke-dashoffset does not affect nsSVGPathGeometryFrame::mRect.
// text-anchor changes also require a reflow since it changes frames' rects.
if (mStrokeWidth != aOther.mStrokeWidth ||
mStrokeMiterlimit != aOther.mStrokeMiterlimit ||
mStrokeLinecap != aOther.mStrokeLinecap ||
mStrokeLinejoin != aOther.mStrokeLinejoin ||
mTextAnchor != aOther.mTextAnchor) {
- NS_UpdateHint(hint, nsChangeHint_NeedReflow);
- NS_UpdateHint(hint, nsChangeHint_NeedDirtyReflow); // XXX remove me: bug 876085
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
- return hint;
+ return hint |
+ nsChangeHint_NeedReflow |
+ nsChangeHint_NeedDirtyReflow | // XXX remove me: bug 876085
+ nsChangeHint_RepaintFrame;
}
if (hint & nsChangeHint_RepaintFrame) {
return hint; // we don't add anything else below
}
if ( mStrokeDashoffset != aOther.mStrokeDashoffset ||
mClipRule != aOther.mClipRule ||
@@ -973,26 +972,25 @@ nsChangeHint nsStyleSVG::CalcDifference(
mPaintOrder != aOther.mPaintOrder ||
mShapeRendering != aOther.mShapeRendering ||
mStrokeDasharrayLength != aOther.mStrokeDasharrayLength ||
mFillOpacitySource != aOther.mFillOpacitySource ||
mStrokeOpacitySource != aOther.mStrokeOpacitySource ||
mStrokeDasharrayFromObject != aOther.mStrokeDasharrayFromObject ||
mStrokeDashoffsetFromObject != aOther.mStrokeDashoffsetFromObject ||
mStrokeWidthFromObject != aOther.mStrokeWidthFromObject) {
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
- return hint;
+ return hint | nsChangeHint_RepaintFrame;
}
// length of stroke dasharrays are the same (tested above) - check entries
- for (uint32_t i=0; i<mStrokeDasharrayLength; i++)
+ for (uint32_t i=0; i<mStrokeDasharrayLength; i++) {
if (mStrokeDasharray[i] != aOther.mStrokeDasharray[i]) {
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
- return hint;
+ return hint | nsChangeHint_RepaintFrame;
}
+ }
return hint;
}
// --------------------
// nsStyleBasicShape
nsCSSKeyword
@@ -1281,42 +1279,42 @@ void nsStyleSVGReset::Destroy(nsPresCont
FreeByObjectID(mozilla::eArenaObjectID_nsStyleSVGReset, this);
}
nsChangeHint nsStyleSVGReset::CalcDifference(const nsStyleSVGReset& aOther) const
{
nsChangeHint hint = nsChangeHint(0);
if (mClipPath != aOther.mClipPath) {
- NS_UpdateHint(hint, nsChangeHint_UpdateEffects);
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_UpdateEffects |
+ nsChangeHint_RepaintFrame;
// clip-path changes require that we update the PreEffectsBBoxProperty,
// which is done during overflow computation.
- NS_UpdateHint(hint, nsChangeHint_UpdateOverflow);
+ hint |= nsChangeHint_UpdateOverflow;
}
if (mDominantBaseline != aOther.mDominantBaseline) {
// XXXjwatt: why NS_STYLE_HINT_REFLOW? Isn't that excessive?
- NS_UpdateHint(hint, NS_STYLE_HINT_REFLOW);
+ hint |= NS_STYLE_HINT_REFLOW;
} else if (mVectorEffect != aOther.mVectorEffect) {
// Stroke currently affects nsSVGPathGeometryFrame::mRect, and
// vector-effect affect stroke. As a result we need to reflow if
// vector-effect changes in order to have nsSVGPathGeometryFrame::
// ReflowSVG called to update its mRect. No intrinsic sizes need
// to change so nsChangeHint_NeedReflow is sufficient.
- NS_UpdateHint(hint, nsChangeHint_NeedReflow);
- NS_UpdateHint(hint, nsChangeHint_NeedDirtyReflow); // XXX remove me: bug 876085
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_NeedReflow |
+ nsChangeHint_NeedDirtyReflow | // XXX remove me: bug 876085
+ nsChangeHint_RepaintFrame;
} else if (mStopColor != aOther.mStopColor ||
mFloodColor != aOther.mFloodColor ||
mLightingColor != aOther.mLightingColor ||
mStopOpacity != aOther.mStopOpacity ||
mFloodOpacity != aOther.mFloodOpacity ||
mMaskType != aOther.mMaskType) {
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_RepaintFrame;
}
hint |= mMask.CalcDifference(aOther.mMask);
return hint;
}
// nsStyleSVGPaint implementation
@@ -1508,26 +1506,26 @@ IsAutonessEqual(const nsStyleSides& aSid
nsChangeHint
nsStylePosition::CalcDifference(const nsStylePosition& aOther,
const nsStyleVisibility* aOldStyleVisibility) const
{
nsChangeHint hint = nsChangeHint(0);
// Changes to "z-index" require a repaint.
if (mZIndex != aOther.mZIndex) {
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ 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
// can adjust the size & position of the subdocument.
if (mObjectFit != aOther.mObjectFit ||
mObjectPosition != aOther.mObjectPosition) {
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame |
- nsChangeHint_NeedReflow);
+ hint |= nsChangeHint_RepaintFrame |
+ nsChangeHint_NeedReflow;
}
if (mOrder != aOther.mOrder) {
// "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
@@ -1594,23 +1592,23 @@ nsStylePosition::CalcDifference(const ns
nsChangeHint_AllReflowHints;
}
// Changing 'justify-content/items/self' might affect the positioning,
// but it won't affect any sizing.
if (mJustifyContent != aOther.mJustifyContent ||
mJustifyItems != aOther.mJustifyItems ||
mJustifySelf != aOther.mJustifySelf) {
- NS_UpdateHint(hint, nsChangeHint_NeedReflow);
+ hint |= nsChangeHint_NeedReflow;
}
// 'align-content' doesn't apply to a single-line flexbox but we don't know
// if we're a flex container at this point so we can't optimize for that.
if (mAlignContent != aOther.mAlignContent) {
- NS_UpdateHint(hint, nsChangeHint_NeedReflow);
+ hint |= nsChangeHint_NeedReflow;
}
bool widthChanged = mWidth != aOther.mWidth ||
mMinWidth != aOther.mMinWidth ||
mMaxWidth != aOther.mMaxWidth;
bool heightChanged = mHeight != aOther.mHeight ||
mMinHeight != aOther.mMinHeight ||
mMaxHeight != aOther.mMaxHeight;
@@ -1629,48 +1627,48 @@ nsStylePosition::CalcDifference(const ns
if (aOldStyleVisibility) {
bool isVertical = WritingMode(aOldStyleVisibility).IsVertical();
if (isVertical ? widthChanged : heightChanged) {
// Block-size changes can affect descendant intrinsic sizes due to
// replaced elements with percentage bsizes in descendants which
// also have percentage bsizes. This is handled via
// nsChangeHint_UpdateComputedBSize which clears intrinsic sizes
// for frames that have such replaced elements.
- NS_UpdateHint(hint, nsChangeHint_NeedReflow |
- nsChangeHint_UpdateComputedBSize |
- nsChangeHint_ReflowChangesSizeOrPosition);
+ hint |= nsChangeHint_NeedReflow |
+ 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.
- NS_UpdateHint(hint, nsChangeHint_AllReflowHints &
- ~(nsChangeHint_ClearDescendantIntrinsics |
- nsChangeHint_NeedDirtyReflow));
+ hint |= nsChangeHint_AllReflowHints &
+ ~(nsChangeHint_ClearDescendantIntrinsics |
+ nsChangeHint_NeedDirtyReflow);
}
} else {
if (widthChanged || heightChanged) {
- NS_UpdateHint(hint, nsChangeHint_NeutralChange);
+ hint |= nsChangeHint_NeutralChange;
}
}
// If any of the offsets have changed, then return the respective hints
// so that we would hopefully be able to avoid reflowing.
// Note that it is possible that we'll need to reflow when processing
// restyles, but we don't have enough information to make a good decision
// 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 != aOther.mOffset) {
if (IsAutonessEqual(mOffset, aOther.mOffset)) {
- NS_UpdateHint(hint, nsChangeHint(nsChangeHint_RecomputePosition |
- nsChangeHint_UpdateParentOverflow));
+ hint |= nsChangeHint_RecomputePosition |
+ nsChangeHint_UpdateParentOverflow;
} else {
- NS_UpdateHint(hint, nsChangeHint_AllReflowHints);
+ hint |= nsChangeHint_AllReflowHints;
}
}
return hint;
}
/* static */ bool
nsStylePosition::WidthCoordDependsOnContainer(const nsStyleCoord &aCoord)
{
@@ -2359,17 +2357,17 @@ nsStyleImageLayers::CalcDifference(const
mClipCount != aOther.mClipCount ||
mCompositeCount != aOther.mCompositeCount ||
mMaskModeCount != aOther.mMaskModeCount ||
mOriginCount != aOther.mOriginCount ||
mRepeatCount != aOther.mRepeatCount ||
mPositionXCount != aOther.mPositionXCount ||
mPositionYCount != aOther.mPositionYCount ||
mSizeCount != aOther.mSizeCount) {
- NS_UpdateHint(hint, nsChangeHint_NeutralChange);
+ hint |= nsChangeHint_NeutralChange;
}
return hint;
}
bool
nsStyleImageLayers::HasLayerWithImage() const
{
@@ -2577,21 +2575,21 @@ nsStyleImageLayers::Layer::operator==(co
EqualURIs(mSourceURI, aOther.mSourceURI);
}
nsChangeHint
nsStyleImageLayers::Layer::CalcDifference(const nsStyleImageLayers::Layer& aOther) const
{
nsChangeHint hint = nsChangeHint(0);
if (!EqualURIs(mSourceURI, aOther.mSourceURI)) {
- NS_UpdateHint(hint, nsChangeHint_UpdateEffects);
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_UpdateEffects |
+ nsChangeHint_RepaintFrame;
// Mask changes require that we update the PreEffectsBBoxProperty,
// which is done during overflow computation.
- NS_UpdateHint(hint, nsChangeHint_UpdateOverflow);
+ hint |= nsChangeHint_UpdateOverflow;
} else if (mAttachment != aOther.mAttachment ||
mClip != aOther.mClip ||
mOrigin != aOther.mOrigin ||
mRepeat != aOther.mRepeat ||
mBlendMode != aOther.mBlendMode ||
mSize != aOther.mSize ||
mImage != aOther.mImage ||
mMaskMode != aOther.mMaskMode ||
@@ -2940,17 +2938,17 @@ nsChangeHint nsStyleDisplay::CalcDiffere
|| mScrollBehavior != aOther.mScrollBehavior
|| mScrollSnapTypeX != aOther.mScrollSnapTypeX
|| mScrollSnapTypeY != aOther.mScrollSnapTypeY
|| mScrollSnapPointsX != aOther.mScrollSnapPointsX
|| mScrollSnapPointsY != aOther.mScrollSnapPointsY
|| mScrollSnapDestination != aOther.mScrollSnapDestination
|| mTopLayer != aOther.mTopLayer
|| mResize != aOther.mResize)
- NS_UpdateHint(hint, nsChangeHint_ReconstructFrame);
+ hint |= nsChangeHint_ReconstructFrame;
/* Note: When mScrollBehavior, mScrollSnapTypeX, mScrollSnapTypeY,
* mScrollSnapPointsX, mScrollSnapPointsY, or mScrollSnapDestination are
* changed, nsChangeHint_NeutralChange is not sufficient to enter
* nsCSSFrameConstructor::PropagateScrollToViewport. By using the same hint
* as used when the overflow css property changes,
* nsChangeHint_ReconstructFrame, PropagateScrollToViewport will be called.
*
@@ -2969,131 +2967,131 @@ nsChangeHint nsStyleDisplay::CalcDiffere
// 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 (mFloats != aOther.mFloats) {
// Changing which side we float on doesn't affect descendants directly
- NS_UpdateHint(hint, nsChangeHint_AllReflowHints &
- ~(nsChangeHint_ClearDescendantIntrinsics |
- nsChangeHint_NeedDirtyReflow));
+ hint |= nsChangeHint_AllReflowHints &
+ ~(nsChangeHint_ClearDescendantIntrinsics |
+ nsChangeHint_NeedDirtyReflow);
}
if (mVerticalAlign != aOther.mVerticalAlign) {
// XXX Can this just be AllReflowHints + RepaintFrame, and be included in
// the block below?
- NS_UpdateHint(hint, NS_STYLE_HINT_REFLOW);
+ hint |= NS_STYLE_HINT_REFLOW;
}
// XXX the following is conservative, for now: changing float breaking shouldn't
// necessarily require a repaint, reflow should suffice.
if (mBreakType != aOther.mBreakType
|| mBreakInside != aOther.mBreakInside
|| mBreakBefore != aOther.mBreakBefore
|| mBreakAfter != aOther.mBreakAfter
|| mAppearance != aOther.mAppearance
|| mOrient != aOther.mOrient
|| mOverflowClipBox != aOther.mOverflowClipBox)
- NS_UpdateHint(hint, nsChangeHint_AllReflowHints |
- nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_AllReflowHints |
+ nsChangeHint_RepaintFrame;
if (mIsolation != aOther.mIsolation) {
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_RepaintFrame;
}
/* If we've added or removed the transform property, we need to reconstruct the frame to add
* or remove the view object, and also to handle abs-pos and fixed-pos containers.
*/
if (HasTransformStyle() != aOther.HasTransformStyle()) {
// We do not need to apply nsChangeHint_UpdateTransformLayer since
// nsChangeHint_RepaintFrame will forcibly invalidate the frame area and
// ensure layers are rebuilt (or removed).
- NS_UpdateHint(hint, nsChangeHint_UpdateContainingBlock |
- nsChangeHint_UpdateOverflow |
- nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_UpdateContainingBlock |
+ nsChangeHint_UpdateOverflow |
+ nsChangeHint_RepaintFrame;
} else {
/* Otherwise, if we've kept the property lying around and we already had a
* transform, we need to see whether or not we've changed the transform.
* 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);
if (!mSpecifiedTransform != !aOther.mSpecifiedTransform ||
(mSpecifiedTransform &&
*mSpecifiedTransform != *aOther.mSpecifiedTransform)) {
- NS_UpdateHint(transformHint, nsChangeHint_UpdateTransformLayer);
+ transformHint |= nsChangeHint_UpdateTransformLayer;
if (mSpecifiedTransform &&
aOther.mSpecifiedTransform) {
- NS_UpdateHint(transformHint, nsChangeHint_UpdatePostTransformOverflow);
+ transformHint |= nsChangeHint_UpdatePostTransformOverflow;
} else {
- NS_UpdateHint(transformHint, nsChangeHint_UpdateOverflow);
+ transformHint |= nsChangeHint_UpdateOverflow;
}
}
const nsChangeHint kUpdateOverflowAndRepaintHint =
nsChangeHint_UpdateOverflow | nsChangeHint_RepaintFrame;
for (uint8_t index = 0; index < 3; ++index)
if (mTransformOrigin[index] != aOther.mTransformOrigin[index]) {
- NS_UpdateHint(transformHint, nsChangeHint_UpdateTransformLayer |
- nsChangeHint_UpdatePostTransformOverflow);
+ transformHint |= nsChangeHint_UpdateTransformLayer |
+ nsChangeHint_UpdatePostTransformOverflow;
break;
}
for (uint8_t index = 0; index < 2; ++index)
if (mPerspectiveOrigin[index] != aOther.mPerspectiveOrigin[index]) {
- NS_UpdateHint(transformHint, kUpdateOverflowAndRepaintHint);
+ transformHint |= kUpdateOverflowAndRepaintHint;
break;
}
if (HasPerspectiveStyle() != aOther.HasPerspectiveStyle()) {
// A change from/to being a containing block for position:fixed.
- NS_UpdateHint(hint, nsChangeHint_UpdateContainingBlock);
+ hint |= nsChangeHint_UpdateContainingBlock;
}
if (mChildPerspective != aOther.mChildPerspective ||
mTransformStyle != aOther.mTransformStyle ||
mTransformBox != aOther.mTransformBox)
- NS_UpdateHint(transformHint, kUpdateOverflowAndRepaintHint);
+ transformHint |= kUpdateOverflowAndRepaintHint;
if (mBackfaceVisibility != aOther.mBackfaceVisibility)
- NS_UpdateHint(transformHint, nsChangeHint_RepaintFrame);
+ transformHint |= nsChangeHint_RepaintFrame;
if (transformHint) {
if (HasTransformStyle()) {
- NS_UpdateHint(hint, transformHint);
+ hint |= transformHint;
} else {
- NS_UpdateHint(hint, nsChangeHint_NeutralChange);
+ hint |= nsChangeHint_NeutralChange;
}
}
}
// Note that the HasTransformStyle() != aOther.HasTransformStyle()
// test above handles relevant changes in the
// NS_STYLE_WILL_CHANGE_TRANSFORM bit, which in turn handles frame
// reconstruction for changes in the containing block of
// fixed-positioned elements.
uint8_t willChangeBitsChanged =
mWillChangeBitField ^ aOther.mWillChangeBitField;
if (willChangeBitsChanged & (NS_STYLE_WILL_CHANGE_STACKING_CONTEXT |
NS_STYLE_WILL_CHANGE_SCROLL |
NS_STYLE_WILL_CHANGE_OPACITY)) {
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_RepaintFrame;
}
if (willChangeBitsChanged & NS_STYLE_WILL_CHANGE_FIXPOS_CB) {
- NS_UpdateHint(hint, nsChangeHint_UpdateContainingBlock);
+ hint |= nsChangeHint_UpdateContainingBlock;
}
// Note: Our current behavior for handling changes to the
// transition-duration, transition-delay, and transition-timing-function
// properties is to do nothing. In other words, the transition
// property that matters is what it is when the transition begins, and
// we don't stop a transition later because the transition property
// changed.
@@ -3122,17 +3120,17 @@ nsChangeHint nsStyleDisplay::CalcDiffere
mAnimationDurationCount != aOther.mAnimationDurationCount ||
mAnimationDelayCount != aOther.mAnimationDelayCount ||
mAnimationNameCount != aOther.mAnimationNameCount ||
mAnimationDirectionCount != aOther.mAnimationDirectionCount ||
mAnimationFillModeCount != aOther.mAnimationFillModeCount ||
mAnimationPlayStateCount != aOther.mAnimationPlayStateCount ||
mAnimationIterationCountCount != aOther.mAnimationIterationCountCount ||
mScrollSnapCoordinate != aOther.mScrollSnapCoordinate)) {
- NS_UpdateHint(hint, nsChangeHint_NeutralChange);
+ hint |= nsChangeHint_NeutralChange;
}
return hint;
}
// --------------------
// nsStyleVisibility
//
@@ -3165,39 +3163,39 @@ nsStyleVisibility::nsStyleVisibility(con
nsChangeHint nsStyleVisibility::CalcDifference(const nsStyleVisibility& aOther) const
{
nsChangeHint hint = nsChangeHint(0);
if (mDirection != aOther.mDirection || mWritingMode != aOther.mWritingMode) {
// It's important that a change in mWritingMode results in frame
// reconstruction, because it may affect intrinsic size (see
// nsSubDocumentFrame::GetIntrinsicISize/BSize).
- NS_UpdateHint(hint, nsChangeHint_ReconstructFrame);
+ hint |= nsChangeHint_ReconstructFrame;
} else {
if ((mImageOrientation != aOther.mImageOrientation)) {
- NS_UpdateHint(hint, nsChangeHint_AllReflowHints);
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_AllReflowHints |
+ nsChangeHint_RepaintFrame;
}
if (mVisible != aOther.mVisible) {
if ((NS_STYLE_VISIBILITY_COLLAPSE == mVisible) ||
(NS_STYLE_VISIBILITY_COLLAPSE == aOther.mVisible)) {
- NS_UpdateHint(hint, NS_STYLE_HINT_REFLOW);
+ hint |= NS_STYLE_HINT_REFLOW;
} else {
- NS_UpdateHint(hint, NS_STYLE_HINT_VISUAL);
+ hint |= NS_STYLE_HINT_VISUAL;
}
}
if (mTextOrientation != aOther.mTextOrientation) {
- NS_UpdateHint(hint, NS_STYLE_HINT_REFLOW);
+ hint |= NS_STYLE_HINT_REFLOW;
}
if (mImageRendering != aOther.mImageRendering) {
hint |= nsChangeHint_RepaintFrame;
}
if (mColorAdjust != aOther.mColorAdjust) {
// color-adjust only affects media where dynamic changes can't happen.
- NS_UpdateHint(hint, nsChangeHint_NeutralChange);
+ hint |= nsChangeHint_NeutralChange;
}
}
return hint;
}
nsStyleContentData::~nsStyleContentData()
{
MOZ_ASSERT(!mImageTracked,
@@ -3675,18 +3673,18 @@ nsChangeHint nsStyleText::CalcDifference
"If the text-emphasis-color are both foreground color, "
"mTextEmphasisColor should also be identical");
if (mTextEmphasisColorForeground != aOther.mTextEmphasisColorForeground ||
mTextEmphasisColor != aOther.mTextEmphasisColor ||
mWebkitTextFillColorForeground != aOther.mWebkitTextFillColorForeground ||
mWebkitTextFillColor != aOther.mWebkitTextFillColor ||
mWebkitTextStrokeColorForeground != aOther.mWebkitTextStrokeColorForeground ||
mWebkitTextStrokeColor != aOther.mWebkitTextStrokeColor) {
- NS_UpdateHint(hint, nsChangeHint_SchedulePaint);
- NS_UpdateHint(hint, nsChangeHint_RepaintFrame);
+ hint |= nsChangeHint_SchedulePaint |
+ nsChangeHint_RepaintFrame;
}
if (hint) {
return hint;
}
if (mTextEmphasisPosition != aOther.mTextEmphasisPosition) {
return nsChangeHint_NeutralChange;
@@ -3778,45 +3776,45 @@ nsStyleUserInterface::~nsStyleUserInterf
MOZ_COUNT_DTOR(nsStyleUserInterface);
delete [] mCursorArray;
}
nsChangeHint nsStyleUserInterface::CalcDifference(const nsStyleUserInterface& aOther) const
{
nsChangeHint hint = nsChangeHint(0);
if (mCursor != aOther.mCursor)
- NS_UpdateHint(hint, nsChangeHint_UpdateCursor);
+ hint |= nsChangeHint_UpdateCursor;
// We could do better. But it wouldn't be worth it, URL-specified cursors are
// rare.
if (mCursorArrayLength > 0 || aOther.mCursorArrayLength > 0)
- NS_UpdateHint(hint, nsChangeHint_UpdateCursor);
+ hint |= nsChangeHint_UpdateCursor;
if (mPointerEvents != aOther.mPointerEvents) {
// nsSVGPathGeometryFrame's mRect depends on stroke _and_ on the value
// of pointer-events. See nsSVGPathGeometryFrame::ReflowSVG's use of
// GetHitTestFlags. (Only a reflow, no visual change.)
hint |= nsChangeHint_NeedReflow |
nsChangeHint_NeedDirtyReflow; // XXX remove me: bug 876085
}
if (mUserModify != aOther.mUserModify)
- NS_UpdateHint(hint, NS_STYLE_HINT_VISUAL);
+ hint |= NS_STYLE_HINT_VISUAL;
if (mUserInput != aOther.mUserInput) {
if (NS_STYLE_USER_INPUT_NONE == mUserInput ||
NS_STYLE_USER_INPUT_NONE == aOther.mUserInput) {
- NS_UpdateHint(hint, NS_STYLE_HINT_FRAMECHANGE);
+ hint |= NS_STYLE_HINT_FRAMECHANGE;
} else {
- NS_UpdateHint(hint, nsChangeHint_NeutralChange);
+ hint |= nsChangeHint_NeutralChange;
}
}
if (mUserFocus != aOther.mUserFocus) {
- NS_UpdateHint(hint, nsChangeHint_NeutralChange);
+ hint |= nsChangeHint_NeutralChange;
}
return hint;
}
void
nsStyleUserInterface::CopyCursorArrayFrom(const nsStyleUserInterface& aSource)
{
--- a/layout/svg/nsSVGEffects.cpp
+++ b/layout/svg/nsSVGEffects.cpp
@@ -321,22 +321,22 @@ nsSVGFilterProperty::DoUpdate()
// Repaint asynchronously in case the filter frame is being torn down
nsChangeHint changeHint =
nsChangeHint(nsChangeHint_RepaintFrame);
if (frame && frame->IsFrameOfType(nsIFrame::eSVG)) {
// Changes should propagate out to things that might be observing
// the referencing frame or its ancestors.
- NS_UpdateHint(changeHint, nsChangeHint_InvalidateRenderingObservers);
+ changeHint |= nsChangeHint_InvalidateRenderingObservers;
}
// Don't need to request UpdateOverflow if we're being reflowed.
if (!(frame->GetStateBits() & NS_FRAME_IN_REFLOW)) {
- NS_UpdateHint(changeHint, nsChangeHint_UpdateOverflow);
+ changeHint |= nsChangeHint_UpdateOverflow;
}
frame->PresContext()->RestyleManager()->PostRestyleEvent(
frame->GetContent()->AsElement(), nsRestyleHint(0), changeHint);
}
void
nsSVGMarkerProperty::DoUpdate()
{
@@ -349,17 +349,17 @@ nsSVGMarkerProperty::DoUpdate()
NS_ASSERTION(frame->IsFrameOfType(nsIFrame::eSVG), "SVG frame expected");
// Repaint asynchronously in case the marker frame is being torn down
nsChangeHint changeHint =
nsChangeHint(nsChangeHint_RepaintFrame);
// Don't need to request ReflowFrame if we're being reflowed.
if (!(frame->GetStateBits() & NS_FRAME_IN_REFLOW)) {
- NS_UpdateHint(changeHint, nsChangeHint_InvalidateRenderingObservers);
+ changeHint |= nsChangeHint_InvalidateRenderingObservers;
// XXXjwatt: We need to unify SVG into standard reflow so we can just use
// nsChangeHint_NeedReflow | nsChangeHint_NeedDirtyReflow here.
// XXXSDL KILL THIS!!!
nsSVGUtils::ScheduleReflowSVG(frame);
}
frame->PresContext()->RestyleManager()->PostRestyleEvent(
frame->GetContent()->AsElement(), nsRestyleHint(0), changeHint);
}