зеркало из https://github.com/mozilla/pjs.git
Backout of commits for bug 97299. This causes assertions, which means we
missed some spots where name was getting set.
This commit is contained in:
Родитель
b27e2932c9
Коммит
b3f93c53a1
|
@ -1598,7 +1598,6 @@ nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDat
|
|||
if (dc) {
|
||||
nsAutoString familyList;
|
||||
fontData.mFamily.GetStringValue(familyList);
|
||||
familyList.ToLowerCase();
|
||||
font->mFont.name = familyList;
|
||||
nsAutoString face;
|
||||
|
||||
|
@ -1640,7 +1639,7 @@ nsRuleNode::ComputeFontData(nsStyleStruct* aStartStruct, const nsCSSStruct& aDat
|
|||
|
||||
// find the correct font if we are usingDocumentFonts OR we are overriding for XUL
|
||||
// MJA: bug 31816
|
||||
PRBool isMozFixed = font->mFont.name.EqualsWithConversion("-moz-fixed");
|
||||
PRBool isMozFixed = font->mFont.name.EqualsIgnoreCase("-moz-fixed");
|
||||
if (chromeOverride || useDocumentFonts) {
|
||||
font->mFont.name += nsAutoString(NS_LITERAL_STRING(",")) + defaultFont.name;
|
||||
font->mFixedFont.name += nsAutoString(NS_LITERAL_STRING(",")) + defaultFixedFont.name;
|
||||
|
|
|
@ -222,7 +222,7 @@ PRInt32 nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont& aFon
|
|||
(aFont1.style == aFont2.style) &&
|
||||
(aFont1.variant == aFont2.variant) &&
|
||||
(aFont1.weight == aFont2.weight) &&
|
||||
(aFont1.name.Equals(aFont2.name))) {
|
||||
(aFont1.name == aFont2.name)) {
|
||||
if ((aFont1.decorations == aFont2.decorations)) {
|
||||
return NS_STYLE_HINT_NONE;
|
||||
}
|
||||
|
|
|
@ -35,7 +35,7 @@ typedef PRBool (*nsFontFamilyEnumFunc)(const nsString& aFamily, PRBool aGeneric,
|
|||
|
||||
// Font structure.
|
||||
struct NS_GFX nsFont {
|
||||
// The family name of the font -- MUST be in lowercase!
|
||||
// The family name of the font
|
||||
nsString name;
|
||||
|
||||
// The style of font (normal, italic, oblique)
|
||||
|
@ -65,12 +65,7 @@ struct NS_GFX nsFont {
|
|||
// Make a copy of the given font
|
||||
nsFont(const nsFont& aFont);
|
||||
|
||||
#ifdef DEBUG
|
||||
// so we can set breakpoints on creation/deletion
|
||||
nsFont();
|
||||
|
||||
~nsFont();
|
||||
#endif
|
||||
|
||||
PRBool operator==(const nsFont& aOther) const {
|
||||
return Equals(aOther);
|
||||
|
|
|
@ -615,7 +615,6 @@ nsDeviceContextGTK::GetSystemFontInfo( GdkFont* iFont, nsSystemAttrID anID, nsFo
|
|||
{
|
||||
fontName = XGetAtomName( fontPrivate->xdisplay, pr );
|
||||
aFont->name.AssignWithConversion( fontName );
|
||||
aFont->name.ToLowerCase();
|
||||
::XFree( fontName );
|
||||
}
|
||||
|
||||
|
|
|
@ -27,7 +27,6 @@ nsFont::nsFont(const char* aName, PRUint8 aStyle, PRUint8 aVariant,
|
|||
PRUint16 aWeight, PRUint8 aDecoration, nscoord aSize)
|
||||
{
|
||||
name.AssignWithConversion(aName);
|
||||
name.ToLowerCase();
|
||||
style = aStyle;
|
||||
variant = aVariant;
|
||||
weight = aWeight;
|
||||
|
@ -39,7 +38,6 @@ nsFont::nsFont(const nsString& aName, PRUint8 aStyle, PRUint8 aVariant,
|
|||
PRUint16 aWeight, PRUint8 aDecoration, nscoord aSize)
|
||||
: name(aName)
|
||||
{
|
||||
name.ToLowerCase();
|
||||
style = aStyle;
|
||||
variant = aVariant;
|
||||
weight = aWeight;
|
||||
|
@ -50,11 +48,6 @@ nsFont::nsFont(const nsString& aName, PRUint8 aStyle, PRUint8 aVariant,
|
|||
nsFont::nsFont(const nsFont& aOther)
|
||||
: name(aOther.name)
|
||||
{
|
||||
// name should be lowercase already
|
||||
#ifdef DEBUG
|
||||
name.ToLowerCase();
|
||||
NS_ASSERTION(name.Equals(aOther.name),"nsFont name wasn't lowercase");
|
||||
#endif
|
||||
style = aOther.style;
|
||||
variant = aOther.variant;
|
||||
weight = aOther.weight;
|
||||
|
@ -62,16 +55,9 @@ nsFont::nsFont(const nsFont& aOther)
|
|||
size = aOther.size;
|
||||
}
|
||||
|
||||
#ifdef DEBUG
|
||||
// so we can set breakpoints on creation/deletion
|
||||
nsFont::nsFont()
|
||||
{
|
||||
}
|
||||
|
||||
nsFont::~nsFont()
|
||||
{
|
||||
}
|
||||
#endif
|
||||
|
||||
PRBool nsFont::Equals(const nsFont& aOther) const
|
||||
{
|
||||
|
@ -80,7 +66,7 @@ PRBool nsFont::Equals(const nsFont& aOther) const
|
|||
(weight == aOther.weight) &&
|
||||
(decorations == aOther.decorations) &&
|
||||
(size == aOther.size) &&
|
||||
name.Equals(aOther.name)) {
|
||||
name.EqualsIgnoreCase(aOther.name)) {
|
||||
return PR_TRUE;
|
||||
}
|
||||
return PR_FALSE;
|
||||
|
@ -88,12 +74,7 @@ PRBool nsFont::Equals(const nsFont& aOther) const
|
|||
|
||||
nsFont& nsFont::operator=(const nsFont& aOther)
|
||||
{
|
||||
// name should be lowercase
|
||||
name = aOther.name;
|
||||
#ifdef DEBUG
|
||||
name.ToLowerCase();
|
||||
NS_ASSERTION(name.Equals(aOther.name),"nsFont name wasn't lowercase");
|
||||
#endif
|
||||
style = aOther.style;
|
||||
variant = aOther.variant;
|
||||
weight = aOther.weight;
|
||||
|
|
|
@ -152,7 +152,6 @@ nsPrintOptions::SetFontNamePointSize(nsString& aFontName, PRInt32 aPointSize)
|
|||
{
|
||||
if (mDefaultFont != nsnull && aFontName.Length() > 0 && aPointSize > 0) {
|
||||
mDefaultFont->name = aFontName;
|
||||
mDefaultFont->name.ToLowerCase();
|
||||
mDefaultFont->size = NSIntPointsToTwips(aPointSize);
|
||||
}
|
||||
return NS_OK;
|
||||
|
|
|
@ -331,7 +331,6 @@ NS_IMETHODIMP nsDeviceContextXlib::GetSystemAttribute(nsSystemAttrID anID, Syste
|
|||
{
|
||||
fontName = XGetAtomName(mDisplay, pr);
|
||||
aInfo->mFont->name.AssignWithConversion(fontName);
|
||||
aInfo->mFont->name.ToLowerCase();
|
||||
::XFree(fontName);
|
||||
}
|
||||
|
||||
|
|
|
@ -212,7 +212,6 @@ nsPresContext::GetFontPreferences()
|
|||
mPrefs->CopyCharPref("font.default", &value);
|
||||
if (value) {
|
||||
mDefaultFont.name.AssignWithConversion(value);
|
||||
mDefaultFont.name.ToLowerCase();
|
||||
nsMemory::Free(value);
|
||||
value = nsnull;
|
||||
}
|
||||
|
|
|
@ -212,7 +212,6 @@ nsPresContext::GetFontPreferences()
|
|||
mPrefs->CopyCharPref("font.default", &value);
|
||||
if (value) {
|
||||
mDefaultFont.name.AssignWithConversion(value);
|
||||
mDefaultFont.name.ToLowerCase();
|
||||
nsMemory::Free(value);
|
||||
value = nsnull;
|
||||
}
|
||||
|
|
|
@ -628,13 +628,13 @@ nsFormControlHelper::GetFont(nsIFormControlFrame * aFormFrame,
|
|||
aFont.weight = NS_FONT_WEIGHT_NORMAL; // always normal weight
|
||||
aFont.size = styleFont->mFont.size; // normal font size
|
||||
if (0 == (styleFont->mFlags & NS_STYLE_FONT_FACE_EXPLICIT)) {
|
||||
aFont.name = "arial"; // XXX windows specific font
|
||||
aFont.name = "Arial"; // XXX windows specific font
|
||||
}
|
||||
} else {
|
||||
// use arial, scaled down one HTML size
|
||||
// italics, decoration & variant(?) get used
|
||||
aFont = styleFont->mFont;
|
||||
aFont.name = "arial"; // XXX windows specific font
|
||||
aFont.name = "Arial"; // XXX windows specific font
|
||||
aFont.weight = NS_FONT_WEIGHT_NORMAL;
|
||||
const nsFont& normal = aPresContext->GetDefaultFontDeprecated();
|
||||
PRInt32 scaler;
|
||||
|
|
|
@ -628,13 +628,13 @@ nsFormControlHelper::GetFont(nsIFormControlFrame * aFormFrame,
|
|||
aFont.weight = NS_FONT_WEIGHT_NORMAL; // always normal weight
|
||||
aFont.size = styleFont->mFont.size; // normal font size
|
||||
if (0 == (styleFont->mFlags & NS_STYLE_FONT_FACE_EXPLICIT)) {
|
||||
aFont.name = "arial"; // XXX windows specific font
|
||||
aFont.name = "Arial"; // XXX windows specific font
|
||||
}
|
||||
} else {
|
||||
// use arial, scaled down one HTML size
|
||||
// italics, decoration & variant(?) get used
|
||||
aFont = styleFont->mFont;
|
||||
aFont.name = "arial"; // XXX windows specific font
|
||||
aFont.name = "Arial"; // XXX windows specific font
|
||||
aFont.weight = NS_FONT_WEIGHT_NORMAL;
|
||||
const nsFont& normal = aPresContext->GetDefaultFontDeprecated();
|
||||
PRInt32 scaler;
|
||||
|
|
|
@ -1276,7 +1276,6 @@ SetFirstFamily(nsFont& aFont, const nsString& aFamily)
|
|||
{
|
||||
// overwrite the old value of font-family:
|
||||
aFont.name.Assign(aFamily);
|
||||
aFont.name.ToLowerCase();
|
||||
}
|
||||
|
||||
nsresult
|
||||
|
|
|
@ -222,7 +222,7 @@ PRInt32 nsStyleFont::CalcFontDifference(const nsFont& aFont1, const nsFont& aFon
|
|||
(aFont1.style == aFont2.style) &&
|
||||
(aFont1.variant == aFont2.variant) &&
|
||||
(aFont1.weight == aFont2.weight) &&
|
||||
(aFont1.name.Equals(aFont2.name))) {
|
||||
(aFont1.name == aFont2.name)) {
|
||||
if ((aFont1.decorations == aFont2.decorations)) {
|
||||
return NS_STYLE_HINT_NONE;
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче