[XForms] Fix excess refresh during widget loading. Bug 326766, r=smaug+me, patch by surkov@dc.baikal.ru

This commit is contained in:
allan%beaufour.dk 2006-03-08 10:14:50 +00:00
Родитель 01ef33157a
Коммит a366580fad
1 изменённых файлов: 13 добавлений и 2 удалений

Просмотреть файл

@ -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;
}