summaryrefslogtreecommitdiffstats
path: root/layout/tables/nsTableFrame.cpp
diff options
context:
space:
mode:
authorMoonchild <moonchild@palemoon.org>2019-07-03 15:17:08 +0000
committerGitHub <noreply@github.com>2019-07-03 15:17:08 +0000
commit0e54a032624b4ce23a959454047bfd504a734cc0 (patch)
tree6e19e55c35095548177db6fb9e5fbabe2aff2310 /layout/tables/nsTableFrame.cpp
parent8ea1f38f9c55a076dade47eaf0daaea27590d179 (diff)
parent3051056bbb0b41b8258d91e44a4ff8ec33a98d8f (diff)
downloadUXP-0e54a032624b4ce23a959454047bfd504a734cc0.tar
UXP-0e54a032624b4ce23a959454047bfd504a734cc0.tar.gz
UXP-0e54a032624b4ce23a959454047bfd504a734cc0.tar.lz
UXP-0e54a032624b4ce23a959454047bfd504a734cc0.tar.xz
UXP-0e54a032624b4ce23a959454047bfd504a734cc0.zip
Merge pull request #1151 from win7-7/FrameProperties
Attach FrameProperties to each frame instead of using a shared hashtable
Diffstat (limited to 'layout/tables/nsTableFrame.cpp')
-rw-r--r--layout/tables/nsTableFrame.cpp31
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();