From 231ada71e558b431668bb9cafe0da173d9e451f4 Mon Sep 17 00:00:00 2001 From: "hyatt%netscape.com" Date: Sat, 21 Sep 2002 01:03:38 +0000 Subject: [PATCH] Fix for 169373, make HTML form controls fully support native look on Windows XP. r/sr=hewitt/blake git-svn-id: svn://10.0.0.236/trunk@130192 18797224-902f-48f8-a5cc-f745e15eee43 --- .../content/html/content/src/nsHTMLAtomList.h | 1 + .../html/document/src/nsHTMLContentSink.cpp | 13 ++- .../content/shared/public/nsHTMLAtomList.h | 1 + .../xml/document/src/nsXMLContentSink.cpp | 10 ++ mozilla/gfx/public/nsITheme.h | 2 + mozilla/gfx/src/gtk/nsNativeThemeGTK.cpp | 10 ++ mozilla/gfx/src/gtk/nsNativeThemeGTK.h | 2 +- mozilla/gfx/src/mac/nsNativeThemeMac.cpp | 11 +- mozilla/gfx/src/mac/nsNativeThemeMac.h | 2 +- mozilla/gfx/src/windows/Makefile.in | 1 + mozilla/gfx/src/windows/nsNativeThemeWin.cpp | 104 ++++++++++++++++-- mozilla/gfx/src/windows/nsNativeThemeWin.h | 3 +- mozilla/layout/base/nsCSSFrameConstructor.cpp | 2 +- mozilla/layout/base/nsCSSRendering.cpp | 10 +- mozilla/layout/base/nsIPresShell.h | 10 ++ mozilla/layout/base/nsPresShell.cpp | 20 ++++ mozilla/layout/base/public/nsIPresShell.h | 10 ++ .../forms/nsGfxCheckboxControlFrame.cpp | 9 ++ .../layout/forms/nsGfxRadioControlFrame.cpp | 11 +- mozilla/layout/forms/nsListControlFrame.cpp | 14 +++ mozilla/layout/html/base/src/nsPresShell.cpp | 20 ++++ mozilla/layout/html/document/src/forms.css | 18 ++- .../forms/src/nsGfxCheckboxControlFrame.cpp | 9 ++ .../html/forms/src/nsGfxRadioControlFrame.cpp | 11 +- .../html/forms/src/nsListControlFrame.cpp | 14 +++ .../html/style/src/nsCSSFrameConstructor.cpp | 2 +- .../layout/html/style/src/nsCSSRendering.cpp | 10 +- mozilla/layout/style/forms.css | 18 ++- mozilla/layout/xul/base/src/nsBox.cpp | 4 +- mozilla/layout/xul/base/src/nsBoxFrame.cpp | 2 +- .../layout/xul/base/src/nsImageBoxFrame.cpp | 4 +- .../xul/base/src/tree/src/nsTreeBodyFrame.cpp | 6 +- mozilla/toolkit/content/xul.css | 8 ++ mozilla/xpfe/global/resources/content/xul.css | 8 ++ 34 files changed, 332 insertions(+), 48 deletions(-) diff --git a/mozilla/content/html/content/src/nsHTMLAtomList.h b/mozilla/content/html/content/src/nsHTMLAtomList.h index 0cad45d156a..d4f0b81bc03 100644 --- a/mozilla/content/html/content/src/nsHTMLAtomList.h +++ b/mozilla/content/html/content/src/nsHTMLAtomList.h @@ -210,6 +210,7 @@ HTML_ATOM(media, "media") HTML_ATOM(menu, "menu") HTML_ATOM(meta, "meta") HTML_ATOM(method, "method") +HTML_ATOM(msthemecompatible, "msthemecompatible") HTML_ATOM(multicol, "multicol") HTML_ATOM(multiple, "multiple") HTML_ATOM(name, "name") diff --git a/mozilla/content/html/document/src/nsHTMLContentSink.cpp b/mozilla/content/html/document/src/nsHTMLContentSink.cpp index a9c746cb262..79c3d6dbba4 100644 --- a/mozilla/content/html/document/src/nsHTMLContentSink.cpp +++ b/mozilla/content/html/document/src/nsHTMLContentSink.cpp @@ -5217,7 +5217,18 @@ HTMLContentSink::ProcessHeaderData(nsIAtom* aHeader, const nsAString& aValue, } } else if (aHeader == nsHTMLAtoms::link) { rv = ProcessLinkHeader(aContent, aValue); - } else if (mParser) { + } + else if (aHeader == nsHTMLAtoms::msthemecompatible) { + // Disable theming for the presshell if the value is no. + nsAutoString value(aValue); + if (value.EqualsIgnoreCase("no")) { + nsCOMPtr shell; + mDocument->GetShellAt(0, getter_AddRefs(shell)); + if (shell) + shell->DisableThemeSupport(); + } + } + else if (mParser) { // we also need to report back HTTP-EQUIV headers to the channel // so that it can process things like pragma: no-cache or other // cache-control headers. Ideally this should also be the way for diff --git a/mozilla/content/shared/public/nsHTMLAtomList.h b/mozilla/content/shared/public/nsHTMLAtomList.h index 0cad45d156a..d4f0b81bc03 100644 --- a/mozilla/content/shared/public/nsHTMLAtomList.h +++ b/mozilla/content/shared/public/nsHTMLAtomList.h @@ -210,6 +210,7 @@ HTML_ATOM(media, "media") HTML_ATOM(menu, "menu") HTML_ATOM(meta, "meta") HTML_ATOM(method, "method") +HTML_ATOM(msthemecompatible, "msthemecompatible") HTML_ATOM(multicol, "multicol") HTML_ATOM(multiple, "multiple") HTML_ATOM(name, "name") diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp index 64fbf8f64d9..4e83ecefc10 100644 --- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp @@ -1124,6 +1124,16 @@ nsXMLContentSink::ProcessHeaderData(nsIAtom* aHeader,const nsAString& aValue,nsI else if (aHeader == nsHTMLAtoms::link) { rv = ProcessLink(aContent, aValue); } + else if (aHeader == nsHTMLAtoms::msthemecompatible) { + // Disable theming for the presshell if the value is no. + nsAutoString value(aValue); + if (value.EqualsIgnoreCase("no")) { + nsCOMPtr shell; + mDocument->GetShellAt(0, getter_AddRefs(shell)); + if (shell) + shell->DisableThemeSupport(); + } + } else if (mParser) { // we also need to report back HTTP-EQUIV headers to the channel // so that it can process things like pragma: no-cache or other diff --git a/mozilla/gfx/public/nsITheme.h b/mozilla/gfx/public/nsITheme.h index df563e6f99e..6c509e833e5 100644 --- a/mozilla/gfx/public/nsITheme.h +++ b/mozilla/gfx/public/nsITheme.h @@ -34,6 +34,7 @@ class nsIPresContext; class nsIRenderingContext; class nsIDeviceContext; class nsIFrame; +class nsIContent; class nsIAtom; // IID for the nsITheme interface @@ -71,6 +72,7 @@ public: NS_IMETHOD ThemeChanged()=0; virtual PRBool ThemeSupportsWidget(nsIPresContext* aPresContext, + nsIFrame* aFrame, PRUint8 aWidgetType)=0; virtual PRBool WidgetIsContainer(PRUint8 aWidgetType)=0; diff --git a/mozilla/gfx/src/gtk/nsNativeThemeGTK.cpp b/mozilla/gfx/src/gtk/nsNativeThemeGTK.cpp index 3976c4be31d..c6b19a83b50 100644 --- a/mozilla/gfx/src/gtk/nsNativeThemeGTK.cpp +++ b/mozilla/gfx/src/gtk/nsNativeThemeGTK.cpp @@ -577,8 +577,18 @@ nsNativeThemeGTK::ThemeChanged() NS_IMETHODIMP_(PRBool) nsNativeThemeGTK::ThemeSupportsWidget(nsIPresContext* aPresContext, + nsIFrame* aFrame, PRUint8 aWidgetType) { + // Check for specific widgets to see if HTML has overridden the style. + if (aFrame) { + // For now don't support HTML. + nsCOMPtr content; + aFrame->GetContent(getter_AddRefs(content)); + if (content->IsContentOfType(nsIContent::eHTML)) + return PR_FALSE; + } + switch (aWidgetType) { case NS_THEME_BUTTON: case NS_THEME_RADIO: diff --git a/mozilla/gfx/src/gtk/nsNativeThemeGTK.h b/mozilla/gfx/src/gtk/nsNativeThemeGTK.h index 1023f868677..dc05d33ebc0 100644 --- a/mozilla/gfx/src/gtk/nsNativeThemeGTK.h +++ b/mozilla/gfx/src/gtk/nsNativeThemeGTK.h @@ -69,7 +69,7 @@ public: NS_IMETHOD ThemeChanged(); - NS_IMETHOD_(PRBool) ThemeSupportsWidget(nsIPresContext* aPresContext, + NS_IMETHOD_(PRBool) ThemeSupportsWidget(nsIPresContext* aPresContext, nsIFrame* aFrame, PRUint8 aWidgetType); NS_IMETHOD_(PRBool) WidgetIsContainer(PRUint8 aWidgetType); diff --git a/mozilla/gfx/src/mac/nsNativeThemeMac.cpp b/mozilla/gfx/src/mac/nsNativeThemeMac.cpp index e6f4379d5f7..38c93d322f5 100644 --- a/mozilla/gfx/src/mac/nsNativeThemeMac.cpp +++ b/mozilla/gfx/src/mac/nsNativeThemeMac.cpp @@ -1088,9 +1088,18 @@ nsNativeThemeMac::ThemeChanged() PRBool -nsNativeThemeMac::ThemeSupportsWidget(nsIPresContext* aPresContext, +nsNativeThemeMac::ThemeSupportsWidget(nsIPresContext* aPresContext, nsIFrame* aFrame, PRUint8 aWidgetType) { + // Check for specific widgets to see if HTML has overridden the style. + if (aFrame) { + // For now don't support HTML. + nsCOMPtr content; + aFrame->GetContent(getter_AddRefs(content)); + if (content->IsContentOfType(nsIContent::eHTML)) + return PR_FALSE; + } + // XXX We can go even further and call the API to ask if support exists. PRBool retVal = PR_FALSE; diff --git a/mozilla/gfx/src/mac/nsNativeThemeMac.h b/mozilla/gfx/src/mac/nsNativeThemeMac.h index aa8cb629c1a..466661c1636 100644 --- a/mozilla/gfx/src/mac/nsNativeThemeMac.h +++ b/mozilla/gfx/src/mac/nsNativeThemeMac.h @@ -70,7 +70,7 @@ public: NS_IMETHOD WidgetStateChanged(nsIFrame* aFrame, PRUint8 aWidgetType, nsIAtom* aAttribute, PRBool* aShouldRepaint); NS_IMETHOD ThemeChanged(); - PRBool ThemeSupportsWidget(nsIPresContext* aPresContext, PRUint8 aWidgetType); + PRBool ThemeSupportsWidget(nsIPresContext* aPresContext, nsIFrame* aFrame, PRUint8 aWidgetType); PRBool WidgetIsContainer(PRUint8 aWidgetType); protected: diff --git a/mozilla/gfx/src/windows/Makefile.in b/mozilla/gfx/src/windows/Makefile.in index a395421ee31..c723aef52ec 100644 --- a/mozilla/gfx/src/windows/Makefile.in +++ b/mozilla/gfx/src/windows/Makefile.in @@ -44,6 +44,7 @@ REQUIRES = xpcom \ necko \ content \ layout \ + dom \ debug \ imglib2 \ $(NULL) diff --git a/mozilla/gfx/src/windows/nsNativeThemeWin.cpp b/mozilla/gfx/src/windows/nsNativeThemeWin.cpp index 0a73eba8890..8ee2450cd7a 100644 --- a/mozilla/gfx/src/windows/nsNativeThemeWin.cpp +++ b/mozilla/gfx/src/windows/nsNativeThemeWin.cpp @@ -54,6 +54,9 @@ #include "nsINameSpaceManager.h" #include "nsIPresContext.h" #include "nsILookAndFeel.h" +#include "nsIDOMHTMLInputElement.h" +#include "nsIComponentManager.h" +#include "nsWidgetsCID.h" #include "nsIMenuFrame.h" #include "nsUnicharUtils.h" #include @@ -77,6 +80,9 @@ #define TFP_TEXTFIELD 1 #define TFS_READONLY 6 +// Treeview/listbox constants +#define TREEVIEW_BODY 1 + // Scrollbar constants #define SP_BUTTON 1 #define SP_THUMBHOR 2 @@ -106,6 +112,8 @@ // Dropdown constants #define CBP_DROPMARKER 1 +static NS_DEFINE_IID(kLookAndFeelCID, NS_LOOKANDFEEL_CID); + NS_IMPL_ISUPPORTS1(nsNativeThemeWin, nsITheme) typedef HANDLE (WINAPI*OpenThemeDataPtr)(HWND hwnd, LPCWSTR pszClassList); @@ -276,6 +284,17 @@ nsNativeThemeWin::GetTheme(PRUint8 aWidgetType) mComboBoxTheme = openTheme(NULL, L"Combobox"); return mComboBoxTheme; } + case NS_THEME_LISTBOX: + case NS_THEME_LISTBOX_LISTITEM: + case NS_THEME_TREEVIEW: + case NS_THEME_TREEVIEW_HEADER: + case NS_THEME_TREEVIEW_HEADER_SORTARROW: + case NS_THEME_TREEVIEW_TWISTY_OPEN: + case NS_THEME_TREEVIEW_TREEITEM: { + if (!mTreeViewTheme) + mTreeViewTheme = openTheme(NULL, L"Listview"); + return mTreeViewTheme; + } } return NULL; } @@ -403,6 +422,9 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, // IsContentOfType test for HTML vs. XUL here. nsIAtom* atom = (aWidgetType == NS_THEME_CHECKBOX) ? mCheckedAtom : mSelectedAtom; + PRBool isHTML = PR_FALSE; + PRBool isHTMLChecked = PR_FALSE; + if (!aFrame) aState = TS_NORMAL; else { @@ -413,15 +435,14 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, if (content->IsContentOfType(nsIContent::eXUL)) aFrame->GetParent(&aFrame); else { - nsCOMPtr tag; - content->GetTag(*getter_AddRefs(tag)); - if (tag == mInputAtom) - atom = mInputCheckedAtom; + // Attempt a QI. + nsCOMPtr inputElt(do_QueryInterface(content)); + if (inputElt) { + inputElt->GetChecked(&isHTMLChecked); + isHTML = PR_TRUE; + } } - } - - if (aFrame) { if (IsDisabled(aFrame)) aState = TS_DISABLED; else { @@ -435,7 +456,11 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, } } - if (CheckBooleanAttr(aFrame, atom)) + if (isHTML) { + if (isHTMLChecked) + aState += 4; + } + else if (CheckBooleanAttr(aFrame, atom)) aState += 4; // 4 unchecked states, 4 checked states. return NS_OK; } @@ -600,6 +625,12 @@ nsNativeThemeWin::GetThemePartAndState(nsIFrame* aFrame, PRUint8 aWidgetType, aState = TS_NORMAL; return NS_OK; } + case NS_THEME_TREEVIEW: + case NS_THEME_LISTBOX: { + aPart = TREEVIEW_BODY; + aState = TS_NORMAL; + return NS_OK; + } case NS_THEME_TAB_PANELS: { aPart = TABP_PANELS; aState = TS_NORMAL; @@ -933,10 +964,17 @@ nsNativeThemeWin::ThemeChanged() PRBool nsNativeThemeWin::ThemeSupportsWidget(nsIPresContext* aPresContext, + nsIFrame* aFrame, PRUint8 aWidgetType) { - // XXXdwh We can go even further and call the API to ask if support exists for - // specific widgets. + if (!aPresContext) + return PR_TRUE; + + nsCOMPtr shell; + aPresContext->GetShell(getter_AddRefs(shell)); + if (!shell->IsThemeSupportEnabled()) + return PR_FALSE; + HANDLE theme = NULL; if (aWidgetType == NS_THEME_CHECKBOX_CONTAINER) theme = GetTheme(NS_THEME_CHECKBOX); @@ -944,7 +982,51 @@ nsNativeThemeWin::ThemeSupportsWidget(nsIPresContext* aPresContext, theme = GetTheme(NS_THEME_RADIO); else theme = GetTheme(aWidgetType); - return theme != NULL; + if (!theme) + return PR_FALSE; + + // Check for specific widgets to see if HTML has overridden the style. + if (aFrame && aWidgetType == NS_THEME_BUTTON || aWidgetType == NS_THEME_TEXTFIELD) { + nsCOMPtr content; + aFrame->GetContent(getter_AddRefs(content)); + if (content->IsContentOfType(nsIContent::eHTML)) { + nscolor bgColor; + nscolor disabledBG; + + nsCOMPtr lookAndFeel(do_CreateInstance(kLookAndFeelCID)); + + lookAndFeel->GetColor(nsILookAndFeel::eColor_threedface, disabledBG); + + switch (aWidgetType) { + case NS_THEME_BUTTON: + lookAndFeel->GetColor(nsILookAndFeel::eColor_buttonface, bgColor); + break; + case NS_THEME_TEXTFIELD: + lookAndFeel->GetColor(nsILookAndFeel::eColor__moz_field, bgColor); + break; + default: + return PR_TRUE; + } + + nsCOMPtr styleContext; + aFrame->GetStyleContext(getter_AddRefs(styleContext)); + + const nsStyleBackground* ourBG = (const nsStyleBackground*)styleContext->GetStyleData(eStyleStruct_Background); + if (ourBG->mBackgroundColor != bgColor && ourBG->mBackgroundColor != disabledBG) + return PR_FALSE; + + const nsStyleBorder* ourBorder = (const nsStyleBorder*)styleContext->GetStyleData(eStyleStruct_Border); + //see if any sides are dotted, dashed or solid + for (PRInt32 cnt = 0; cnt < 4; cnt++) { + if ((ourBorder->GetBorderStyle(cnt) == NS_STYLE_BORDER_STYLE_DOTTED) || + (ourBorder->GetBorderStyle(cnt) == NS_STYLE_BORDER_STYLE_DASHED) || + (ourBorder->GetBorderStyle(cnt) == NS_STYLE_BORDER_STYLE_SOLID)) + return PR_FALSE; + } + } + } + + return PR_TRUE; } PRBool diff --git a/mozilla/gfx/src/windows/nsNativeThemeWin.h b/mozilla/gfx/src/windows/nsNativeThemeWin.h index b0ed43eba7e..069f7f9a17a 100644 --- a/mozilla/gfx/src/windows/nsNativeThemeWin.h +++ b/mozilla/gfx/src/windows/nsNativeThemeWin.h @@ -53,7 +53,8 @@ public: NS_IMETHOD ThemeChanged(); - PRBool ThemeSupportsWidget(nsIPresContext* aPresContext, + PRBool ThemeSupportsWidget(nsIPresContext* aPresContext, + nsIFrame* aFrame, PRUint8 aWidgetType); PRBool WidgetIsContainer(PRUint8 aWidgetType); diff --git a/mozilla/layout/base/nsCSSFrameConstructor.cpp b/mozilla/layout/base/nsCSSFrameConstructor.cpp index 45e84285995..6d27368953c 100644 --- a/mozilla/layout/base/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/base/nsCSSFrameConstructor.cpp @@ -10687,7 +10687,7 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext, if (disp && disp->mAppearance) { nsCOMPtr theme; aPresContext->GetTheme(getter_AddRefs(theme)); - if (theme && theme->ThemeSupportsWidget(aPresContext, disp->mAppearance)) { + if (theme && theme->ThemeSupportsWidget(aPresContext, primaryFrame, disp->mAppearance)) { PRBool repaint = PR_FALSE; theme->WidgetStateChanged(primaryFrame, disp->mAppearance, aAttribute, &repaint); if (repaint) diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index 94bb573c060..46fee54c13c 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -1569,13 +1569,13 @@ void nsCSSRendering::PaintBorder(nsIPresContext* aPresContext, aPresContext->GetCompatibilityMode(&compatMode); // Check to see if we have an appearance defined. If so, we let the theme - // renderer draw the border. - const nsStyleDisplay* displayData; - aForFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct*&)displayData)); + // renderer draw the border. DO not get the data from aForFrame, since the passed in style context + // may be different! Always use |aStyleContext|! + const nsStyleDisplay* displayData = (const nsStyleDisplay*)aStyleContext->GetStyleData(eStyleStruct_Display); if (displayData->mAppearance) { nsCOMPtr theme; aPresContext->GetTheme(getter_AddRefs(theme)); - if (theme && theme->ThemeSupportsWidget(aPresContext, displayData->mAppearance)) + if (theme && theme->ThemeSupportsWidget(aPresContext, aForFrame, displayData->mAppearance)) return; // Let the theme handle it. } // Get our style context's color struct. @@ -2699,7 +2699,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, if (displayData->mAppearance) { nsCOMPtr theme; aPresContext->GetTheme(getter_AddRefs(theme)); - if (theme && theme->ThemeSupportsWidget(aPresContext, displayData->mAppearance)) { + if (theme && theme->ThemeSupportsWidget(aPresContext, aForFrame, displayData->mAppearance)) { theme->DrawWidgetBackground(&aRenderingContext, aForFrame, displayData->mAppearance, aBorderArea, aDirtyRect); return; diff --git a/mozilla/layout/base/nsIPresShell.h b/mozilla/layout/base/nsIPresShell.h index cdec023f12f..843d1e58690 100644 --- a/mozilla/layout/base/nsIPresShell.h +++ b/mozilla/layout/base/nsIPresShell.h @@ -536,6 +536,16 @@ public: */ NS_IMETHOD UnsuppressPainting() = 0; + /** + * Called to disable nsITheme support in a specific presshell. + */ + NS_IMETHOD DisableThemeSupport() = 0; + + /** + * Indicates whether theme support is enabled. + */ + virtual PRBool IsThemeSupportEnabled() = 0; + /** * See if reflow verification is enabled. To enable reflow verification add * "verifyreflow:1" to your NSPR_LOG_MODULES environment variable diff --git a/mozilla/layout/base/nsPresShell.cpp b/mozilla/layout/base/nsPresShell.cpp index 5b667b45e0a..67b586370de 100644 --- a/mozilla/layout/base/nsPresShell.cpp +++ b/mozilla/layout/base/nsPresShell.cpp @@ -1132,6 +1132,9 @@ public: NS_IMETHOD IsPaintingSuppressed(PRBool* aResult); NS_IMETHOD UnsuppressPainting(); + NS_IMETHOD DisableThemeSupport(); + virtual PRBool IsThemeSupportEnabled(); + NS_IMETHOD HandleEventWithTarget(nsEvent* aEvent, nsIFrame* aFrame, nsIContent* aContent, PRUint32 aFlags, nsEventStatus* aStatus); NS_IMETHOD GetEventTargetFrame(nsIFrame** aFrame); @@ -1379,6 +1382,8 @@ protected: nsCallbackEventRequest* mFirstCallbackEventRequest; nsCallbackEventRequest* mLastCallbackEventRequest; + PRPackedBool mIsThemeSupportDisabled; // Whether or not form controls should use nsITheme in this shell. + PRPackedBool mIsDocumentGone; // We've been disconnected from the document. PRPackedBool mPaintingSuppressed; // For all documents we initially lock down painting. // We will refuse to paint the document until either @@ -1567,6 +1572,7 @@ PresShell::PresShell(): gLog = PR_NewLogModule("PresShell"); #endif mSelectionFlags = nsISelectionDisplay::DISPLAY_TEXT | nsISelectionDisplay::DISPLAY_IMAGES; + mIsThemeSupportDisabled = PR_FALSE; } NS_IMPL_ADDREF(PresShell) @@ -4915,6 +4921,20 @@ PresShell::UnsuppressPainting() return NS_OK; } +NS_IMETHODIMP +PresShell::DisableThemeSupport() +{ + // Doesn't have to be dynamic. Just set the bool. + mIsThemeSupportDisabled = PR_TRUE; + return NS_OK; +} + +PRBool +PresShell::IsThemeSupportEnabled() +{ + return !mIsThemeSupportDisabled; +} + // Post a request to handle an arbitrary callback after reflow has finished. NS_IMETHODIMP PresShell::PostReflowCallback(nsIReflowCallback* aCallback) diff --git a/mozilla/layout/base/public/nsIPresShell.h b/mozilla/layout/base/public/nsIPresShell.h index cdec023f12f..843d1e58690 100644 --- a/mozilla/layout/base/public/nsIPresShell.h +++ b/mozilla/layout/base/public/nsIPresShell.h @@ -536,6 +536,16 @@ public: */ NS_IMETHOD UnsuppressPainting() = 0; + /** + * Called to disable nsITheme support in a specific presshell. + */ + NS_IMETHOD DisableThemeSupport() = 0; + + /** + * Indicates whether theme support is enabled. + */ + virtual PRBool IsThemeSupportEnabled() = 0; + /** * See if reflow verification is enabled. To enable reflow verification add * "verifyreflow:1" to your NSPR_LOG_MODULES environment variable diff --git a/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp b/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp index d0150eabd68..7c63a6ed733 100644 --- a/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp @@ -54,6 +54,7 @@ #include "nsIServiceManager.h" #include "nsIDOMNode.h" #include "nsIDOMHTMLInputElement.h" +#include "nsITheme.h" //------------------------------------------------------------ @@ -187,6 +188,14 @@ nsGfxCheckboxControlFrame::PaintCheckBox(nsIPresContext* aPresContext, const nsRect& aDirtyRect, nsFramePaintLayer aWhichLayer) { + const nsStyleDisplay* disp = (const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display); + if (disp->mAppearance) { + nsCOMPtr theme; + aPresContext->GetTheme(getter_AddRefs(theme)); + if (theme && theme->ThemeSupportsWidget(aPresContext, this, disp->mAppearance)) + return; // No need to paint the checkbox. The theme will do it. + } + aRenderingContext.PushState(); float p2t; diff --git a/mozilla/layout/forms/nsGfxRadioControlFrame.cpp b/mozilla/layout/forms/nsGfxRadioControlFrame.cpp index 62cd0413829..4d845c31df8 100644 --- a/mozilla/layout/forms/nsGfxRadioControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxRadioControlFrame.cpp @@ -53,7 +53,7 @@ #endif #include "nsIServiceManager.h" #include "nsIDOMNode.h" - +#include "nsITheme.h" nsresult NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) @@ -180,7 +180,14 @@ nsGfxRadioControlFrame::PaintRadioButton(nsIPresContext* aPresContext, nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect) { - + const nsStyleDisplay* disp = (const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display); + if (disp->mAppearance) { + nsCOMPtr theme; + aPresContext->GetTheme(getter_AddRefs(theme)); + if (theme && theme->ThemeSupportsWidget(aPresContext, this, disp->mAppearance)) + return; // No need to paint the radio button. The theme will do it. + } + PRBool checked = PR_TRUE; GetCurrentCheckState(&checked); // Get check state from the content model if (checked) { diff --git a/mozilla/layout/forms/nsListControlFrame.cpp b/mozilla/layout/forms/nsListControlFrame.cpp index 1cb50166f6f..25fe540acab 100644 --- a/mozilla/layout/forms/nsListControlFrame.cpp +++ b/mozilla/layout/forms/nsListControlFrame.cpp @@ -86,6 +86,7 @@ #include "nsCSSRendering.h" #include "nsILookAndFeel.h" #include "nsReflowPath.h" +#include "nsITheme.h" // Timer Includes #include "nsITimer.h" @@ -522,6 +523,19 @@ nsListControlFrame::Paint(nsIPresContext* aPresContext, } if (isVisible) { + if (aWhichLayer == NS_FRAME_PAINT_LAYER_BACKGROUND) { + const nsStyleDisplay* displayData; + GetStyleData(eStyleStruct_Display, ((const nsStyleStruct*&)displayData)); + if (displayData->mAppearance) { + nsCOMPtr theme; + aPresContext->GetTheme(getter_AddRefs(theme)); + nsRect rect(0, 0, mRect.width, mRect.height); + if (theme && theme->ThemeSupportsWidget(aPresContext, this, displayData->mAppearance)) + theme->DrawWidgetBackground(&aRenderingContext, this, + displayData->mAppearance, rect, aDirtyRect); + } + } + return nsScrollFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer); } diff --git a/mozilla/layout/html/base/src/nsPresShell.cpp b/mozilla/layout/html/base/src/nsPresShell.cpp index 5b667b45e0a..67b586370de 100644 --- a/mozilla/layout/html/base/src/nsPresShell.cpp +++ b/mozilla/layout/html/base/src/nsPresShell.cpp @@ -1132,6 +1132,9 @@ public: NS_IMETHOD IsPaintingSuppressed(PRBool* aResult); NS_IMETHOD UnsuppressPainting(); + NS_IMETHOD DisableThemeSupport(); + virtual PRBool IsThemeSupportEnabled(); + NS_IMETHOD HandleEventWithTarget(nsEvent* aEvent, nsIFrame* aFrame, nsIContent* aContent, PRUint32 aFlags, nsEventStatus* aStatus); NS_IMETHOD GetEventTargetFrame(nsIFrame** aFrame); @@ -1379,6 +1382,8 @@ protected: nsCallbackEventRequest* mFirstCallbackEventRequest; nsCallbackEventRequest* mLastCallbackEventRequest; + PRPackedBool mIsThemeSupportDisabled; // Whether or not form controls should use nsITheme in this shell. + PRPackedBool mIsDocumentGone; // We've been disconnected from the document. PRPackedBool mPaintingSuppressed; // For all documents we initially lock down painting. // We will refuse to paint the document until either @@ -1567,6 +1572,7 @@ PresShell::PresShell(): gLog = PR_NewLogModule("PresShell"); #endif mSelectionFlags = nsISelectionDisplay::DISPLAY_TEXT | nsISelectionDisplay::DISPLAY_IMAGES; + mIsThemeSupportDisabled = PR_FALSE; } NS_IMPL_ADDREF(PresShell) @@ -4915,6 +4921,20 @@ PresShell::UnsuppressPainting() return NS_OK; } +NS_IMETHODIMP +PresShell::DisableThemeSupport() +{ + // Doesn't have to be dynamic. Just set the bool. + mIsThemeSupportDisabled = PR_TRUE; + return NS_OK; +} + +PRBool +PresShell::IsThemeSupportEnabled() +{ + return !mIsThemeSupportDisabled; +} + // Post a request to handle an arbitrary callback after reflow has finished. NS_IMETHODIMP PresShell::PostReflowCallback(nsIReflowCallback* aCallback) diff --git a/mozilla/layout/html/document/src/forms.css b/mozilla/layout/html/document/src/forms.css index 1e638d33bae..89d43b472d8 100644 --- a/mozilla/layout/html/document/src/forms.css +++ b/mozilla/layout/html/document/src/forms.css @@ -73,6 +73,7 @@ label { /* default inputs, text inputs, and selects */ input { + -moz-appearance: textfield; padding: 1px 0 1px 0; border: 2px inset ThreeDFace; background-color: -moz-Field; @@ -100,6 +101,7 @@ textarea { -moz-box-sizing: border-box; -moz-user-focus: normal; -moz-binding: url("resource:///res/builtin/platformHTMLBindings.xml#textAreas"); + -moz-appearance: textfield; } textarea > scrollbar { @@ -126,7 +128,7 @@ select { -moz-box-sizing: border-box; -moz-user-select: none; -moz-user-focus: normal; - + -moz-appearance: menulist; border-width: 2px !important; border-style: inset !important; -moz-border-radius: 0 !important; @@ -135,8 +137,10 @@ select { select[size] { padding: 1px 0 1px 0; } + select[size="1"] { padding: 0; + -moz-appearance: menulist; } select > input[type="button"] { @@ -149,6 +153,7 @@ select > input[type="button"] { background-image: url("arrow.gif") !important; background-repeat: no-repeat !important; background-position: center !important; + -moz-appearance: menulist-button; } select > input[type="button"]:active { @@ -157,6 +162,7 @@ select > input[type="button"]:active { select[size], :-moz-select-scrolled-content { overflow: -moz-scrollbars-vertical; + -moz-appearance: listbox; } select:-moz-dummy-option { @@ -231,7 +237,7 @@ select[disabled]:-moz-display-comboboxcontrol-frame { option[disabled], optgroup[disabled] { - background-color: -moz-field; + background-color: transparent; } /* hidden inputs */ @@ -267,6 +273,7 @@ input[type="image"]:focus { /* file selector */ input[type="file"] { + -moz-appearance: none; white-space: nowrap; cursor: default; -moz-binding: none; @@ -294,8 +301,9 @@ input[type="file"] > input[type="button"]:-moz-focus-inner /* radio buttons */ input[type="radio"] { - width: 12px; - height: 12px; + -moz-appearance: radio; + width: 13px; + height: 13px; margin: 3px 3px 0px 5px; padding: 0; vertical-align: baseline; @@ -307,6 +315,7 @@ input[type="radio"] { /* check boxes */ input[type="checkbox"] { + -moz-appearance: checkbox; width: 13px; height: 13px; margin: 3px 3px 3px 4px; @@ -366,6 +375,7 @@ button, input[type="reset"], input[type="button"], input[type="submit"] { + -moz-appearance: button; padding: 2px 0 2px 0; border: 2px outset ButtonFace; background-color: ButtonFace; diff --git a/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp index d0150eabd68..7c63a6ed733 100644 --- a/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp @@ -54,6 +54,7 @@ #include "nsIServiceManager.h" #include "nsIDOMNode.h" #include "nsIDOMHTMLInputElement.h" +#include "nsITheme.h" //------------------------------------------------------------ @@ -187,6 +188,14 @@ nsGfxCheckboxControlFrame::PaintCheckBox(nsIPresContext* aPresContext, const nsRect& aDirtyRect, nsFramePaintLayer aWhichLayer) { + const nsStyleDisplay* disp = (const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display); + if (disp->mAppearance) { + nsCOMPtr theme; + aPresContext->GetTheme(getter_AddRefs(theme)); + if (theme && theme->ThemeSupportsWidget(aPresContext, this, disp->mAppearance)) + return; // No need to paint the checkbox. The theme will do it. + } + aRenderingContext.PushState(); float p2t; diff --git a/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp index 62cd0413829..4d845c31df8 100644 --- a/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp @@ -53,7 +53,7 @@ #endif #include "nsIServiceManager.h" #include "nsIDOMNode.h" - +#include "nsITheme.h" nsresult NS_NewGfxRadioControlFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame) @@ -180,7 +180,14 @@ nsGfxRadioControlFrame::PaintRadioButton(nsIPresContext* aPresContext, nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect) { - + const nsStyleDisplay* disp = (const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display); + if (disp->mAppearance) { + nsCOMPtr theme; + aPresContext->GetTheme(getter_AddRefs(theme)); + if (theme && theme->ThemeSupportsWidget(aPresContext, this, disp->mAppearance)) + return; // No need to paint the radio button. The theme will do it. + } + PRBool checked = PR_TRUE; GetCurrentCheckState(&checked); // Get check state from the content model if (checked) { diff --git a/mozilla/layout/html/forms/src/nsListControlFrame.cpp b/mozilla/layout/html/forms/src/nsListControlFrame.cpp index 1cb50166f6f..25fe540acab 100644 --- a/mozilla/layout/html/forms/src/nsListControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsListControlFrame.cpp @@ -86,6 +86,7 @@ #include "nsCSSRendering.h" #include "nsILookAndFeel.h" #include "nsReflowPath.h" +#include "nsITheme.h" // Timer Includes #include "nsITimer.h" @@ -522,6 +523,19 @@ nsListControlFrame::Paint(nsIPresContext* aPresContext, } if (isVisible) { + if (aWhichLayer == NS_FRAME_PAINT_LAYER_BACKGROUND) { + const nsStyleDisplay* displayData; + GetStyleData(eStyleStruct_Display, ((const nsStyleStruct*&)displayData)); + if (displayData->mAppearance) { + nsCOMPtr theme; + aPresContext->GetTheme(getter_AddRefs(theme)); + nsRect rect(0, 0, mRect.width, mRect.height); + if (theme && theme->ThemeSupportsWidget(aPresContext, this, displayData->mAppearance)) + theme->DrawWidgetBackground(&aRenderingContext, this, + displayData->mAppearance, rect, aDirtyRect); + } + } + return nsScrollFrame::Paint(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer); } diff --git a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp index 45e84285995..6d27368953c 100644 --- a/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp +++ b/mozilla/layout/html/style/src/nsCSSFrameConstructor.cpp @@ -10687,7 +10687,7 @@ nsCSSFrameConstructor::AttributeChanged(nsIPresContext* aPresContext, if (disp && disp->mAppearance) { nsCOMPtr theme; aPresContext->GetTheme(getter_AddRefs(theme)); - if (theme && theme->ThemeSupportsWidget(aPresContext, disp->mAppearance)) { + if (theme && theme->ThemeSupportsWidget(aPresContext, primaryFrame, disp->mAppearance)) { PRBool repaint = PR_FALSE; theme->WidgetStateChanged(primaryFrame, disp->mAppearance, aAttribute, &repaint); if (repaint) diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp index 94bb573c060..46fee54c13c 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ b/mozilla/layout/html/style/src/nsCSSRendering.cpp @@ -1569,13 +1569,13 @@ void nsCSSRendering::PaintBorder(nsIPresContext* aPresContext, aPresContext->GetCompatibilityMode(&compatMode); // Check to see if we have an appearance defined. If so, we let the theme - // renderer draw the border. - const nsStyleDisplay* displayData; - aForFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct*&)displayData)); + // renderer draw the border. DO not get the data from aForFrame, since the passed in style context + // may be different! Always use |aStyleContext|! + const nsStyleDisplay* displayData = (const nsStyleDisplay*)aStyleContext->GetStyleData(eStyleStruct_Display); if (displayData->mAppearance) { nsCOMPtr theme; aPresContext->GetTheme(getter_AddRefs(theme)); - if (theme && theme->ThemeSupportsWidget(aPresContext, displayData->mAppearance)) + if (theme && theme->ThemeSupportsWidget(aPresContext, aForFrame, displayData->mAppearance)) return; // Let the theme handle it. } // Get our style context's color struct. @@ -2699,7 +2699,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, if (displayData->mAppearance) { nsCOMPtr theme; aPresContext->GetTheme(getter_AddRefs(theme)); - if (theme && theme->ThemeSupportsWidget(aPresContext, displayData->mAppearance)) { + if (theme && theme->ThemeSupportsWidget(aPresContext, aForFrame, displayData->mAppearance)) { theme->DrawWidgetBackground(&aRenderingContext, aForFrame, displayData->mAppearance, aBorderArea, aDirtyRect); return; diff --git a/mozilla/layout/style/forms.css b/mozilla/layout/style/forms.css index 1e638d33bae..89d43b472d8 100644 --- a/mozilla/layout/style/forms.css +++ b/mozilla/layout/style/forms.css @@ -73,6 +73,7 @@ label { /* default inputs, text inputs, and selects */ input { + -moz-appearance: textfield; padding: 1px 0 1px 0; border: 2px inset ThreeDFace; background-color: -moz-Field; @@ -100,6 +101,7 @@ textarea { -moz-box-sizing: border-box; -moz-user-focus: normal; -moz-binding: url("resource:///res/builtin/platformHTMLBindings.xml#textAreas"); + -moz-appearance: textfield; } textarea > scrollbar { @@ -126,7 +128,7 @@ select { -moz-box-sizing: border-box; -moz-user-select: none; -moz-user-focus: normal; - + -moz-appearance: menulist; border-width: 2px !important; border-style: inset !important; -moz-border-radius: 0 !important; @@ -135,8 +137,10 @@ select { select[size] { padding: 1px 0 1px 0; } + select[size="1"] { padding: 0; + -moz-appearance: menulist; } select > input[type="button"] { @@ -149,6 +153,7 @@ select > input[type="button"] { background-image: url("arrow.gif") !important; background-repeat: no-repeat !important; background-position: center !important; + -moz-appearance: menulist-button; } select > input[type="button"]:active { @@ -157,6 +162,7 @@ select > input[type="button"]:active { select[size], :-moz-select-scrolled-content { overflow: -moz-scrollbars-vertical; + -moz-appearance: listbox; } select:-moz-dummy-option { @@ -231,7 +237,7 @@ select[disabled]:-moz-display-comboboxcontrol-frame { option[disabled], optgroup[disabled] { - background-color: -moz-field; + background-color: transparent; } /* hidden inputs */ @@ -267,6 +273,7 @@ input[type="image"]:focus { /* file selector */ input[type="file"] { + -moz-appearance: none; white-space: nowrap; cursor: default; -moz-binding: none; @@ -294,8 +301,9 @@ input[type="file"] > input[type="button"]:-moz-focus-inner /* radio buttons */ input[type="radio"] { - width: 12px; - height: 12px; + -moz-appearance: radio; + width: 13px; + height: 13px; margin: 3px 3px 0px 5px; padding: 0; vertical-align: baseline; @@ -307,6 +315,7 @@ input[type="radio"] { /* check boxes */ input[type="checkbox"] { + -moz-appearance: checkbox; width: 13px; height: 13px; margin: 3px 3px 3px 4px; @@ -366,6 +375,7 @@ button, input[type="reset"], input[type="button"], input[type="submit"] { + -moz-appearance: button; padding: 2px 0 2px 0; border: 2px outset ButtonFace; background-color: ButtonFace; diff --git a/mozilla/layout/xul/base/src/nsBox.cpp b/mozilla/layout/xul/base/src/nsBox.cpp index 36a27800ad4..61a8dff8496 100644 --- a/mozilla/layout/xul/base/src/nsBox.cpp +++ b/mozilla/layout/xul/base/src/nsBox.cpp @@ -675,7 +675,7 @@ nsBox::GetBorder(nsMargin& aMargin) doc->GetShellAt(0, getter_AddRefs(shell)); nsCOMPtr context; shell->GetPresContext(getter_AddRefs(context)); - if (gTheme->ThemeSupportsWidget(context, disp->mAppearance)) { + if (gTheme->ThemeSupportsWidget(context, frame, disp->mAppearance)) { nsCOMPtr dc; context->GetDeviceContext(getter_AddRefs(dc)); nsMargin margin(0,0,0,0); @@ -1301,7 +1301,7 @@ nsIBox::AddCSSMinSize(nsBoxLayoutState& aState, nsIBox* aBox, nsSize& aSize) if (display->mAppearance) { nsCOMPtr theme; aState.GetPresContext()->GetTheme(getter_AddRefs(theme)); - if (theme && theme->ThemeSupportsWidget(aState.GetPresContext(), display->mAppearance)) { + if (theme && theme->ThemeSupportsWidget(aState.GetPresContext(), frame, display->mAppearance)) { nsSize size; const nsHTMLReflowState* reflowState = aState.GetReflowState(); if (reflowState) { diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.cpp b/mozilla/layout/xul/base/src/nsBoxFrame.cpp index b1234d036e3..ee5483cad74 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsBoxFrame.cpp @@ -1651,7 +1651,7 @@ nsBoxFrame::Paint(nsIPresContext* aPresContext, const nsStyleDisplay* display = (const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display); if (!(display->mAppearance && nsBox::gTheme && - gTheme->ThemeSupportsWidget(aPresContext, display->mAppearance) && + gTheme->ThemeSupportsWidget(aPresContext, this, display->mAppearance) && !gTheme->WidgetIsContainer(display->mAppearance))) PaintChildren(aPresContext, aRenderingContext, aDirtyRect, aWhichLayer); diff --git a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp index 959d146745d..bfedb68b67a 100644 --- a/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsImageBoxFrame.cpp @@ -365,7 +365,7 @@ nsImageBoxFrame::GetImageSource() const nsStyleDisplay* disp = (const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display); if (disp->mAppearance && nsBox::gTheme && - nsBox::gTheme->ThemeSupportsWidget(nsnull, disp->mAppearance)) + nsBox::gTheme->ThemeSupportsWidget(nsnull, this, disp->mAppearance)) return; // get the list-style-image @@ -572,7 +572,7 @@ nsImageBoxFrame::DidSetStyleContext( nsIPresContext* aPresContext ) const nsStyleDisplay* disp = (const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display); if (disp->mAppearance && nsBox::gTheme && - nsBox::gTheme->ThemeSupportsWidget(nsnull, disp->mAppearance)) + nsBox::gTheme->ThemeSupportsWidget(nsnull, this, disp->mAppearance)) return NS_OK; // If list-style-image changes, we have a new image. diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index 801cf43002d..8d43c5cd2e9 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -2233,7 +2233,7 @@ NS_IMETHODIMP nsTreeBodyFrame::PaintRow(PRInt32 aRowIndex, const nsStyleDisplay* displayData = (const nsStyleDisplay*)rowContext->GetStyleData(eStyleStruct_Display); if ( displayData->mAppearance ) { aPresContext->GetTheme(getter_AddRefs(theme)); - if (theme && theme->ThemeSupportsWidget(aPresContext, displayData->mAppearance)) + if (theme && theme->ThemeSupportsWidget(aPresContext, nsnull, displayData->mAppearance)) useTheme = PR_TRUE; } PRBool isSelected = PR_FALSE; @@ -2264,7 +2264,7 @@ NS_IMETHODIMP nsTreeBodyFrame::PaintRow(PRInt32 aRowIndex, const nsStyleDisplay* displayData = (const nsStyleDisplay*)separatorContext->GetStyleData(eStyleStruct_Display); if ( displayData->mAppearance ) { aPresContext->GetTheme(getter_AddRefs(theme)); - if (theme && theme->ThemeSupportsWidget(aPresContext, displayData->mAppearance)) + if (theme && theme->ThemeSupportsWidget(aPresContext, nsnull, displayData->mAppearance)) useTheme = PR_TRUE; } @@ -2534,7 +2534,7 @@ nsTreeBodyFrame::PaintTwisty(PRInt32 aRowIndex, const nsStyleDisplay* twistyDisplayData = (const nsStyleDisplay*)twistyContext->GetStyleData(eStyleStruct_Display); if ( twistyDisplayData->mAppearance ) { aPresContext->GetTheme(getter_AddRefs(theme)); - if (theme && theme->ThemeSupportsWidget(aPresContext, twistyDisplayData->mAppearance)) + if (theme && theme->ThemeSupportsWidget(aPresContext, nsnull, twistyDisplayData->mAppearance)) useTheme = PR_TRUE; } diff --git a/mozilla/toolkit/content/xul.css b/mozilla/toolkit/content/xul.css index 3071f7dbdf4..06548eee59c 100644 --- a/mozilla/toolkit/content/xul.css +++ b/mozilla/toolkit/content/xul.css @@ -605,6 +605,14 @@ textbox[multiline="true"] { -moz-binding: url("chrome://global/content/widgets/textbox.xml#textarea"); } +html|*.textbox-input { + -moz-appearance: none !important; +} + +html|*.textbox-textarea { + -moz-appearance: none !important; +} + .textbox-input-box { -moz-binding: url("chrome://global/content/widgets/textbox.xml#input-box"); } diff --git a/mozilla/xpfe/global/resources/content/xul.css b/mozilla/xpfe/global/resources/content/xul.css index cec1ebf798a..eaba73f9a70 100644 --- a/mozilla/xpfe/global/resources/content/xul.css +++ b/mozilla/xpfe/global/resources/content/xul.css @@ -604,6 +604,14 @@ textbox[multiline="true"] { -moz-binding: url("chrome://global/content/bindings/textbox.xml#textarea"); } +html|*.textbox-input { + -moz-appearance: none !important; +} + +html|*.textbox-textarea { + -moz-appearance: none !important; +} + .textbox-input-box { -moz-binding: url("chrome://global/content/bindings/textbox.xml#input-box"); }