Bug 1430297: Use AddRef() instead of NS_ADDREF (when keeping generated content alive in nsCSSFrameConstructor). r?mats
MozReview-Commit-ID: ECz1SCYO4ia
--- a/layout/base/nsCSSFrameConstructor.cpp
+++ b/layout/base/nsCSSFrameConstructor.cpp
@@ -6235,17 +6235,18 @@ nsCSSFrameConstructor::AddFrameConstruct
aSuppressWhiteSpaceOptimizations, aAnonChildren);
}
item->mIsText = isText;
item->mIsGeneratedContent = isGeneratedContent;
item->mIsAnonymousContentCreatorContent =
aFlags & ITEM_IS_ANONYMOUSCONTENTCREATOR_CONTENT;
if (isGeneratedContent) {
// We need to keep this alive until the frame takes ownership.
- NS_ADDREF(item->mContent);
+ // This corresponds to the Release in ConstructFramesFromItem.
+ item->mContent->AddRef();
}
item->mIsRootPopupgroup =
aNameSpaceID == kNameSpaceID_XUL && aTag == nsGkAtoms::popupgroup &&
aContent->IsRootOfNativeAnonymousSubtree();
if (item->mIsRootPopupgroup) {
aState.mHavePendingPopupgroup = true;
}
item->mIsPopup = isPopup;