[XForms] Fix excess refresh during widget loading. Bug 326766, r=smaug+me, patch by surkov@dc.baikal.ru
git-svn-id: svn://10.0.0.236/trunk@191967 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
@@ -190,9 +190,20 @@ nsXFormsDelegateStub::ReportError(const nsAString& aErrorMsg)
|
||||
NS_IMETHODIMP
|
||||
nsXFormsDelegateStub::WidgetAttached()
|
||||
{
|
||||
if (UpdateRepeatState() != eType_Template)
|
||||
nsXFormsModelElement::NeedsPostRefresh(this);
|
||||
if (UpdateRepeatState() == eType_Template)
|
||||
return NS_OK;
|
||||
|
||||
if (mBindAttrsCount) {
|
||||
// If control is bounded to instance data then we should ask for refresh
|
||||
// only when model is loaded entirely. The reason is control is refreshed
|
||||
// by model when it get loaded.
|
||||
nsCOMPtr<nsIDOMDocument> domDoc;
|
||||
mElement->GetOwnerDocument(getter_AddRefs(domDoc));
|
||||
if (!nsXFormsUtils::IsDocumentReadyForBind(domDoc))
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
nsXFormsModelElement::NeedsPostRefresh(this);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user