From 3fcba76e2b62c6adafb05911c226d06d18869981 Mon Sep 17 00:00:00 2001 From: "bryner%uiuc.edu" Date: Wed, 4 Oct 2000 00:38:03 +0000 Subject: [PATCH] Fix for bug 53723 (gray form control on Linux). r=pierre, ianh, pavlov. sr/a=ben. --- content/html/style/src/nsCSSKeywordList.h | 1 + content/shared/public/nsCSSKeywordList.h | 1 + content/shared/src/nsCSSProps.cpp | 1 + layout/html/document/src/html.css | 10 +++++----- layout/html/style/src/nsCSSKeywordList.h | 1 + layout/html/style/src/nsCSSProps.cpp | 1 + layout/style/html.css | 10 +++++----- layout/style/nsCSSKeywordList.h | 1 + layout/style/nsCSSProps.cpp | 1 + widget/public/nsILookAndFeel.h | 5 ++++- widget/src/gtk/nsLookAndFeel.cpp | 7 +++++++ widget/src/mac/nsLookAndFeel.cpp | 3 +++ widget/src/os2/nsLookAndFeel.cpp | 3 +++ widget/src/windows/nsLookAndFeel.cpp | 3 +++ widget/src/xlib/nsLookAndFeel.cpp | 4 ++++ widget/src/xpwidgets/nsXPLookAndFeel.cpp | 2 ++ 16 files changed, 43 insertions(+), 11 deletions(-) diff --git a/content/html/style/src/nsCSSKeywordList.h b/content/html/style/src/nsCSSKeywordList.h index 072d822669a..337673819c3 100644 --- a/content/html/style/src/nsCSSKeywordList.h +++ b/content/html/style/src/nsCSSKeywordList.h @@ -51,6 +51,7 @@ CSS_KEY(-moz-all, _moz_all) CSS_KEY(-moz-bg-inset, _moz_bg_inset) CSS_KEY(-moz-bg-outset, _moz_bg_outset) CSS_KEY(-moz-center, _moz_center) +CSS_KEY(-moz-field, _moz_field) CSS_KEY(-moz-right, _moz_right) CSS_KEY(-moz-pre-wrap, _moz_pre_wrap) CSS_KEY(-moz-scrollbars-none, _moz_scrollbars_none) diff --git a/content/shared/public/nsCSSKeywordList.h b/content/shared/public/nsCSSKeywordList.h index 072d822669a..337673819c3 100644 --- a/content/shared/public/nsCSSKeywordList.h +++ b/content/shared/public/nsCSSKeywordList.h @@ -51,6 +51,7 @@ CSS_KEY(-moz-all, _moz_all) CSS_KEY(-moz-bg-inset, _moz_bg_inset) CSS_KEY(-moz-bg-outset, _moz_bg_outset) CSS_KEY(-moz-center, _moz_center) +CSS_KEY(-moz-field, _moz_field) CSS_KEY(-moz-right, _moz_right) CSS_KEY(-moz-pre-wrap, _moz_pre_wrap) CSS_KEY(-moz-scrollbars-none, _moz_scrollbars_none) diff --git a/content/shared/src/nsCSSProps.cpp b/content/shared/src/nsCSSProps.cpp index cbff9053857..0e9106a6b96 100644 --- a/content/shared/src/nsCSSProps.cpp +++ b/content/shared/src/nsCSSProps.cpp @@ -226,6 +226,7 @@ const PRInt32 nsCSSProps::kColorKTable[] = { eCSSKeyword_window, nsILookAndFeel::eColor_window, eCSSKeyword_windowframe, nsILookAndFeel::eColor_windowframe, eCSSKeyword_windowtext, nsILookAndFeel::eColor_windowtext, + eCSSKeyword__moz_field, nsILookAndFeel::eColor__moz_field, -1,-1 }; diff --git a/layout/html/document/src/html.css b/layout/html/document/src/html.css index 331a76656aa..03192bf0e84 100644 --- a/layout/html/document/src/html.css +++ b/layout/html/document/src/html.css @@ -424,7 +424,7 @@ fieldset { /* default inputs, text inputs, and selects */ input { - background-color: Window; + background-color: -moz-field; border: 2px inset ThreeDFace; color: WindowText; cursor: text; @@ -437,7 +437,7 @@ input { } textarea { - background-color: Window; + background-color: -moz-field; border: 2px inset ThreeDFace; color: WindowText; font: field; @@ -458,7 +458,7 @@ textarea { select { font: list; - background-color: Window; + background-color: -moz-field; border: 2px inset ThreeDFace; margin: 1px 0 1px 0; vertical-align: bottom; @@ -604,7 +604,7 @@ input[type="file"] > input[type="button"] { /* radio buttons */ input[type="radio"] { border: 2px inset ThreeDFace; - background-color: Window; + background-color: -moz-field; color: WindowText; width: 12px; height: 12px; @@ -617,7 +617,7 @@ input[type="radio"] { /* check boxes */ input[type="checkbox"] { border: 2px inset ThreeDFace; - background-color: Window; + background-color: -moz-field; color: WindowText; width: 13px; height: 13px; diff --git a/layout/html/style/src/nsCSSKeywordList.h b/layout/html/style/src/nsCSSKeywordList.h index 072d822669a..337673819c3 100644 --- a/layout/html/style/src/nsCSSKeywordList.h +++ b/layout/html/style/src/nsCSSKeywordList.h @@ -51,6 +51,7 @@ CSS_KEY(-moz-all, _moz_all) CSS_KEY(-moz-bg-inset, _moz_bg_inset) CSS_KEY(-moz-bg-outset, _moz_bg_outset) CSS_KEY(-moz-center, _moz_center) +CSS_KEY(-moz-field, _moz_field) CSS_KEY(-moz-right, _moz_right) CSS_KEY(-moz-pre-wrap, _moz_pre_wrap) CSS_KEY(-moz-scrollbars-none, _moz_scrollbars_none) diff --git a/layout/html/style/src/nsCSSProps.cpp b/layout/html/style/src/nsCSSProps.cpp index cbff9053857..0e9106a6b96 100644 --- a/layout/html/style/src/nsCSSProps.cpp +++ b/layout/html/style/src/nsCSSProps.cpp @@ -226,6 +226,7 @@ const PRInt32 nsCSSProps::kColorKTable[] = { eCSSKeyword_window, nsILookAndFeel::eColor_window, eCSSKeyword_windowframe, nsILookAndFeel::eColor_windowframe, eCSSKeyword_windowtext, nsILookAndFeel::eColor_windowtext, + eCSSKeyword__moz_field, nsILookAndFeel::eColor__moz_field, -1,-1 }; diff --git a/layout/style/html.css b/layout/style/html.css index 331a76656aa..03192bf0e84 100644 --- a/layout/style/html.css +++ b/layout/style/html.css @@ -424,7 +424,7 @@ fieldset { /* default inputs, text inputs, and selects */ input { - background-color: Window; + background-color: -moz-field; border: 2px inset ThreeDFace; color: WindowText; cursor: text; @@ -437,7 +437,7 @@ input { } textarea { - background-color: Window; + background-color: -moz-field; border: 2px inset ThreeDFace; color: WindowText; font: field; @@ -458,7 +458,7 @@ textarea { select { font: list; - background-color: Window; + background-color: -moz-field; border: 2px inset ThreeDFace; margin: 1px 0 1px 0; vertical-align: bottom; @@ -604,7 +604,7 @@ input[type="file"] > input[type="button"] { /* radio buttons */ input[type="radio"] { border: 2px inset ThreeDFace; - background-color: Window; + background-color: -moz-field; color: WindowText; width: 12px; height: 12px; @@ -617,7 +617,7 @@ input[type="radio"] { /* check boxes */ input[type="checkbox"] { border: 2px inset ThreeDFace; - background-color: Window; + background-color: -moz-field; color: WindowText; width: 13px; height: 13px; diff --git a/layout/style/nsCSSKeywordList.h b/layout/style/nsCSSKeywordList.h index 072d822669a..337673819c3 100644 --- a/layout/style/nsCSSKeywordList.h +++ b/layout/style/nsCSSKeywordList.h @@ -51,6 +51,7 @@ CSS_KEY(-moz-all, _moz_all) CSS_KEY(-moz-bg-inset, _moz_bg_inset) CSS_KEY(-moz-bg-outset, _moz_bg_outset) CSS_KEY(-moz-center, _moz_center) +CSS_KEY(-moz-field, _moz_field) CSS_KEY(-moz-right, _moz_right) CSS_KEY(-moz-pre-wrap, _moz_pre_wrap) CSS_KEY(-moz-scrollbars-none, _moz_scrollbars_none) diff --git a/layout/style/nsCSSProps.cpp b/layout/style/nsCSSProps.cpp index cbff9053857..0e9106a6b96 100644 --- a/layout/style/nsCSSProps.cpp +++ b/layout/style/nsCSSProps.cpp @@ -226,6 +226,7 @@ const PRInt32 nsCSSProps::kColorKTable[] = { eCSSKeyword_window, nsILookAndFeel::eColor_window, eCSSKeyword_windowframe, nsILookAndFeel::eColor_windowframe, eCSSKeyword_windowtext, nsILookAndFeel::eColor_windowtext, + eCSSKeyword__moz_field, nsILookAndFeel::eColor__moz_field, -1,-1 }; diff --git a/widget/public/nsILookAndFeel.h b/widget/public/nsILookAndFeel.h index 3c59985c6f7..e35e0ba774e 100644 --- a/widget/public/nsILookAndFeel.h +++ b/widget/public/nsILookAndFeel.h @@ -82,7 +82,10 @@ public: eColor_threedshadow, eColor_window, eColor_windowframe, - eColor_windowtext + eColor_windowtext, + + // Colors which will hopefully become CSS3 + eColor__moz_field } nsColorID; diff --git a/widget/src/gtk/nsLookAndFeel.cpp b/widget/src/gtk/nsLookAndFeel.cpp index aac72966310..bdc8b807c2a 100644 --- a/widget/src/gtk/nsLookAndFeel.cpp +++ b/widget/src/gtk/nsLookAndFeel.cpp @@ -197,6 +197,13 @@ NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor) aColor = GDK_COLOR_TO_NS_RGB(mStyle->fg[GTK_STATE_NORMAL]); break; + // from the CSS3 working draft (not yet finalized) + // http://www.w3.org/tr/2000/wd-css3-userint-20000216.html#color + + case eColor__moz_field: + aColor = GDK_COLOR_TO_NS_RGB(mStyle->base[GTK_STATE_NORMAL]); + break; + default: /* default color is BLACK */ aColor = 0; diff --git a/widget/src/mac/nsLookAndFeel.cpp b/widget/src/mac/nsLookAndFeel.cpp index 8963c5a06f6..d8dfcd67166 100644 --- a/widget/src/mac/nsLookAndFeel.cpp +++ b/widget/src/mac/nsLookAndFeel.cpp @@ -185,6 +185,9 @@ NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor) case eColor_window: aColor = NS_RGB(0xff,0xff,0xff); break; + case eColor__moz_field: + aColor = NS_RGB(0xff,0xff,0xff); + break; default: NS_WARNING("Someone asked nsILookAndFeel for a color I don't know about"); diff --git a/widget/src/os2/nsLookAndFeel.cpp b/widget/src/os2/nsLookAndFeel.cpp index dea4cbb1461..ce5603e6140 100644 --- a/widget/src/os2/nsLookAndFeel.cpp +++ b/widget/src/os2/nsLookAndFeel.cpp @@ -183,6 +183,9 @@ NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor) case eColor_windowtext: idx = SYSCLR_WINDOWTEXT; break; + case eColor__moz_field: + idx = SYSCLR_WINDOW; + break; default: idx = SYSCLR_WINDOW; break; diff --git a/widget/src/windows/nsLookAndFeel.cpp b/widget/src/windows/nsLookAndFeel.cpp index f72bebb26aa..c43007b8b3d 100644 --- a/widget/src/windows/nsLookAndFeel.cpp +++ b/widget/src/windows/nsLookAndFeel.cpp @@ -176,6 +176,9 @@ NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor) case eColor_windowtext: idx = COLOR_WINDOWTEXT; break; + case eColor__moz_field: + idx = COLOR_WINDOW; + break; default: idx = COLOR_WINDOW; break; diff --git a/widget/src/xlib/nsLookAndFeel.cpp b/widget/src/xlib/nsLookAndFeel.cpp index 7aaa912d2d6..be290c7ee79 100644 --- a/widget/src/xlib/nsLookAndFeel.cpp +++ b/widget/src/xlib/nsLookAndFeel.cpp @@ -179,6 +179,10 @@ NS_IMETHODIMP nsLookAndFeel::GetColor(const nsColorID aID, nscolor &aColor) aColor = NS_RGB(0x00, 0x00, 0x00); break; + case eColor__moz_field: + aColor = NS_RGB(0xc0, 0xc0, 0xc0); + break; + default: /* default color is BLACK */ aColor = 0; diff --git a/widget/src/xpwidgets/nsXPLookAndFeel.cpp b/widget/src/xpwidgets/nsXPLookAndFeel.cpp index 4d6347e36a1..f0385437b5d 100644 --- a/widget/src/xpwidgets/nsXPLookAndFeel.cpp +++ b/widget/src/xpwidgets/nsXPLookAndFeel.cpp @@ -167,6 +167,8 @@ nsLookAndFeelColorPref nsXPLookAndFeel::sColorPrefs[] = eColor_windowframe, PR_FALSE, nsLookAndFeelTypeColor, (nscolor)0 }, { "ui.windowtext", eColor_windowtext, PR_FALSE, nsLookAndFeelTypeColor, (nscolor)0 }, + { "ui.-moz-field", + eColor__moz_field, PR_FALSE, nsLookAndFeelTypeColor, (nscolor)0 }, }; PRBool nsXPLookAndFeel::sInitialized = PR_FALSE;