diff --git a/mozilla/gfx/src/mac/Makefile.in b/mozilla/gfx/src/mac/Makefile.in index bd4008434bc..42a3d013059 100644 --- a/mozilla/gfx/src/mac/Makefile.in +++ b/mozilla/gfx/src/mac/Makefile.in @@ -73,17 +73,16 @@ CPPSRCS = \ nsNativeThemeMac.cpp \ $(NULL) -# $(DIST)/lib/libimg_s.a \ +SHARED_LIBRARY_LIBS = $(DIST)/lib/$(LIB_PREFIX)gfxshared_s.$(LIB_SUFFIX) +EXTRA_DSO_LIBS = mozutil_s gkgfx +EXTRA_DEPS = $(DIST)/lib/$(LIB_PREFIX)mozutil_s.$(LIB_SUFFIX) EXTRA_DSO_LDOPTS = \ - $(MKSHLIB_FORCE_ALL) \ - $(DIST)/lib/libmozutil_s.a \ - -lgkgfx \ - -lgfxshared_s \ - $(MKSHLIB_UNFORCE_ALL) \ - $(TK_LIBS) \ - $(MOZ_COMPONENT_LIBS) \ - $(NULL) + $(LIBS_DIR) \ + $(EXTRA_DSO_LIBS) \ + $(TK_LIBS) \ + $(MOZ_COMPONENT_LIBS) \ + $(NULL) LOCAL_INCLUDES = \ -I$(srcdir)/../shared \ diff --git a/mozilla/gfx/src/mac/nsNativeThemeMac.cpp b/mozilla/gfx/src/mac/nsNativeThemeMac.cpp index 37c2d2b4351..fa1258458bc 100644 --- a/mozilla/gfx/src/mac/nsNativeThemeMac.cpp +++ b/mozilla/gfx/src/mac/nsNativeThemeMac.cpp @@ -97,7 +97,8 @@ nsNativeThemeMac::nsNativeThemeMac() if (!sInitializedBorders) { sInitializedBorders = PR_TRUE; sTextfieldBorderSize.left = sTextfieldBorderSize.top = 2; - sTextfieldBorderSize.right = sTextfieldBorderSize.bottom = 1; + sTextfieldBorderSize.right = sTextfieldBorderSize.bottom = 2; + sTextfieldBGTransparent = PR_TRUE; } } @@ -166,8 +167,14 @@ nsNativeThemeMac::DrawButton ( ThemeButtonKind inKind, const Rect& inBoxRect, PR kThemeStatePressed : kThemeStateActive; info.value = inValue; info.adornment = inAdornment; - if ( inState & NS_EVENT_STATE_FOCUS ) - info.adornment = kThemeAdornmentFocus; + if ( inState & NS_EVENT_STATE_FOCUS ) { + // There is a bug in OS 10.2 and higher where if we are in a CG context and + // draw the focus ring with DrawThemeButton(), there are ugly lines all + // through the button. This may get fixed in a dot-release, but until it + // does, we can't draw the focus ring. + if (inKind != kThemePushButton || !nsRenderingContextMac::OnJaguar()) + info.adornment = kThemeAdornmentFocus; + } if ( inIsDefault ) info.adornment |= kThemeAdornmentDefault; @@ -507,7 +514,7 @@ nsNativeThemeMac::GetWidgetBorder(nsIDeviceContext* aContext, case NS_THEME_TEXTFIELD: { - aResult->SizeTo(2, 2, 1, 1); + aResult->SizeTo(2, 2, 2, 2); break; } diff --git a/mozilla/gfx/src/mac/nsRenderingContextMac.cpp b/mozilla/gfx/src/mac/nsRenderingContextMac.cpp index 6e80dfae6e8..05eb700cfe5 100644 --- a/mozilla/gfx/src/mac/nsRenderingContextMac.cpp +++ b/mozilla/gfx/src/mac/nsRenderingContextMac.cpp @@ -1535,3 +1535,17 @@ nsRenderingContextMac::OnMacOSX() } return gOnMacOSX; } + +PRBool +nsRenderingContextMac::OnJaguar() +{ + static PRBool sInitVer = PR_FALSE; + static PRBool sOnJaguar = PR_FALSE; + if (!sInitVer) { + long version; + OSErr err = ::Gestalt(gestaltSystemVersion, &version); + sOnJaguar = (err == noErr && version >= 0x00001020); + sInitVer = PR_TRUE; + } + return sOnJaguar; +} diff --git a/mozilla/gfx/src/mac/nsRenderingContextMac.h b/mozilla/gfx/src/mac/nsRenderingContextMac.h index 85eed499472..a5e22ae15c2 100644 --- a/mozilla/gfx/src/mac/nsRenderingContextMac.h +++ b/mozilla/gfx/src/mac/nsRenderingContextMac.h @@ -185,6 +185,7 @@ public: // useful for determining if we're running on MacOSX static PRBool OnMacOSX(); + static PRBool OnJaguar(); protected: enum GraphicStateChanges { diff --git a/mozilla/gfx/src/shared/nsNativeTheme.cpp b/mozilla/gfx/src/shared/nsNativeTheme.cpp index f7275af636b..6dd6c6e3f43 100644 --- a/mozilla/gfx/src/shared/nsNativeTheme.cpp +++ b/mozilla/gfx/src/shared/nsNativeTheme.cpp @@ -53,6 +53,7 @@ nsMargin nsNativeTheme::sButtonBorderSize(2, 2, 2, 2); nsMargin nsNativeTheme::sButtonDisabledBorderSize(1, 1, 1, 1); nsMargin nsNativeTheme::sTextfieldBorderSize(2, 2, 2, 2); +PRBool nsNativeTheme::sTextfieldBGTransparent = PR_FALSE; nsNativeTheme::nsNativeTheme() { @@ -217,7 +218,9 @@ nsNativeTheme::IsWidgetStyled(nsIPresContext* aPresContext, nsIFrame* aFrame, PRUint8 aWidgetType) { // Check for specific widgets to see if HTML has overridden the style. - if (aFrame && (aWidgetType == NS_THEME_BUTTON || aWidgetType == NS_THEME_TEXTFIELD)) { + if (aFrame && (aWidgetType == NS_THEME_BUTTON || + aWidgetType == NS_THEME_TEXTFIELD)) { + nsCOMPtr content; aFrame->GetContent(getter_AddRefs(content)); if (content->IsContentOfType(nsIContent::eHTML)) { @@ -225,6 +228,7 @@ nsNativeTheme::IsWidgetStyled(nsIPresContext* aPresContext, nsIFrame* aFrame, nscolor defaultBGColor, defaultBorderColor; PRUint8 defaultBorderStyle; nsMargin defaultBorderSize; + PRBool defaultBGTransparent = PR_FALSE; float p2t; aPresContext->GetPixelsToTwips(&p2t); @@ -262,11 +266,13 @@ nsNativeTheme::IsWidgetStyled(nsIPresContext* aPresContext, nsIFrame* aFrame, ConvertMarginToTwips(sTextfieldBorderSize, defaultBorderSize, p2t); lookAndFeel->GetColor(nsILookAndFeel::eColor_threedface, defaultBorderColor); - if (IsDisabled(aFrame)) - defaultBGColor = defaultBorderColor; - else - lookAndFeel->GetColor(nsILookAndFeel::eColor__moz_field, - defaultBGColor); + if (!(defaultBGTransparent = sTextfieldBGTransparent)) { + if (IsDisabled(aFrame)) + defaultBGColor = defaultBorderColor; + else + lookAndFeel->GetColor(nsILookAndFeel::eColor__moz_field, + defaultBGColor); + } break; default: @@ -278,9 +284,14 @@ nsNativeTheme::IsWidgetStyled(nsIPresContext* aPresContext, nsIFrame* aFrame, const nsStyleBackground* ourBG; ::GetStyleData(aFrame, &ourBG); - if (ourBG->mBackgroundColor != defaultBGColor || - ourBG->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT || - !(ourBG->mBackgroundFlags & NS_STYLE_BG_IMAGE_NONE)) + if (defaultBGTransparent) { + if (!(ourBG->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) + return PR_TRUE; + } else if (ourBG->mBackgroundColor != defaultBGColor || + ourBG->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) + return PR_TRUE; + + if (!(ourBG->mBackgroundFlags & NS_STYLE_BG_IMAGE_NONE)) return PR_TRUE; // Check whether border style or color differs from default diff --git a/mozilla/gfx/src/shared/nsNativeTheme.h b/mozilla/gfx/src/shared/nsNativeTheme.h index fce6f394a51..b06c6307ab6 100644 --- a/mozilla/gfx/src/shared/nsNativeTheme.h +++ b/mozilla/gfx/src/shared/nsNativeTheme.h @@ -153,6 +153,7 @@ protected: static nsMargin sButtonBorderSize; static nsMargin sButtonDisabledBorderSize; static nsMargin sTextfieldBorderSize; + static PRBool sTextfieldBGTransparent; private: nsCOMPtr mFocusedAtom; diff --git a/mozilla/layout/html/document/src/mac/platform-forms.css b/mozilla/layout/html/document/src/mac/platform-forms.css index 7740aa8a6f5..f63e8c98ec7 100644 --- a/mozilla/layout/html/document/src/mac/platform-forms.css +++ b/mozilla/layout/html/document/src/mac/platform-forms.css @@ -37,10 +37,7 @@ @import url("resource:/res/forms.css"); input { - border-left-width: 2px; - border-top-width: 2px; - border-right-width: 1px; - border-bottom-width: 1px; + border-width: 2px; padding: 0 2px 0 1px; font-size: 11px; background-color: transparent; @@ -55,7 +52,7 @@ select { } select[size] { - -moz-appearance: none; + -moz-appearance: listbox; margin: 0px; background-color: -moz-Field !important; } @@ -102,4 +99,36 @@ input[type="button"], input[type="submit"] { -moz-appearance: button-small; font-size: 11px; + margin: 0px 3px; + padding: 0; + border-width: 2px 8px 2px 8px; + color: -moz-FieldText !important; +} + +button:active:hover, +input[type="reset"]:active:hover, +input[type="button"]:active:hover, +input[type="submit"]:active:hover { + padding: 0; +} + +button:-moz-focus-inner, +input[type="reset"]:-moz-focus-inner, +input[type="button"]:-moz-focus-inner, +input[type="submit"]:-moz-focus-inner, +input[type="file"] > input[type="button"]:focus:-moz-focus-inner { + padding: 0; + border: 0; +} + +button[disabled]:active, button[disabled], +input[type="reset"][disabled]:active, +input[type="reset"][disabled], +input[type="button"][disabled]:active, +input[type="button"][disabled], +input[type="submit"][disabled]:active, +input[type="submit"][disabled] { + padding: 0; + border-width: 2px 8px 2px 8px; + color: GrayText !important; }