зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1266249 - Remove mHasCachedOutline. r=dbaron
This commit is contained in:
Родитель
ea6f023ffe
Коммит
37c8b13e17
|
@ -843,8 +843,7 @@ nsCSSRendering::PaintOutline(nsPresContext* aPresContext,
|
|||
"shouldn't have created nsDisplayOutline item");
|
||||
|
||||
uint8_t outlineStyle = ourOutline->GetOutlineStyle();
|
||||
nscoord width;
|
||||
ourOutline->GetOutlineWidth(width);
|
||||
nscoord width = ourOutline->GetOutlineWidth();
|
||||
|
||||
if (width == 0 && outlineStyle != NS_STYLE_BORDER_STYLE_AUTO) {
|
||||
// Empty outline
|
||||
|
|
|
@ -7845,9 +7845,7 @@ ComputeAndIncludeOutlineArea(nsIFrame* aFrame, nsOverflowAreas& aOverflowAreas,
|
|||
return;
|
||||
}
|
||||
|
||||
nscoord width;
|
||||
DebugOnly<bool> result = outline->GetOutlineWidth(width);
|
||||
NS_ASSERTION(result, "GetOutlineWidth had no cached outline width");
|
||||
nscoord width = outline->GetOutlineWidth();
|
||||
if (width <= 0 && outlineStyle != NS_STYLE_BORDER_STYLE_AUTO) {
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -3165,15 +3165,10 @@ nsComputedDOMStyle::DoGetOutlineWidth()
|
|||
|
||||
nscoord width;
|
||||
if (outline->GetOutlineStyle() == NS_STYLE_BORDER_STYLE_NONE) {
|
||||
NS_ASSERTION(outline->GetOutlineWidth(width) && width == 0,
|
||||
"unexpected width");
|
||||
NS_ASSERTION(outline->GetOutlineWidth() == 0, "unexpected width");
|
||||
width = 0;
|
||||
} else {
|
||||
#ifdef DEBUG
|
||||
bool res =
|
||||
#endif
|
||||
outline->GetOutlineWidth(width);
|
||||
NS_ASSERTION(res, "percent outline doesn't exist");
|
||||
width = outline->GetOutlineWidth();
|
||||
}
|
||||
val->SetAppUnits(width);
|
||||
|
||||
|
|
|
@ -580,7 +580,6 @@ nsStyleOutline::nsStyleOutline(StyleStructContext aContext)
|
|||
mOutlineStyle = NS_STYLE_BORDER_STYLE_NONE;
|
||||
mOutlineColor = NS_RGB(0, 0, 0);
|
||||
|
||||
mHasCachedOutline = false;
|
||||
mTwipsPerPixel = aContext.DevPixelsToAppUnits(1);
|
||||
|
||||
SetOutlineInitialColor();
|
||||
|
@ -592,7 +591,6 @@ nsStyleOutline::nsStyleOutline(const nsStyleOutline& aSrc)
|
|||
, mOutlineOffset(aSrc.mOutlineOffset)
|
||||
, mCachedOutlineWidth(aSrc.mCachedOutlineWidth)
|
||||
, mOutlineColor(aSrc.mOutlineColor)
|
||||
, mHasCachedOutline(aSrc.mHasCachedOutline)
|
||||
, mOutlineStyle(aSrc.mOutlineStyle)
|
||||
, mTwipsPerPixel(aSrc.mTwipsPerPixel)
|
||||
{
|
||||
|
@ -604,17 +602,14 @@ nsStyleOutline::RecalcData(nsPresContext* aContext)
|
|||
{
|
||||
if (NS_STYLE_BORDER_STYLE_NONE == GetOutlineStyle()) {
|
||||
mCachedOutlineWidth = 0;
|
||||
mHasCachedOutline = true;
|
||||
} else if (IsFixedUnit(mOutlineWidth, true)) {
|
||||
} else {
|
||||
MOZ_ASSERT(IsFixedUnit(mOutlineWidth, true));
|
||||
// Clamp negative calc() to 0.
|
||||
mCachedOutlineWidth =
|
||||
std::max(CalcCoord(mOutlineWidth, aContext->GetBorderWidthTable(), 3), 0);
|
||||
mCachedOutlineWidth =
|
||||
NS_ROUND_BORDER_TO_PIXELS(mCachedOutlineWidth, mTwipsPerPixel);
|
||||
mHasCachedOutline = true;
|
||||
}
|
||||
else
|
||||
mHasCachedOutline = false;
|
||||
}
|
||||
|
||||
nsChangeHint nsStyleOutline::CalcDifference(const nsStyleOutline& aOther) const
|
||||
|
@ -641,9 +636,7 @@ nsChangeHint nsStyleOutline::CalcDifference(const nsStyleOutline& aOther) const
|
|||
if (mOutlineWidth != aOther.mOutlineWidth ||
|
||||
mOutlineOffset != aOther.mOutlineOffset ||
|
||||
mTwipsPerPixel != aOther.mTwipsPerPixel ||
|
||||
mHasCachedOutline != aOther.mHasCachedOutline ||
|
||||
(mHasCachedOutline &&
|
||||
(mCachedOutlineWidth != aOther.mCachedOutlineWidth))) {
|
||||
mCachedOutlineWidth != aOther.mCachedOutlineWidth) {
|
||||
return nsChangeHint_NeutralChange;
|
||||
}
|
||||
|
||||
|
|
|
@ -1352,13 +1352,9 @@ struct MOZ_NEEDS_MEMMOVABLE_MEMBERS nsStyleOutline
|
|||
nsStyleCoord mOutlineWidth; // [reset] coord, enum (see nsStyleConsts.h)
|
||||
nscoord mOutlineOffset; // [reset]
|
||||
|
||||
bool GetOutlineWidth(nscoord& aWidth) const
|
||||
nscoord GetOutlineWidth() const
|
||||
{
|
||||
if (mHasCachedOutline) {
|
||||
aWidth = mCachedOutlineWidth;
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
return mCachedOutlineWidth;
|
||||
}
|
||||
|
||||
uint8_t GetOutlineStyle(void) const
|
||||
|
@ -1405,7 +1401,6 @@ protected:
|
|||
|
||||
nscolor mOutlineColor; // [reset]
|
||||
|
||||
bool mHasCachedOutline;
|
||||
uint8_t mOutlineStyle; // [reset] See nsStyleConsts.h
|
||||
|
||||
nscoord mTwipsPerPixel;
|
||||
|
|
Загрузка…
Ссылка в новой задаче