From c5c0ef9787a872f234d132b65751a1f8f641434f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Emilio=20Cobos=20=C3=81lvarez?= Date: Thu, 6 Feb 2020 16:06:49 +0000 Subject: [PATCH] Bug 1613349 - Rename nsIFrame::DeleteProperty to RemoveProperty. r=dholbert As it doesn't necessarily call delete and that may be confusing. Differential Revision: https://phabricator.services.mozilla.com/D61764 --HG-- extra : moz-landing-system : lando --- gfx/layers/wr/WebRenderCommandBuilder.cpp | 2 +- layout/base/FrameProperties.h | 16 +++++----- layout/base/PresShell.cpp | 2 +- layout/base/nsCSSFrameConstructor.cpp | 2 +- layout/forms/nsTextControlFrame.cpp | 2 +- layout/forms/nsTextControlFrame.h | 2 +- layout/generic/BlockReflowInput.cpp | 2 +- layout/generic/ReflowInput.cpp | 6 ++-- layout/generic/RubyUtils.cpp | 2 +- layout/generic/nsBlockFrame.cpp | 4 +-- layout/generic/nsBulletFrame.cpp | 2 +- layout/generic/nsContainerFrame.cpp | 10 +++---- layout/generic/nsFlexContainerFrame.cpp | 4 +-- layout/generic/nsFloatManager.cpp | 2 +- layout/generic/nsFrame.cpp | 26 ++++++++--------- layout/generic/nsGridContainerFrame.cpp | 20 ++++++------- layout/generic/nsIFrame.h | 6 ++-- layout/generic/nsLineLayout.cpp | 2 +- layout/generic/nsPlaceholderFrame.cpp | 2 +- layout/generic/nsTextFrame.cpp | 20 ++++++------- layout/mathml/nsMathMLContainerFrame.cpp | 2 +- layout/mathml/nsMathMLmtableFrame.cpp | 6 ++-- layout/painting/ActiveLayerTracker.cpp | 2 +- .../painting/RetainedDisplayListBuilder.cpp | 4 +-- layout/painting/nsDisplayList.cpp | 2 +- layout/painting/nsDisplayList.h | 4 +-- layout/svg/SVGObserverUtils.cpp | 29 +++++++++---------- layout/tables/nsTableRowGroupFrame.cpp | 2 +- layout/xul/nsBox.cpp | 6 ++-- 29 files changed, 94 insertions(+), 97 deletions(-) diff --git a/gfx/layers/wr/WebRenderCommandBuilder.cpp b/gfx/layers/wr/WebRenderCommandBuilder.cpp index adc90e20196d..53d2a86e0b22 100644 --- a/gfx/layers/wr/WebRenderCommandBuilder.cpp +++ b/gfx/layers/wr/WebRenderCommandBuilder.cpp @@ -138,7 +138,7 @@ struct BlobItemData { if (mArray->IsEmpty()) { // If the frame is in the process of being destroyed this will fail // but that's ok, because the the property will be removed then anyways - mFrame->DeleteProperty(BlobGroupDataProperty()); + mFrame->RemoveProperty(BlobGroupDataProperty()); } mFrame = nullptr; } diff --git a/layout/base/FrameProperties.h b/layout/base/FrameProperties.h index f9d390adf170..dd5dfec68f2b 100644 --- a/layout/base/FrameProperties.h +++ b/layout/base/FrameProperties.h @@ -231,13 +231,13 @@ class FrameProperties { } /** - * Remove and destroy a property value. This requires a linear search - * through the properties of the frame. If the frame has no such - * property, nothing happens. + * Remove and destroy a property value. This requires a linear search through + * the properties of the frame. If the frame has no such property, nothing + * happens. */ template - void Delete(Descriptor aProperty, const nsIFrame* aFrame) { - DeleteInternal(aProperty, aFrame); + void Remove(Descriptor aProperty, const nsIFrame* aFrame) { + RemoveInternal(aProperty, aFrame); } /** @@ -261,7 +261,7 @@ class FrameProperties { /** * Remove and destroy all property values for the frame. */ - void DeleteAll(const nsIFrame* aFrame) { + void RemoveAll(const nsIFrame* aFrame) { nsTArray toDelete; toDelete.SwapElements(mProperties); for (auto& prop : toDelete) { @@ -295,7 +295,7 @@ class FrameProperties { inline void* TakeInternal(UntypedDescriptor aProperty, bool* aFoundResult); - inline void DeleteInternal(UntypedDescriptor aProperty, + inline void RemoveInternal(UntypedDescriptor aProperty, const nsIFrame* aFrame); template @@ -428,7 +428,7 @@ inline void* FrameProperties::TakeInternal(UntypedDescriptor aProperty, return result; } -inline void FrameProperties::DeleteInternal(UntypedDescriptor aProperty, +inline void FrameProperties::RemoveInternal(UntypedDescriptor aProperty, const nsIFrame* aFrame) { MOZ_ASSERT(NS_IsMainThread()); MOZ_ASSERT(aProperty, "Null property?"); diff --git a/layout/base/PresShell.cpp b/layout/base/PresShell.cpp index 82fa2964fa08..9a009b15a6c2 100644 --- a/layout/base/PresShell.cpp +++ b/layout/base/PresShell.cpp @@ -2069,7 +2069,7 @@ void PresShell::NotifyDestroyingFrame(nsIFrame* aFrame) { mDirtyRoots.Remove(aFrame); // Remove frame properties - aFrame->DeleteAllProperties(); + aFrame->RemoveAllProperties(); if (aFrame == mCurrentEventFrame) { mCurrentEventContent = aFrame->GetContent(); diff --git a/layout/base/nsCSSFrameConstructor.cpp b/layout/base/nsCSSFrameConstructor.cpp index 16cfd08b83e6..524d586659ad 100644 --- a/layout/base/nsCSSFrameConstructor.cpp +++ b/layout/base/nsCSSFrameConstructor.cpp @@ -10359,7 +10359,7 @@ void nsCSSFrameConstructor::RemoveLetterFrames(PresShell* aPresShell, nsContainerFrame* aBlockFrame) { aBlockFrame = static_cast(aBlockFrame->FirstContinuation()); - aBlockFrame->DeleteProperty(nsContainerFrame::FirstLetterProperty()); + aBlockFrame->RemoveProperty(nsContainerFrame::FirstLetterProperty()); nsContainerFrame* continuation = aBlockFrame; bool stopLooking = false; diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index f9a35191a4e7..14d6defeaefb 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -135,7 +135,7 @@ void nsTextControlFrame::DestroyFrom(nsIFrame* aDestructRoot, PostDestroyData& aPostDestroyData) { mScrollEvent.Revoke(); - DeleteProperty(TextControlInitializer()); + RemoveProperty(TextControlInitializer()); // Unbind the text editor state object from the frame. The editor will live // on, but things like controllers will be released. diff --git a/layout/forms/nsTextControlFrame.h b/layout/forms/nsTextControlFrame.h index 7c1ef13063c9..293c39ab3b6d 100644 --- a/layout/forms/nsTextControlFrame.h +++ b/layout/forms/nsTextControlFrame.h @@ -326,7 +326,7 @@ class nsTextControlFrame : public nsContainerFrame, SetSelectionEndPoints(uint32_t aSelStart, uint32_t aSelEnd, SelectionDirection aDirection = eNone); - void FinishedInitializer() { DeleteProperty(TextControlInitializer()); } + void FinishedInitializer() { RemoveProperty(TextControlInitializer()); } const nsAString& CachedValue() const { return mCachedValue; } diff --git a/layout/generic/BlockReflowInput.cpp b/layout/generic/BlockReflowInput.cpp index a446c20148f6..4178ba4340f0 100644 --- a/layout/generic/BlockReflowInput.cpp +++ b/layout/generic/BlockReflowInput.cpp @@ -973,7 +973,7 @@ bool BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat) { } } else if (invalidationData) { invalidationData = nullptr; - aFloat->DeleteProperty(ShapeInvalidationDataProperty()); + aFloat->RemoveProperty(ShapeInvalidationDataProperty()); } if (!reflowStatus.IsFullyComplete()) { diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index bb81dae841ed..144d29ebdeba 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -1058,7 +1058,7 @@ void ReflowInput::ApplyRelativePositioning(nsIFrame* aFrame, "We assume that changing the 'position' property causes " "frame reconstruction. If that ever changes, this code " "should call " - "aFrame->DeleteProperty(nsIFrame::NormalPositionProperty())"); + "aFrame->RemoveProperty(nsIFrame::NormalPositionProperty())"); return; } @@ -2518,7 +2518,7 @@ static void UpdateProp(nsIFrame* aFrame, aFrame->AddProperty(aProperty, new nsMargin(aNewValue)); } } else { - aFrame->DeleteProperty(aProperty); + aFrame->RemoveProperty(aProperty); } } @@ -2533,7 +2533,7 @@ void SizeComputationInput::InitOffsets(WritingMode aWM, nscoord aPercentBasis, // Since we are in reflow, we don't need to store these properties anymore // unless they are dependent on width, in which case we store the new value. nsPresContext* presContext = mFrame->PresContext(); - mFrame->DeleteProperty(nsIFrame::UsedBorderProperty()); + mFrame->RemoveProperty(nsIFrame::UsedBorderProperty()); // Compute margins from the specified margin style information. These // become the default computed values, and may be adjusted below diff --git a/layout/generic/RubyUtils.cpp b/layout/generic/RubyUtils.cpp index 3f39dd08e151..4cdd4b65b367 100644 --- a/layout/generic/RubyUtils.cpp +++ b/layout/generic/RubyUtils.cpp @@ -24,7 +24,7 @@ void RubyUtils::SetReservedISize(nsIFrame* aFrame, nscoord aISize) { /* static */ void RubyUtils::ClearReservedISize(nsIFrame* aFrame) { MOZ_ASSERT(IsExpandableRubyBox(aFrame)); - aFrame->DeleteProperty(ReservedISize()); + aFrame->RemoveProperty(ReservedISize()); } /* static */ diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 6a62443bd6d0..2ac0a2841b51 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -2021,7 +2021,7 @@ void nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput, if (blockEndEdgeOfChildren != finalSize.BSize(wm) - borderPadding.BEnd(wm)) { SetProperty(BlockEndEdgeOfChildrenProperty(), blockEndEdgeOfChildren); } else { - DeleteProperty(BlockEndEdgeOfChildrenProperty()); + RemoveProperty(BlockEndEdgeOfChildrenProperty()); } aMetrics.SetSize(wm, finalSize); @@ -7141,7 +7141,7 @@ void nsBlockFrame::ClearLineCursor() { return; } - DeleteProperty(LineCursorProperty()); + RemoveProperty(LineCursorProperty()); RemoveStateBits(NS_BLOCK_HAS_LINE_CURSOR); } diff --git a/layout/generic/nsBulletFrame.cpp b/layout/generic/nsBulletFrame.cpp index c7e8056152aa..17256d342cfb 100644 --- a/layout/generic/nsBulletFrame.cpp +++ b/layout/generic/nsBulletFrame.cpp @@ -1181,7 +1181,7 @@ void nsBulletFrame::SetFontSizeInflation(float aInflation) { if (aInflation == 1.0f) { if (HasFontSizeInflation()) { RemoveStateBits(BULLET_FRAME_HAS_FONT_INFLATION); - DeleteProperty(FontSizeInflationProperty()); + RemoveProperty(FontSizeInflationProperty()); } return; } diff --git a/layout/generic/nsContainerFrame.cpp b/layout/generic/nsContainerFrame.cpp index d52a63a4b750..803863caa209 100644 --- a/layout/generic/nsContainerFrame.cpp +++ b/layout/generic/nsContainerFrame.cpp @@ -217,21 +217,19 @@ void nsContainerFrame::DestroyFrom(nsIFrame* aDestructRoot, // If we have any IB split siblings, clear their references to us. if (HasAnyStateBits(NS_FRAME_PART_OF_IBSPLIT)) { // Delete previous sibling's reference to me. - nsIFrame* prevSib = GetProperty(nsIFrame::IBSplitPrevSibling()); - if (prevSib) { + if (nsIFrame* prevSib = GetProperty(nsIFrame::IBSplitPrevSibling())) { NS_WARNING_ASSERTION( this == prevSib->GetProperty(nsIFrame::IBSplitSibling()), "IB sibling chain is inconsistent"); - prevSib->DeleteProperty(nsIFrame::IBSplitSibling()); + prevSib->RemoveProperty(nsIFrame::IBSplitSibling()); } // Delete next sibling's reference to me. - nsIFrame* nextSib = GetProperty(nsIFrame::IBSplitSibling()); - if (nextSib) { + if (nsIFrame* nextSib = GetProperty(nsIFrame::IBSplitSibling())) { NS_WARNING_ASSERTION( this == nextSib->GetProperty(nsIFrame::IBSplitPrevSibling()), "IB sibling chain is inconsistent"); - nextSib->DeleteProperty(nsIFrame::IBSplitPrevSibling()); + nextSib->RemoveProperty(nsIFrame::IBSplitPrevSibling()); } #ifdef DEBUG diff --git a/layout/generic/nsFlexContainerFrame.cpp b/layout/generic/nsFlexContainerFrame.cpp index 1a48deb09486..f9522b86e384 100644 --- a/layout/generic/nsFlexContainerFrame.cpp +++ b/layout/generic/nsFlexContainerFrame.cpp @@ -1754,7 +1754,7 @@ NS_DECLARE_FRAME_PROPERTY_DELETABLE(CachedFlexMeasuringReflow, void nsFlexContainerFrame::MarkCachedFlexMeasurementsDirty( nsIFrame* aItemFrame) { - aItemFrame->DeleteProperty(CachedFlexMeasuringReflow()); + aItemFrame->RemoveProperty(CachedFlexMeasuringReflow()); } const CachedMeasuringReflowResult& @@ -4270,7 +4270,7 @@ class MOZ_RAII AutoFlexItemMainSizeOverride final { } ~AutoFlexItemMainSizeOverride() { - mItemFrame->DeleteProperty(nsIFrame::FlexItemMainSizeOverride()); + mItemFrame->RemoveProperty(nsIFrame::FlexItemMainSizeOverride()); } private: diff --git a/layout/generic/nsFloatManager.cpp b/layout/generic/nsFloatManager.cpp index 7024a4ee91c1..e4dd325bbdc2 100644 --- a/layout/generic/nsFloatManager.cpp +++ b/layout/generic/nsFloatManager.cpp @@ -335,7 +335,7 @@ void nsFloatManager::StoreRegionFor(WritingMode aWM, nsIFrame* aFloat, nsRect region = aRegion.GetPhysicalRect(aWM, aContainerSize); nsRect rect = aFloat->GetRect(); if (region.IsEqualEdges(rect)) { - aFloat->DeleteProperty(FloatRegionProperty()); + aFloat->RemoveProperty(FloatRegionProperty()); } else { nsMargin* storedMargin = aFloat->GetProperty(FloatRegionProperty()); if (!storedMargin) { diff --git a/layout/generic/nsFrame.cpp b/layout/generic/nsFrame.cpp index 12b9bb651cd4..6058ba31ed31 100644 --- a/layout/generic/nsFrame.cpp +++ b/layout/generic/nsFrame.cpp @@ -205,7 +205,7 @@ NS_DECLARE_FRAME_PROPERTY_DELETABLE(BoxMetricsProperty, nsBoxLayoutMetrics) static void InitBoxMetrics(nsIFrame* aFrame, bool aClear) { if (aClear) { - aFrame->DeleteProperty(BoxMetricsProperty()); + aFrame->RemoveProperty(BoxMetricsProperty()); } nsBoxLayoutMetrics* metrics = new nsBoxLayoutMetrics(); @@ -353,7 +353,7 @@ void nsIFrame::MarkAsNotAbsoluteContainingBlock() { "Should have NS_FRAME_HAS_ABSPOS_CHILDREN state bit"); MOZ_ASSERT(HasAnyStateBits(NS_FRAME_CAN_HAVE_ABSPOS_CHILDREN)); RemoveStateBits(NS_FRAME_HAS_ABSPOS_CHILDREN); - DeleteProperty(AbsoluteContainingBlockProperty()); + RemoveProperty(AbsoluteContainingBlockProperty()); } bool nsIFrame::CheckAndClearPaintedState() { @@ -872,9 +872,9 @@ void nsFrame::DestroyFrom(nsIFrame* aDestructRoot, } } - // Delete all properties attached to the frame, to ensure any property + // Remove all properties attached to the frame, to ensure any property // destructors that need the frame pointer are handled properly. - DeleteAllProperties(); + RemoveAllProperties(); // Must retrieve the object ID before calling destructors, so the // vtable is still valid. @@ -978,7 +978,7 @@ bool nsIFrame::RemoveDisplayItem(nsDisplayItemBase* aItem) { } bool result = items->RemoveElement(aItem); if (items->IsEmpty()) { - DeleteProperty(DisplayItems()); + RemoveProperty(DisplayItems()); } return result; } @@ -1265,7 +1265,7 @@ void nsFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle) { if (disp->mPosition != oldDisp->mPosition) { if (!disp->IsRelativelyPositionedStyle() && oldDisp->IsRelativelyPositionedStyle()) { - DeleteProperty(NormalPositionProperty()); + RemoveProperty(NormalPositionProperty()); } handleStickyChange = disp->mPosition == NS_STYLE_POSITION_STICKY || @@ -1380,10 +1380,10 @@ void nsFrame::DidSetComputedStyle(ComputedStyle* aOldComputedStyle) { SetProperty(nsIFrame::OffsetPathCache(), path.forget().take()); } else { // May have an old cached path, so we have to delete it. - DeleteProperty(nsIFrame::OffsetPathCache()); + RemoveProperty(nsIFrame::OffsetPathCache()); } } else if (oldPath) { - DeleteProperty(nsIFrame::OffsetPathCache()); + RemoveProperty(nsIFrame::OffsetPathCache()); } } @@ -7244,7 +7244,7 @@ static void InvalidateFrameInternal(nsIFrame* aFrame, bool aHasDisplayItem, SchedulePaintInternal(displayRoot, aFrame); } if (aFrame->HasAnyStateBits(NS_FRAME_HAS_INVALID_RECT)) { - aFrame->DeleteProperty(nsIFrame::InvalidationRect()); + aFrame->RemoveProperty(nsIFrame::InvalidationRect()); aFrame->RemoveStateBits(NS_FRAME_HAS_INVALID_RECT); } } @@ -9201,7 +9201,7 @@ bool nsIFrame::ClearOverflowRects() { return false; } if (mOverflow.mType == NS_FRAME_OVERFLOW_LARGE) { - DeleteProperty(OverflowAreasProperty()); + RemoveProperty(OverflowAreasProperty()); } mOverflow.mType = NS_FRAME_OVERFLOW_NONE; return true; @@ -9503,14 +9503,14 @@ bool nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas, *initial = aOverflowAreas; } } else { - DeleteProperty(nsIFrame::InitialOverflowProperty()); + RemoveProperty(nsIFrame::InitialOverflowProperty()); } #ifdef DEBUG SetProperty(nsIFrame::DebugInitialOverflowPropertyApplied(), true); #endif } else { #ifdef DEBUG - DeleteProperty(nsIFrame::DebugInitialOverflowPropertyApplied()); + RemoveProperty(nsIFrame::DebugInitialOverflowPropertyApplied()); #endif } @@ -9654,7 +9654,7 @@ bool nsIFrame::FinishAndStoreOverflow(nsOverflowAreas& aOverflowAreas, } } } else { - DeleteProperty(nsIFrame::PreTransformOverflowAreasProperty()); + RemoveProperty(nsIFrame::PreTransformOverflowAreasProperty()); } /* Revert the size change in case some caller is depending on this. */ diff --git a/layout/generic/nsGridContainerFrame.cpp b/layout/generic/nsGridContainerFrame.cpp index 04642b361f1d..b9d335a26ae3 100644 --- a/layout/generic/nsGridContainerFrame.cpp +++ b/layout/generic/nsGridContainerFrame.cpp @@ -3687,7 +3687,7 @@ void nsGridContainerFrame::InitImplicitNamedAreas( Add(aStyle->mGridTemplateColumns, IsSubgrid(eLogicalAxisInline)); Add(aStyle->mGridTemplateRows, IsSubgrid(eLogicalAxisBlock)); if (areas && areas->count() == 0) { - DeleteProperty(ImplicitNamedAreasProperty()); + RemoveProperty(ImplicitNamedAreasProperty()); } } @@ -4656,7 +4656,7 @@ static nscoord MeasuringReflow(nsIFrame* aChild, aChild->SetProperty(nsIFrame::BClampMarginBoxMinSizeProperty(), aBMinSizeClamp); } else { - aChild->DeleteProperty(nsIFrame::BClampMarginBoxMinSizeProperty()); + aChild->RemoveProperty(nsIFrame::BClampMarginBoxMinSizeProperty()); } ReflowInput childRI(pc, *rs, aChild, aAvailableSize, Some(aCBSize), riFlags); @@ -4682,7 +4682,7 @@ static nscoord MeasuringReflow(nsIFrame* aChild, nsContainerFrame::FinishReflowChild(aChild, pc, childSize, &childRI, wm, LogicalPoint(wm), nsSize(), flags); #ifdef DEBUG - parent->DeleteProperty(nsContainerFrame::DebugReflowingWithInfiniteISize()); + parent->RemoveProperty(nsContainerFrame::DebugReflowingWithInfiniteISize()); #endif return childSize.BSize(wm); } @@ -6342,7 +6342,7 @@ void nsGridContainerFrame::ReflowInFlowChild( if (baselineAdjust != nscoord(0)) { aChild->SetProperty(aProp, baselineAdjust); } else { - aChild->DeleteProperty(aProp); + aChild->RemoveProperty(aProp); } }; SetProp(eLogicalAxisBlock, @@ -6394,7 +6394,7 @@ void nsGridContainerFrame::ReflowInFlowChild( aChild->SetProperty(BClampMarginBoxMinSizeProperty(), childCBSize.BSize(childWM)); } else { - aChild->DeleteProperty(BClampMarginBoxMinSizeProperty()); + aChild->RemoveProperty(BClampMarginBoxMinSizeProperty()); } if ((aGridItemInfo->mState[childIAxis] & ItemState::eApplyAutoMinSize)) { @@ -6449,7 +6449,7 @@ void nsGridContainerFrame::ReflowInFlowChild( if (stretch) { aChild->SetProperty(FragStretchBSizeProperty(), *aStretchBSize); } else { - aChild->DeleteProperty(FragStretchBSizeProperty()); + aChild->RemoveProperty(FragStretchBSizeProperty()); } } @@ -7177,7 +7177,7 @@ void nsGridContainerFrame::NormalizeChildLists() { f = next; } if (overflowContainers->IsEmpty()) { - DeleteProperty(OverflowContainersProperty()); + RemoveProperty(OverflowContainersProperty()); } MergeSortedExcessOverflowContainers(moveToEOC); } @@ -7766,7 +7766,7 @@ void nsGridContainerFrame::Reflow(nsPresContext* aPresContext, gridReflowInput.mGridStyle->mGridTemplateAreas.AsAreas()->areas); SetProperty(ExplicitNamedAreasProperty(), areas); } else { - DeleteProperty(ExplicitNamedAreasProperty()); + RemoveProperty(ExplicitNamedAreasProperty()); } } @@ -7808,7 +7808,7 @@ void nsGridContainerFrame::Reflow(nsPresContext* aPresContext, sharedGridData->mGenerateComputedGridInfo = HasAnyStateBits(NS_STATE_GRID_GENERATE_COMPUTED_VALUES); } else if (sharedGridData && !GetNextInFlow()) { - DeleteProperty(SharedGridData::Prop()); + RemoveProperty(SharedGridData::Prop()); } } @@ -7822,7 +7822,7 @@ void nsGridContainerFrame::UpdateSubgridFrameState() { if (newBits != oldBits) { RemoveStateBits(kIsSubgridBits); if (!newBits) { - DeleteProperty(Subgrid::Prop()); + RemoveProperty(Subgrid::Prop()); } else { AddStateBits(newBits); } diff --git a/layout/generic/nsIFrame.h b/layout/generic/nsIFrame.h index 5faecbc0f9c7..f333af61acf1 100644 --- a/layout/generic/nsIFrame.h +++ b/layout/generic/nsIFrame.h @@ -3680,11 +3680,11 @@ class nsIFrame : public nsQueryFrame { } template - void DeleteProperty(FrameProperties::Descriptor aProperty) { - mProperties.Delete(aProperty, this); + void RemoveProperty(FrameProperties::Descriptor aProperty) { + mProperties.Remove(aProperty, this); } - void DeleteAllProperties() { mProperties.DeleteAll(this); } + void RemoveAllProperties() { mProperties.RemoveAll(this); } // nsIFrames themselves are in the nsPresArena, and so are not measured here. // Instead, this measures heap-allocated things hanging off the nsIFrame, and diff --git a/layout/generic/nsLineLayout.cpp b/layout/generic/nsLineLayout.cpp index 825ff7cb5f3d..c224f91b8c0e 100644 --- a/layout/generic/nsLineLayout.cpp +++ b/layout/generic/nsLineLayout.cpp @@ -758,7 +758,7 @@ void nsLineLayout::ReflowFrame(nsIFrame* aFrame, nsReflowStatus& aReflowStatus, #endif if (mCurrentSpan == mRootSpan) { - pfd->mFrame->DeleteProperty(nsIFrame::LineBaselineOffset()); + pfd->mFrame->RemoveProperty(nsIFrame::LineBaselineOffset()); } else { #ifdef DEBUG bool hasLineOffset; diff --git a/layout/generic/nsPlaceholderFrame.cpp b/layout/generic/nsPlaceholderFrame.cpp index 66654a7ae94a..1c0442decb1b 100644 --- a/layout/generic/nsPlaceholderFrame.cpp +++ b/layout/generic/nsPlaceholderFrame.cpp @@ -169,7 +169,7 @@ void nsPlaceholderFrame::DestroyFrom(nsIFrame* aDestructRoot, nsIFrame* oof = mOutOfFlowFrame; if (oof) { mOutOfFlowFrame = nullptr; - oof->DeleteProperty(nsIFrame::PlaceholderFrameProperty()); + oof->RemoveProperty(nsIFrame::PlaceholderFrameProperty()); // If aDestructRoot is not an ancestor of the out-of-flow frame, // then call RemoveFrame on it here. diff --git a/layout/generic/nsTextFrame.cpp b/layout/generic/nsTextFrame.cpp index f397590a9299..757f1523f24b 100644 --- a/layout/generic/nsTextFrame.cpp +++ b/layout/generic/nsTextFrame.cpp @@ -2987,7 +2987,7 @@ gfxSkipCharsIterator nsTextFrame::EnsureTextRun( } TabWidthStore* tabWidths = GetProperty(TabWidthProperty()); if (tabWidths && tabWidths->mValidForContentOffset != GetContentOffset()) { - DeleteProperty(TabWidthProperty()); + RemoveProperty(TabWidthProperty()); } } @@ -3594,7 +3594,7 @@ void nsTextFrame::PropertyProvider::CalcTabWidths(Range aRange, if (!mTabWidths) { // Delete any stale property that may be left on the frame - mFrame->DeleteProperty(TabWidthProperty()); + mFrame->RemoveProperty(TabWidthProperty()); mTabWidthsAnalyzedLimit = std::max(mTabWidthsAnalyzedLimit, aRange.end - startOffset); } @@ -4320,7 +4320,7 @@ void nsTextFrame::ClearFrameOffsetCache() { // means that the primary frame is already dead if we're a continuing text // frame, in which case, all of its properties are gone, and we don't need // to worry about deleting this property here. - primaryFrame->DeleteProperty(OffsetToFrameProperty()); + primaryFrame->RemoveProperty(OffsetToFrameProperty()); } RemoveStateBits(TEXT_IN_OFFSET_CACHE); } @@ -4674,7 +4674,7 @@ bool nsTextFrame::RemoveTextRun(gfxTextRun* aTextRun) { } if ((GetStateBits() & TEXT_HAS_FONT_INFLATION) && GetProperty(UninflatedTextRunProperty()) == aTextRun) { - DeleteProperty(UninflatedTextRunProperty()); + RemoveProperty(UninflatedTextRunProperty()); return true; } return false; @@ -4703,7 +4703,7 @@ void nsTextFrame::DisconnectTextRuns() { "disconnect"); mTextRun = nullptr; if ((GetStateBits() & TEXT_HAS_FONT_INFLATION)) { - DeleteProperty(UninflatedTextRunProperty()); + RemoveProperty(UninflatedTextRunProperty()); } } @@ -5223,7 +5223,7 @@ nsRect nsTextFrame::UpdateTextEmphasis(WritingMode aWM, PropertyProvider& aProvider) { const nsStyleText* styleText = StyleText(); if (!styleText->HasEffectiveTextEmphasis()) { - DeleteProperty(EmphasisMarkProperty()); + RemoveProperty(EmphasisMarkProperty()); return nsRect(); } @@ -8244,7 +8244,7 @@ void nsTextFrame::SetFontSizeInflation(float aInflation) { if (aInflation == 1.0f) { if (HasFontSizeInflation()) { RemoveStateBits(TEXT_HAS_FONT_INFLATION); - DeleteProperty(FontSizeInflationProperty()); + RemoveProperty(FontSizeInflationProperty()); } return; } @@ -8975,7 +8975,7 @@ void nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth, // reflow request from CharacterDataChanged (since we're reflowing now). RemoveStateBits(TEXT_REFLOW_FLAGS | TEXT_WHITESPACE_FLAGS); mReflowRequestedForCharDataChange = false; - DeleteProperty(WebRenderTextBounds()); + RemoveProperty(WebRenderTextBounds()); // Temporarily map all possible content while we construct our new textrun. // so that when doing reflow our styles prevail over any part of the // textrun we look at. Note that next-in-flows may be mapping the same @@ -9383,7 +9383,7 @@ void nsTextFrame::ReflowText(nsLineLayout& aLineLayout, nscoord aAvailableWidth, gfxFloat em = fm->EmHeight(); // Compress the characters in horizontal axis if necessary. if (width <= em) { - DeleteProperty(TextCombineScaleFactorProperty()); + RemoveProperty(TextCombineScaleFactorProperty()); } else { SetProperty(TextCombineScaleFactorProperty(), em / width); finalSize.ISize(wm) = em; @@ -9641,7 +9641,7 @@ nsTextFrame::TrimOutput nsTextFrame::TrimTrailingWhiteSpace( nsOverflowAreas nsTextFrame::RecomputeOverflow(nsIFrame* aBlockFrame, bool aIncludeShadows) { - DeleteProperty(WebRenderTextBounds()); + RemoveProperty(WebRenderTextBounds()); nsRect bounds(nsPoint(0, 0), GetSize()); nsOverflowAreas result(bounds, bounds); diff --git a/layout/mathml/nsMathMLContainerFrame.cpp b/layout/mathml/nsMathMLContainerFrame.cpp index ce56b66014f0..78275e1f3e32 100644 --- a/layout/mathml/nsMathMLContainerFrame.cpp +++ b/layout/mathml/nsMathMLContainerFrame.cpp @@ -158,7 +158,7 @@ void nsMathMLContainerFrame::GetReflowAndBoundingMetricsFor( void nsMathMLContainerFrame::ClearSavedChildMetrics() { nsIFrame* childFrame = mFrames.FirstChild(); while (childFrame) { - childFrame->DeleteProperty(HTMLReflowOutputProperty()); + childFrame->RemoveProperty(HTMLReflowOutputProperty()); childFrame = childFrame->GetNextSibling(); } } diff --git a/layout/mathml/nsMathMLmtableFrame.cpp b/layout/mathml/nsMathMLmtableFrame.cpp index 20a9ec946b26..61896163acca 100644 --- a/layout/mathml/nsMathMLmtableFrame.cpp +++ b/layout/mathml/nsMathMLmtableFrame.cpp @@ -726,7 +726,7 @@ nsresult nsMathMLmtableWrapperFrame::AttributeChanged(int32_t aNameSpaceID, aAttribute == nsGkAtoms::columnalign_ || aAttribute == nsGkAtoms::columnlines_) { // clear any cached property list for this table - tableFrame->DeleteProperty(AttributeToProperty(aAttribute)); + tableFrame->RemoveProperty(AttributeToProperty(aAttribute)); // Reparse the new attribute on the table. ParseFrameAttribute(tableFrame, aAttribute, true); } else { @@ -1061,7 +1061,7 @@ nsresult nsMathMLmtrFrame::AttributeChanged(int32_t aNameSpaceID, return NS_OK; } - DeleteProperty(AttributeToProperty(aAttribute)); + RemoveProperty(AttributeToProperty(aAttribute)); bool allowMultiValues = (aAttribute == nsGkAtoms::columnalign_); @@ -1109,7 +1109,7 @@ nsresult nsMathMLmtdFrame::AttributeChanged(int32_t aNameSpaceID, if (aAttribute == nsGkAtoms::rowalign_ || aAttribute == nsGkAtoms::columnalign_) { - DeleteProperty(AttributeToProperty(aAttribute)); + RemoveProperty(AttributeToProperty(aAttribute)); // Reparse the attribute. ParseFrameAttribute(this, aAttribute, false); diff --git a/layout/painting/ActiveLayerTracker.cpp b/layout/painting/ActiveLayerTracker.cpp index 3e4900e1a744..6a7bcbd167c6 100644 --- a/layout/painting/ActiveLayerTracker.cpp +++ b/layout/painting/ActiveLayerTracker.cpp @@ -198,7 +198,7 @@ void LayerActivityTracker::NotifyExpired(LayerActivity* aObject) { f->SchedulePaint(nsIFrame::PAINT_DEFAULT, false); } f->RemoveStateBits(NS_FRAME_HAS_LAYER_ACTIVITY_PROPERTY); - f->DeleteProperty(LayerActivityProperty()); + f->RemoveProperty(LayerActivityProperty()); } else { c->DeleteProperty(nsGkAtoms::LayerActivity); } diff --git a/layout/painting/RetainedDisplayListBuilder.cpp b/layout/painting/RetainedDisplayListBuilder.cpp index ccdf009fc65c..a7aff240c132 100644 --- a/layout/painting/RetainedDisplayListBuilder.cpp +++ b/layout/painting/RetainedDisplayListBuilder.cpp @@ -1390,8 +1390,8 @@ static void ClearFrameProps(nsTArray& aFrames) { for (nsIFrame* f : aFrames) { if (f->HasOverrideDirtyRegion()) { f->SetHasOverrideDirtyRegion(false); - f->DeleteProperty(nsDisplayListBuilder::DisplayListBuildingRect()); - f->DeleteProperty( + f->RemoveProperty(nsDisplayListBuilder::DisplayListBuildingRect()); + f->RemoveProperty( nsDisplayListBuilder::DisplayListBuildingDisplayPortRect()); } diff --git a/layout/painting/nsDisplayList.cpp b/layout/painting/nsDisplayList.cpp index 1672715a020b..0fba54c3bc70 100644 --- a/layout/painting/nsDisplayList.cpp +++ b/layout/painting/nsDisplayList.cpp @@ -1838,7 +1838,7 @@ void nsDisplayListBuilder::ResetMarkedFramesForDisplayList( firstFrameForShell = CurrentPresShellState()->mFirstFrameWithOOFData; for (uint32_t i = firstFrameForShell; i < mFramesWithOOFData.Length(); ++i) { - mFramesWithOOFData[i]->DeleteProperty(OutOfFlowDisplayDataProperty()); + mFramesWithOOFData[i]->RemoveProperty(OutOfFlowDisplayDataProperty()); } mFramesWithOOFData.SetLength(firstFrameForShell); } diff --git a/layout/painting/nsDisplayList.h b/layout/painting/nsDisplayList.h index 4fb3334fa6c7..43b6e104bf21 100644 --- a/layout/painting/nsDisplayList.h +++ b/layout/painting/nsDisplayList.h @@ -230,7 +230,7 @@ struct AnimatedGeometryRoot { ~AnimatedGeometryRoot() { if (mFrame && mIsRetained) { - mFrame->DeleteProperty(AnimatedGeometryRootCache()); + mFrame->RemoveProperty(AnimatedGeometryRootCache()); } } }; @@ -327,7 +327,7 @@ struct ActiveScrolledRoot { ~ActiveScrolledRoot() { if (mScrollableFrame && mRetained) { nsIFrame* f = do_QueryFrame(mScrollableFrame); - f->DeleteProperty(ActiveScrolledRootCache()); + f->RemoveProperty(ActiveScrolledRootCache()); } } diff --git a/layout/svg/SVGObserverUtils.cpp b/layout/svg/SVGObserverUtils.cpp index f37181f42dfa..76284db0278d 100644 --- a/layout/svg/SVGObserverUtils.cpp +++ b/layout/svg/SVGObserverUtils.cpp @@ -1408,7 +1408,7 @@ void SVGObserverUtils::InitiateResourceDocLoads(nsIFrame* aFrame) { } void SVGObserverUtils::RemoveTextPathObserver(nsIFrame* aTextPathFrame) { - aTextPathFrame->DeleteProperty(HrefAsTextPathProperty()); + aTextPathFrame->RemoveProperty(HrefAsTextPathProperty()); } nsIFrame* SVGObserverUtils::GetAndObserveTemplate( @@ -1444,7 +1444,7 @@ nsIFrame* SVGObserverUtils::GetAndObserveTemplate( } void SVGObserverUtils::RemoveTemplateObserver(nsIFrame* aFrame) { - aFrame->DeleteProperty(HrefToTemplateProperty()); + aFrame->RemoveProperty(HrefToTemplateProperty()); } Element* SVGObserverUtils::GetAndObserveBackgroundImage(nsIFrame* aFrame, @@ -1543,15 +1543,15 @@ void SVGObserverUtils::UpdateEffects(nsIFrame* aFrame) { NS_ASSERTION(aFrame->GetContent()->IsElement(), "aFrame's content should be an element"); - aFrame->DeleteProperty(FilterProperty()); - aFrame->DeleteProperty(MaskProperty()); - aFrame->DeleteProperty(ClipPathProperty()); - aFrame->DeleteProperty(MarkerStartProperty()); - aFrame->DeleteProperty(MarkerMidProperty()); - aFrame->DeleteProperty(MarkerEndProperty()); - aFrame->DeleteProperty(FillProperty()); - aFrame->DeleteProperty(StrokeProperty()); - aFrame->DeleteProperty(BackgroundImageProperty()); + aFrame->RemoveProperty(FilterProperty()); + aFrame->RemoveProperty(MaskProperty()); + aFrame->RemoveProperty(ClipPathProperty()); + aFrame->RemoveProperty(MarkerStartProperty()); + aFrame->RemoveProperty(MarkerMidProperty()); + aFrame->RemoveProperty(MarkerEndProperty()); + aFrame->RemoveProperty(FillProperty()); + aFrame->RemoveProperty(StrokeProperty()); + aFrame->RemoveProperty(BackgroundImageProperty()); // Ensure that the filter is repainted correctly // We can't do that in OnRenderingChange as the referenced frame may @@ -1617,7 +1617,7 @@ void SVGObserverUtils::InvalidateRenderingObservers(nsIFrame* aFrame) { } // If the rendering has changed, the bounds may well have changed too: - aFrame->DeleteProperty(nsSVGUtils::ObjectBoundingBoxProperty()); + aFrame->RemoveProperty(nsSVGUtils::ObjectBoundingBoxProperty()); SVGRenderingObserverSet* observers = GetObserverSet(content->AsElement()); if (observers) { @@ -1641,10 +1641,9 @@ void SVGObserverUtils::InvalidateRenderingObservers(nsIFrame* aFrame) { void SVGObserverUtils::InvalidateDirectRenderingObservers( Element* aElement, uint32_t aFlags /* = 0 */) { - nsIFrame* frame = aElement->GetPrimaryFrame(); - if (frame) { + if (nsIFrame* frame = aElement->GetPrimaryFrame()) { // If the rendering has changed, the bounds may well have changed too: - frame->DeleteProperty(nsSVGUtils::ObjectBoundingBoxProperty()); + frame->RemoveProperty(nsSVGUtils::ObjectBoundingBoxProperty()); } if (aElement->HasRenderingObservers()) { diff --git a/layout/tables/nsTableRowGroupFrame.cpp b/layout/tables/nsTableRowGroupFrame.cpp index 0909622a113c..87530e535c7c 100644 --- a/layout/tables/nsTableRowGroupFrame.cpp +++ b/layout/tables/nsTableRowGroupFrame.cpp @@ -1869,7 +1869,7 @@ void nsTableRowGroupFrame::ClearRowCursor() { } RemoveStateBits(NS_ROWGROUP_HAS_ROW_CURSOR); - DeleteProperty(RowCursorProperty()); + RemoveProperty(RowCursorProperty()); } nsTableRowGroupFrame::FrameCursorData* nsTableRowGroupFrame::SetupRowCursor() { diff --git a/layout/xul/nsBox.cpp b/layout/xul/nsBox.cpp index 33d8f0c9c769..ab3a807c40e6 100644 --- a/layout/xul/nsBox.cpp +++ b/layout/xul/nsBox.cpp @@ -39,9 +39,9 @@ nsresult nsBox::BeginXULLayout(nsBoxLayoutState& aState) { // Another copy-over from ReflowInput. // Since we are in reflow, we don't need to store these properties anymore. - DeleteProperty(UsedBorderProperty()); - DeleteProperty(UsedPaddingProperty()); - DeleteProperty(UsedMarginProperty()); + RemoveProperty(UsedBorderProperty()); + RemoveProperty(UsedPaddingProperty()); + RemoveProperty(UsedMarginProperty()); return NS_OK; }