зеркало из https://github.com/mozilla/pjs.git
[XForms] Stop processing on instance load error. Bug 332218, r=smaug+aaronr
This commit is contained in:
Родитель
3e4469d997
Коммит
1a52929f69
|
@ -1406,11 +1406,18 @@ nsXFormsModelElement::InstanceLoadStarted()
|
|||
NS_IMETHODIMP
|
||||
nsXFormsModelElement::InstanceLoadFinished(PRBool aSuccess)
|
||||
{
|
||||
--mPendingInstanceCount;
|
||||
if (!aSuccess) {
|
||||
// This will leave mPendingInstanceCount in an invalid state, which is
|
||||
// exactly what we want, because this is a fatal error, and processing
|
||||
// should stop. If we decrease mPendingInstanceCount, the model would
|
||||
// finish construction, which is wrong.
|
||||
nsXFormsUtils::ReportError(NS_LITERAL_STRING("instanceLoadError"), mElement);
|
||||
nsXFormsUtils::DispatchEvent(mElement, eEvent_LinkException);
|
||||
} else if (IsComplete()) {
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
--mPendingInstanceCount;
|
||||
if (IsComplete()) {
|
||||
nsresult rv = FinishConstruction();
|
||||
if (NS_SUCCEEDED(rv)) {
|
||||
MaybeNotifyCompletion();
|
||||
|
|
Загрузка…
Ссылка в новой задаче