diff --git a/dom/html/HTMLCanvasElement.cpp b/dom/html/HTMLCanvasElement.cpp index 7bbcfd0611f5..4d49e7e919f8 100644 --- a/dom/html/HTMLCanvasElement.cpp +++ b/dom/html/HTMLCanvasElement.cpp @@ -593,10 +593,10 @@ HTMLCanvasElement::GetAttributeChangeHint(const nsIAtom* aAttribute, 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; } diff --git a/dom/html/HTMLDetailsElement.cpp b/dom/html/HTMLDetailsElement.cpp index 5ab76f8b5a36..88ec9616baaf 100644 --- a/dom/html/HTMLDetailsElement.cpp +++ b/dom/html/HTMLDetailsElement.cpp @@ -66,7 +66,7 @@ HTMLDetailsElement::GetAttributeChangeHint(const nsIAtom* aAttribute, nsChangeHint hint = nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType); if (aAttribute == nsGkAtoms::open) { - NS_UpdateHint(hint, nsChangeHint_ReconstructFrame); + hint |= nsChangeHint_ReconstructFrame; } return hint; } diff --git a/dom/html/HTMLFrameSetElement.cpp b/dom/html/HTMLFrameSetElement.cpp index 49c7fbb8d55b..760dfd841210 100644 --- a/dom/html/HTMLFrameSetElement.cpp +++ b/dom/html/HTMLFrameSetElement.cpp @@ -195,7 +195,7 @@ HTMLFrameSetElement::GetAttributeChangeHint(const nsIAtom* aAttribute, nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType); if (aAttribute == nsGkAtoms::rows || aAttribute == nsGkAtoms::cols) { - NS_UpdateHint(retval, mCurrentRowColHint); + retval |= mCurrentRowColHint; } return retval; } diff --git a/dom/html/HTMLImageElement.cpp b/dom/html/HTMLImageElement.cpp index 970aa61b2d58..ce033b46974d 100644 --- a/dom/html/HTMLImageElement.cpp +++ b/dom/html/HTMLImageElement.cpp @@ -343,11 +343,11 @@ HTMLImageElement::GetAttributeChangeHint(const nsIAtom* aAttribute, 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; diff --git a/dom/html/HTMLInputElement.cpp b/dom/html/HTMLInputElement.cpp index e2d90a180876..101cb626ae32 100644 --- a/dom/html/HTMLInputElement.cpp +++ b/dom/html/HTMLInputElement.cpp @@ -4954,20 +4954,20 @@ HTMLInputElement::GetAttributeChangeHint(const nsIAtom* aAttribute, // 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; } diff --git a/dom/html/HTMLLegendElement.cpp b/dom/html/HTMLLegendElement.cpp index a0693ebe6ef0..42638ea1a13d 100644 --- a/dom/html/HTMLLegendElement.cpp +++ b/dom/html/HTMLLegendElement.cpp @@ -65,7 +65,7 @@ HTMLLegendElement::GetAttributeChangeHint(const nsIAtom* aAttribute, nsChangeHint retval = nsGenericHTMLElement::GetAttributeChangeHint(aAttribute, aModType); if (aAttribute == nsGkAtoms::align) { - NS_UpdateHint(retval, NS_STYLE_HINT_REFLOW); + retval |= NS_STYLE_HINT_REFLOW; } return retval; } diff --git a/dom/html/HTMLOptionElement.cpp b/dom/html/HTMLOptionElement.cpp index 2073115beb0c..7b1e3ca2d706 100644 --- a/dom/html/HTMLOptionElement.cpp +++ b/dom/html/HTMLOptionElement.cpp @@ -174,7 +174,7 @@ HTMLOptionElement::GetAttributeChangeHint(const nsIAtom* aAttribute, if (aAttribute == nsGkAtoms::label || aAttribute == nsGkAtoms::text) { - NS_UpdateHint(retval, NS_STYLE_HINT_REFLOW); + retval |= NS_STYLE_HINT_REFLOW; } return retval; } diff --git a/dom/html/HTMLSelectElement.cpp b/dom/html/HTMLSelectElement.cpp index b1910deee3f0..ca37eb0622ac 100644 --- a/dom/html/HTMLSelectElement.cpp +++ b/dom/html/HTMLSelectElement.cpp @@ -1413,7 +1413,7 @@ HTMLSelectElement::GetAttributeChangeHint(const nsIAtom* aAttribute, 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; } diff --git a/dom/html/HTMLTextAreaElement.cpp b/dom/html/HTMLTextAreaElement.cpp index 9430792fe2d8..6668b69f39a1 100644 --- a/dom/html/HTMLTextAreaElement.cpp +++ b/dom/html/HTMLTextAreaElement.cpp @@ -436,11 +436,11 @@ HTMLTextAreaElement::GetAttributeChangeHint(const nsIAtom* aAttribute, 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; } diff --git a/dom/svg/SVGTransformableElement.cpp b/dom/svg/SVGTransformableElement.cpp index fd450be56603..a9028fc4961c 100644 --- a/dom/svg/SVGTransformableElement.cpp +++ b/dom/svg/SVGTransformableElement.cpp @@ -59,7 +59,7 @@ SVGTransformableElement::GetAttributeChangeHint(const nsIAtom* aAttribute, aAttribute == nsGkAtoms::mozAnimateMotionDummyAttr) { nsIFrame* frame = const_cast(this)->GetPrimaryFrame(); - NS_UpdateHint(retval, nsChangeHint_InvalidateRenderingObservers); + retval |= nsChangeHint_InvalidateRenderingObservers; if (!frame || (frame->GetStateBits() & NS_FRAME_IS_NONDISPLAY)) { return retval; } @@ -81,11 +81,11 @@ SVGTransformableElement::GetAttributeChangeHint(const nsIAtom* aAttribute, 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; diff --git a/dom/svg/nsSVGElement.cpp b/dom/svg/nsSVGElement.cpp index e068c58fb8d9..bbd6245dea04 100644 --- a/dom/svg/nsSVGElement.cpp +++ b/dom/svg/nsSVGElement.cpp @@ -883,7 +883,7 @@ nsSVGElement::GetAttributeChangeHint(const nsIAtom* 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; } diff --git a/layout/base/RestyleManager.cpp b/layout/base/RestyleManager.cpp index d6940870a698..a5ef16f5f9e0 100644 --- a/layout/base/RestyleManager.cpp +++ b/layout/base/RestyleManager.cpp @@ -793,7 +793,7 @@ RestyleManager::ProcessRestyledFrames(nsStyleChangeList& aChangeList) 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)) { @@ -1063,7 +1063,7 @@ RestyleManager::RestyleElement(Element* aElement, if (aRestyleHint & eRestyle_SomeDescendants) { mRebuildAllRestyleHint |= eRestyle_Subtree; } - NS_UpdateHint(mRebuildAllExtraHint, aMinHint); + mRebuildAllExtraHint |= aMinHint; StartRebuildAllStyleData(aRestyleTracker); return; } @@ -1212,7 +1212,7 @@ RestyleManager::ContentStateChanged(nsIContent* aContent, bool repaint = false; theme->WidgetStateChanged(primaryFrame, app, nullptr, &repaint, nullptr); if (repaint) { - NS_UpdateHint(hint, nsChangeHint_RepaintFrame); + hint |= nsChangeHint_RepaintFrame; } } } @@ -1248,7 +1248,7 @@ RestyleManager::ContentStateChanged(nsIContent* aContent, // 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); @@ -1342,7 +1342,7 @@ RestyleManager::AttributeChanged(Element* aElement, theme->WidgetStateChanged(primaryFrame, disp->mAppearance, aAttribute, &repaint, aOldValue); if (repaint) - NS_UpdateHint(hint, nsChangeHint_RepaintFrame); + hint |= nsChangeHint_RepaintFrame; } } @@ -1652,7 +1652,7 @@ RestyleManager::RebuildAllStyleData(nsChangeHint aExtraHint, "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 @@ -1969,7 +1969,7 @@ RestyleManager::PostRebuildAllStyleDataEvent(nsChangeHint aExtraHint, "eRestyle_SomeDescendants"); mDoRebuildAllStyleData = true; - NS_UpdateHint(mRebuildAllExtraHint, aExtraHint); + mRebuildAllExtraHint |= aExtraHint; mRebuildAllRestyleHint |= aRestyleHint; // Get a restyle event posted if necessary @@ -2749,7 +2749,7 @@ ElementRestyler::AddLayerChangesForAnimation() !mFrame->StyleDisplay()->HasTransformStyle()) { continue; } - NS_UpdateHint(hint, layerInfo.mChangeHint); + hint |= layerInfo.mChangeHint; } } if (hint) { @@ -2795,8 +2795,9 @@ ElementRestyler::CaptureChange(nsStyleContext* aOldContext, 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()); @@ -2805,8 +2806,8 @@ ElementRestyler::CaptureChange(nsStyleContext* aOldContext, 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()); } @@ -3270,7 +3271,8 @@ ElementRestyler::Restyle(nsRestyleHint aRestyleHint) mContent->OwnerDoc()->FlushPendingLinkUpdates(); nsAutoPtr 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( @@ -4003,7 +4005,7 @@ ElementRestyler::RestyleSelf(nsIFrame* aSelf, 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 @@ -4739,7 +4741,7 @@ ElementRestyler::MaybeReframeForPseudo(CSSPseudoElementType aPseudoType, // 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); } } diff --git a/layout/base/RestyleTracker.h b/layout/base/RestyleTracker.h index 2652fde2d695..1f5479063af4 100644 --- a/layout/base/RestyleTracker.h +++ b/layout/base/RestyleTracker.h @@ -465,7 +465,7 @@ RestyleTracker::AddPendingRestyleToTable(Element* aElement, (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); diff --git a/layout/base/nsChangeHint.h b/layout/base/nsChangeHint.h index ca1004c622b9..336be264ccdf 100644 --- a/layout/base/nsChangeHint.h +++ b/layout/base/nsChangeHint.h @@ -220,15 +220,6 @@ 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; @@ -326,14 +317,14 @@ inline nsChangeHint NS_HintsNotHandledForDescendantsIn(nsChangeHint 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; } } @@ -341,7 +332,7 @@ inline nsChangeHint NS_HintsNotHandledForDescendantsIn(nsChangeHint 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, diff --git a/layout/base/nsPresContext.cpp b/layout/base/nsPresContext.cpp index 97e293ac7acf..f238eb1c700d 100644 --- a/layout/base/nsPresContext.cpp +++ b/layout/base/nsPresContext.cpp @@ -768,7 +768,7 @@ nsPresContext::UpdateAfterPreferencesChanged() 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 diff --git a/layout/base/nsStyleChangeList.cpp b/layout/base/nsStyleChangeList.cpp index 9773d1e3ca0b..ecbd7e9557c9 100644 --- a/layout/base/nsStyleChangeList.cpp +++ b/layout/base/nsStyleChangeList.cpp @@ -88,7 +88,7 @@ nsStyleChangeList::AppendChange(nsIFrame* aFrame, nsIContent* aContent, nsChange 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) { diff --git a/layout/style/nsStyleContext.cpp b/layout/style/nsStyleContext.cpp index 6854e4d5571b..a19e76015438 100644 --- a/layout/style/nsStyleContext.cpp +++ b/layout/style/nsStyleContext.cpp @@ -941,7 +941,7 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther, 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_); \ } \ @@ -1054,7 +1054,7 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther, 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; @@ -1171,7 +1171,7 @@ nsStyleContext::CalcStyleDifference(nsStyleContext* aOther, } if (change) { - NS_UpdateHint(hint, nsChangeHint_RepaintFrame); + hint |= nsChangeHint_RepaintFrame; } } diff --git a/layout/style/nsStyleStruct.cpp b/layout/style/nsStyleStruct.cpp index f16bf9b81294..6a4425eb2192 100644 --- a/layout/style/nsStyleStruct.cpp +++ b/layout/style/nsStyleStruct.cpp @@ -916,18 +916,17 @@ nsChangeHint nsStyleSVG::CalcDifference(const nsStyleSVG& aOther) const // 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 @@ -936,12 +935,12 @@ nsChangeHint nsStyleSVG::CalcDifference(const nsStyleSVG& aOther) const // 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; } } @@ -955,10 +954,10 @@ nsChangeHint nsStyleSVG::CalcDifference(const nsStyleSVG& aOther) const 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) { @@ -978,16 +977,15 @@ nsChangeHint nsStyleSVG::CalcDifference(const nsStyleSVG& aOther) const 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 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 @@ -3799,19 +3797,19 @@ nsChangeHint nsStyleUserInterface::CalcDifference(const nsStyleUserInterface& aO } 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; diff --git a/layout/svg/nsSVGEffects.cpp b/layout/svg/nsSVGEffects.cpp index def09740d484..31f5abea071c 100644 --- a/layout/svg/nsSVGEffects.cpp +++ b/layout/svg/nsSVGEffects.cpp @@ -326,12 +326,12 @@ nsSVGFilterProperty::DoUpdate() 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); @@ -354,7 +354,7 @@ nsSVGMarkerProperty::DoUpdate() // 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!!!