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/tables/nsTableFrame.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/tables/nsTableFrame.cpp')
-rw-r--r-- | layout/tables/nsTableFrame.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 4c11d2704..b9b6ca5fe 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -272,13 +272,12 @@ nsTableFrame::RegisterPositionedTablePart(nsIFrame* aFrame) tableFrame = static_cast<nsTableFrame*>(tableFrame->FirstContinuation()); // Retrieve the positioned parts array for this table. - FrameProperties props = tableFrame->Properties(); - FrameTArray* positionedParts = props.Get(PositionedTablePartArray()); + FrameTArray* positionedParts = tableFrame->GetProperty(PositionedTablePartArray()); // Lazily create the array if it doesn't exist yet. if (!positionedParts) { positionedParts = new FrameTArray; - props.Set(PositionedTablePartArray(), positionedParts); + tableFrame->SetProperty(PositionedTablePartArray(), positionedParts); } // Add this frame to the list. @@ -302,8 +301,7 @@ nsTableFrame::UnregisterPositionedTablePart(nsIFrame* aFrame, tableFrame = static_cast<nsTableFrame*>(tableFrame->FirstContinuation()); // Retrieve the positioned parts array for this table. - FrameProperties props = tableFrame->Properties(); - FrameTArray* positionedParts = props.Get(PositionedTablePartArray()); + FrameTArray* positionedParts = tableFrame->GetProperty(PositionedTablePartArray()); // Remove the frame. MOZ_ASSERT(positionedParts && positionedParts->Contains(aFrame), @@ -1992,7 +1990,7 @@ nsTableFrame::FixupPositionedTableParts(nsPresContext* aPresContext, ReflowOutput& aDesiredSize, const ReflowInput& aReflowInput) { - FrameTArray* positionedParts = Properties().Get(PositionedTablePartArray()); + FrameTArray* positionedParts = GetProperty(PositionedTablePartArray()); if (!positionedParts) { return; } @@ -2653,13 +2651,18 @@ nsTableFrame::GetUsedMargin() const NS_DECLARE_FRAME_PROPERTY_DELETABLE(TableBCProperty, BCPropertyData) BCPropertyData* -nsTableFrame::GetBCProperty(bool aCreateIfNecessary) const +nsTableFrame::GetBCProperty() const { - FrameProperties props = Properties(); - BCPropertyData* value = props.Get(TableBCProperty()); - if (!value && aCreateIfNecessary) { + return GetProperty(TableBCProperty()); +} + +BCPropertyData* +nsTableFrame::GetOrCreateBCProperty() +{ + BCPropertyData* value = GetProperty(TableBCProperty()); + if (!value) { value = new BCPropertyData(); - props.Set(TableBCProperty(), value); + SetProperty(TableBCProperty(), value); } return value; @@ -4103,7 +4106,7 @@ nsTableFrame::AddBCDamageArea(const TableArea& aValue) SetNeedToCalcBCBorders(true); // Get the property - BCPropertyData* value = GetBCProperty(true); + BCPropertyData* value = GetOrCreateBCProperty(); if (value) { #ifdef DEBUG VerifyNonNegativeDamageRect(value->mDamageArea); @@ -4143,7 +4146,7 @@ nsTableFrame::SetFullBCDamageArea() SetNeedToCalcBCBorders(true); - BCPropertyData* value = GetBCProperty(true); + BCPropertyData* value = GetOrCreateBCProperty(); if (value) { value->mDamageArea = TableArea(0, 0, GetColCount(), GetRowCount()); } @@ -4310,7 +4313,7 @@ BCMapCellInfo::BCMapCellInfo(nsTableFrame* aTableFrame) : mTableFrame(aTableFrame) , mNumTableRows(aTableFrame->GetRowCount()) , mNumTableCols(aTableFrame->GetColCount()) - , mTableBCData(mTableFrame->Properties().Get(TableBCProperty())) + , mTableBCData(mTableFrame->GetProperty(TableBCProperty())) , mTableWM(aTableFrame->StyleContext()) { ResetCellInfo(); |