From 1b71e7ac3e5868899d8d2764aef0b0486cb5589f Mon Sep 17 00:00:00 2001 From: "bsmedberg%covad.net" Date: Sat, 13 Sep 2003 17:55:56 +0000 Subject: [PATCH] Bug 179834. Separate application resources and GRE resources. r=darin sr=dougt git-svn-id: svn://10.0.0.236/trunk@146844 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsStyleSet.cpp | 2 +- .../xbl/builtin/mac/platformHTMLBindings.xml | 4 +- .../xbl/builtin/unix/platformHTMLBindings.xml | 4 +- .../xbl/builtin/win/platformHTMLBindings.xml | 4 +- .../content/xbl/src/nsXBLWindowHandler.cpp | 8 +- .../xml/document/resources/XMLPrettyPrint.css | 2 +- .../xml/document/src/nsXMLContentSink.cpp | 2 +- .../config/basebrowser-installer-win.pkg | 57 +++++++++ mozilla/embedding/config/basebrowser-mac-cfm | 3 +- mozilla/embedding/config/basebrowser-win | 56 ++++++++ mozilla/embedding/config/basebrowser-win-supp | 61 --------- mozilla/embedding/config/gre-win-supp | 13 -- mozilla/gfx/src/gtk/nsFontMetricsXft.cpp | 3 +- mozilla/gfx/src/windows/nsFontMetricsWin.cpp | 2 +- mozilla/htmlparser/src/nsExpatDriver.cpp | 4 +- .../intl/locale/src/nsLanguageAtomService.cpp | 2 +- mozilla/intl/strres/src/nsAcceptLang.cpp | 2 +- .../intl/strres/tests/StringBundleTest.cpp | 2 +- mozilla/intl/strres/tests/strres-test.html | 2 +- mozilla/intl/strres/tests/strres-test.js | 2 +- mozilla/intl/uconv/src/nsCharsetAliasImp.cpp | 2 +- .../uconv/src/nsCharsetConverterManager.cpp | 2 +- mozilla/intl/uconv/src/nsMacCharset.cpp | 2 +- mozilla/intl/uconv/src/nsOS2Charset.cpp | 2 +- mozilla/intl/uconv/src/nsUNIXCharset.cpp | 4 +- mozilla/intl/uconv/src/nsWinCharset.cpp | 2 +- .../unicharutil/src/nsEntityConverter.cpp | 4 +- mozilla/layout/build/nsContentDLF.cpp | 2 +- .../forms/resources/content/xbl-forms.css | 4 +- mozilla/layout/generic/nsImageFrame.cpp | 4 +- mozilla/layout/html/base/src/nsImageFrame.cpp | 4 +- mozilla/layout/html/document/src/forms.css | 4 +- mozilla/layout/html/document/src/ua.css | 4 +- .../forms/resources/content/xbl-forms.css | 4 +- .../layout/html/tests/block/bugs/17636.html | 2 +- .../layout/mathml/base/src/nsMathMLChar.cpp | 6 +- .../layout/mathml/content/src/mathml-css.pl | 2 +- mozilla/layout/style/forms.css | 4 +- mozilla/layout/style/nsStyleSet.cpp | 2 +- mozilla/layout/style/ua.css | 4 +- mozilla/mailnews/mime/src/mimefilt.cpp | 22 ++-- mozilla/mailnews/mime/src/mimemoz2.cpp | 2 +- .../res/public/nsIResProtocolHandler.idl | 11 +- .../protocol/res/src/nsResProtocolHandler.cpp | 120 ++++++++---------- .../protocol/res/src/nsResProtocolHandler.h | 8 +- .../streamconv/converters/nsIndexedToHTML.cpp | 4 +- .../parser/htmlparser/src/nsExpatDriver.cpp | 4 +- mozilla/rdf/chrome/src/nsChromeRegistry.cpp | 3 +- .../rdf/chrome/src/nsChromeUIDataSource.cpp | 1 - mozilla/xpcom/build/nsXPComInit.cpp | 11 +- mozilla/xpcom/ds/nsHashKeys.h | 1 - .../standalone/nsGREDirServiceProvider.cpp | 19 +-- mozilla/xpcom/io/nsDirectoryService.cpp | 6 +- mozilla/xpfe/bootstrap/nsAppRunner.cpp | 3 +- .../browser/resources/content/pageInfo.js | 2 +- mozilla/xpinstall/packager/packages-win | 22 ---- 56 files changed, 274 insertions(+), 264 deletions(-) diff --git a/mozilla/content/base/src/nsStyleSet.cpp b/mozilla/content/base/src/nsStyleSet.cpp index 8ea7c15d3c1..574c18128ed 100644 --- a/mozilla/content/base/src/nsStyleSet.cpp +++ b/mozilla/content/base/src/nsStyleSet.cpp @@ -380,7 +380,7 @@ StyleSetImpl::StyleSetImpl() { if (gInstances++ == 0) { - static const char kQuirk_href[] = "resource:/res/quirk.css"; + static const char kQuirk_href[] = "resource://gre/res/quirk.css"; NS_NewURI (&gQuirkURI, NS_LITERAL_CSTRING(kQuirk_href)); NS_ASSERTION (gQuirkURI != 0, "Cannot allocate nsStyleSetImpl::gQuirkURI"); } diff --git a/mozilla/content/xbl/builtin/mac/platformHTMLBindings.xml b/mozilla/content/xbl/builtin/mac/platformHTMLBindings.xml index 7a0bdf9052c..dc319a1404e 100644 --- a/mozilla/content/xbl/builtin/mac/platformHTMLBindings.xml +++ b/mozilla/content/xbl/builtin/mac/platformHTMLBindings.xml @@ -4,7 +4,7 @@ xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - + @@ -27,7 +27,7 @@ - + diff --git a/mozilla/content/xbl/builtin/unix/platformHTMLBindings.xml b/mozilla/content/xbl/builtin/unix/platformHTMLBindings.xml index dba1b7d76cc..c42edc20a23 100644 --- a/mozilla/content/xbl/builtin/unix/platformHTMLBindings.xml +++ b/mozilla/content/xbl/builtin/unix/platformHTMLBindings.xml @@ -4,7 +4,7 @@ xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - + - + diff --git a/mozilla/content/xbl/builtin/win/platformHTMLBindings.xml b/mozilla/content/xbl/builtin/win/platformHTMLBindings.xml index 4e25ec74ae4..9e9e74056eb 100644 --- a/mozilla/content/xbl/builtin/win/platformHTMLBindings.xml +++ b/mozilla/content/xbl/builtin/win/platformHTMLBindings.xml @@ -4,7 +4,7 @@ xmlns="http://www.mozilla.org/xbl" xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"> - + @@ -48,7 +48,7 @@ - + diff --git a/mozilla/content/xbl/src/nsXBLWindowHandler.cpp b/mozilla/content/xbl/src/nsXBLWindowHandler.cpp index 7dc430c461d..d460b4804ba 100644 --- a/mozilla/content/xbl/src/nsXBLWindowHandler.cpp +++ b/mozilla/content/xbl/src/nsXBLWindowHandler.cpp @@ -97,11 +97,11 @@ public: nsXBLSpecialDocInfo() : mInitialized(PR_FALSE) {}; }; -const char nsXBLSpecialDocInfo::sHTMLBindingStr[] = "resource:///res/builtin/htmlBindings.xml"; -const char nsXBLSpecialDocInfo::sPlatformHTMLBindingStr[] = "resource:///res/builtin/platformHTMLBindings.xml"; +const char nsXBLSpecialDocInfo::sHTMLBindingStr[] = "resource://gre/res/builtin/htmlBindings.xml"; +const char nsXBLSpecialDocInfo::sPlatformHTMLBindingStr[] = "resource://gre/res/builtin/platformHTMLBindings.xml"; // Allow for a userHTMLBindings.xml. -// XXX Should be in the user profile directory, when we have a urlspec for that -const char nsXBLSpecialDocInfo::sUserHTMLBindingStr[] = "resource:///res/builtin/userHTMLBindings.xml"; +// XXXbsmedberg Should be in the profile chrome directory, when we have a resource mapping for that +const char nsXBLSpecialDocInfo::sUserHTMLBindingStr[] = "resource://gre/res/builtin/userHTMLBindings.xml"; void nsXBLSpecialDocInfo::LoadDocInfo() { diff --git a/mozilla/content/xml/document/resources/XMLPrettyPrint.css b/mozilla/content/xml/document/resources/XMLPrettyPrint.css index b948a6fdef1..4d65f595f1d 100644 --- a/mozilla/content/xml/document/resources/XMLPrettyPrint.css +++ b/mozilla/content/xml/document/resources/XMLPrettyPrint.css @@ -35,7 +35,7 @@ * * ***** END LICENSE BLOCK ***** */ -@import url("resource:/res/viewsource.css"); +@import url("resource://gre/res/viewsource.css"); #header { background-color: #ccc; diff --git a/mozilla/content/xml/document/src/nsXMLContentSink.cpp b/mozilla/content/xml/document/src/nsXMLContentSink.cpp index 948ee1c706b..ffbeb09dca9 100644 --- a/mozilla/content/xml/document/src/nsXMLContentSink.cpp +++ b/mozilla/content/xml/document/src/nsXMLContentSink.cpp @@ -1614,7 +1614,7 @@ NS_IMETHODIMP MathMLElementFactoryImpl::CreateInstanceByTag(nsINodeInfo* aNodeInfo, nsIContent** aResult) { - static const char kMathMLStyleSheetURI[] = "resource:///res/mathml.css"; + static const char kMathMLStyleSheetURI[] = "resource://gre/res/mathml.css"; // this bit of code is to load mathml.css on demand nsIDocument* doc = aNodeInfo->GetDocument(); diff --git a/mozilla/embedding/config/basebrowser-installer-win.pkg b/mozilla/embedding/config/basebrowser-installer-win.pkg index c0b16e61b28..bf78b8dacae 100644 --- a/mozilla/embedding/config/basebrowser-installer-win.pkg +++ b/mozilla/embedding/config/basebrowser-installer-win.pkg @@ -74,6 +74,7 @@ components\gkparser.dll components\layout_base.xpt components\layout_xul.xpt components\content_base.xpt +res\dtd\xhtml11.dtd ; ; Imaging: @@ -144,6 +145,13 @@ components\shistory.xpt components\rdf.dll components\rdf.xpt +; required l10n resources +res\language.properties +res\langGroups.properties +res\charsetData.properties +res\charsetalias.properties +res\wincharset.properties + ; required i18n libraries components\i18n.dll components\intl.xpt @@ -223,12 +231,61 @@ nssckbi.dll components\xmlextras.dll components\xmlextras.xpt +; +; res: +; +res\html.css +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 +res\broken-image.gif +res\builtin\htmlBindings.xml +res\builtin\platformHTMLBindings.xml +res\entityTables\html40Special.properties +res\entityTables\htmlEntityVersions.properties +res\entityTables\html40Latin1.properties +res\entityTables\html40Symbols.properties +res\entityTables\transliterate.properties +res\fonts\fontEncoding.properties + +; needed for ftp:// dir listings etc +res\html\gopher-audio.gif +res\html\gopher-binary.gif +res\html\gopher-find.gif +res\html\gopher-image.gif +res\html\gopher-menu.gif +res\html\gopher-movie.gif +res\html\gopher-sound.gif +res\html\gopher-telnet.gif +res\html\gopher-text.gif +res\html\gopher-unknown.gif + ; ; MathML, optional for MathML charset conversion ; components\ucvmath.dll +res\mathml.css +res\dtd\mathml.dtd +res\entityTables\mathml20.properties +res\fonts\mathfont.properties +res\fonts\mathfontCMEX10.properties +res\fonts\mathfontCMSY10.properties +res\fonts\mathfontMath1.properties +res\fonts\mathfontMath2.properties +res\fonts\mathfontMath4.properties +res\fonts\mathfontMTExtra.properties +res\fonts\mathfontPUA.properties +res\fonts\mathfontSymbol.properties + ; p3p components\p3p.dll components\p3p.xpt +; XPInstall +res\cmessage.txt diff --git a/mozilla/embedding/config/basebrowser-mac-cfm b/mozilla/embedding/config/basebrowser-mac-cfm index bc07453cc10..ceda1a20761 100644 --- a/mozilla/embedding/config/basebrowser-mac-cfm +++ b/mozilla/embedding/config/basebrowser-mac-cfm @@ -281,5 +281,4 @@ res:fonts:fontEncoding.properties ;res:fonts:mathfontMTExtra.properties ;res:fonts:mathfontPUA.properties ;res:fonts:mathfontSymbol.properties -;Components:ucvmath.shlb - +;components:ucvmath.shlb diff --git a/mozilla/embedding/config/basebrowser-win b/mozilla/embedding/config/basebrowser-win index 63655aaa0ea..5ae8267adf7 100644 --- a/mozilla/embedding/config/basebrowser-win +++ b/mozilla/embedding/config/basebrowser-win @@ -79,6 +79,7 @@ components\layout_base.xpt components\layout_xul.xpt components\layout_xul_tree.xpt components\content_base.xpt +res\dtd\xhtml11.dtd ; ; Imaging: @@ -147,6 +148,14 @@ components\shistory.xpt components\rdf.dll components\rdf.xpt +; required l10n resources +res\language.properties +res\langGroups.properties +res\charsetData.properties +res\charsetalias.properties +res\wincharset.properties +; res\strres.properties + ; required i18n libraries components\i18n.dll components\intl.xpt @@ -234,10 +243,57 @@ nssckbi.dll components\xmlextras.dll components\xmlextras.xpt +; +; res: +; +res\html.css +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 +res\broken-image.gif +res\builtin\htmlBindings.xml +res\builtin\platformHTMLBindings.xml +res\entityTables\html40Special.properties +res\entityTables\htmlEntityVersions.properties +res\entityTables\html40Latin1.properties +res\entityTables\html40Symbols.properties +res\entityTables\transliterate.properties +res\fonts\fontEncoding.properties + +; needed for ftp:// dir listings etc +res\html\gopher-audio.gif +res\html\gopher-binary.gif +res\html\gopher-find.gif +res\html\gopher-image.gif +res\html\gopher-menu.gif +res\html\gopher-movie.gif +res\html\gopher-sound.gif +res\html\gopher-telnet.gif +res\html\gopher-text.gif +res\html\gopher-unknown.gif + ; ; MathML, optional for MathML charset conversion ; ; components\ucvmath.dll +; res\mathml.css +; res\dtd\mathml.dtd +; res\entityTables\mathml20.properties +; res\fonts\mathfont.properties +; res\fonts\mathfontCMEX10.properties +; res\fonts\mathfontCMSY10.properties +; res\fonts\mathfontMath1.properties +; res\fonts\mathfontMath2.properties +; res\fonts\mathfontMath4.properties +; res\fonts\mathfontMTExtra.properties +; res\fonts\mathfontPUA.properties +; res\fonts\mathfontSymbol.properties + ; p3p components\p3p.dll diff --git a/mozilla/embedding/config/basebrowser-win-supp b/mozilla/embedding/config/basebrowser-win-supp index b6ee8749466..22dd998bb14 100644 --- a/mozilla/embedding/config/basebrowser-win-supp +++ b/mozilla/embedding/config/basebrowser-win-supp @@ -7,23 +7,11 @@ [Embed] -; layout -res\dtd\xhtml11.dtd - ; psm2 ; Optional - only if you need PSM2 support chrome\pipnss.jar defaults\pref\security-prefs.js -; required l10n resources - -res\language.properties -res\langGroups.properties -res\charsetData.properties -res\charsetalias.properties -res\wincharset.properties -; res\strres.properties - ; required prefs files defaults\pref\all.js defaults\pref\winpref.js @@ -33,52 +21,3 @@ defaults\pref\winpref.js ; chrome\embed.jar -; -; res: -; -res\html.css -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 -res\broken-image.gif -res\builtin\htmlBindings.xml -res\builtin\platformHTMLBindings.xml -res\entityTables\html40Special.properties -res\entityTables\htmlEntityVersions.properties -res\entityTables\html40Latin1.properties -res\entityTables\html40Symbols.properties -res\entityTables\transliterate.properties -res\fonts\fontEncoding.properties - -; -; MathML -; -; res\mathml.css -; res\dtd\mathml.dtd -; res\entityTables\mathml20.properties -; res\fonts\mathfont.properties -; res\fonts\mathfontCMEX10.properties -; res\fonts\mathfontCMSY10.properties -; res\fonts\mathfontMath1.properties -; res\fonts\mathfontMath2.properties -; res\fonts\mathfontMath4.properties -; res\fonts\mathfontMTExtra.properties -; res\fonts\mathfontPUA.properties -; res\fonts\mathfontSymbol.properties - -; needed for ftp:// dir listings etc -res\html\gopher-audio.gif -res\html\gopher-binary.gif -res\html\gopher-find.gif -res\html\gopher-image.gif -res\html\gopher-menu.gif -res\html\gopher-movie.gif -res\html\gopher-sound.gif -res\html\gopher-telnet.gif -res\html\gopher-text.gif -res\html\gopher-unknown.gif diff --git a/mozilla/embedding/config/gre-win-supp b/mozilla/embedding/config/gre-win-supp index 6f29d8c337e..01cb44ecd0f 100644 --- a/mozilla/embedding/config/gre-win-supp +++ b/mozilla/embedding/config/gre-win-supp @@ -10,18 +10,6 @@ [gre_app_support] -; -; layout -; -res\dtd\xhtml11.dtd - -; -; MathML Support -; -; http://bugzilla.mozilla.org/show_bug.cgi?id=137029 -; -res\dtd\mathml.dtd - ; ; wallet ; @@ -37,4 +25,3 @@ defaults\wallet\StateSchema.tbl ; XP Install Support ; defaults\pref\xpinstall.js -res\cmessage.txt diff --git a/mozilla/gfx/src/gtk/nsFontMetricsXft.cpp b/mozilla/gfx/src/gtk/nsFontMetricsXft.cpp index 0ccbf9efd86..e23edf8cf2e 100644 --- a/mozilla/gfx/src/gtk/nsFontMetricsXft.cpp +++ b/mozilla/gfx/src/gtk/nsFontMetricsXft.cpp @@ -2844,7 +2844,7 @@ GetEncoding(const char *aFontName, char **aEncoding, nsXftFontType &aType, // if we have not init the property yet, init it right now. if (!gFontEncodingProperties) NS_LoadPersistentPropertiesFromURISpec(&gFontEncodingProperties, - NS_LITERAL_CSTRING("resource:/res/fonts/fontEncoding.properties")); + NS_LITERAL_CSTRING("resource://gre/res/fonts/fontEncoding.properties")); nsAutoString encoding; *aEncoding = nsnull; @@ -2951,7 +2951,6 @@ FreeGlobals(void) return NS_OK; } -/* static */ nsFontXftInfo* GetFontXftInfo(FcPattern* aPattern) { diff --git a/mozilla/gfx/src/windows/nsFontMetricsWin.cpp b/mozilla/gfx/src/windows/nsFontMetricsWin.cpp index d082a6450dc..d9814f1bdb5 100644 --- a/mozilla/gfx/src/windows/nsFontMetricsWin.cpp +++ b/mozilla/gfx/src/windows/nsFontMetricsWin.cpp @@ -1276,7 +1276,7 @@ GetEncoding(const char* aFontName, nsCString& aValue) // if we have not init the property yet, init it right now. if (!gFontEncodingProperties) NS_LoadPersistentPropertiesFromURISpec(&gFontEncodingProperties, - NS_LITERAL_CSTRING("resource:/res/fonts/fontEncoding.properties")); + NS_LITERAL_CSTRING("resource://gre/res/fonts/fontEncoding.properties")); if (gFontEncodingProperties) { nsAutoString prop; diff --git a/mozilla/htmlparser/src/nsExpatDriver.cpp b/mozilla/htmlparser/src/nsExpatDriver.cpp index d3bb66f514a..4f5c997c4c7 100644 --- a/mozilla/htmlparser/src/nsExpatDriver.cpp +++ b/mozilla/htmlparser/src/nsExpatDriver.cpp @@ -203,8 +203,8 @@ static const nsCatalogData kCatalogTable[] = { {"-//W3C//DTD XHTML 1.0 Strict//EN", "xhtml11.dtd", nsnull }, {"-//W3C//DTD XHTML 1.0 Frameset//EN", "xhtml11.dtd", nsnull }, {"-//W3C//DTD XHTML Basic 1.0//EN", "xhtml11.dtd", nsnull }, - {"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN", "mathml.dtd", "resource:/res/mathml.css" }, - {"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN", "mathml.dtd", "resource:/res/mathml.css" }, + {"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN", "mathml.dtd", "resource://gre/res/mathml.css" }, + {"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN", "mathml.dtd", "resource://gre/res/mathml.css" }, {"-//W3C//DTD SVG 20001102//EN", "svg.dtd", nsnull }, {"-//WAPFORUM//DTD XHTML Mobile 1.0//EN", "xhtml11.dtd", nsnull }, {nsnull, nsnull, nsnull} diff --git a/mozilla/intl/locale/src/nsLanguageAtomService.cpp b/mozilla/intl/locale/src/nsLanguageAtomService.cpp index 9aac87af375..04b70acf1a5 100644 --- a/mozilla/intl/locale/src/nsLanguageAtomService.cpp +++ b/mozilla/intl/locale/src/nsLanguageAtomService.cpp @@ -142,7 +142,7 @@ nsLanguageAtomService::InitLangGroupTable() if (NS_FAILED(rv)) return rv; - rv = bundleService->CreateBundle("resource:/res/langGroups.properties", + rv = bundleService->CreateBundle("resource://gre/res/langGroups.properties", getter_AddRefs(mLangGroups)); return rv; } diff --git a/mozilla/intl/strres/src/nsAcceptLang.cpp b/mozilla/intl/strres/src/nsAcceptLang.cpp index 19f765b0fad..39727db97a2 100644 --- a/mozilla/intl/strres/src/nsAcceptLang.cpp +++ b/mozilla/intl/strres/src/nsAcceptLang.cpp @@ -89,7 +89,7 @@ nsAcceptLang::GetAcceptLangFromLocale(const PRUnichar *aLocale, PRUnichar **_ret nsCOMPtr bundle; #if 1 - res = sBundleService->CreateBundle("resource:/res/language.properties", + res = sBundleService->CreateBundle("resource://gre/res/language.properties", getter_AddRefs(bundle)); #else res = sBundleService->CreateBundle("chrome://global/locale/languageNames.properties", diff --git a/mozilla/intl/strres/tests/StringBundleTest.cpp b/mozilla/intl/strres/tests/StringBundleTest.cpp index f4801b21f02..0e565144473 100644 --- a/mozilla/intl/strres/tests/StringBundleTest.cpp +++ b/mozilla/intl/strres/tests/StringBundleTest.cpp @@ -53,7 +53,7 @@ #include "nsIServiceManager.h" #include "nsIComponentManager.h" // -#define TEST_URL "resource:/res/strres.properties" +#define TEST_URL "resource://gre/res/strres.properties" //////////////////////////////////////////////////////////////////////////////////////////////////// // diff --git a/mozilla/intl/strres/tests/strres-test.html b/mozilla/intl/strres/tests/strres-test.html index da259bb930a..3c8c229e985 100644 --- a/mozilla/intl/strres/tests/strres-test.html +++ b/mozilla/intl/strres/tests/strres-test.html @@ -32,7 +32,7 @@ function write() { sample.WriteValue("here is what I'm writing!"); - var Bundle = JS_GetStrBundle("resource:/res/strres.properties", null); + var Bundle = JS_GetStrBundle("resource://gre/res/strres.properties", null); var ostr1 = Bundle.GetStringFromName("file"); dump("\n--** strBundle GetStringFromName file=" + ostr1 + " **--\n"); var ostr2 = Bundle.GetStringFromID(123); diff --git a/mozilla/intl/strres/tests/strres-test.js b/mozilla/intl/strres/tests/strres-test.js index cbfabfe5bea..4be229664ac 100644 --- a/mozilla/intl/strres/tests/strres-test.js +++ b/mozilla/intl/strres/tests/strres-test.js @@ -105,7 +105,7 @@ function help() { } function strresTest() { - var Bundle = srGetStrBundle("resource:/res/strres.properties"); + var Bundle = srGetStrBundle("resource://gre/res/strres.properties"); var ostr1 = Bundle.GetStringFromName("file"); dump("\n--** JS strBundle GetStringFromName file=" + ostr1 + "len=" + ostr1.length + "**--\n"); diff --git a/mozilla/intl/uconv/src/nsCharsetAliasImp.cpp b/mozilla/intl/uconv/src/nsCharsetAliasImp.cpp index 1b4f300a1dd..d2c47cf4fcf 100644 --- a/mozilla/intl/uconv/src/nsCharsetAliasImp.cpp +++ b/mozilla/intl/uconv/src/nsCharsetAliasImp.cpp @@ -101,7 +101,7 @@ NS_IMETHODIMP nsCharsetAlias2::GetPreferred(const nsACString& aAlias, //load charsetalias.properties string bundle with all remaining aliases // we may need to protect the following section with a lock so we won't call the // 'new nsURLProperties' from two different threads - mDelegate = new nsURLProperties( NS_LITERAL_CSTRING("resource:/res/charsetalias.properties") ); + mDelegate = new nsURLProperties( NS_LITERAL_CSTRING("resource://gre/res/charsetalias.properties") ); NS_ASSERTION(mDelegate, "cannot create nsURLProperties"); if(nsnull == mDelegate) return NS_ERROR_OUT_OF_MEMORY; diff --git a/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp b/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp index 2d4c32e8d52..e0105a3cd81 100644 --- a/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp +++ b/mozilla/intl/uconv/src/nsCharsetConverterManager.cpp @@ -100,7 +100,7 @@ nsresult nsCharsetConverterManager::RegisterConverterManagerData() RegisterConverterCategory(catman, NS_TITLE_BUNDLE_CATEGORY, "chrome://global/locale/charsetTitles.properties"); RegisterConverterCategory(catman, NS_DATA_BUNDLE_CATEGORY, - "resource:/res/charsetData.properties"); + "resource://gre/res/charsetData.properties"); return NS_OK; } diff --git a/mozilla/intl/uconv/src/nsMacCharset.cpp b/mozilla/intl/uconv/src/nsMacCharset.cpp index 729456878bd..259f6515a14 100644 --- a/mozilla/intl/uconv/src/nsMacCharset.cpp +++ b/mozilla/intl/uconv/src/nsMacCharset.cpp @@ -72,7 +72,7 @@ nsresult nsPlatformCharset::InitInfo() { // load the .property file if necessary if (gInfo == nsnull) { - nsURLProperties *info = new nsURLProperties( NS_LITERAL_CSTRING("resource:/res/maccharset.properties") ); + nsURLProperties *info = new nsURLProperties( NS_LITERAL_CSTRING("resource://gre/res/maccharset.properties") ); NS_ASSERTION(info , "cannot open properties file"); NS_ENSURE_TRUE(info, NS_ERROR_FAILURE); gInfo = info; diff --git a/mozilla/intl/uconv/src/nsOS2Charset.cpp b/mozilla/intl/uconv/src/nsOS2Charset.cpp index 809f96b5b89..c5d7526010e 100644 --- a/mozilla/intl/uconv/src/nsOS2Charset.cpp +++ b/mozilla/intl/uconv/src/nsOS2Charset.cpp @@ -69,7 +69,7 @@ nsPlatformCharset::InitInfo() PR_AtomicIncrement(&gCnt); // count for gInfo if (gInfo == nsnull) { - nsURLProperties *info = new nsURLProperties(NS_LITERAL_CSTRING("resource:/res/os2charset.properties")); + nsURLProperties *info = new nsURLProperties(NS_LITERAL_CSTRING("resource://gre/res/os2charset.properties")); NS_ASSERTION(info , "cannot open properties file"); NS_ENSURE_TRUE(info, NS_ERROR_FAILURE); diff --git a/mozilla/intl/uconv/src/nsUNIXCharset.cpp b/mozilla/intl/uconv/src/nsUNIXCharset.cpp index 60d57c41988..7fbde2ea3f6 100644 --- a/mozilla/intl/uconv/src/nsUNIXCharset.cpp +++ b/mozilla/intl/uconv/src/nsUNIXCharset.cpp @@ -96,7 +96,7 @@ nsPlatformCharset::ConvertLocaleToCharsetUsingDeprecatedConfig(nsAutoString& loc { nsAutoLock guard(gLock); if (!gInfo_deprecated) { - nsURLProperties *info = new nsURLProperties(NS_LITERAL_CSTRING("resource:/res/unixcharset.properties")); + nsURLProperties *info = new nsURLProperties(NS_LITERAL_CSTRING("resource://gre/res/unixcharset.properties")); NS_ASSERTION( info, "cannot create nsURLProperties"); gInfo_deprecated = info; } @@ -233,7 +233,7 @@ nsPlatformCharset::InitGetCharset(nsACString &oString) if (!gNLInfo) { nsCAutoString propertyURL; // note: NS_LITERAL_STRING("resource:/res/unixcharset." OSARCH ".properties") does not compile on AIX - propertyURL.Assign(NS_LITERAL_CSTRING("resource:/res/unixcharset.")); + propertyURL.Assign(NS_LITERAL_CSTRING("resource://gre/res/unixcharset.")); propertyURL.Append(OSARCH); propertyURL.Append(NS_LITERAL_CSTRING(".properties")); nsURLProperties *info; diff --git a/mozilla/intl/uconv/src/nsWinCharset.cpp b/mozilla/intl/uconv/src/nsWinCharset.cpp index 126fecd02b5..7130e623e97 100644 --- a/mozilla/intl/uconv/src/nsWinCharset.cpp +++ b/mozilla/intl/uconv/src/nsWinCharset.cpp @@ -82,7 +82,7 @@ nsPlatformCharset::InitInfo() PR_AtomicIncrement(&gCnt); // count for gInfo if (gInfo == nsnull) { - nsURLProperties *info = new nsURLProperties(NS_LITERAL_CSTRING("resource:/res/wincharset.properties")); + nsURLProperties *info = new nsURLProperties(NS_LITERAL_CSTRING("resource://gre/res/wincharset.properties")); NS_ASSERTION(info , "cannot open properties file"); NS_ENSURE_TRUE(info, NS_ERROR_FAILURE); diff --git a/mozilla/intl/unicharutil/src/nsEntityConverter.cpp b/mozilla/intl/unicharutil/src/nsEntityConverter.cpp index 41b552741fb..6459836097a 100644 --- a/mozilla/intl/unicharutil/src/nsEntityConverter.cpp +++ b/mozilla/intl/unicharutil/src/nsEntityConverter.cpp @@ -63,7 +63,7 @@ nsEntityConverter::~nsEntityConverter() NS_IMETHODIMP nsEntityConverter::LoadVersionPropertyFile() { - NS_NAMED_LITERAL_CSTRING(url, "resource:/res/entityTables/htmlEntityVersions.properties"); + NS_NAMED_LITERAL_CSTRING(url, "resource://gre/res/entityTables/htmlEntityVersions.properties"); nsresult rv; nsCOMPtr bundleService = do_CreateInstance(NS_STRINGBUNDLE_CONTRACTID, &rv); @@ -108,7 +108,7 @@ nsEntityConverter::LoadVersionPropertyFile() already_AddRefed nsEntityConverter::LoadEntityBundle(PRUint32 version) { - nsCAutoString url(NS_LITERAL_CSTRING("resource:/res/entityTables/")); + nsCAutoString url(NS_LITERAL_CSTRING("resource://gre/res/entityTables/")); const PRUnichar *versionName = NULL; nsresult rv; diff --git a/mozilla/layout/build/nsContentDLF.cpp b/mozilla/layout/build/nsContentDLF.cpp index 8d998c96f25..f66723c3125 100644 --- a/mozilla/layout/build/nsContentDLF.cpp +++ b/mozilla/layout/build/nsContentDLF.cpp @@ -72,7 +72,7 @@ static NS_DEFINE_CID(kPluginManagerCID, NS_PLUGINMANAGER_CID); static NS_DEFINE_CID(kPluginDocumentCID, NS_PLUGINDOCUMENT_CID); // URL for the "user agent" style sheet -#define UA_CSS_URL "resource:/res/ua.css" +#define UA_CSS_URL "resource://gre/res/ua.css" // Factory code for creating variations on html documents diff --git a/mozilla/layout/forms/resources/content/xbl-forms.css b/mozilla/layout/forms/resources/content/xbl-forms.css index 835c928af4d..4a320ae0451 100644 --- a/mozilla/layout/forms/resources/content/xbl-forms.css +++ b/mozilla/layout/forms/resources/content/xbl-forms.css @@ -203,7 +203,7 @@ input { vertical-align: text-bottom; -moz-box-sizing: border-box; -moz-user-focus: normal; - -moz-binding: url("resource:///res/builtin/platformHTMLBindings.xml#inputFields"); + -moz-binding: url("resource://gre/res/builtin/platformHTMLBindings.xml#inputFields"); padding: 1px 0 1px 0; } @@ -218,7 +218,7 @@ textarea { vertical-align: text-bottom; -moz-box-sizing: border-box; -moz-user-focus: normal; - -moz-binding: url("resource:///res/builtin/platformHTMLBindings.xml#textAreas"); + -moz-binding: url("resource://gre/res/builtin/platformHTMLBindings.xml#textAreas"); } textarea > scrollbar { diff --git a/mozilla/layout/generic/nsImageFrame.cpp b/mozilla/layout/generic/nsImageFrame.cpp index 20b17987207..d54de770f92 100644 --- a/mozilla/layout/generic/nsImageFrame.cpp +++ b/mozilla/layout/generic/nsImageFrame.cpp @@ -1931,8 +1931,8 @@ nsImageFrame::GetLoadGroup(nsIPresContext *aPresContext, nsILoadGroup **aLoadGro nsresult nsImageFrame::LoadIcons(nsIPresContext *aPresContext) { - NS_NAMED_LITERAL_STRING(loadingSrc,"resource:/res/loading-image.gif"); - NS_NAMED_LITERAL_STRING(brokenSrc,"resource:/res/broken-image.gif"); + NS_NAMED_LITERAL_STRING(loadingSrc,"resource://gre/res/loading-image.gif"); + NS_NAMED_LITERAL_STRING(brokenSrc,"resource://gre/res/broken-image.gif"); PRBool doLoad = PR_FALSE; // only load icons once... diff --git a/mozilla/layout/html/base/src/nsImageFrame.cpp b/mozilla/layout/html/base/src/nsImageFrame.cpp index 20b17987207..d54de770f92 100644 --- a/mozilla/layout/html/base/src/nsImageFrame.cpp +++ b/mozilla/layout/html/base/src/nsImageFrame.cpp @@ -1931,8 +1931,8 @@ nsImageFrame::GetLoadGroup(nsIPresContext *aPresContext, nsILoadGroup **aLoadGro nsresult nsImageFrame::LoadIcons(nsIPresContext *aPresContext) { - NS_NAMED_LITERAL_STRING(loadingSrc,"resource:/res/loading-image.gif"); - NS_NAMED_LITERAL_STRING(brokenSrc,"resource:/res/broken-image.gif"); + NS_NAMED_LITERAL_STRING(loadingSrc,"resource://gre/res/loading-image.gif"); + NS_NAMED_LITERAL_STRING(brokenSrc,"resource://gre/res/broken-image.gif"); PRBool doLoad = PR_FALSE; // only load icons once... diff --git a/mozilla/layout/html/document/src/forms.css b/mozilla/layout/html/document/src/forms.css index 7fda907e92f..3d20ee63c28 100644 --- a/mozilla/layout/html/document/src/forms.css +++ b/mozilla/layout/html/document/src/forms.css @@ -94,7 +94,7 @@ input { letter-spacing: normal; cursor: text; -moz-user-focus: normal; - -moz-binding: url("resource:///res/builtin/platformHTMLBindings.xml#inputFields"); + -moz-binding: url("resource://gre/res/builtin/platformHTMLBindings.xml#inputFields"); } textarea { @@ -111,7 +111,7 @@ textarea { vertical-align: text-bottom; cursor: text; -moz-user-focus: normal; - -moz-binding: url("resource:///res/builtin/platformHTMLBindings.xml#textAreas"); + -moz-binding: url("resource://gre/res/builtin/platformHTMLBindings.xml#textAreas"); -moz-appearance: textfield; } diff --git a/mozilla/layout/html/document/src/ua.css b/mozilla/layout/html/document/src/ua.css index af8e02a6cd2..0d718b6652d 100644 --- a/mozilla/layout/html/document/src/ua.css +++ b/mozilla/layout/html/document/src/ua.css @@ -34,9 +34,9 @@ * * ***** END LICENSE BLOCK ***** */ -@import url(resource:/res/html.css); +@import url(resource://gre/res/html.css); @import url(chrome://global/content/xul.css); -@import url(resource:/res/quirk.css); +@import url(resource://gre/res/quirk.css); @namespace parsererror url(http://www.mozilla.org/newlayout/xml/parsererror.xml); diff --git a/mozilla/layout/html/forms/resources/content/xbl-forms.css b/mozilla/layout/html/forms/resources/content/xbl-forms.css index 835c928af4d..4a320ae0451 100644 --- a/mozilla/layout/html/forms/resources/content/xbl-forms.css +++ b/mozilla/layout/html/forms/resources/content/xbl-forms.css @@ -203,7 +203,7 @@ input { vertical-align: text-bottom; -moz-box-sizing: border-box; -moz-user-focus: normal; - -moz-binding: url("resource:///res/builtin/platformHTMLBindings.xml#inputFields"); + -moz-binding: url("resource://gre/res/builtin/platformHTMLBindings.xml#inputFields"); padding: 1px 0 1px 0; } @@ -218,7 +218,7 @@ textarea { vertical-align: text-bottom; -moz-box-sizing: border-box; -moz-user-focus: normal; - -moz-binding: url("resource:///res/builtin/platformHTMLBindings.xml#textAreas"); + -moz-binding: url("resource://gre/res/builtin/platformHTMLBindings.xml#textAreas"); } textarea > scrollbar { diff --git a/mozilla/layout/html/tests/block/bugs/17636.html b/mozilla/layout/html/tests/block/bugs/17636.html index 2415129d690..6bdae8671fc 100644 --- a/mozilla/layout/html/tests/block/bugs/17636.html +++ b/mozilla/layout/html/tests/block/bugs/17636.html @@ -6,7 +6,7 @@
Diamond Logo -    Diamond Home Page Header Logo
+    Diamond Home Page Header Logo
diff --git a/mozilla/layout/mathml/base/src/nsMathMLChar.cpp b/mozilla/layout/mathml/base/src/nsMathMLChar.cpp index d44dda03c0f..90885d065ea 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLChar.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLChar.cpp @@ -139,7 +139,7 @@ AlertMissingFonts(nsString& aMissingFonts) return; nsCOMPtr sb; - sbs->CreateBundle("resource:/res/fonts/mathfont.properties", getter_AddRefs(sb)); + sbs->CreateBundle("resource://gre/res/fonts/mathfont.properties", getter_AddRefs(sb)); if (!sb) return; @@ -195,7 +195,7 @@ LoadProperties(const nsString& aName, nsCOMPtr& aProperties) { nsAutoString uriStr; - uriStr.Assign(NS_LITERAL_STRING("resource:/res/fonts/mathfont")); + uriStr.Assign(NS_LITERAL_STRING("resource://gre/res/fonts/mathfont")); uriStr.Append(aName); uriStr.StripWhitespace(); // that may come from aName uriStr.Append(NS_LITERAL_STRING(".properties")); @@ -360,7 +360,7 @@ nsGlyphTable::ElementAt(nsIPresContext* aPresContext, nsMathMLChar* aChar, PRUin nsresult rv = LoadProperties(*mFontName[0], mGlyphProperties); #ifdef NS_DEBUG nsCAutoString uriStr; - uriStr.Assign(NS_LITERAL_CSTRING("resource:/res/fonts/mathfont")); + uriStr.Assign(NS_LITERAL_CSTRING("resource://gre/res/fonts/mathfont")); uriStr.Append(NS_LossyConvertUCS2toASCII(*mFontName[0])); uriStr.StripWhitespace(); // that may come from mFontName uriStr.Append(NS_LITERAL_CSTRING(".properties")); diff --git a/mozilla/layout/mathml/content/src/mathml-css.pl b/mozilla/layout/mathml/content/src/mathml-css.pl index 38e7a79966b..9be37638336 100644 --- a/mozilla/layout/mathml/content/src/mathml-css.pl +++ b/mozilla/layout/mathml/content/src/mathml-css.pl @@ -12,7 +12,7 @@ if (!($css =~ m|\@import.*mathml\.css|)) { # since bad end of lines cause troubles on some platforms # do a little perl magic for dos2{unix or mac} here - $css =~ s#(\@import[^\@]+\;)(\cM?)(\n\cM?\n)#$1$2\n\@import url\(resource:/res/mathml\.css\);$2$3#; + $css =~ s#(\@import[^\@]+\;)(\cM?)(\n\cM?\n)#$1$2\n\@import url\(resource://gre/res/mathml\.css\);$2$3#; open(UA, ">$ua"); print UA $css; close(UA); diff --git a/mozilla/layout/style/forms.css b/mozilla/layout/style/forms.css index 7fda907e92f..3d20ee63c28 100644 --- a/mozilla/layout/style/forms.css +++ b/mozilla/layout/style/forms.css @@ -94,7 +94,7 @@ input { letter-spacing: normal; cursor: text; -moz-user-focus: normal; - -moz-binding: url("resource:///res/builtin/platformHTMLBindings.xml#inputFields"); + -moz-binding: url("resource://gre/res/builtin/platformHTMLBindings.xml#inputFields"); } textarea { @@ -111,7 +111,7 @@ textarea { vertical-align: text-bottom; cursor: text; -moz-user-focus: normal; - -moz-binding: url("resource:///res/builtin/platformHTMLBindings.xml#textAreas"); + -moz-binding: url("resource://gre/res/builtin/platformHTMLBindings.xml#textAreas"); -moz-appearance: textfield; } diff --git a/mozilla/layout/style/nsStyleSet.cpp b/mozilla/layout/style/nsStyleSet.cpp index 8ea7c15d3c1..574c18128ed 100644 --- a/mozilla/layout/style/nsStyleSet.cpp +++ b/mozilla/layout/style/nsStyleSet.cpp @@ -380,7 +380,7 @@ StyleSetImpl::StyleSetImpl() { if (gInstances++ == 0) { - static const char kQuirk_href[] = "resource:/res/quirk.css"; + static const char kQuirk_href[] = "resource://gre/res/quirk.css"; NS_NewURI (&gQuirkURI, NS_LITERAL_CSTRING(kQuirk_href)); NS_ASSERTION (gQuirkURI != 0, "Cannot allocate nsStyleSetImpl::gQuirkURI"); } diff --git a/mozilla/layout/style/ua.css b/mozilla/layout/style/ua.css index af8e02a6cd2..0d718b6652d 100644 --- a/mozilla/layout/style/ua.css +++ b/mozilla/layout/style/ua.css @@ -34,9 +34,9 @@ * * ***** END LICENSE BLOCK ***** */ -@import url(resource:/res/html.css); +@import url(resource://gre/res/html.css); @import url(chrome://global/content/xul.css); -@import url(resource:/res/quirk.css); +@import url(resource://gre/res/quirk.css); @namespace parsererror url(http://www.mozilla.org/newlayout/xml/parsererror.xml); diff --git a/mozilla/mailnews/mime/src/mimefilt.cpp b/mozilla/mailnews/mime/src/mimefilt.cpp index 77b3d971d94..802364b7354 100644 --- a/mozilla/mailnews/mime/src/mimefilt.cpp +++ b/mozilla/mailnews/mime/src/mimefilt.cpp @@ -129,17 +129,17 @@ static char * test_type_icon(const char *type, void *stream_closure) { if (!nsCRT::strncasecmp(type, "text/", 5)) - return nsCRT::strdup("resource:/res/html/gopher-text.gif"); - else if (!nsCRT::strncasecmp(type, "image/", 6)) - return nsCRT::strdup("resource:/res/html/gopher-image.gif"); - else if (!nsCRT::strncasecmp(type, "audio/", 6)) - return nsCRT::strdup("resource:/res/html/gopher-sound.gif"); - else if (!nsCRT::strncasecmp(type, "video/", 6)) - return nsCRT::strdup("resource:/res/html/gopher-movie.gif"); - else if (!nsCRT::strncasecmp(type, "application/", 12)) - return nsCRT::strdup("resource:/res/html/gopher-binary.gif"); - else - return nsCRT::strdup("resource:/res/html/gopher-unknown.gif"); + return nsCRT::strdup("resource://gre/res/html/gopher-text.gif"); + if (!nsCRT::strncasecmp(type, "image/", 6)) + return nsCRT::strdup("resource://gre/res/html/gopher-image.gif"); + if (!nsCRT::strncasecmp(type, "audio/", 6)) + return nsCRT::strdup("resource://gre/res/html/gopher-sound.gif"); + if (!nsCRT::strncasecmp(type, "video/", 6)) + return nsCRT::strdup("resource://gre/res/html/gopher-movie.gif"); + if (!nsCRT::strncasecmp(type, "application/", 12)) + return nsCRT::strdup("resource://gre/res/html/gopher-binary.gif"); + + return nsCRT::strdup("resource://gre/res/html/gopher-unknown.gif"); } static int diff --git a/mozilla/mailnews/mime/src/mimemoz2.cpp b/mozilla/mailnews/mime/src/mimemoz2.cpp index 3b7d321cdda..1fd5256e74b 100644 --- a/mozilla/mailnews/mime/src/mimemoz2.cpp +++ b/mozilla/mailnews/mime/src/mimemoz2.cpp @@ -1181,7 +1181,7 @@ mime_image_make_image_html(void *image_closure) /* Internal-external-reconnect only works when going to the screen. */ if (!mid->istream) - return nsCRT::strdup("

\"[Image]\"

"); + return nsCRT::strdup("

\"[Image]\"

"); if ( (!mid->url) || (!(*mid->url)) ) url = ""; diff --git a/mozilla/netwerk/protocol/res/public/nsIResProtocolHandler.idl b/mozilla/netwerk/protocol/res/public/nsIResProtocolHandler.idl index 09fc62f2298..eb61501c016 100644 --- a/mozilla/netwerk/protocol/res/public/nsIResProtocolHandler.idl +++ b/mozilla/netwerk/protocol/res/public/nsIResProtocolHandler.idl @@ -42,7 +42,10 @@ #include "nsAString.h" %} -[scriptable, uuid(d12c08c6-9ef6-11d3-8cda-0060b0fc14a3)] +/** + * Protocol handler interface for the resource:// protocol + */ +[scriptable, uuid(067ca872-e947-4bd6-8946-a479cb6ba5dd)] interface nsIResProtocolHandler : nsIProtocolHandler { /** @@ -54,19 +57,19 @@ interface nsIResProtocolHandler : nsIProtocolHandler * A root key should always be lowercase; however, this may not be * enforced. */ - void setSubstitution(in string root, in nsIURI baseURI); + void setSubstitution(in ACString root, in nsIURI baseURI); /** * Gets the substitution for the root key. * * @throws NS_ERROR_NOT_AVAILABLE if none exists. */ - nsIURI getSubstitution(in string root); + nsIURI getSubstitution(in ACString root); /** * Returns TRUE if the substitution exists and FALSE otherwise. */ - boolean hasSubstitution(in string root); + boolean hasSubstitution(in ACString root); /** * Utility function to resolve a resource URI. A resolved URI is not diff --git a/mozilla/netwerk/protocol/res/src/nsResProtocolHandler.cpp b/mozilla/netwerk/protocol/res/src/nsResProtocolHandler.cpp index 282ad80c1dc..ecc34ab38cb 100644 --- a/mozilla/netwerk/protocol/res/src/nsResProtocolHandler.cpp +++ b/mozilla/netwerk/protocol/res/src/nsResProtocolHandler.cpp @@ -21,6 +21,7 @@ * * Contributor(s): * Darin Fisher + * Benjamin Smedberg * * 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 @@ -93,7 +94,18 @@ nsResURL::GetFile(nsIFile **result) rv = gResHandler->ResolveURI(this, spec); if (NS_FAILED(rv)) return rv; - return net_GetFileFromURLSpec(spec, result); + rv = net_GetFileFromURLSpec(spec, result); +#ifdef DEBUG_bsmedberg + if (NS_SUCCEEDED(rv)) { + PRBool exists = PR_TRUE; + (*result)->Exists(&exists); + if (!exists) { + printf("resource %s doesn't exist!\n", spec.get()); + } + } +#endif + + return rv; } //---------------------------------------------------------------------------- @@ -101,7 +113,6 @@ nsResURL::GetFile(nsIFile **result) //---------------------------------------------------------------------------- nsResProtocolHandler::nsResProtocolHandler() - : mSubstitutions(32) { #if defined(PR_LOGGING) gResLog = PR_NewLogModule("nsResProtocol"); @@ -116,55 +127,44 @@ nsResProtocolHandler::~nsResProtocolHandler() gResHandler = nsnull; } +nsresult +nsResProtocolHandler::AddSpecialDir(const char* aSpecialDir, const nsACString& aSubstitution) +{ + nsCOMPtr file; + nsresult rv = NS_GetSpecialDirectory(aSpecialDir, getter_AddRefs(file)); + NS_ENSURE_SUCCESS(rv, rv); + + nsCOMPtr uri; + rv = mIOService->NewFileURI(file, getter_AddRefs(uri)); + NS_ENSURE_SUCCESS(rv, rv); + + return SetSubstitution(aSubstitution, uri); +} + nsresult nsResProtocolHandler::Init() { + if (!mSubstitutions.Init(32)) + return NS_ERROR_UNEXPECTED; + nsresult rv; mIOService = do_GetIOService(&rv); - if (NS_FAILED(rv)) return rv; + NS_ENSURE_SUCCESS(rv, rv); - // set up initial mappings - rv = SetSpecialDir("programdir", NS_OS_CURRENT_PROCESS_DIR); - if (NS_FAILED(rv)) return rv; + // + // make resource:/// point to the application directory + // + rv = AddSpecialDir(NS_OS_CURRENT_PROCESS_DIR, NS_LITERAL_CSTRING("")); + NS_ENSURE_SUCCESS(rv, rv); - // make "res:///" == "resource:/" - rv = SetSpecialDir("", NS_XPCOM_CURRENT_PROCESS_DIR); - if (NS_FAILED(rv)) return rv; + // + // make resource://gre/ point to the GRE directory + // + return AddSpecialDir(NS_GRE_DIR, NS_LITERAL_CSTRING("gre")); - rv = SetSpecialDir("tempdir", NS_OS_TEMP_DIR); - if (NS_FAILED(rv)) return rv; - - rv = SetSpecialDir("componentsdir", NS_XPCOM_COMPONENT_DIR); - if (NS_FAILED(rv)) return rv; - - // Set up the "Resource" root to point to the old resource location - // such that: - // resource:// == res://Resource/ - rv = SetSpecialDir("resource", NS_XPCOM_CURRENT_PROCESS_DIR); - if (NS_FAILED(rv)) return rv; - - return rv; -} - -//---------------------------------------------------------------------------- -// nsResProtocolHandler -//---------------------------------------------------------------------------- - -nsresult -nsResProtocolHandler::SetSpecialDir(const char *root, const char *dir) -{ - LOG(("nsResProtocolHandler::SetSpecialDir [root=\"%s\" dir=%s]\n", root, dir)); - - nsresult rv; - nsCOMPtr file; - rv = NS_GetSpecialDirectory(dir, getter_AddRefs(file)); - if (NS_FAILED(rv)) return rv; - - nsCOMPtr uri; - mIOService->NewFileURI(file, getter_AddRefs(uri)); - - return SetSubstitution(root, uri); + //XXXbsmedberg Neil wants a resource://pchrome/ for the profile chrome dir... + // but once I finish multiple chrome registration I'm not sure that it is needed } //---------------------------------------------------------------------------- @@ -250,37 +250,30 @@ nsResProtocolHandler::AllowPort(PRInt32 port, const char *scheme, PRBool *_retva //---------------------------------------------------------------------------- NS_IMETHODIMP -nsResProtocolHandler::SetSubstitution(const char *root, nsIURI *baseURI) +nsResProtocolHandler::SetSubstitution(const nsACString& root, nsIURI *baseURI) { - NS_ENSURE_ARG_POINTER(root); + if (!baseURI) { + mSubstitutions.Remove(root); + return NS_OK; + } - nsCStringKey key(root); - if (baseURI) - mSubstitutions.Put(&key, baseURI); - else - mSubstitutions.Remove(&key); - return NS_OK; + return mSubstitutions.Put(root, baseURI) ? NS_OK : NS_ERROR_UNEXPECTED; } NS_IMETHODIMP -nsResProtocolHandler::GetSubstitution(const char *root, nsIURI **result) +nsResProtocolHandler::GetSubstitution(const nsACString& root, nsIURI **result) { - NS_ENSURE_ARG_POINTER(root); NS_ENSURE_ARG_POINTER(result); - nsCStringKey key(root); - *result = NS_STATIC_CAST(nsIURI *, mSubstitutions.Get(&key)); - return *result ? NS_OK : NS_ERROR_NOT_AVAILABLE; + return mSubstitutions.Get(root, result) ? NS_OK : NS_ERROR_NOT_AVAILABLE; } NS_IMETHODIMP -nsResProtocolHandler::HasSubstitution(const char *root, PRBool *result) +nsResProtocolHandler::HasSubstitution(const nsACString& root, PRBool *result) { - NS_ENSURE_ARG_POINTER(root); NS_ENSURE_ARG_POINTER(result); - nsCStringKey key(root); - *result = mSubstitutions.Exists(&key); + *result = mSubstitutions.Get(root, nsnull); return NS_OK; } @@ -298,14 +291,13 @@ nsResProtocolHandler::ResolveURI(nsIURI *uri, nsACString &result) if (NS_FAILED(rv)) return rv; nsCOMPtr baseURI; - rv = GetSubstitution(host.get() ? host.get() : "", getter_AddRefs(baseURI)); + rv = GetSubstitution(host, getter_AddRefs(baseURI)); if (NS_FAILED(rv)) return rv; - const char *p = path.get(); - if (path[0] == '/') - p++; + const char *p = path.get() + 1; // path always starts with a slash + NS_ASSERTION(*(p-1) == '/', "Path did not begin with a slash!"); - rv = baseURI->Resolve(nsDependentCString(p), result); + rv = baseURI->Resolve(nsDependentCString(p, path.Length()-1), result); #if defined(PR_LOGGING) if (PR_LOG_TEST(gResLog, PR_LOG_DEBUG)) { diff --git a/mozilla/netwerk/protocol/res/src/nsResProtocolHandler.h b/mozilla/netwerk/protocol/res/src/nsResProtocolHandler.h index ab11a4eede5..953fb1a2788 100644 --- a/mozilla/netwerk/protocol/res/src/nsResProtocolHandler.h +++ b/mozilla/netwerk/protocol/res/src/nsResProtocolHandler.h @@ -21,6 +21,7 @@ * * Contributor(s): * Darin Fisher + * Benjamin Smedberg * * 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 @@ -40,7 +41,7 @@ #define nsResProtocolHandler_h___ #include "nsIResProtocolHandler.h" -#include "nsHashtable.h" +#include "nsInterfaceHashtable.h" #include "nsISupportsArray.h" #include "nsIIOService.h" #include "nsWeakReference.h" @@ -58,9 +59,8 @@ public: nsresult Init(); private: - nsresult SetSpecialDir(const char* rootName, const char* specialDir); - - nsSupportsHashtable mSubstitutions; + nsresult AddSpecialDir(const char* aSpecialDir, const nsACString& aSubstitution); + nsInterfaceHashtable mSubstitutions; nsCOMPtr mIOService; friend class nsResURL; diff --git a/mozilla/netwerk/streamconv/converters/nsIndexedToHTML.cpp b/mozilla/netwerk/streamconv/converters/nsIndexedToHTML.cpp index bb4674e51a4..46a8cf13693 100644 --- a/mozilla/netwerk/streamconv/converters/nsIndexedToHTML.cpp +++ b/mozilla/netwerk/streamconv/converters/nsIndexedToHTML.cpp @@ -517,11 +517,11 @@ nsIndexedToHTML::OnIndexAvailable(nsIRequest *aRequest, switch (type) { case nsIDirIndex::TYPE_DIRECTORY: case nsIDirIndex::TYPE_SYMLINK: - pushBuffer.Append(NS_LITERAL_STRING("resource:/res/html/gopher-menu.gif\" alt=\"Directory: ")); + pushBuffer.Append(NS_LITERAL_STRING("resource://gre/res/html/gopher-menu.gif\" alt=\"Directory: ")); break; case nsIDirIndex::TYPE_FILE: case nsIDirIndex::TYPE_UNKNOWN: - pushBuffer.Append(NS_LITERAL_STRING("resource:/res/html/gopher-unknown.gif\" alt=\"File: ")); + pushBuffer.Append(NS_LITERAL_STRING("resource://gre/res/html/gopher-unknown.gif\" alt=\"File: ")); break; } pushBuffer.Append(NS_LITERAL_STRING("\"/>")); diff --git a/mozilla/parser/htmlparser/src/nsExpatDriver.cpp b/mozilla/parser/htmlparser/src/nsExpatDriver.cpp index d3bb66f514a..4f5c997c4c7 100644 --- a/mozilla/parser/htmlparser/src/nsExpatDriver.cpp +++ b/mozilla/parser/htmlparser/src/nsExpatDriver.cpp @@ -203,8 +203,8 @@ static const nsCatalogData kCatalogTable[] = { {"-//W3C//DTD XHTML 1.0 Strict//EN", "xhtml11.dtd", nsnull }, {"-//W3C//DTD XHTML 1.0 Frameset//EN", "xhtml11.dtd", nsnull }, {"-//W3C//DTD XHTML Basic 1.0//EN", "xhtml11.dtd", nsnull }, - {"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN", "mathml.dtd", "resource:/res/mathml.css" }, - {"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN", "mathml.dtd", "resource:/res/mathml.css" }, + {"-//W3C//DTD XHTML 1.1 plus MathML 2.0//EN", "mathml.dtd", "resource://gre/res/mathml.css" }, + {"-//W3C//DTD XHTML 1.1 plus MathML 2.0 plus SVG 1.1//EN", "mathml.dtd", "resource://gre/res/mathml.css" }, {"-//W3C//DTD SVG 20001102//EN", "svg.dtd", nsnull }, {"-//WAPFORUM//DTD XHTML Mobile 1.0//EN", "xhtml11.dtd", nsnull }, {nsnull, nsnull, nsnull} diff --git a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp index 3847db8ca8d..5288d98d116 100644 --- a/mozilla/rdf/chrome/src/nsChromeRegistry.cpp +++ b/mozilla/rdf/chrome/src/nsChromeRegistry.cpp @@ -90,7 +90,6 @@ #include "nsIXULPrototypeCache.h" #endif #include "nsIIOService.h" -#include "nsIResProtocolHandler.h" #include "nsLayoutCID.h" #include "nsGfxCIID.h" #include "nsIBindingManager.h" @@ -3204,7 +3203,7 @@ nsresult nsChromeRegistry::GetUserSheetURL(PRBool aIsChrome, nsACString & aURL) nsresult nsChromeRegistry::GetFormSheetURL(nsACString& aURL) { - aURL = mUseXBLForms ? "chrome://forms/skin/forms.css" : "resource:/res/platform-forms.css"; + aURL = mUseXBLForms ? "chrome://forms/skin/forms.css" : "resource://gre/res/platform-forms.css"; return NS_OK; } diff --git a/mozilla/rdf/chrome/src/nsChromeUIDataSource.cpp b/mozilla/rdf/chrome/src/nsChromeUIDataSource.cpp index f5c60eca30a..4cf7b7f9ae2 100644 --- a/mozilla/rdf/chrome/src/nsChromeUIDataSource.cpp +++ b/mozilla/rdf/chrome/src/nsChromeUIDataSource.cpp @@ -56,7 +56,6 @@ #include "nsNetUtil.h" #include "nsISupportsArray.h" #include "nsIIOService.h" -#include "nsIResProtocolHandler.h" //////////////////////////////////////////////////////////////////////////////// diff --git a/mozilla/xpcom/build/nsXPComInit.cpp b/mozilla/xpcom/build/nsXPComInit.cpp index 469d4b79ab7..36921a809f6 100644 --- a/mozilla/xpcom/build/nsXPComInit.cpp +++ b/mozilla/xpcom/build/nsXPComInit.cpp @@ -581,13 +581,22 @@ nsresult NS_COM NS_InitXPCOM2(nsIServiceManager* *result, nsCOMPtr greDir; PRBool persistent = PR_TRUE; - appFileLocationProvider->GetFile(NS_GRE_COMPONENT_DIR, &persistent, getter_AddRefs(greDir)); + appFileLocationProvider->GetFile(NS_GRE_DIR, &persistent, getter_AddRefs(greDir)); if (greDir) { #ifdef DEBUG_dougt printf("start - Registering GRE components\n"); #endif + nsCOMPtr dirServiceP = do_QueryInterface(dirService); + NS_ENSURE_TRUE(dirServiceP, NS_NOINTERFACE); + + rv = dirServiceP->Get(NS_GRE_COMPONENT_DIR, nsIFile::GetIID(), getter_AddRefs(greDir)); + if (NS_FAILED(rv)) { + NS_ERROR("Could not get GRE components directory!"); + return rv; + } + // If the GRE contains any loaders, we want to know about it so that we can cause another // autoregistration of the applications component directory. int loaderCount = nsComponentManagerImpl::gComponentManager->GetLoaderCount(); diff --git a/mozilla/xpcom/ds/nsHashKeys.h b/mozilla/xpcom/ds/nsHashKeys.h index 9e0eab43718..764f42986a0 100644 --- a/mozilla/xpcom/ds/nsHashKeys.h +++ b/mozilla/xpcom/ds/nsHashKeys.h @@ -212,7 +212,6 @@ private: const nsID mID; }; - /** * hashkey wrapper for "dependent" const char*; this class does not "own" * its string pointer. diff --git a/mozilla/xpcom/glue/standalone/nsGREDirServiceProvider.cpp b/mozilla/xpcom/glue/standalone/nsGREDirServiceProvider.cpp index e58ba1d7bef..6b22f97d97a 100644 --- a/mozilla/xpcom/glue/standalone/nsGREDirServiceProvider.cpp +++ b/mozilla/xpcom/glue/standalone/nsGREDirServiceProvider.cpp @@ -112,10 +112,10 @@ nsGREDirServiceProvider::GetFile(const char *prop, PRBool *persistant, nsIFile * *persistant = PR_TRUE; //--------------------------------------------------------------- - // Note that by returning a valid localFile's for NS_GRE_DIR and - // NS_GRE_COMPONENT_DIR, your app is indicating to XPCOM that - // it found a GRE version with which it's compatible with and - // intends to be "run against" that GRE. + // Note that by returning a valid localFile's for NS_GRE_DIR, + // your app is indicating to XPCOM that it found a GRE version + // with which it's compatible with and intends to be "run against" + // that GRE. // // Please see http://www.mozilla.org/projects/embedding/MRE.html // for more info on GRE. @@ -124,16 +124,7 @@ nsGREDirServiceProvider::GetFile(const char *prop, PRBool *persistant, nsIFile * { rv = GetGreDirectory(getter_AddRefs(localFile)); } - else if(strcmp(prop, NS_GRE_COMPONENT_DIR) == 0) - { - rv = GetGreDirectory(getter_AddRefs(localFile)); - if(NS_SUCCEEDED(rv)) { - nsEmbedCString leaf; - leaf.Assign("components"); - rv = localFile->AppendRelativeNativePath(leaf); - } - } - + if(!localFile || NS_FAILED(rv)) return rv; diff --git a/mozilla/xpcom/io/nsDirectoryService.cpp b/mozilla/xpcom/io/nsDirectoryService.cpp index b8cdbeb9dbb..973f760fe55 100644 --- a/mozilla/xpcom/io/nsDirectoryService.cpp +++ b/mozilla/xpcom/io/nsDirectoryService.cpp @@ -790,13 +790,15 @@ nsDirectoryService::GetFile(const char *prop, PRBool *persistent, nsIFile **_ret { rv = GetCurrentProcessDirectory(getter_AddRefs(localFile)); } + // the GRE components directory is relative to the GRE directory + // by default; applications may override this behavior in special + // cases else if (inAtom == nsDirectoryService::sGRE_ComponentDirectory) { - rv = GetCurrentProcessDirectory(getter_AddRefs(localFile)); + rv = Get(NS_GRE_DIR, nsILocalFile::GetIID(), getter_AddRefs(localFile)); if (localFile) localFile->AppendNative(COMPONENT_DIRECTORY); } - else if (inAtom == nsDirectoryService::sComponentDirectory) { rv = GetCurrentProcessDirectory(getter_AddRefs(localFile)); diff --git a/mozilla/xpfe/bootstrap/nsAppRunner.cpp b/mozilla/xpfe/bootstrap/nsAppRunner.cpp index 07320fa6cdc..9870b5831b7 100644 --- a/mozilla/xpfe/bootstrap/nsAppRunner.cpp +++ b/mozilla/xpfe/bootstrap/nsAppRunner.cpp @@ -961,10 +961,11 @@ static void ShowOSAlertFromFile(int argc, char **argv, const char *alert_filenam directoryService = do_GetService(NS_DIRECTORY_SERVICE_CONTRACTID, &rv); if (NS_SUCCEEDED(rv)) { - rv = directoryService->Get(NS_APP_RES_DIR, + rv = directoryService->Get(NS_GRE_DIR, NS_GET_IID(nsIFile), getter_AddRefs(fileName)); if (NS_SUCCEEDED(rv) && fileName) { + fileName->AppendNative(NS_LITERAL_CSTRING("res")); fileName->AppendNative(nsDependentCString(alert_filename)); PRFileDesc* fd = 0; fileName->OpenNSPRFileDesc(PR_RDONLY, 0664, &fd); diff --git a/mozilla/xpfe/browser/resources/content/pageInfo.js b/mozilla/xpfe/browser/resources/content/pageInfo.js index 7591f774003..66247c31c83 100644 --- a/mozilla/xpfe/browser/resources/content/pageInfo.js +++ b/mozilla/xpfe/browser/resources/content/pageInfo.js @@ -915,7 +915,7 @@ function makePreview(row) { // fallback image for protocols not allowed (e.g., data: or javascript:) // or elements not [yet] handled (e.g., object, embed). XXX blank?? - newImage.src = "resource:///res/loading-image.gif"; + newImage.src = "resource://gre/re/loading-image.gif"; newImage.width = 40; newImage.height = 40; } diff --git a/mozilla/xpinstall/packager/packages-win b/mozilla/xpinstall/packager/packages-win index f6e636a44f2..8efb8c36f22 100644 --- a/mozilla/xpinstall/packager/packages-win +++ b/mozilla/xpinstall/packager/packages-win @@ -68,7 +68,6 @@ bin\jpeg3250.dll bin\mozilla.exe bin\regxpcom.exe bin\xpicleanup.exe -bin\res\cmessage.txt bin\components\AcctIdl.dll bin\components\AcctIdl.xpt bin\components\appcomps.dll @@ -209,11 +208,6 @@ bin\chrome\icons\default\main-window.ico ; to prevent migration bugs bin\defaults\pref\* bin\defaults\autoconfig\* -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\grabber.gif bin\res\table-add-column-after-active.gif @@ -234,14 +228,6 @@ bin\res\table-remove-column.gif bin\res\table-remove-row-active.gif bin\res\table-remove-row-hover.gif bin\res\table-remove-row.gif -bin\res\viewsource.css -bin\res\mathml.css -bin\res\arrow.gif -bin\res\loading-image.gif -bin\res\broken-image.gif -bin\res\html\* -bin\res\fonts\* -bin\res\dtd\* bin\defaults\wallet\VcardSchema.tbl bin\defaults\wallet\FieldSchema.tbl bin\defaults\wallet\SchemaConcat.tbl @@ -249,12 +235,6 @@ bin\defaults\wallet\DistinguishedSchema.tbl bin\defaults\wallet\SchemaStrings.tbl bin\defaults\wallet\PositionalSchema.tbl bin\defaults\wallet\StateSchema.tbl -bin\res\wincharset.properties -bin\res\charsetalias.properties -bin\res\charsetData.properties -bin\res\langGroups.properties -bin\res\language.properties -bin\res\entityTables\* bin\res\rdf\article.gif bin\res\rdf\document.gif bin\res\rdf\folder-closed.gif @@ -263,8 +243,6 @@ bin\res\rdf\loading.gif bin\res\throbber\* ;debug menus reference samples dir - remove for actual releases: bin\res\samples\* -bin\res\builtin\htmlBindings.xml -bin\res\builtin\platformHTMLBindings.xml ; download progress bin\components\nsProgressDialog.js