From e2aa2edb9212971d74bb7f9847ed7ac2330c1b80 Mon Sep 17 00:00:00 2001 From: "dbaron%dbaron.org" Date: Tue, 30 Nov 2004 06:04:04 +0000 Subject: [PATCH] Use preprocessor instead of separate files for platform-specific parts of forms.css. b=272151 r+sr=bryner --- browser/installer/unix/packages-static | 1 - browser/installer/windows/packages-static | 1 - calendar/installer/windows/packages-static | 1 - calendar/sunbird/Makefile.in | 1 - content/base/src/nsLayoutStylesheetCache.cpp | 4 +- .../powerplant/PPEmbed.pbproj/project.pbxproj | 13 -- .../config/basebrowser-installer-win.pkg | 1 - embedding/config/basebrowser-mac-macho | 1 - embedding/config/basebrowser-qnx | 1 - embedding/config/basebrowser-unix | 1 - embedding/config/basebrowser-win | 1 - embedding/config/minimo-qnx | 1 - embedding/config/minimo-unix | 1 - .../CocoaEmbed.pbproj/project.pbxproj | 13 -- gfx/src/shared/nsNativeTheme.h | 2 +- gfx/src/windows/nsNativeThemeWin.cpp | 2 +- layout/build/layout.pkg | 1 - layout/html/document/src/Makefile.in | 28 ++-- layout/html/document/src/forms.css | 134 ++++++++++++++++ .../html/document/src/mac/platform-forms.css | 149 ------------------ .../html/document/src/os2/platform-forms.css | 56 ------- .../html/document/src/win/platform-forms.css | 37 ----- layout/style/forms.css | 134 ++++++++++++++++ layout/style/nsLayoutStylesheetCache.cpp | 4 +- mail/config/basemail-os2 | 1 - mail/config/basemail-unix | 2 - mail/installer/windows/basemail-win | 1 - xpinstall/packager/packages-os2 | 1 - xpinstall/packager/packages-static-unix | 1 - xpinstall/packager/packages-unix | 1 - 30 files changed, 288 insertions(+), 307 deletions(-) delete mode 100644 layout/html/document/src/mac/platform-forms.css delete mode 100644 layout/html/document/src/os2/platform-forms.css delete mode 100644 layout/html/document/src/win/platform-forms.css diff --git a/browser/installer/unix/packages-static b/browser/installer/unix/packages-static index a4b44d52edda..92b6c594745c 100644 --- a/browser/installer/unix/packages-static +++ b/browser/installer/unix/packages-static @@ -226,7 +226,6 @@ bin/res/ua.css bin/res/html.css bin/res/quirk.css bin/res/forms.css -bin/res/platform-forms.css bin/res/EditorOverride.css bin/res/table-add-column-after-active.gif bin/res/table-add-column-after-hover.gif diff --git a/browser/installer/windows/packages-static b/browser/installer/windows/packages-static index aabc1bc53443..038c32dd7542 100644 --- a/browser/installer/windows/packages-static +++ b/browser/installer/windows/packages-static @@ -212,7 +212,6 @@ bin\res\ua.css bin\res\html.css bin\res\quirk.css bin\res\forms.css -bin\res\platform-forms.css bin\res\EditorOverride.css bin\res\table-add-column-after-active.gif bin\res\table-add-column-after-hover.gif diff --git a/calendar/installer/windows/packages-static b/calendar/installer/windows/packages-static index f6a80146c024..61005a5a7404 100644 --- a/calendar/installer/windows/packages-static +++ b/calendar/installer/windows/packages-static @@ -212,7 +212,6 @@ bin\res\ua.css bin\res\html.css bin\res\quirk.css bin\res\forms.css -bin\res\platform-forms.css ;!4sunbird bin\res\EditorOverride.css ;!4sunbird bin\res\table-add-column-after-active.gif ;!4sunbird bin\res\table-add-column-after-hover.gif diff --git a/calendar/sunbird/Makefile.in b/calendar/sunbird/Makefile.in index 8a5dab229832..31ee04f5c5c0 100644 --- a/calendar/sunbird/Makefile.in +++ b/calendar/sunbird/Makefile.in @@ -145,7 +145,6 @@ endif cp $(topsrcdir)/dist/bin/res/arrow.gif ./$(MOZ_APP_NAME)/res cp $(topsrcdir)/dist/bin/res/arrowd.gif ./$(MOZ_APP_NAME)/res cp $(topsrcdir)/dist/bin/res/forms.css ./$(MOZ_APP_NAME)/res - cp $(topsrcdir)/dist/bin/res/platform-forms.css ./$(MOZ_APP_NAME)/res cp $(topsrcdir)/dist/bin/res/ua.css ./$(MOZ_APP_NAME)/res cp $(topsrcdir)/dist/bin/res/mathml.css ./$(MOZ_APP_NAME)/res cp $(topsrcdir)/dist/bin/res/viewer.properties ./$(MOZ_APP_NAME)/res diff --git a/content/base/src/nsLayoutStylesheetCache.cpp b/content/base/src/nsLayoutStylesheetCache.cpp index c05a02211eca..39887c933871 100644 --- a/content/base/src/nsLayoutStylesheetCache.cpp +++ b/content/base/src/nsLayoutStylesheetCache.cpp @@ -101,12 +101,12 @@ nsLayoutStylesheetCache::FormsSheet() if (!gStyleCache->mFormsSheet) { nsCOMPtr sheetURI; NS_NewURI(getter_AddRefs(sheetURI), - NS_LITERAL_CSTRING("resource://gre/res/platform-forms.css")); + NS_LITERAL_CSTRING("resource://gre/res/forms.css")); if (sheetURI) LoadSheet(sheetURI, gStyleCache->mFormsSheet); - NS_ASSERTION(gStyleCache->mFormsSheet, "Could not load platform-forms.css."); + NS_ASSERTION(gStyleCache->mFormsSheet, "Could not load forms.css."); } return gStyleCache->mFormsSheet; diff --git a/embedding/browser/powerplant/PPEmbed.pbproj/project.pbxproj b/embedding/browser/powerplant/PPEmbed.pbproj/project.pbxproj index 9848d4e8a4fb..d4d2ac4539af 100644 --- a/embedding/browser/powerplant/PPEmbed.pbproj/project.pbxproj +++ b/embedding/browser/powerplant/PPEmbed.pbproj/project.pbxproj @@ -484,17 +484,6 @@ settings = { }; }; - 79DED800049E0A4800202892 = { - isa = PBXFileReference; - path = "platform-forms.css"; - refType = 4; - }; - 79DED801049E0A5B00202892 = { - fileRef = 79DED800049E0A4800202892; - isa = PBXBuildFile; - settings = { - }; - }; //790 //791 //792 @@ -1492,7 +1481,6 @@ F5A6412F03A640D101202892, F5A6413003A640D101202892, F5A6413103A640D101202892, - 79DED800049E0A4800202892, F5A6413303A640D101202892, F5A6413403A640D101202892, F5A6413503A640D101202892, @@ -1662,7 +1650,6 @@ F5A6416103A6412301202892, F5A6416203A6412301202892, F5A6416303A6412301202892, - 79DED801049E0A5B00202892, F5A6416503A6412301202892, F5A6416603A6412301202892, F5A6416703A6412301202892, diff --git a/embedding/config/basebrowser-installer-win.pkg b/embedding/config/basebrowser-installer-win.pkg index cbdba34c2ad8..f63cc7d60a6e 100644 --- a/embedding/config/basebrowser-installer-win.pkg +++ b/embedding/config/basebrowser-installer-win.pkg @@ -237,7 +237,6 @@ res\quirk.css res\viewsource.css res\ua.css res\forms.css -res\platform-forms.css res\arrow.gif res\arrowd.gif res\loading-image.gif diff --git a/embedding/config/basebrowser-mac-macho b/embedding/config/basebrowser-mac-macho index 7b8f02a26727..70d7d9991003 100644 --- a/embedding/config/basebrowser-mac-macho +++ b/embedding/config/basebrowser-mac-macho @@ -236,7 +236,6 @@ res/quirk.css res/viewsource.css res/ua.css res/forms.css -res/platform-forms.css res/arrow.gif res/arrowd.gif res/loading-image.gif diff --git a/embedding/config/basebrowser-qnx b/embedding/config/basebrowser-qnx index 20b46a3a5b88..50d39df35d25 100644 --- a/embedding/config/basebrowser-qnx +++ b/embedding/config/basebrowser-qnx @@ -241,7 +241,6 @@ res/quirk.css res/viewsource.css res/ua.css res/forms.css -res/platform-forms.css res/arrow.gif res/arrowd.gif res/loading-image.gif diff --git a/embedding/config/basebrowser-unix b/embedding/config/basebrowser-unix index 81f7afed6d13..7c1a5ca7f627 100644 --- a/embedding/config/basebrowser-unix +++ b/embedding/config/basebrowser-unix @@ -243,7 +243,6 @@ res/quirk.css res/viewsource.css res/ua.css res/forms.css -res/platform-forms.css res/arrow.gif res/arrowd.gif res/loading-image.gif diff --git a/embedding/config/basebrowser-win b/embedding/config/basebrowser-win index 2f84e245b0d8..c1856452b568 100644 --- a/embedding/config/basebrowser-win +++ b/embedding/config/basebrowser-win @@ -253,7 +253,6 @@ res\quirk.css res\viewsource.css res\ua.css res\forms.css -res\platform-forms.css res\arrow.gif res\arrowd.gif res\loading-image.gif diff --git a/embedding/config/minimo-qnx b/embedding/config/minimo-qnx index 586301add740..79c4f627acb0 100644 --- a/embedding/config/minimo-qnx +++ b/embedding/config/minimo-qnx @@ -187,7 +187,6 @@ res/quirk.css res/viewsource.css res/ua.css res/forms.css -res/platform-forms.css res/arrow.gif res/arrowd.gif res/loading-image.gif diff --git a/embedding/config/minimo-unix b/embedding/config/minimo-unix index aff0951150ba..ff268b665351 100644 --- a/embedding/config/minimo-unix +++ b/embedding/config/minimo-unix @@ -185,7 +185,6 @@ res/quirk.css res/viewsource.css res/ua.css res/forms.css -res/platform-forms.css res/arrow.gif res/arrowd.gif res/loading-image.gif diff --git a/embedding/tests/cocoaEmbed/CocoaEmbed.pbproj/project.pbxproj b/embedding/tests/cocoaEmbed/CocoaEmbed.pbproj/project.pbxproj index e9d7831cd8f5..2ed64fc74e38 100644 --- a/embedding/tests/cocoaEmbed/CocoaEmbed.pbproj/project.pbxproj +++ b/embedding/tests/cocoaEmbed/CocoaEmbed.pbproj/project.pbxproj @@ -1025,11 +1025,6 @@ path = maccharset.properties; refType = 4; }; - 79C236790439FF2600202892 = { - isa = PBXFileReference; - path = "platform-forms.css"; - refType = 4; - }; 79C2367A0439FF2600202892 = { isa = PBXFileReference; path = quirk.css; @@ -1665,12 +1660,6 @@ settings = { }; }; - 79C236FD043A010D00202892 = { - fileRef = 79C236790439FF2600202892; - isa = PBXBuildFile; - settings = { - }; - }; 79C236FE043A010D00202892 = { fileRef = 79C2367A0439FF2600202892; isa = PBXBuildFile; @@ -2106,7 +2095,6 @@ 79C236760439FF2600202892, 79C236770439FF2600202892, 79C236780439FF2600202892, - 79C236790439FF2600202892, 79C2367A0439FF2600202892, 79C2367B0439FF2600202892, 79C2367C0439FF2600202892, @@ -2131,7 +2119,6 @@ 79C236FA043A010D00202892, 79C236FB043A010D00202892, 79C236FC043A010D00202892, - 79C236FD043A010D00202892, 79C236FE043A010D00202892, 79C236FF043A010D00202892, 79C23700043A010D00202892, diff --git a/gfx/src/shared/nsNativeTheme.h b/gfx/src/shared/nsNativeTheme.h index c65d3f62c48a..3fa7f8e6e581 100644 --- a/gfx/src/shared/nsNativeTheme.h +++ b/gfx/src/shared/nsNativeTheme.h @@ -155,7 +155,7 @@ protected: nsCOMPtr mFocusedAtom; // these should be set to appropriate platform values by the subclass, to - // match the values in platform-forms.css. These defaults match forms.css + // match the values in forms.css. These defaults match forms.css static nsMargin sButtonBorderSize; static nsMargin sButtonDisabledBorderSize; static PRUint8 sButtonActiveBorderStyle; diff --git a/gfx/src/windows/nsNativeThemeWin.cpp b/gfx/src/windows/nsNativeThemeWin.cpp index e92626ae65a1..6a5d2cb58fe0 100644 --- a/gfx/src/windows/nsNativeThemeWin.cpp +++ b/gfx/src/windows/nsNativeThemeWin.cpp @@ -165,7 +165,7 @@ nsNativeThemeWin::nsNativeThemeWin() { mInputCheckedAtom = do_GetAtom("_moz-input-checked"); mTypeAtom = do_GetAtom("type"); - // If there is a relevant change in platform-forms.css for windows platform, + // If there is a relevant change in forms.css for windows platform, // static widget style variables (e.g. sButtonBorderSize) should be // reinitialized here. } diff --git a/layout/build/layout.pkg b/layout/build/layout.pkg index dcc891fb7b7c..3e07c871876e 100644 --- a/layout/build/layout.pkg +++ b/layout/build/layout.pkg @@ -34,7 +34,6 @@ dist/bin/res/html.css dist/bin/res/quirk.css dist/bin/res/viewsource.css dist/bin/res/forms.css -dist/bin/res/platform-forms.css dist/bin/res/arrow.gif dist/bin/res/arrowd.gif dist/bin/res/ua.css diff --git a/layout/html/document/src/Makefile.in b/layout/html/document/src/Makefile.in index 2d36ee8886bd..2913b5d18e5d 100644 --- a/layout/html/document/src/Makefile.in +++ b/layout/html/document/src/Makefile.in @@ -92,24 +92,24 @@ _FILES = \ arrowd.gif \ $(NULL) -ifeq ($(OS_ARCH), OS2) -PLATFORM_DIR = os2 -else -ifeq ($(MOZ_WIDGET_TOOLKIT), cocoa) -PLATFORM_DIR = mac -else -PLATFORM_DIR = win -endif -endif - -PLATFORM_FORMS_CSS = $(srcdir)/$(PLATFORM_DIR)/platform-forms.css - GARBAGE += $(addprefix $(DIST)/bin/res/,$(_FILES)) -libs:: $(_FILES) $(srcdir)/forms.css $(PLATFORM_FORMS_CSS) +FORMS_CSS_SRC = $(srcdir)/forms.css +PREPROCESS_FORMS_CSS = $(PERL) $(MOZILLA_DIR)/config/preprocessor.pl $(DEFINES) $(ACDEFINES) $(FORMS_CSS_SRC) + +$(DIST)/bin/res/forms.css $(DESTDIR)$(mozappdir)/res/form.css: $(FORMS_CSS_SRC) Makefile + if test ! -d $(@D); then rm -rf $(@D); $(NSINSTALL) -D $(@D); else true; fi + rm -f $@ + $(PREPROCESS_FORMS_CSS) > $@ + +libs:: $(DIST)/bin/res/forms.css + +install:: $(DESTDIR)$(mozappdir)/res/forms.css + +libs:: $(_FILES) $(INSTALL) $^ $(DIST)/bin/res -install:: $(_FILES) $(srcdir)/forms.css $(PLATFORM_FORMS_CSS) +install:: $(_FILES) $(SYSINSTALL) $(IFLAGS1) $^ $(DESTDIR)$(mozappdir)/res DEFINES += -D_IMPL_NS_LAYOUT diff --git a/layout/html/document/src/forms.css b/layout/html/document/src/forms.css index 990f9258fefb..40e99caca56c 100644 --- a/layout/html/document/src/forms.css +++ b/layout/html/document/src/forms.css @@ -533,3 +533,137 @@ input[type="file"] > input[type="text"] { input[type="file"] { height: 2em; } } +#if OSARCH=="OS2" +input { + font: medium serif; font-family: inherit +} + +select { + font: medium serif; font-family: inherit +} + +optgroup { + font: medium serif; font-family: inherit +} + +input[type="reset"], +input[type="button"], +input[type="submit"] { + font: medium serif; font-family: inherit +} + +#endif + +#if MOZ_DEFAULT_TOOLKIT=="cocoa" +/* makes sure enabled and disabled input and text area fields are drawn */ +input, +textarea, +input[disabled], +textarea[disabled] { + border-width: 2px; + padding: 0px 1px 0px 1px; + font-size: 11px; + margin: 1px 1px 1px 1px; + background-color: -moz-field; +} + +select { + -moz-appearance: menulist; + margin: 1px 1px 1px 1px; + background-color: transparent !important; + color: -moz-FieldText !important; + font-size: 11px; + direction: ltr; +} + +/* Need the "select[size][multiple]" selector to override the settings on + 'select[size="1"]', eg if one has */ -select[size], -select[multiple], -select[size][multiple] { - -moz-appearance: listbox; - margin: 1px 1px 1px 1px; - background-color: transparent !important; -} - -select[size="0"], -select[size="1"] { - -moz-appearance: menulist; - margin: 1px 1px 1px 1px; - background-color: transparent !important; -} - -/* make sure nothing paints for the menulist button, since the button is - painted as part of the menulist. */ -select > input[type="button"], -select > input[type="button"]:active { - background-image: none !important; -} - -option[disabled], -optgroup[disabled], -select[disabled] { - color: GrayText !important; -} - -/* margins makes sure they are aligned with the text baseline */ -input[type="checkbox"] { - -moz-appearance: checkbox-small; - width: 15px; - height: 15px; - margin: 1px 2px 0px 3px; -} - -input[type="radio"] { - -moz-appearance: radio-small; - width: 15px; - height: 16px; - margin: 1px 2px -3px 3px; -} - -input[type="reset"], -input[type="button"], -input[type="submit"], -input[type="reset"]:active:hover, -input[type="button"]:active:hover, -input[type="submit"]:active:hover { - -moz-appearance: button-small; - font-size: 11px; - margin: 2px 1px 2px 1px; - padding: 0; - border-width: 2px 8px 2px 8px; - color: -moz-FieldText !important; - min-width: 24px; -} - -/* makes sure diabled buttons have the same style as enabled buttons */ -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] { - margin: 2px 1px 2px 1px; - padding: 0; - border-width: 2px 8px 2px 8px; - min-width: 24px; - color: GrayText !important; -} - -/* this draws the square button */ -button, -button[disabled], -button:active:hover, -button[disabled]:active { - -moz-appearance: none; -} - -/* this turns off the mozilla focus ring shown inside clicked or selecetd buttons */ -input[type="reset"]::-moz-focus-inner, -input[type="button"]::-moz-focus-inner, -input[type="submit"]::-moz-focus-inner, -input[type="file"] > input[type="button"]::-moz-focus-inner { - border: 0; -} - diff --git a/layout/html/document/src/os2/platform-forms.css b/layout/html/document/src/os2/platform-forms.css deleted file mode 100644 index ea106c1a1110..000000000000 --- a/layout/html/document/src/os2/platform-forms.css +++ /dev/null @@ -1,56 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 1998 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either of the GNU General Public License Version 2 or later (the "GPL"), - * or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -@import url("resource://gre/res/forms.css"); - -input { - font: medium serif; font-family: inherit -} - -select { - font: medium serif; font-family: inherit -} - -optgroup { - font: medium serif; font-family: inherit -} - -input[type="reset"], -input[type="button"], -input[type="submit"] { - font: medium serif; font-family: inherit -} - diff --git a/layout/html/document/src/win/platform-forms.css b/layout/html/document/src/win/platform-forms.css deleted file mode 100644 index 6dddfbd58cd0..000000000000 --- a/layout/html/document/src/win/platform-forms.css +++ /dev/null @@ -1,37 +0,0 @@ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is mozilla.org code. - * - * The Initial Developer of the Original Code is - * Netscape Communications Corporation. - * Portions created by the Initial Developer are Copyright (C) 2003 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -@import url("resource:/res/forms.css"); diff --git a/layout/style/forms.css b/layout/style/forms.css index 990f9258fefb..40e99caca56c 100644 --- a/layout/style/forms.css +++ b/layout/style/forms.css @@ -533,3 +533,137 @@ input[type="file"] > input[type="text"] { input[type="file"] { height: 2em; } } +#if OSARCH=="OS2" +input { + font: medium serif; font-family: inherit +} + +select { + font: medium serif; font-family: inherit +} + +optgroup { + font: medium serif; font-family: inherit +} + +input[type="reset"], +input[type="button"], +input[type="submit"] { + font: medium serif; font-family: inherit +} + +#endif + +#if MOZ_DEFAULT_TOOLKIT=="cocoa" +/* makes sure enabled and disabled input and text area fields are drawn */ +input, +textarea, +input[disabled], +textarea[disabled] { + border-width: 2px; + padding: 0px 1px 0px 1px; + font-size: 11px; + margin: 1px 1px 1px 1px; + background-color: -moz-field; +} + +select { + -moz-appearance: menulist; + margin: 1px 1px 1px 1px; + background-color: transparent !important; + color: -moz-FieldText !important; + font-size: 11px; + direction: ltr; +} + +/* Need the "select[size][multiple]" selector to override the settings on + 'select[size="1"]', eg if one has