mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-11-26 14:22:01 +00:00
Bug 259861. Warn when an XBL binding has no id attribute. r=bzbarsky
This commit is contained in:
parent
68f964b8bb
commit
e7ff531b74
@ -291,7 +291,7 @@ nsXBLContentSink::HandleStartElement(const PRUnichar *aName,
|
||||
return rv;
|
||||
|
||||
if (mState == eXBL_InBinding && !mBinding) {
|
||||
rv = ConstructBinding();
|
||||
rv = ConstructBinding(aLineNumber);
|
||||
if (NS_FAILED(rv))
|
||||
return rv;
|
||||
|
||||
@ -555,7 +555,7 @@ nsXBLContentSink::OnOpenContainer(const PRUnichar **aAtts,
|
||||
#undef ENSURE_XBL_STATE
|
||||
|
||||
nsresult
|
||||
nsXBLContentSink::ConstructBinding()
|
||||
nsXBLContentSink::ConstructBinding(PRUint32 aLineNumber)
|
||||
{
|
||||
nsCOMPtr<nsIContent> binding = GetCurrentContent();
|
||||
nsAutoString id;
|
||||
@ -581,6 +581,14 @@ nsXBLContentSink::ConstructBinding()
|
||||
delete mBinding;
|
||||
mBinding = nsnull;
|
||||
}
|
||||
} else {
|
||||
nsContentUtils::ReportToConsole(nsContentUtils::eXBL_PROPERTIES,
|
||||
"MissingIdAttr", nsnull, 0,
|
||||
mDocumentURI,
|
||||
EmptyString(),
|
||||
aLineNumber, 0,
|
||||
nsIScriptError::errorFlag,
|
||||
"XBL Content Sink");
|
||||
}
|
||||
|
||||
return rv;
|
||||
|
@ -136,7 +136,7 @@ protected:
|
||||
#endif
|
||||
|
||||
// Our own helpers for constructing XBL prototype objects.
|
||||
nsresult ConstructBinding();
|
||||
nsresult ConstructBinding(PRUint32 aLineNumber);
|
||||
void ConstructHandler(const PRUnichar **aAtts, PRUint32 aLineNumber);
|
||||
void ConstructResource(const PRUnichar **aAtts, nsIAtom* aResourceType);
|
||||
void ConstructImplementation(const PRUnichar **aAtts);
|
||||
|
@ -43,3 +43,4 @@ CircularExtendsBinding=Extending the XBL binding "%S" with "%S" would lead to it
|
||||
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.
|
||||
MissingIdAttr = An "id" attribute missing on the binding tag.
|
||||
|
Loading…
Reference in New Issue
Block a user