Bug 1448162 - Crash in the presence of a XUL overlay. r?mystor
MozReview-Commit-ID: 1docjuCTBpE
--- a/dom/xul/XULDocument.cpp
+++ b/dom/xul/XULDocument.cpp
@@ -2254,16 +2254,31 @@ XULDocument::LoadOverlay(const nsAString
nsresult
XULDocument::LoadOverlayInternal(nsIURI* aURI, bool aIsDynamic,
bool* aShouldReturn,
bool* aFailureFromContent)
{
nsresult rv;
+ // XUL overlays are in the process of being removed. In a Firefox build,
+ // loading an overlay will cause a crash as they are no longer allowed.
+ // However, overlays are allowed in other applications (e.g. Thunderbird)
+ // while they work on removing them. See bug 1448162.
+#ifdef MOZ_CRASH_XUL_OVERLAYS
+ nsCString docSpec;
+ mCurrentPrototype->GetURI()->GetSpec(docSpec);
+ nsCString overlaySpec;
+ aURI->GetSpec(overlaySpec);
+ printf("Attempt to load overlay %s into %s\n",
+ overlaySpec.get(),
+ docSpec.get());
+ MOZ_CRASH("Attempt to load overlay");
+#endif
+
*aShouldReturn = false;
*aFailureFromContent = false;
if (MOZ_LOG_TEST(gXULLog, LogLevel::Debug)) {
nsCOMPtr<nsIURI> uri;
mChannel->GetOriginalURI(getter_AddRefs(uri));
MOZ_LOG(gXULLog, LogLevel::Debug,
--- a/dom/xul/moz.build
+++ b/dom/xul/moz.build
@@ -2,16 +2,19 @@
# vim: set filetype=python:
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at http://mozilla.org/MPL/2.0/.
with Files("**"):
BUG_COMPONENT = ("Core", "XUL")
+if CONFIG['MOZ_BUILD_APP'] == 'browser':
+ DEFINES['MOZ_CRASH_XUL_OVERLAYS'] = True
+
MOCHITEST_MANIFESTS += ['test/mochitest.ini']
MOCHITEST_CHROME_MANIFESTS += ['test/chrome.ini']
if CONFIG['MOZ_XUL']:
XPIDL_SOURCES += [
'nsIXULOverlayProvider.idl',
]