Bug 567369 - GetAccessibleInWeakShell should return nsAccessible*, r=marcoz

This commit is contained in:
Alexander Surkov 2010-05-25 17:05:52 +09:00
parent cd94c32d80
commit b6ef0d73b1
18 changed files with 98 additions and 106 deletions

View File

@ -158,7 +158,7 @@ nsAccessNode::Init()
if (presShell) {
nsCOMPtr<nsIDOMNode> docNode(do_QueryInterface(presShell->GetDocument()));
if (docNode) {
nsRefPtr<nsAccessible> accessible =
nsAccessible *accessible =
GetAccService()->GetAccessibleInWeakShell(docNode, mWeakShell);
docAcc = do_QueryObject(accessible);
}
@ -508,12 +508,8 @@ nsAccessNode::MakeAccessNode(nsIDOMNode *aNode, nsIAccessNode **aAccessNode)
nsCOMPtr<nsIAccessNode> accessNode =
GetAccService()->GetCachedAccessNode(aNode, mWeakShell);
if (!accessNode) {
nsRefPtr<nsAccessible> accessible =
GetAccService()->GetAccessibleInWeakShell(aNode, mWeakShell);
accessNode = accessible;
}
if (!accessNode)
accessNode = GetAccService()->GetAccessibleInWeakShell(aNode, mWeakShell);
if (accessNode) {
NS_ADDREF(*aAccessNode = accessNode);

View File

@ -1176,32 +1176,8 @@ nsAccessibilityService::GetAccessibleFor(nsIDOMNode *aNode,
nsIAccessible **aAccessible)
{
NS_ENSURE_ARG_POINTER(aAccessible);
*aAccessible = nsnull;
NS_ENSURE_ARG(aNode);
nsCOMPtr<nsIContent> content(do_QueryInterface(aNode));
nsCOMPtr<nsIDocument> doc;
if (content) {
doc = content->GetDocument();
}
else {// Could be document node
doc = do_QueryInterface(aNode);
}
if (!doc)
return NS_ERROR_FAILURE;
// We use presentation shell #0 because we assume that is presentation of
// given node window.
nsIPresShell *presShell = doc->GetPrimaryShell();
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(presShell));
nsRefPtr<nsAccessible> accessible =
GetAccessible(aNode, presShell, weakShell);
if (accessible)
CallQueryInterface(accessible.get(), aAccessible);
NS_IF_ADDREF(*aAccessible = GetAccessible(aNode));
return NS_OK;
}
@ -1240,7 +1216,23 @@ nsAccessibilityService::GetAccessibleInShell(nsIDOMNode *aNode,
////////////////////////////////////////////////////////////////////////////////
// nsAccessibilityService public
already_AddRefed<nsAccessible>
nsAccessible *
nsAccessibilityService::GetAccessible(nsIDOMNode *aNode)
{
if (!aNode)
return nsnull;
nsIPresShell *presShell = nsCoreUtils::GetPresShellFor(aNode);
if (!presShell)
return nsnull;
nsCOMPtr<nsIWeakReference> weakShell(do_GetWeakReference(presShell));
nsRefPtr<nsAccessible> accessible = GetAccessible(aNode, presShell,
weakShell);
return accessible;
}
nsAccessible *
nsAccessibilityService::GetAccessibleInWeakShell(nsIDOMNode *aNode,
nsIWeakReference *aWeakShell)
{
@ -1248,7 +1240,9 @@ nsAccessibilityService::GetAccessibleInWeakShell(nsIDOMNode *aNode,
return nsnull;
nsCOMPtr<nsIPresShell> presShell(do_QueryReferent(aWeakShell));
return GetAccessible(aNode, presShell, aWeakShell);
nsRefPtr<nsAccessible> accessible = GetAccessible(aNode, presShell,
aWeakShell);
return accessible;
}
////////////////////////////////////////////////////////////////////////////////
@ -1492,7 +1486,7 @@ nsAccessibilityService::GetAccessible(nsIDOMNode *aNode,
if (tableFrame->GetType() == nsAccessibilityAtoms::tableOuterFrame) {
nsCOMPtr<nsIDOMNode> tableNode(do_QueryInterface(tableContent));
nsRefPtr<nsAccessible> tableAccessible =
nsAccessible *tableAccessible =
GetAccessibleInWeakShell(tableNode, aWeakShell);
if (tableAccessible) {

View File

@ -172,14 +172,19 @@ public:
GetAccessible(nsIDOMNode *aNode, nsIPresShell *aPresShell,
nsIWeakReference *aWeakShell, PRBool *aIsHidden = nsnull);
/**
* Return an accessible for the given DOM node.
*/
nsAccessible *GetAccessible(nsIDOMNode *aNode);
/**
* Return an accessible for a DOM node in the given pres shell.
*
* @param aNode [in] the given node.
* @param aPresShell [in] the presentation shell of the given node.
*/
already_AddRefed<nsAccessible>
GetAccessibleInWeakShell(nsIDOMNode *aNode, nsIWeakReference *aPresShell);
nsAccessible *GetAccessibleInWeakShell(nsIDOMNode *aNode,
nsIWeakReference *aPresShell);
/**
* Return an access node for the DOM node in the given presentation shell if

View File

@ -3002,17 +3002,17 @@ nsAccessible::GetSiblingAtOffset(PRInt32 aOffset, nsresult* aError)
return child;
}
already_AddRefed<nsAccessible>
nsAccessible::GetFirstAvailableAccessible(nsIDOMNode *aStartNode)
nsAccessible *
nsAccessible::GetFirstAvailableAccessible(nsIDOMNode *aStartNode) const
{
nsCOMPtr<nsIDOMTreeWalker> walker;
nsCOMPtr<nsIDOMNode> currentNode(aStartNode);
while (currentNode) {
nsRefPtr<nsAccessible> accessible =
nsAccessible *accessible =
GetAccService()->GetAccessibleInWeakShell(currentNode, mWeakShell);
if (accessible)
return accessible.forget();
return accessible;
if (!walker) {
// Instantiate walker lazily since we won't need it in 90% of the cases

View File

@ -338,9 +338,8 @@ protected:
*
* @param aStartNode [in] the DOM node to start from
* @return the resulting accessible
*/
already_AddRefed<nsAccessible>
GetFirstAvailableAccessible(nsIDOMNode *aStartNode);
*/
nsAccessible *GetFirstAvailableAccessible(nsIDOMNode *aStartNode) const;
// Hyperlink helpers
virtual nsresult GetLinkOffset(PRInt32* aStartOffset, PRInt32* aEndOffset);

View File

@ -107,7 +107,7 @@ NS_IMPL_ISUPPORTS_INHERITED0(nsLinkableAccessible, nsAccessibleWrap)
NS_IMETHODIMP
nsLinkableAccessible::TakeFocus()
{
nsRefPtr<nsAccessible> actionAcc = GetActionAccessible();
nsAccessible *actionAcc = GetActionAccessible();
if (actionAcc)
return actionAcc->TakeFocus();
@ -122,7 +122,7 @@ nsLinkableAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
if (mIsLink) {
*aState |= nsIAccessibleStates::STATE_LINKED;
nsRefPtr<nsAccessible> actionAcc = GetActionAccessible();
nsAccessible *actionAcc = GetActionAccessible();
if (nsAccUtils::State(actionAcc) & nsIAccessibleStates::STATE_TRAVERSED)
*aState |= nsIAccessibleStates::STATE_TRAVERSED;
}
@ -140,7 +140,7 @@ nsLinkableAccessible::GetValue(nsAString& aValue)
return NS_OK;
if (mIsLink) {
nsRefPtr<nsAccessible> actionAcc = GetActionAccessible();
nsAccessible *actionAcc = GetActionAccessible();
if (actionAcc)
return actionAcc->GetValue(aValue);
}
@ -183,8 +183,8 @@ nsLinkableAccessible::DoAction(PRUint8 aIndex)
{
if (aIndex != eAction_Jump)
return NS_ERROR_INVALID_ARG;
nsRefPtr<nsAccessible> actionAcc = GetActionAccessible();
nsAccessible *actionAcc = GetActionAccessible();
if (actionAcc)
return actionAcc->DoAction(aIndex);
@ -196,7 +196,7 @@ nsLinkableAccessible::GetKeyboardShortcut(nsAString& aKeyboardShortcut)
{
aKeyboardShortcut.Truncate();
nsRefPtr<nsAccessible> actionAcc = GetActionAccessible();
nsAccessible *actionAcc = GetActionAccessible();
if (actionAcc)
return actionAcc->GetKeyboardShortcut(aKeyboardShortcut);
@ -210,7 +210,7 @@ NS_IMETHODIMP
nsLinkableAccessible::GetURI(PRInt32 aIndex, nsIURI **aURI)
{
if (mIsLink) {
nsRefPtr<nsAccessible> actionAcc = GetActionAccessible();
nsAccessible *actionAcc = GetActionAccessible();
if (actionAcc) {
nsCOMPtr<nsIAccessibleHyperLink> hyperLinkAcc = do_QueryObject(actionAcc);
NS_ASSERTION(hyperLinkAcc,
@ -261,7 +261,7 @@ nsLinkableAccessible::CacheActionContent()
nsCOMPtr<nsIDOMNode> walkUpNode(do_QueryInterface(walkUpContent));
nsRefPtr<nsAccessible> walkUpAcc =
nsAccessible *walkUpAcc =
GetAccService()->GetAccessibleInWeakShell(walkUpNode, mWeakShell);
if (nsAccUtils::Role(walkUpAcc) == nsIAccessibleRole::ROLE_LINK &&
@ -279,8 +279,8 @@ nsLinkableAccessible::CacheActionContent()
}
}
already_AddRefed<nsAccessible>
nsLinkableAccessible::GetActionAccessible()
nsAccessible *
nsLinkableAccessible::GetActionAccessible() const
{
// Return accessible for the action content if it's different from node of
// this accessible. If the action accessible is not null then it is used to

View File

@ -110,7 +110,7 @@ protected:
/**
* Return an accessible for cached action node.
*/
already_AddRefed<nsAccessible> GetActionAccessible();
nsAccessible *GetActionAccessible() const;
/**
* Cache action node.

View File

@ -2108,10 +2108,9 @@ nsDocAccessible::GetAccessibleInParentChain(nsIDOMNode *aNode,
currentNode = relevantNode;
}
if (aCanCreate) {
nsRefPtr<nsAccessible> acc =
nsAccessible *accessible =
GetAccService()->GetAccessibleInWeakShell(currentNode, mWeakShell);
if (acc)
CallQueryInterface(acc, aAccessible);
NS_IF_ADDREF(*aAccessible = accessible);
}
else { // Only return cached accessibles, don't create anything
nsAccessNode* accessNode = GetCachedAccessNode(currentNode);

View File

@ -120,19 +120,19 @@ nsHTMLSelectableAccessible::iterator::AddAccessibleIfSelected(nsIMutableArray *a
nsPresContext *aContext)
{
PRBool isSelected = PR_FALSE;
nsRefPtr<nsAccessible> tempAcc;
nsAccessible *optionAcc = nsnull;
if (mOption) {
mOption->GetSelected(&isSelected);
if (isSelected) {
nsCOMPtr<nsIDOMNode> optionNode(do_QueryInterface(mOption));
tempAcc = GetAccService()->GetAccessibleInWeakShell(optionNode,
mWeakShell);
optionAcc = GetAccService()->GetAccessibleInWeakShell(optionNode,
mWeakShell);
}
}
if (tempAcc)
aSelectedAccessibles->AppendElement(static_cast<nsIAccessible*>(tempAcc),
if (optionAcc)
aSelectedAccessibles->AppendElement(static_cast<nsIAccessible*>(optionAcc),
PR_FALSE);
}
@ -150,10 +150,9 @@ nsHTMLSelectableAccessible::iterator::GetAccessibleIfSelected(PRInt32 aIndex,
if (isSelected) {
if (mSelCount == aIndex) {
nsCOMPtr<nsIDOMNode> optionNode(do_QueryInterface(mOption));
nsRefPtr<nsAccessible> acc =
nsAccessible *accessible =
GetAccService()->GetAccessibleInWeakShell(optionNode, mWeakShell);
if (acc)
CallQueryInterface(acc, aAccessible);
NS_IF_ADDREF(*aAccessible = accessible);
return PR_TRUE;
}
@ -402,11 +401,11 @@ nsHTMLSelectListAccessible::CacheOptSiblings(nsIContent *aParentContent)
// Get an accessible for option or optgroup and cache it.
nsCOMPtr<nsIDOMNode> childNode(do_QueryInterface(childContent));
nsRefPtr<nsAccessible> acc =
nsAccessible *accessible =
GetAccService()->GetAccessibleInWeakShell(childNode, mWeakShell);
if (acc) {
mChildren.AppendElement(acc);
acc->SetParent(this);
if (accessible) {
mChildren.AppendElement(accessible);
accessible->SetParent(this);
}
// Deep down into optgroup element.
@ -436,7 +435,7 @@ nsHTMLSelectOptionAccessible::
// GetParent would normally return. This is because the
// nsHTMLComboboxListAccessible is inserted into the accessible hierarchy
// where there is no DOM node for it.
nsRefPtr<nsAccessible> parentAcc =
nsAccessible *parentAcc =
GetAccService()->GetAccessibleInWeakShell(parentNode, mWeakShell);
if (!parentAcc)
return;
@ -1009,11 +1008,11 @@ NS_IMETHODIMP nsHTMLComboboxAccessible::GetDescription(nsAString& aDescription)
return NS_OK;
}
// Use description of currently focused option
nsRefPtr<nsAccessible> optionAcc = GetFocusedOptionAccessible();
return optionAcc ? optionAcc->GetDescription(aDescription) : NS_OK;
nsAccessible *option = GetFocusedOptionAccessible();
return option ? option->GetDescription(aDescription) : NS_OK;
}
already_AddRefed<nsAccessible>
nsAccessible *
nsHTMLComboboxAccessible::GetFocusedOptionAccessible()
{
if (IsDefunct())
@ -1038,8 +1037,8 @@ nsHTMLComboboxAccessible::GetFocusedOptionAccessible()
NS_IMETHODIMP nsHTMLComboboxAccessible::GetValue(nsAString& aValue)
{
// Use accessible name of currently focused option.
nsRefPtr<nsAccessible> optionAcc = GetFocusedOptionAccessible();
return optionAcc ? optionAcc->GetName(aValue) : NS_OK;
nsAccessible *option = GetFocusedOptionAccessible();
return option ? option->GetName(aValue) : NS_OK;
}
/** Just one action ( click ). */

View File

@ -244,7 +244,7 @@ protected:
/**
* Return focused option accessible.
*/
already_AddRefed<nsAccessible> GetFocusedOptionAccessible();
nsAccessible *GetFocusedOptionAccessible();
private:
nsRefPtr<nsHTMLComboboxListAccessible> mListAccessible;

View File

@ -335,7 +335,7 @@ nsHTMLTableCellAccessible::GetHeaderCells(PRInt32 aRowOrColumnHeaderCell,
nsCOMPtr<nsIDOMNode> headerCellNode;
for (PRUint32 idx = 0; idx < count; idx++) {
headerCellNode = do_QueryElementAt(headerCellElms, idx, &rv);
nsRefPtr<nsAccessible> headerCell =
nsAccessible *headerCell =
GetAccService()->GetAccessibleInWeakShell(headerCellNode, mWeakShell);
if (headerCell &&
@ -343,7 +343,7 @@ nsHTMLTableCellAccessible::GetHeaderCells(PRInt32 aRowOrColumnHeaderCell,
nsAccUtils::Role(headerCell) == nsIAccessibleRole::ROLE_ROWHEADER ||
aRowOrColumnHeaderCell == nsAccUtils::eColumnHeaderCells &&
nsAccUtils::Role(headerCell) == nsIAccessibleRole::ROLE_COLUMNHEADER))
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell.get()),
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
PR_FALSE);
}
}
@ -738,9 +738,9 @@ nsHTMLTableAccessible::GetSelectedCells(nsIArray **aCells)
if (NS_SUCCEEDED(rv) && startRowIndex == rowIndex &&
startColIndex == columnIndex && isSelected) {
nsRefPtr<nsAccessible> cell =
nsAccessible *cell =
GetAccService()->GetAccessibleInWeakShell(cellElement, mWeakShell);
selCells->AppendElement(static_cast<nsIAccessible*>(cell.get()), PR_FALSE);
selCells->AppendElement(static_cast<nsIAccessible*>(cell), PR_FALSE);
}
}
}
@ -911,10 +911,10 @@ nsHTMLTableAccessible::GetCellAt(PRInt32 aRow, PRInt32 aColumn,
nsresult rv = GetCellAt(aRow, aColumn, *getter_AddRefs(cellElement));
NS_ENSURE_SUCCESS(rv, rv);
nsRefPtr<nsAccessible> cellAcc =
nsAccessible *cell =
GetAccService()->GetAccessibleInWeakShell(cellElement, mWeakShell);
if (cellAcc)
CallQueryInterface(cellAcc, aTableCellAccessible);
if (cell)
CallQueryInterface(cell, aTableCellAccessible);
return NS_OK;
}

View File

@ -581,7 +581,7 @@ nsHyperTextAccessible::DOMPointToHypertextOffset(nsIDOMNode *aNode,
// Get accessible for this findNode, or if that node isn't accessible, use the
// accessible for the next DOM node which has one (based on forward depth first search)
nsRefPtr<nsAccessible> descendantAcc;
nsAccessible *descendantAcc = nsnull;
if (findNode) {
nsCOMPtr<nsIContent> findContent = do_QueryInterface(findNode);
if (findContent->IsHTML() &&
@ -598,9 +598,9 @@ nsHyperTextAccessible::DOMPointToHypertextOffset(nsIDOMNode *aNode,
}
// From the descendant, go up and get the immediate child of this hypertext
nsRefPtr<nsAccessible> childAccAtOffset;
nsAccessible *childAccAtOffset = nsnull;
while (descendantAcc) {
nsRefPtr<nsAccessible> parentAcc = descendantAcc->GetParent();
nsAccessible *parentAcc = descendantAcc->GetParent();
if (parentAcc == this) {
childAccAtOffset = descendantAcc;
break;
@ -626,7 +626,7 @@ nsHyperTextAccessible::DOMPointToHypertextOffset(nsIDOMNode *aNode,
(nsAccUtils::TextLength(descendantAcc) == static_cast<PRInt32>(addTextOffset)) ? 1 : 0;
}
descendantAcc.swap(parentAcc);
descendantAcc = parentAcc;
}
// Loop through, adding offsets until we reach childAccessible

View File

@ -413,7 +413,7 @@ ISimpleDOMNode* nsAccessNodeWrap::MakeAccessNode(nsIDOMNode *node)
return NULL;
ISimpleDOMNode *iNode = NULL;
nsRefPtr<nsAccessible> acc =
nsAccessible *acc =
GetAccService()->GetAccessibleInWeakShell(node, mWeakShell);
if (acc) {
IAccessible *msaaAccessible = nsnull;

View File

@ -145,7 +145,7 @@ nsXULComboboxAccessible::GetDescription(nsAString& aDescription)
menuListElm->GetSelectedItem(getter_AddRefs(focusedOptionItem));
nsCOMPtr<nsIDOMNode> focusedOptionNode(do_QueryInterface(focusedOptionItem));
if (focusedOptionNode) {
nsRefPtr<nsAccessible> focusedOption =
nsAccessible *focusedOption =
GetAccService()->GetAccessibleInWeakShell(focusedOptionNode, mWeakShell);
NS_ENSURE_TRUE(focusedOption, NS_ERROR_FAILURE);

View File

@ -364,11 +364,11 @@ nsXULListboxAccessible::GetCellAt(PRInt32 aRow, PRInt32 aColumn,
nsCOMPtr<nsIDOMNode> itemNode(do_QueryInterface(item));
nsRefPtr<nsAccessible> accessibleRow =
nsAccessible *row =
GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
NS_ENSURE_STATE(accessibleRow);
NS_ENSURE_STATE(row);
nsresult rv = accessibleRow->GetChildAt(aColumn, aAccessibleCell);
nsresult rv = row->GetChildAt(aColumn, aAccessibleCell);
NS_ENSURE_SUCCESS(rv, NS_ERROR_INVALID_ARG);
return NS_OK;
@ -630,7 +630,7 @@ nsXULListboxAccessible::GetSelectedCells(nsIArray **aCells)
for (; index < selectedItemsCount; index++) {
nsCOMPtr<nsIDOMNode> itemNode;
selectedItems->Item(index, getter_AddRefs(itemNode));
nsRefPtr<nsAccessible> item =
nsAccessible *item =
GetAccService()->GetAccessibleInWeakShell(itemNode, mWeakShell);
if (item) {
@ -874,7 +874,7 @@ nsXULListitemAccessible::
/** Inherit the ISupports impl from nsAccessible, we handle nsIAccessibleSelectable */
NS_IMPL_ISUPPORTS_INHERITED0(nsXULListitemAccessible, nsAccessible)
already_AddRefed<nsAccessible>
nsAccessible *
nsXULListitemAccessible::GetListAccessible()
{
if (IsDefunct())
@ -923,10 +923,10 @@ nsXULListitemAccessible::GetNameInternal(nsAString& aName)
nsresult
nsXULListitemAccessible::GetRoleInternal(PRUint32 *aRole)
{
nsRefPtr<nsAccessible> listAcc = GetListAccessible();
NS_ENSURE_STATE(listAcc);
nsAccessible *list = GetListAccessible();
NS_ENSURE_STATE(list);
if (nsAccUtils::Role(listAcc) == nsIAccessibleRole::ROLE_TABLE) {
if (nsAccUtils::Role(list) == nsIAccessibleRole::ROLE_TABLE) {
*aRole = nsIAccessibleRole::ROLE_ROW;
return NS_OK;
}

View File

@ -137,7 +137,7 @@ protected:
/**
* Return listbox accessible for the listitem.
*/
already_AddRefed<nsAccessible> GetListAccessible();
nsAccessible *GetListAccessible();
private:
PRBool mIsCheckbox;

View File

@ -138,7 +138,7 @@ NS_IMETHODIMP nsXULSelectableAccessible::GetSelectedChildren(nsIArray **aChildre
nsCOMPtr<nsIDOMXULSelectControlItemElement> selectedItem;
xulMultiSelect->GetSelectedItem(index, getter_AddRefs(selectedItem));
nsCOMPtr<nsIDOMNode> selectedNode(do_QueryInterface(selectedItem));
nsRefPtr<nsAccessible> selectedAcc =
nsAccessible *selectedAcc =
GetAccService()->GetAccessibleInWeakShell(selectedNode, mWeakShell);
if (selectedAcc)
selectedAccessibles->AppendElement(static_cast<nsIAccessible*>(selectedAcc),
@ -150,10 +150,10 @@ NS_IMETHODIMP nsXULSelectableAccessible::GetSelectedChildren(nsIArray **aChildre
mSelectControl->GetSelectedItem(getter_AddRefs(selectedItem));
nsCOMPtr<nsIDOMNode> selectedNode(do_QueryInterface(selectedItem));
if(selectedNode) {
nsRefPtr<nsAccessible> selectedAcc =
nsAccessible *selectedAcc =
GetAccService()->GetAccessibleInWeakShell(selectedNode, mWeakShell);
if (selectedAcc)
selectedAccessibles->AppendElement(static_cast<nsIAccessible*>(selectedAcc.get()),
selectedAccessibles->AppendElement(static_cast<nsIAccessible*>(selectedAcc),
PR_FALSE);
}
}
@ -187,12 +187,12 @@ NS_IMETHODIMP nsXULSelectableAccessible::RefSelection(PRInt32 aIndex, nsIAccessi
if (!selectedItem)
return NS_ERROR_FAILURE;
nsRefPtr<nsAccessible> selectedAcc =
nsAccessible *selectedAcc =
GetAccService()->GetAccessibleInWeakShell(selectedItem, mWeakShell);
if (!selectedAcc)
return NS_ERROR_FAILURE;
CallQueryInterface(selectedAcc, aAccessible);
NS_ADDREF(*aAccessible = selectedAcc);
return NS_OK;
}

View File

@ -1042,11 +1042,11 @@ nsXULTreeGridCellAccessible::GetColumnHeaderCells(nsIArray **aHeaderCells)
nsCOMPtr<nsIDOMElement> columnElm;
mColumn->GetElement(getter_AddRefs(columnElm));
nsRefPtr<nsAccessible> headerCell =
nsAccessible *headerCell =
GetAccService()->GetAccessibleInWeakShell(columnElm, mWeakShell);
if (headerCell)
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell.get()),
headerCells->AppendElement(static_cast<nsIAccessible*>(headerCell),
PR_FALSE);
NS_ADDREF(*aHeaderCells = headerCells);