зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1234676 part 3: Remove some now-unneeded local RefPtr variables. r=heycam
This commit is contained in:
Родитель
e6f677af60
Коммит
497e3d5ec0
|
@ -2574,14 +2574,9 @@ nsComputedDOMStyle::GetGridTemplateColumnsRows(const nsStyleGridTemplate& aTrack
|
|||
AppendGridLineNames(valueList, aTrackList.mRepeatAutoLineNameListBefore);
|
||||
}
|
||||
|
||||
// XXXdholbert The |tmpTrackSize| RefPtr variable below can go away once
|
||||
// we fix bug 1234676 and can make GetGridTrackSize return an
|
||||
// already_AddRefed value.
|
||||
RefPtr<CSSValue> tmpTrackSize =
|
||||
valueList->AppendCSSValue(
|
||||
GetGridTrackSize(aTrackList.mMinTrackSizingFunctions[i],
|
||||
aTrackList.mMaxTrackSizingFunctions[i]);
|
||||
|
||||
valueList->AppendCSSValue(tmpTrackSize.forget());
|
||||
aTrackList.mMaxTrackSizingFunctions[i]));
|
||||
if (!aTrackList.mRepeatAutoLineNameListAfter.IsEmpty()) {
|
||||
AppendGridLineNames(valueList, aTrackList.mRepeatAutoLineNameListAfter);
|
||||
}
|
||||
|
@ -2589,13 +2584,9 @@ nsComputedDOMStyle::GetGridTemplateColumnsRows(const nsStyleGridTemplate& aTrack
|
|||
end->SetString(NS_LITERAL_STRING(")"));
|
||||
valueList->AppendCSSValue(end.forget());
|
||||
} else {
|
||||
// XXXdholbert The |tmpTrackSize| RefPtr variable below can go away once
|
||||
// we fix bug 1234676 and make GetGridTrackSize return an
|
||||
// already_AddRefed value.
|
||||
RefPtr<CSSValue> tmpTrackSize =
|
||||
valueList->AppendCSSValue(
|
||||
GetGridTrackSize(aTrackList.mMinTrackSizingFunctions[i],
|
||||
aTrackList.mMaxTrackSizingFunctions[i]);
|
||||
valueList->AppendCSSValue(tmpTrackSize.forget());
|
||||
aTrackList.mMaxTrackSizingFunctions[i]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3483,19 +3474,12 @@ nsComputedDOMStyle::CreateTextAlignValue(uint8_t aAlign, bool aAlignTrue,
|
|||
return val.forget();
|
||||
}
|
||||
|
||||
// XXXdholbert Really we should store |val| in a RefPtr right away, and our
|
||||
// return-type should be already_AddRefed. See bug 1234676. For now, we only
|
||||
// put it in a RefPtr (for the benefit of AppendCSSValue) after we know we're
|
||||
// not returning it directly.
|
||||
RefPtr<nsROCSSPrimitiveValue> refcountedVal = val;
|
||||
val = nullptr; // (to avoid accidental reuse/misuse)
|
||||
|
||||
RefPtr<nsROCSSPrimitiveValue> first = new nsROCSSPrimitiveValue;
|
||||
first->SetIdent(eCSSKeyword_true);
|
||||
|
||||
RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
|
||||
valueList->AppendCSSValue(first.forget());
|
||||
valueList->AppendCSSValue(refcountedVal.forget());
|
||||
valueList->AppendCSSValue(val.forget());
|
||||
return valueList.forget();
|
||||
}
|
||||
|
||||
|
@ -3553,17 +3537,12 @@ nsComputedDOMStyle::DoGetTextDecoration()
|
|||
|
||||
RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
|
||||
|
||||
// XXXdholbert The |tmp| RefPtr variable below can go away once we fix bug
|
||||
// 1234676 and make the DoGet* functions return an already_AddRefed value.
|
||||
RefPtr<CSSValue> tmp = DoGetTextDecorationLine();
|
||||
valueList->AppendCSSValue(tmp.forget());
|
||||
valueList->AppendCSSValue(DoGetTextDecorationLine());
|
||||
if (!isInitialStyle) {
|
||||
tmp = DoGetTextDecorationStyle();
|
||||
valueList->AppendCSSValue(tmp.forget());
|
||||
valueList->AppendCSSValue(DoGetTextDecorationStyle());
|
||||
}
|
||||
if (!isForegroundColor) {
|
||||
tmp = DoGetTextDecorationColor();
|
||||
valueList->AppendCSSValue(tmp.forget());
|
||||
valueList->AppendCSSValue(DoGetTextDecorationColor());
|
||||
}
|
||||
|
||||
return valueList.forget();
|
||||
|
@ -5421,17 +5400,10 @@ nsComputedDOMStyle::GetSVGPaintFor(bool aFill)
|
|||
RefPtr<nsDOMCSSValueList> valueList = GetROCSSValueList(false);
|
||||
RefPtr<nsROCSSPrimitiveValue> fallback = new nsROCSSPrimitiveValue;
|
||||
|
||||
// XXXdholbert Really we should store |val| in a RefPtr right away, and
|
||||
// our return-type should be already_AddRefed. See bug 1234676. For now,
|
||||
// we only put it in a RefPtr (for the benefit of AppendCSSValue) after
|
||||
// we know we're not returning it directly.
|
||||
RefPtr<nsROCSSPrimitiveValue> refcountedVal = val;
|
||||
val = nullptr; // (to avoid accidental reuse/misuse)
|
||||
|
||||
refcountedVal->SetURI(paint->mPaint.mPaintServer);
|
||||
val->SetURI(paint->mPaint.mPaintServer);
|
||||
SetToRGBAColor(fallback, paint->mFallbackColor);
|
||||
|
||||
valueList->AppendCSSValue(refcountedVal.forget());
|
||||
valueList->AppendCSSValue(val.forget());
|
||||
valueList->AppendCSSValue(fallback.forget());
|
||||
return valueList.forget();
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче