Bug 1509718 - Get rid of mBorderWidthTable. r=jwatt

It has little to no use these days.

Differential Revision: https://phabricator.services.mozilla.com/D12857

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Emilio Cobos Álvarez 2018-11-27 19:52:13 +00:00
parent c279a94301
commit 9670d54612
7 changed files with 6 additions and 28 deletions

View File

@ -38,10 +38,6 @@ StaticPresData::Get()
StaticPresData::StaticPresData()
{
mLangService = nsLanguageAtomService::GetService();
mBorderWidthTable[NS_STYLE_BORDER_WIDTH_THIN] = nsPresContext::CSSPixelsToAppUnits(1);
mBorderWidthTable[NS_STYLE_BORDER_WIDTH_MEDIUM] = nsPresContext::CSSPixelsToAppUnits(3);
mBorderWidthTable[NS_STYLE_BORDER_WIDTH_THICK] = nsPresContext::CSSPixelsToAppUnits(5);
}
#define MAKE_FONT_PREF_KEY(_pref, _s0, _s1) \

View File

@ -92,12 +92,6 @@ public:
// and Shutdown.
static StaticPresData* Get();
/**
* This table maps border-width enums 'thin', 'medium', 'thick'
* to actual nscoord values.
*/
const nscoord* GetBorderWidthTable() { return mBorderWidthTable; }
/**
* Given a language, get the language group name, which can
* be used as an argument to LangGroupFontPrefs::Initialize()
@ -188,7 +182,6 @@ private:
~StaticPresData() {}
nsLanguageAtomService* mLangService;
nscoord mBorderWidthTable[3];
LangGroupFontPrefs mStaticLangGroupFontPrefs;
};

View File

@ -257,7 +257,6 @@ nsPresContext::nsPresContext(nsIDocument* aDocument, nsPresContextType aType)
, mInitialized(false)
#endif
{
PodZero(&mBorderWidthTable);
#ifdef DEBUG
PodZero(&mLayoutPhaseCount);
#endif

View File

@ -1386,8 +1386,6 @@ protected:
bool mFontGroupCacheDirty;
nsTHashtable<nsRefPtrHashKey<nsAtom>> mLanguagesUsed;
nscoord mBorderWidthTable[3];
uint32_t mInterruptChecksToSkip;
// Counters for tests and tools that want to detect frame construction

View File

@ -185,8 +185,7 @@ ApplyBorderToStyle(const nsMathMLmtdFrame* aFrame,
uint32_t rowIndex = aFrame->RowIndex();
uint32_t columnIndex = aFrame->ColIndex();
nscoord borderWidth =
nsPresContext::GetBorderWidthForKeyword(NS_STYLE_BORDER_WIDTH_THIN);
nscoord borderWidth = nsPresContext::CSSPixelsToAppUnits(1);
nsTArray<int8_t>* rowLinesList =
FindCellProperty(aFrame, RowLinesProperty());

View File

@ -300,12 +300,6 @@ enum class StyleImageLayerRepeat : uint8_t {
#define NS_STYLE_BORDER_COLLAPSE 0
#define NS_STYLE_BORDER_SEPARATE 1
// Possible enumerated specified values of border-*-width, used by nsCSSMargin
#define NS_STYLE_BORDER_WIDTH_THIN 0
#define NS_STYLE_BORDER_WIDTH_MEDIUM 1
#define NS_STYLE_BORDER_WIDTH_THICK 2
// XXX chopping block #define NS_STYLE_BORDER_WIDTH_LENGTH_VALUE 3
enum class StyleBorderStyle : uint8_t {
None,
Groove,

View File

@ -48,6 +48,8 @@ using namespace mozilla::dom;
/* static */ const int32_t nsStyleGridLine::kMinLine;
/* static */ const int32_t nsStyleGridLine::kMaxLine;
static const nscoord kMediumBorderWidth = nsPresContext::CSSPixelsToAppUnits(3);
// We set the size limit of style structs to 504 bytes so that when they
// are allocated by Servo side with Arc, the total size doesn't exceed
// 512 bytes, which minimizes allocator slop.
@ -283,8 +285,7 @@ nsStyleBorder::nsStyleBorder(const nsPresContext* aContext)
mBorderRadius.Set(corner, nsStyleCoord(0, nsStyleCoord::CoordConstructor));
}
nscoord medium =
(StaticPresData::Get()->GetBorderWidthTable())[NS_STYLE_BORDER_WIDTH_MEDIUM];
nscoord medium = kMediumBorderWidth;
NS_FOR_CSS_SIDES(side) {
mBorderImageSlice.Set(side, nsStyleCoord(1.0f, eStyleUnit_Percent));
mBorderImageWidth.Set(side, nsStyleCoord(1.0f, eStyleUnit_Factor));
@ -445,8 +446,7 @@ nsStyleBorder::CalcDifference(const nsStyleBorder& aNewData) const
}
nsStyleOutline::nsStyleOutline(const nsPresContext* aContext)
: mOutlineWidth((StaticPresData::Get()
->GetBorderWidthTable())[NS_STYLE_BORDER_WIDTH_MEDIUM])
: mOutlineWidth(kMediumBorderWidth)
, mOutlineOffset(0)
, mOutlineColor(StyleComplexColor::CurrentColor())
, mOutlineStyle(StyleBorderStyle::None)
@ -668,8 +668,7 @@ nsStyleColumn::nsStyleColumn(const nsPresContext* aContext)
: mColumnWidth(eStyleUnit_Auto)
, mColumnRuleColor(StyleComplexColor::CurrentColor())
, mColumnRuleStyle(StyleBorderStyle::None)
, mColumnRuleWidth((StaticPresData::Get()
->GetBorderWidthTable())[NS_STYLE_BORDER_WIDTH_MEDIUM])
, mColumnRuleWidth(kMediumBorderWidth)
, mTwipsPerPixel(aContext->AppUnitsPerDevPixel())
{
MOZ_COUNT_CTOR(nsStyleColumn);