IsWidgetStyled calculates case NS_THEME_DROPDOWN incorrectly. It shouldn't be doing anything with the NS_THEME_DROPDOWN case right now. b=385367 r=cbarrett sr=roc

This commit is contained in:
joshmoz%gmail.com 2007-06-21 21:27:43 +00:00
Родитель 823ddd529b
Коммит b928716626
2 изменённых файлов: 13 добавлений и 8 удалений

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

@ -58,12 +58,14 @@ nsILookAndFeel::nsColorID nsNativeTheme::sButtonBorderColorID = nsILookAndFeel::
nsILookAndFeel::nsColorID nsNativeTheme::sButtonDisabledBorderColorID = nsILookAndFeel::eColor_buttonshadow;
nsILookAndFeel::nsColorID nsNativeTheme::sButtonBGColorID = nsILookAndFeel::eColor_buttonface;
nsILookAndFeel::nsColorID nsNativeTheme::sButtonDisabledBGColorID = nsILookAndFeel::eColor_buttonface;
nsMargin nsNativeTheme::sTextfieldBorderSize(2, 2, 2, 2);
PRUint8 nsNativeTheme::sTextfieldBorderStyle = NS_STYLE_BORDER_STYLE_INSET;
nsILookAndFeel::nsColorID nsNativeTheme::sTextfieldBorderColorID = nsILookAndFeel::eColor_threedface;
PRBool nsNativeTheme::sTextfieldBGTransparent = PR_FALSE;
nsILookAndFeel::nsColorID nsNativeTheme::sTextfieldBGColorID = nsILookAndFeel::eColor__moz_field;
nsILookAndFeel::nsColorID nsNativeTheme::sTextfieldDisabledBGColorID = nsILookAndFeel::eColor_threedface;
nsMargin nsNativeTheme::sListboxBorderSize(2, 2, 2, 2);
PRUint8 nsNativeTheme::sListboxBorderStyle = NS_STYLE_BORDER_STYLE_INSET;
nsILookAndFeel::nsColorID nsNativeTheme::sListboxBorderColorID = nsILookAndFeel::eColor_threedface;
@ -193,9 +195,7 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame,
if (aFrame && (aWidgetType == NS_THEME_BUTTON ||
aWidgetType == NS_THEME_TEXTFIELD ||
aWidgetType == NS_THEME_TEXTFIELD_MULTILINE ||
aWidgetType == NS_THEME_LISTBOX ||
aWidgetType == NS_THEME_DROPDOWN)) {
aWidgetType == NS_THEME_LISTBOX)) {
if (aFrame->GetContent()->IsNodeOfType(nsINode::eHTML)) {
nscolor defaultBGColor, defaultBorderColor;
PRUint8 defaultBorderStyle;
@ -234,7 +234,8 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame,
ConvertMarginToAppUnits(sTextfieldBorderSize, defaultBorderSize);
lookAndFeel->GetColor(sTextfieldBorderColorID,
defaultBorderColor);
if (!(defaultBGTransparent = sTextfieldBGTransparent)) {
defaultBGTransparent = sTextfieldBGTransparent;
if (!defaultBGTransparent) {
if (IsDisabled(aFrame))
lookAndFeel->GetColor(sTextfieldDisabledBGColorID,
defaultBGColor);
@ -245,12 +246,12 @@ nsNativeTheme::IsWidgetStyled(nsPresContext* aPresContext, nsIFrame* aFrame,
break;
case NS_THEME_LISTBOX:
case NS_THEME_DROPDOWN:
defaultBorderStyle = sListboxBorderStyle;
ConvertMarginToAppUnits(sListboxBorderSize, defaultBorderSize);
lookAndFeel->GetColor(sListboxBorderColorID,
defaultBorderColor);
if (!(defaultBGTransparent = sListboxBGTransparent)) {
defaultBGTransparent = sListboxBGTransparent;
if (!defaultBGTransparent) {
if (IsDisabled(aFrame))
lookAndFeel->GetColor(sListboxDisabledBGColorID,
defaultBGColor);

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

@ -135,8 +135,10 @@ class nsNativeTheme
PRBool GetCheckedOrSelected(nsIFrame* aFrame, PRBool aCheckSelected);
// these should be set to appropriate platform values by the subclass, to
// match the values in forms.css. These defaults match forms.css
// The following should be set to appropriate platform values by the subclass,
// to match the values in forms.css. The defaults match forms.css.
// push buttons
static nsMargin sButtonBorderSize;
static nsMargin sButtonDisabledBorderSize;
static PRUint8 sButtonActiveBorderStyle;
@ -145,12 +147,14 @@ class nsNativeTheme
static nsILookAndFeel::nsColorID sButtonDisabledBorderColorID;
static nsILookAndFeel::nsColorID sButtonBGColorID;
static nsILookAndFeel::nsColorID sButtonDisabledBGColorID;
// text fields
static nsMargin sTextfieldBorderSize;
static PRUint8 sTextfieldBorderStyle;
static nsILookAndFeel::nsColorID sTextfieldBorderColorID;
static PRBool sTextfieldBGTransparent;
static nsILookAndFeel::nsColorID sTextfieldBGColorID;
static nsILookAndFeel::nsColorID sTextfieldDisabledBGColorID;
// listboxes
static nsMargin sListboxBorderSize;
static PRUint8 sListboxBorderStyle;
static nsILookAndFeel::nsColorID sListboxBorderColorID;