Bug 691248 - XUL tree items shouldn't pick up relations from XUL tree, r=tbsaunde

This commit is contained in:
Alexander Surkov 2011-10-03 23:26:11 +09:00
Родитель b841abc8f2
Коммит 2e7eafacca
4 изменённых файлов: 25 добавлений и 11 удалений

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

@ -817,22 +817,17 @@ Relation
nsXULTreeItemAccessibleBase::RelationByType(PRUint32 aType)
{
if (aType != nsIAccessibleRelation::RELATION_NODE_CHILD_OF)
return nsAccessible::RelationByType(aType);
return Relation();
Relation rel;
PRInt32 parentIndex;
if (!NS_SUCCEEDED(mTreeView->GetParentIndex(mRow, &parentIndex)))
return rel;
return Relation();
if (parentIndex == -1) {
rel.AppendTarget(mParent);
return rel;
}
if (parentIndex == -1)
return Relation(mParent);
nsRefPtr<nsXULTreeAccessible> treeAcc = do_QueryObject(mParent);
rel.AppendTarget(treeAcc->GetTreeItemAccessible(parentIndex));
return rel;
return Relation(treeAcc->GetTreeItemAccessible(parentIndex));
}
PRUint8

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

@ -43,6 +43,7 @@
#include "nsAccUtils.h"
#include "nsDocAccessible.h"
#include "nsEventShell.h"
#include "Relation.h"
#include "States.h"
#include "nsITreeSelection.h"
@ -1237,6 +1238,12 @@ nsXULTreeGridCellAccessible::IndexInParent() const
return GetColumnIndex();
}
Relation
nsXULTreeGridCellAccessible::RelationByType(PRUint32 aType)
{
return Relation();
}
////////////////////////////////////////////////////////////////////////////////
// nsXULTreeGridCellAccessible: public implementation

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

@ -163,6 +163,7 @@ public:
virtual nsAccessible* FocusedChild();
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual PRInt32 IndexInParent() const;
virtual Relation RelationByType(PRUint32 aType);
virtual PRUint32 NativeRole();
virtual PRUint64 NativeState();

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

@ -47,6 +47,10 @@
var treeitem6 = treeitem5.nextSibling;
testRelation(treeitem6, RELATION_NODE_CHILD_OF, [tree]);
// treeitems and treecells shouldn't pick up relations from tree
testRelation(treeitem1, RELATION_LABELLED_BY, null);
testRelation(treeitem1.firstChild, RELATION_LABELLED_BY, null);
SimpleTest.finish();
}
@ -68,7 +72,12 @@
href="https://bugzilla.mozilla.org/show_bug.cgi?id=503727"
title="Reorganize implementation of XUL tree accessibility">
Mozilla Bug 503727
</a><br/>
</a>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=691248"
title="XUL tree items shouldn't pick up relations from XUL tree">
Mozilla Bug 691248
</a>
<p id="display"></p>
<div id="content" style="display: none">
</div>
@ -77,9 +86,11 @@
</body>
<vbox flex="1">
<label control="tree" value="It's a tree"/>
<tree id="tree" flex="1">
<treecols>
<treecol id="col" flex="1" primary="true" label="column"/>
<treecol id="col2" flex="1" label="column2"/>
</treecols>
<treechildren/>
</tree>