From 7598a7ebfcf6676a193db44622ff5bf3eae36a13 Mon Sep 17 00:00:00 2001 From: "pierre%netscape.com" Date: Thu, 21 Sep 2000 10:21:23 +0000 Subject: [PATCH] fix related to the reconstruction of html.css (#6625) and to css system fonts (#1021): in quirks mode and on each platform, use the same fonts as Nav4 for edit fields, lists and buttons. r=rods a=buster git-svn-id: svn://10.0.0.236/trunk@79754 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/html/style/src/nsCSSStyleRule.cpp | 46 +++++++++++++++++-- .../layout/html/style/src/nsCSSStyleRule.cpp | 46 +++++++++++++++++-- mozilla/layout/style/nsCSSStyleRule.cpp | 46 +++++++++++++++++-- 3 files changed, 123 insertions(+), 15 deletions(-) diff --git a/mozilla/content/html/style/src/nsCSSStyleRule.cpp b/mozilla/content/html/style/src/nsCSSStyleRule.cpp index 9d697844670..39fdc773356 100644 --- a/mozilla/content/html/style/src/nsCSSStyleRule.cpp +++ b/mozilla/content/html/style/src/nsCSSStyleRule.cpp @@ -1648,6 +1648,7 @@ MapDeclarationFontInto(nsICSSDeclaration* aDeclaration, if (dc) { SystemAttrStruct sysInfo; sysInfo.mFont = &font->mFont; + font->mFont.size = defaultFont.size; // GetSystemAttribute sets the font face but not necessarily the size if (NS_FAILED(dc->GetSystemAttribute(sysID, &sysInfo))) { font->mFont.name = defaultFont.name; font->mFixedFont.name = defaultFixedFont.name; @@ -1657,12 +1658,47 @@ MapDeclarationFontInto(nsICSSDeclaration* aDeclaration, // NavQuirks uses sans-serif instead of whatever the native font is if (eCompatibility_NavQuirks == mode) { - if (sysID == eSystemAttr_Font_Field) { - font->mFont.name.AssignWithConversion("monospace"); - } else if (sysID == eSystemAttr_Font_Button || - sysID == eSystemAttr_Font_Caption) { - font->mFont.name.AssignWithConversion("sans-serif"); +#ifdef XP_MAC + switch (sysID) { + case eSystemAttr_Font_Field: + case eSystemAttr_Font_List: + font->mFont.name.AssignWithConversion("monospace"); + font->mFont.size = defaultFixedFont.size; + break; + case eSystemAttr_Font_Button: + font->mFont.name.AssignWithConversion("serif"); + font->mFont.size = defaultFont.size; + break; } +#endif + +#ifdef XP_PC + switch (sysID) { + case eSystemAttr_Font_Field: + font->mFont.name.AssignWithConversion("monospace"); + font->mFont.size = defaultFixedFont.size; + break; + case eSystemAttr_Font_Button: + case eSystemAttr_Font_List: + font->mFont.name.AssignWithConversion("sans-serif"); + font->mFont.size = defaultFont.size; + break; + } +#endif + +#ifdef XP_UNIX + switch (sysID) { + case eSystemAttr_Font_Field: + font->mFont.name.AssignWithConversion("monospace"); + font->mFont.size = defaultFixedFont.size; + break; + case eSystemAttr_Font_Button: + case eSystemAttr_Font_List: + font->mFont.name.AssignWithConversion("serif"); + font->mFont.size = defaultFont.size; + break; + } +#endif } } else if (eCSSUnit_Inherit == ourFont->mFamily.GetUnit()) { diff --git a/mozilla/layout/html/style/src/nsCSSStyleRule.cpp b/mozilla/layout/html/style/src/nsCSSStyleRule.cpp index 9d697844670..39fdc773356 100644 --- a/mozilla/layout/html/style/src/nsCSSStyleRule.cpp +++ b/mozilla/layout/html/style/src/nsCSSStyleRule.cpp @@ -1648,6 +1648,7 @@ MapDeclarationFontInto(nsICSSDeclaration* aDeclaration, if (dc) { SystemAttrStruct sysInfo; sysInfo.mFont = &font->mFont; + font->mFont.size = defaultFont.size; // GetSystemAttribute sets the font face but not necessarily the size if (NS_FAILED(dc->GetSystemAttribute(sysID, &sysInfo))) { font->mFont.name = defaultFont.name; font->mFixedFont.name = defaultFixedFont.name; @@ -1657,12 +1658,47 @@ MapDeclarationFontInto(nsICSSDeclaration* aDeclaration, // NavQuirks uses sans-serif instead of whatever the native font is if (eCompatibility_NavQuirks == mode) { - if (sysID == eSystemAttr_Font_Field) { - font->mFont.name.AssignWithConversion("monospace"); - } else if (sysID == eSystemAttr_Font_Button || - sysID == eSystemAttr_Font_Caption) { - font->mFont.name.AssignWithConversion("sans-serif"); +#ifdef XP_MAC + switch (sysID) { + case eSystemAttr_Font_Field: + case eSystemAttr_Font_List: + font->mFont.name.AssignWithConversion("monospace"); + font->mFont.size = defaultFixedFont.size; + break; + case eSystemAttr_Font_Button: + font->mFont.name.AssignWithConversion("serif"); + font->mFont.size = defaultFont.size; + break; } +#endif + +#ifdef XP_PC + switch (sysID) { + case eSystemAttr_Font_Field: + font->mFont.name.AssignWithConversion("monospace"); + font->mFont.size = defaultFixedFont.size; + break; + case eSystemAttr_Font_Button: + case eSystemAttr_Font_List: + font->mFont.name.AssignWithConversion("sans-serif"); + font->mFont.size = defaultFont.size; + break; + } +#endif + +#ifdef XP_UNIX + switch (sysID) { + case eSystemAttr_Font_Field: + font->mFont.name.AssignWithConversion("monospace"); + font->mFont.size = defaultFixedFont.size; + break; + case eSystemAttr_Font_Button: + case eSystemAttr_Font_List: + font->mFont.name.AssignWithConversion("serif"); + font->mFont.size = defaultFont.size; + break; + } +#endif } } else if (eCSSUnit_Inherit == ourFont->mFamily.GetUnit()) { diff --git a/mozilla/layout/style/nsCSSStyleRule.cpp b/mozilla/layout/style/nsCSSStyleRule.cpp index 9d697844670..39fdc773356 100644 --- a/mozilla/layout/style/nsCSSStyleRule.cpp +++ b/mozilla/layout/style/nsCSSStyleRule.cpp @@ -1648,6 +1648,7 @@ MapDeclarationFontInto(nsICSSDeclaration* aDeclaration, if (dc) { SystemAttrStruct sysInfo; sysInfo.mFont = &font->mFont; + font->mFont.size = defaultFont.size; // GetSystemAttribute sets the font face but not necessarily the size if (NS_FAILED(dc->GetSystemAttribute(sysID, &sysInfo))) { font->mFont.name = defaultFont.name; font->mFixedFont.name = defaultFixedFont.name; @@ -1657,12 +1658,47 @@ MapDeclarationFontInto(nsICSSDeclaration* aDeclaration, // NavQuirks uses sans-serif instead of whatever the native font is if (eCompatibility_NavQuirks == mode) { - if (sysID == eSystemAttr_Font_Field) { - font->mFont.name.AssignWithConversion("monospace"); - } else if (sysID == eSystemAttr_Font_Button || - sysID == eSystemAttr_Font_Caption) { - font->mFont.name.AssignWithConversion("sans-serif"); +#ifdef XP_MAC + switch (sysID) { + case eSystemAttr_Font_Field: + case eSystemAttr_Font_List: + font->mFont.name.AssignWithConversion("monospace"); + font->mFont.size = defaultFixedFont.size; + break; + case eSystemAttr_Font_Button: + font->mFont.name.AssignWithConversion("serif"); + font->mFont.size = defaultFont.size; + break; } +#endif + +#ifdef XP_PC + switch (sysID) { + case eSystemAttr_Font_Field: + font->mFont.name.AssignWithConversion("monospace"); + font->mFont.size = defaultFixedFont.size; + break; + case eSystemAttr_Font_Button: + case eSystemAttr_Font_List: + font->mFont.name.AssignWithConversion("sans-serif"); + font->mFont.size = defaultFont.size; + break; + } +#endif + +#ifdef XP_UNIX + switch (sysID) { + case eSystemAttr_Font_Field: + font->mFont.name.AssignWithConversion("monospace"); + font->mFont.size = defaultFixedFont.size; + break; + case eSystemAttr_Font_Button: + case eSystemAttr_Font_List: + font->mFont.name.AssignWithConversion("serif"); + font->mFont.size = defaultFont.size; + break; + } +#endif } } else if (eCSSUnit_Inherit == ourFont->mFamily.GetUnit()) {