Change assertion to error console report for malformed XBL file. (Bug 397561) r=bzbarsky

This commit is contained in:
Surya Ismail 2010-05-04 21:28:19 -07:00
parent c6bd227acc
commit 0a8ed314df
2 changed files with 10 additions and 2 deletions

View File

@ -450,8 +450,15 @@ nsXBLStreamListener::Load(nsIDOMEvent* aEvent)
xblDocBindingManager->GetXBLDocumentInfo(documentURI);
xblDocBindingManager->RemoveXBLDocumentInfo(info); // Break the self-imposed cycle.
if (!info) {
// FIXME: How about an error console warning?
NS_WARNING("An XBL file is malformed. Did you forget the XBL namespace on the bindings tag?");
if (IsChromeOrResourceURI(documentURI)) {
NS_WARNING("An XBL file is malformed. Did you forget the XBL namespace on the bindings tag?");
}
nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
"MalformedXBL",
nsnull, 0, documentURI,
EmptyString(), 0, 0,
nsIScriptError::warningFlag,
"XBL");
return NS_ERROR_FAILURE;
}

View File

@ -41,4 +41,5 @@ TooDeepBindingRecursion=The XBL binding "%S" is already used by too many ancesto
CircularExtendsBinding=Extending the XBL binding "%S" with "%S" would lead to it extending itself
# LOCALIZATION NOTE: do not localize <handler command="…">
CommandNotInChrome=Use of <handler command="…"> not allowed outside chrome.
MalformedXBL = An XBL file is malformed. Did you forget the XBL namespace on the bindings tag?
InvalidExtendsBinding=Extending "%S" is invalid. In general, do not extend tag names.