Backed out changeset 98094a8c0d46 (bug 1349417)

This commit is contained in:
Carsten "Tomcat" Book 2017-04-19 08:31:50 +02:00
Родитель d32c8f24cc
Коммит 1f45312241
4 изменённых файлов: 6 добавлений и 48 удалений

Просмотреть файл

@ -904,12 +904,6 @@ Gecko_Atomize(const char* aString, uint32_t aLength)
return NS_Atomize(nsDependentCSubstring(aString, aLength)).take();
}
nsIAtom*
Gecko_Atomize16(const nsAString* aString)
{
return NS_Atomize(*aString).take();
}
void
Gecko_AddRefAtom(nsIAtom* aAtom)
{
@ -983,33 +977,6 @@ Gecko_CopyFontFamilyFrom(nsFont* dst, const nsFont* src)
dst->fontlist = src->fontlist;
}
void
Gecko_nsFont_InitSystem(nsFont* aDest, int32_t aFontId,
const nsStyleFont* aFont, RawGeckoPresContextBorrowed aPresContext)
{
const nsFont* defaultVariableFont =
aPresContext->GetDefaultFont(kPresContext_DefaultVariableFont_ID,
aFont->mLanguage);
// We have passed uninitialized memory to this function,
// initialize it. We can't simply return an nsFont because then
// we need to know its size beforehand. Servo cannot initialize nsFont
// itself, so this will do.
nsFont* system = new (aDest) nsFont(*defaultVariableFont);
*system = *defaultVariableFont;
LookAndFeel::FontID fontID = static_cast<LookAndFeel::FontID>(aFontId);
nsRuleNode::ComputeSystemFont(system, fontID, aPresContext, defaultVariableFont);
}
void
Gecko_nsFont_Destroy(nsFont* aDest)
{
aDest->~nsFont();
}
void
Gecko_SetImageOrientation(nsStyleVisibility* aVisibility,
double aRadians, bool aFlip)

Просмотреть файл

@ -232,7 +232,6 @@ RawServoAnimationValueBorrowedOrNull Gecko_AnimationGetBaseStyle(
// Atoms.
nsIAtom* Gecko_Atomize(const char* aString, uint32_t aLength);
nsIAtom* Gecko_Atomize16(const nsAString* aString);
void Gecko_AddRefAtom(nsIAtom* aAtom);
void Gecko_ReleaseAtom(nsIAtom* aAtom);
const uint16_t* Gecko_GetAtomAsUTF16(nsIAtom* aAtom, uint32_t* aLength);
@ -244,11 +243,6 @@ void Gecko_FontFamilyList_Clear(FontFamilyList* aList);
void Gecko_FontFamilyList_AppendNamed(FontFamilyList* aList, nsIAtom* aName, bool aQuoted);
void Gecko_FontFamilyList_AppendGeneric(FontFamilyList* list, FontFamilyType familyType);
void Gecko_CopyFontFamilyFrom(nsFont* dst, const nsFont* src);
// will not run destructors on dst, give it uninitialized memory
// font_id is LookAndFeel::FontID
void Gecko_nsFont_InitSystem(nsFont* dst, int32_t font_id,
const nsStyleFont* font, RawGeckoPresContextBorrowed pres_context);
void Gecko_nsFont_Destroy(nsFont* dst);
// Visibility style
void Gecko_SetImageOrientation(nsStyleVisibility* aVisibility,

Просмотреть файл

@ -3568,8 +3568,7 @@ static int8_t ClampTo8Bit(int32_t aValue) {
/* static */ void
nsRuleNode::ComputeSystemFont(nsFont* aSystemFont, LookAndFeel::FontID aFontID,
const nsPresContext* aPresContext,
const nsFont* aDefaultVariableFont)
const nsPresContext* aPresContext)
{
gfxFontStyle fontStyle;
float devPerCSS =
@ -3612,7 +3611,7 @@ nsRuleNode::ComputeSystemFont(nsFont* aSystemFont, LookAndFeel::FontID aFontID,
// the default proportional font.
// Assumption: system defined font is proportional
aSystemFont->size =
std::max(aDefaultVariableFont->size -
std::max(defaultVariableFont->size -
nsPresContext::CSSPointsToAppUnits(2), 0);
}
#endif
@ -3690,7 +3689,7 @@ nsRuleNode::SetFont(nsPresContext* aPresContext, nsStyleContext* aContext,
if (eCSSUnit_Enumerated == systemFontValue->GetUnit()) {
LookAndFeel::FontID fontID =
(LookAndFeel::FontID)systemFontValue->GetIntValue();
ComputeSystemFont(&systemFont, fontID, aPresContext, defaultVariableFont);
ComputeSystemFont(&systemFont, fontID, aPresContext);
}
// font-family: font family list, enum, inherit

Просмотреть файл

@ -1087,11 +1087,6 @@ public:
static void FillAllMaskLists(nsStyleImageLayers& aLayers,
uint32_t aMaxItemCount);
static void ComputeSystemFont(nsFont* aSystemFont,
mozilla::LookAndFeel::FontID aFontID,
const nsPresContext* aPresContext,
const nsFont* aDefaultVariableFont);
private:
#ifdef DEBUG
// non-inline helper function to allow assertions without incomplete
@ -1104,6 +1099,9 @@ private:
static void StoreStyleOnContext(nsStyleContext* aContext,
nsStyleStructID aSID,
void* aStruct);
static void ComputeSystemFont(nsFont* aSystemFont,
mozilla::LookAndFeel::FontID aFontID,
const nsPresContext* aPresContext);
};
/**