diff options
author | win7-7 <win7-7@users.noreply.github.com> | 2019-06-26 01:51:45 +0300 |
---|---|---|
committer | win7-7 <win7-7@users.noreply.github.com> | 2019-06-26 01:51:45 +0300 |
commit | 00812e30dfa70f9b1a752cf0d09de00f6d401c85 (patch) | |
tree | e7eec9b55dd4e5825d3196f196c7f981be56e17a /layout/generic/ReflowInput.cpp | |
parent | d7359c38b197c221c43def1e24cb48d4aee51bba (diff) | |
download | UXP-00812e30dfa70f9b1a752cf0d09de00f6d401c85.tar UXP-00812e30dfa70f9b1a752cf0d09de00f6d401c85.tar.gz UXP-00812e30dfa70f9b1a752cf0d09de00f6d401c85.tar.lz UXP-00812e30dfa70f9b1a752cf0d09de00f6d401c85.tar.xz UXP-00812e30dfa70f9b1a752cf0d09de00f6d401c85.zip |
Attach FrameProperties to each frame instead of using a shared hashtable
Dispense the shared hashtable and instead attach the frame property list directly to nsIFrame.
Diffstat (limited to 'layout/generic/ReflowInput.cpp')
-rw-r--r-- | layout/generic/ReflowInput.cpp | 36 |
1 files changed, 18 insertions, 18 deletions
diff --git a/layout/generic/ReflowInput.cpp b/layout/generic/ReflowInput.cpp index bbff77ad4..78eca8c6c 100644 --- a/layout/generic/ReflowInput.cpp +++ b/layout/generic/ReflowInput.cpp @@ -999,13 +999,13 @@ ReflowInput::ComputeRelativeOffsets(WritingMode aWM, // Convert the offsets to physical coordinates and store them on the frame aComputedOffsets = offsets.GetPhysicalMargin(aWM); - FrameProperties props = aFrame->Properties(); - nsMargin* physicalOffsets = props.Get(nsIFrame::ComputedOffsetProperty()); + nsMargin* physicalOffsets = + aFrame->GetProperty(nsIFrame::ComputedOffsetProperty()); if (physicalOffsets) { *physicalOffsets = aComputedOffsets; } else { - props.Set(nsIFrame::ComputedOffsetProperty(), - new nsMargin(aComputedOffsets)); + aFrame->SetProperty(nsIFrame::ComputedOffsetProperty(), + new nsMargin(aComputedOffsets)); } } @@ -1015,21 +1015,22 @@ ReflowInput::ApplyRelativePositioning(nsIFrame* aFrame, nsPoint* aPosition) { if (!aFrame->IsRelativelyPositioned()) { - NS_ASSERTION(!aFrame->Properties().Get(nsIFrame::NormalPositionProperty()), + NS_ASSERTION(!aFrame->GetProperty(nsIFrame::NormalPositionProperty()), "We assume that changing the 'position' property causes " "frame reconstruction. If that ever changes, this code " "should call " - "props.Delete(nsIFrame::NormalPositionProperty())"); + "aFrame->DeleteProperty(nsIFrame::NormalPositionProperty())"); return; } // Store the normal position - FrameProperties props = aFrame->Properties(); - nsPoint* normalPosition = props.Get(nsIFrame::NormalPositionProperty()); + nsPoint* normalPosition = + aFrame->GetProperty(nsIFrame::NormalPositionProperty()); if (normalPosition) { *normalPosition = *aPosition; } else { - props.Set(nsIFrame::NormalPositionProperty(), new nsPoint(*aPosition)); + aFrame->SetProperty(nsIFrame::NormalPositionProperty(), + new nsPoint(*aPosition)); } const nsStyleDisplay* display = aFrame->StyleDisplay(); @@ -2452,20 +2453,20 @@ ReflowInput::InitConstraints(nsPresContext* aPresContext, } static void -UpdateProp(FrameProperties& aProps, +UpdateProp(nsIFrame* aFrame, const FramePropertyDescriptor<nsMargin>* aProperty, bool aNeeded, nsMargin& aNewValue) { if (aNeeded) { - nsMargin* propValue = aProps.Get(aProperty); + nsMargin* propValue = aFrame->GetProperty(aProperty); if (propValue) { *propValue = aNewValue; } else { - aProps.Set(aProperty, new nsMargin(aNewValue)); + aFrame->SetProperty(aProperty, new nsMargin(aNewValue)); } } else { - aProps.Delete(aProperty); + aFrame->DeleteProperty(aProperty); } } @@ -2482,8 +2483,7 @@ SizeComputationInput::InitOffsets(WritingMode aWM, // 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(); - FrameProperties props(presContext->PropertyTable(), mFrame); - props.Delete(nsIFrame::UsedBorderProperty()); + mFrame->DeleteProperty(nsIFrame::UsedBorderProperty()); // Compute margins from the specified margin style information. These // become the default computed values, and may be adjusted below @@ -2494,7 +2494,7 @@ SizeComputationInput::InitOffsets(WritingMode aWM, // ... but if we did that, we'd need to fix nsFrame::GetUsedMargin // to use it even when the margins are all zero (since sometimes // they get treated as auto) - ::UpdateProp(props, nsIFrame::UsedMarginProperty(), needMarginProp, + ::UpdateProp(mFrame, nsIFrame::UsedMarginProperty(), needMarginProp, ComputedPhysicalMargin()); @@ -2530,7 +2530,7 @@ SizeComputationInput::InitOffsets(WritingMode aWM, auto ApplyBaselinePadding = [this, &needPaddingProp] (LogicalAxis aAxis, Prop aProp) { bool found; - nscoord val = mFrame->Properties().Get(aProp, &found); + nscoord val = mFrame->GetProperty(aProp, &found); if (found) { NS_ASSERTION(val != nscoord(0), "zero in this property is useless"); WritingMode wm = GetWritingMode(); @@ -2603,7 +2603,7 @@ SizeComputationInput::InitOffsets(WritingMode aWM, ComputedPhysicalBorderPadding().SizeTo(0,0,0,0); } } - ::UpdateProp(props, nsIFrame::UsedPaddingProperty(), needPaddingProp, + ::UpdateProp(mFrame, nsIFrame::UsedPaddingProperty(), needPaddingProp, ComputedPhysicalPadding()); } |