Bug 608201 File chooser and some other dialogs are not added to Firefox a11y tree r=surkov.alexander,roc a=blocking-2.0

This commit is contained in:
Ginn Chen 2010-11-09 18:21:56 +08:00
Родитель 285b0ccda4
Коммит b25533d3d4
3 изменённых файлов: 25 добавлений и 12 удалений

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

@ -2730,6 +2730,9 @@ nsAccessible::InvalidateChildren()
PRBool
nsAccessible::AppendChild(nsAccessible* aChild)
{
if (!aChild)
return PR_FLASE;
if (!mChildren.AppendElement(aChild))
return PR_FALSE;
@ -2743,11 +2746,16 @@ nsAccessible::AppendChild(nsAccessible* aChild)
PRBool
nsAccessible::InsertChildAt(PRUint32 aIndex, nsAccessible* aChild)
{
if (!aChild)
return PR_FLASE;
if (!mChildren.InsertElementAt(aIndex, aChild))
return PR_FALSE;
for (PRUint32 idx = aIndex + 1; idx < mChildren.Length(); idx++)
mChildren[idx]->mIndexInParent++;
for (PRUint32 idx = aIndex + 1; idx < mChildren.Length(); idx++) {
NS_ASSERTION(mChildren[idx]->mIndexInParent == idx - 1, "Accessible child index doesn't match");
mChildren[idx]->mIndexInParent = idx;
}
if (nsAccUtils::IsText(aChild))
mChildrenFlags = eMixedChildren;
@ -2761,23 +2769,28 @@ nsAccessible::InsertChildAt(PRUint32 aIndex, nsAccessible* aChild)
PRBool
nsAccessible::RemoveChild(nsAccessible* aChild)
{
if (aChild->mParent != this || aChild->mIndexInParent == -1)
if (!aChild)
return PR_FLASE;
PRInt32 index = aChild->mIndexInParent;
if (aChild->mParent != this || index == -1)
return PR_FALSE;
if (aChild->mIndexInParent >= mChildren.Length() ||
mChildren[aChild->mIndexInParent] != aChild) {
if (index >= mChildren.Length() || mChildren[index] != aChild) {
NS_ERROR("Child is bound to parent but parent hasn't this child at its index!");
aChild->UnbindFromParent();
return PR_FALSE;
}
for (PRUint32 idx = aChild->mIndexInParent + 1; idx < mChildren.Length(); idx++)
mChildren[idx]->mIndexInParent--;
mChildren.RemoveElementAt(aChild->mIndexInParent);
mEmbeddedObjCollector = nsnull;
for (PRUint32 idx = index + 1; idx < mChildren.Length(); idx++) {
NS_ASSERTION(mChildren[idx]->mIndexInParent == idx, "Accessible child index doesn't match");
mChildren[idx]->mIndexInParent = idx - 1;
}
aChild->UnbindFromParent();
mChildren.RemoveElementAt(index);
mEmbeddedObjCollector = nsnull;
return PR_TRUE;
}

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

@ -538,7 +538,7 @@ nsFilePicker::Show(PRInt16 *aReturn)
}
gtk_file_chooser_set_do_overwrite_confirmation(GTK_FILE_CHOOSER(file_chooser), PR_TRUE);
gint response = gtk_dialog_run(GTK_DIALOG(file_chooser));
gint response = RunDialog(GTK_DIALOG(file_chooser));
switch (response) {
case GTK_RESPONSE_OK:

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

@ -142,7 +142,7 @@ ShowCustomDialog(GtkComboBox *changed_box, gpointer user_data)
gtk_widget_show_all(custom_hbox);
gtk_box_pack_start(GTK_BOX(GTK_DIALOG(prompt_dialog)->vbox), custom_hbox, FALSE, FALSE, 0);
gint diag_response = gtk_dialog_run(GTK_DIALOG(prompt_dialog));
gint diag_response = RunDialog(GTK_DIALOG(prompt_dialog));
if (diag_response == GTK_RESPONSE_ACCEPT) {
const gchar* response_text = gtk_entry_get_text(GTK_ENTRY(custom_entry));