2001-12-17 01:21:29 +00:00
|
|
|
/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* ***** BEGIN LICENSE BLOCK *****
|
2004-04-17 21:52:36 +00:00
|
|
|
* Version: MPL 1.1/GPL 2.0/LGPL 2.1
|
2001-12-17 01:21:29 +00:00
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* The contents of this file are subject to the Mozilla Public License Version
|
|
|
|
* 1.1 (the "License"); you may not use this file except in compliance with
|
|
|
|
* the License. You may obtain a copy of the License at
|
|
|
|
* http://www.mozilla.org/MPL/
|
2001-12-17 01:21:29 +00:00
|
|
|
*
|
|
|
|
* Software distributed under the License is distributed on an "AS IS" basis,
|
|
|
|
* WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
|
|
|
|
* for the specific language governing rights and limitations under the
|
|
|
|
* License.
|
|
|
|
*
|
|
|
|
* The Original Code is mozilla.org code.
|
|
|
|
*
|
2004-04-17 21:52:36 +00:00
|
|
|
* The Initial Developer of the Original Code is
|
2001-12-17 01:21:29 +00:00
|
|
|
* Netscape Communications Corporation.
|
|
|
|
* Portions created by the Initial Developer are Copyright (C) 1998
|
|
|
|
* the Initial Developer. All Rights Reserved.
|
|
|
|
*
|
|
|
|
* Contributor(s):
|
2004-04-17 21:52:36 +00:00
|
|
|
* Author: John Gaunt (jgaunt@netscape.com)
|
2001-12-17 01:21:29 +00:00
|
|
|
*
|
|
|
|
* Alternatively, the contents of this file may be used under the terms of
|
2004-04-17 21:52:36 +00:00
|
|
|
* either of the GNU General Public License Version 2 or later (the "GPL"),
|
|
|
|
* or the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
|
2001-12-17 01:21:29 +00:00
|
|
|
* in which case the provisions of the GPL or the LGPL are applicable instead
|
|
|
|
* of those above. If you wish to allow use of your version of this file only
|
|
|
|
* under the terms of either the GPL or the LGPL, and not to allow others to
|
2004-04-17 21:52:36 +00:00
|
|
|
* use your version of this file under the terms of the MPL, indicate your
|
2001-12-17 01:21:29 +00:00
|
|
|
* decision by deleting the provisions above and replace them with the notice
|
|
|
|
* and other provisions required by the GPL or the LGPL. If you do not delete
|
|
|
|
* the provisions above, a recipient may use your version of this file under
|
2004-04-17 21:52:36 +00:00
|
|
|
* the terms of any one of the MPL, the GPL or the LGPL.
|
2001-12-17 01:21:29 +00:00
|
|
|
*
|
|
|
|
* ***** END LICENSE BLOCK ***** */
|
|
|
|
|
|
|
|
#include "nsXULTabAccessible.h"
|
2010-04-27 06:52:03 +00:00
|
|
|
|
|
|
|
#include "nsAccUtils.h"
|
|
|
|
#include "nsRelUtils.h"
|
|
|
|
|
|
|
|
// NOTE: alphabetically ordered
|
2002-07-02 17:39:40 +00:00
|
|
|
#include "nsIDocument.h"
|
2003-04-15 08:45:55 +00:00
|
|
|
#include "nsIFrame.h"
|
2002-07-02 17:39:40 +00:00
|
|
|
#include "nsIDOMDocument.h"
|
2001-12-17 01:21:29 +00:00
|
|
|
#include "nsIDOMXULSelectCntrlEl.h"
|
|
|
|
#include "nsIDOMXULSelectCntrlItemEl.h"
|
|
|
|
|
2010-01-19 04:35:08 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsXULTabAccessible
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
|
|
|
|
nsXULTabAccessible::
|
|
|
|
nsXULTabAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell) :
|
|
|
|
nsAccessibleWrap(aNode, aShell)
|
|
|
|
{
|
2001-12-17 01:21:29 +00:00
|
|
|
}
|
|
|
|
|
2010-01-19 04:35:08 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsXULTabAccessible: nsIAccessible
|
|
|
|
|
2003-07-31 08:09:39 +00:00
|
|
|
NS_IMETHODIMP nsXULTabAccessible::GetNumActions(PRUint8 *_retval)
|
2001-12-17 01:21:29 +00:00
|
|
|
{
|
2006-07-31 04:31:13 +00:00
|
|
|
*_retval = 1;
|
2001-12-17 01:21:29 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** Return the name of our only action */
|
2007-02-25 03:43:20 +00:00
|
|
|
NS_IMETHODIMP nsXULTabAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
|
2001-12-17 01:21:29 +00:00
|
|
|
{
|
2007-02-25 03:43:20 +00:00
|
|
|
if (aIndex == eAction_Switch) {
|
|
|
|
aName.AssignLiteral("switch");
|
2001-12-17 01:21:29 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
return NS_ERROR_INVALID_ARG;
|
|
|
|
}
|
|
|
|
|
2008-10-02 06:49:45 +00:00
|
|
|
/** Tell the tab to do its action */
|
2003-07-31 08:09:39 +00:00
|
|
|
NS_IMETHODIMP nsXULTabAccessible::DoAction(PRUint8 index)
|
2001-12-17 01:21:29 +00:00
|
|
|
{
|
|
|
|
if (index == eAction_Switch) {
|
2004-04-07 16:55:24 +00:00
|
|
|
nsCOMPtr<nsIDOMXULElement> tab(do_QueryInterface(mDOMNode));
|
2001-12-17 01:21:29 +00:00
|
|
|
if ( tab )
|
|
|
|
{
|
2002-06-21 04:41:28 +00:00
|
|
|
tab->Click();
|
2001-12-17 01:21:29 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
return NS_ERROR_FAILURE;
|
|
|
|
}
|
|
|
|
return NS_ERROR_INVALID_ARG;
|
|
|
|
}
|
|
|
|
|
2010-01-19 04:35:08 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsXULTabAccessible: nsAccessible
|
|
|
|
|
2009-03-07 15:38:58 +00:00
|
|
|
nsresult
|
|
|
|
nsXULTabAccessible::GetRoleInternal(PRUint32 *aRole)
|
2001-12-17 01:21:29 +00:00
|
|
|
{
|
2009-03-07 15:38:58 +00:00
|
|
|
*aRole = nsIAccessibleRole::ROLE_PAGETAB;
|
2001-12-17 01:21:29 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2008-11-04 03:37:46 +00:00
|
|
|
nsresult
|
|
|
|
nsXULTabAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
|
2001-12-17 01:21:29 +00:00
|
|
|
{
|
2010-01-19 04:35:08 +00:00
|
|
|
// Possible states: focused, focusable, unavailable(disabled), offscreen.
|
|
|
|
|
2001-12-17 01:21:29 +00:00
|
|
|
// get focus and disable status from base class
|
2010-01-19 04:35:08 +00:00
|
|
|
nsresult rv = nsAccessibleWrap::GetStateInternal(aState, aExtraState);
|
2008-11-27 04:04:05 +00:00
|
|
|
NS_ENSURE_A11Y_SUCCESS(rv, rv);
|
2002-06-21 04:41:28 +00:00
|
|
|
|
|
|
|
// In the past, tabs have been focusable in classic theme
|
|
|
|
// They may be again in the future
|
|
|
|
// Check style for -moz-user-focus: normal to see if it's focusable
|
2007-04-02 15:56:24 +00:00
|
|
|
*aState &= ~nsIAccessibleStates::STATE_FOCUSABLE;
|
2002-06-21 04:41:28 +00:00
|
|
|
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
|
2009-12-24 21:20:05 +00:00
|
|
|
if (content) {
|
|
|
|
nsIFrame *frame = content->GetPrimaryFrame();
|
2002-06-21 04:41:28 +00:00
|
|
|
if (frame) {
|
2003-05-15 03:42:21 +00:00
|
|
|
const nsStyleUserInterface* ui = frame->GetStyleUserInterface();
|
2002-06-21 04:41:28 +00:00
|
|
|
if (ui->mUserFocus == NS_STYLE_USER_FOCUS_NORMAL)
|
2007-04-02 15:56:24 +00:00
|
|
|
*aState |= nsIAccessibleStates::STATE_FOCUSABLE;
|
2002-06-21 04:41:28 +00:00
|
|
|
}
|
|
|
|
}
|
2005-02-01 03:43:37 +00:00
|
|
|
// Check whether the tab is selected
|
2007-04-02 15:56:24 +00:00
|
|
|
*aState |= nsIAccessibleStates::STATE_SELECTABLE;
|
|
|
|
*aState &= ~nsIAccessibleStates::STATE_SELECTED;
|
2005-02-01 03:43:37 +00:00
|
|
|
nsCOMPtr<nsIDOMXULSelectControlItemElement> tab(do_QueryInterface(mDOMNode));
|
|
|
|
if (tab) {
|
|
|
|
PRBool selected = PR_FALSE;
|
|
|
|
if (NS_SUCCEEDED(tab->GetSelected(&selected)) && selected)
|
2007-04-02 15:56:24 +00:00
|
|
|
*aState |= nsIAccessibleStates::STATE_SELECTED;
|
2005-02-01 03:43:37 +00:00
|
|
|
}
|
2001-12-17 01:21:29 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2010-01-19 04:35:08 +00:00
|
|
|
// nsIAccessible
|
2007-11-12 06:02:42 +00:00
|
|
|
NS_IMETHODIMP
|
2009-02-10 10:03:30 +00:00
|
|
|
nsXULTabAccessible::GetRelationByType(PRUint32 aRelationType,
|
|
|
|
nsIAccessibleRelation **aRelation)
|
2007-11-12 06:02:42 +00:00
|
|
|
{
|
2010-01-19 04:35:08 +00:00
|
|
|
nsresult rv = nsAccessibleWrap::GetRelationByType(aRelationType,
|
2009-02-10 10:03:30 +00:00
|
|
|
aRelation);
|
2007-11-12 06:02:42 +00:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2009-02-10 10:03:30 +00:00
|
|
|
if (aRelationType != nsIAccessibleRelation::RELATION_LABEL_FOR)
|
2007-11-12 06:02:42 +00:00
|
|
|
return NS_OK;
|
|
|
|
|
|
|
|
// Expose 'LABEL_FOR' relation on tab accessible for tabpanel accessible.
|
|
|
|
// XXX: It makes sense to require the interface from xul:tab to get linked
|
|
|
|
// tabpanel element.
|
|
|
|
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
|
|
|
|
|
|
|
|
// Check whether tab and tabpanel are related by 'linkedPanel' attribute on
|
|
|
|
// xul:tab element.
|
2009-02-10 10:03:30 +00:00
|
|
|
rv = nsRelUtils::AddTargetFromIDRefAttr(aRelationType, aRelation, content,
|
2009-08-10 14:54:22 +00:00
|
|
|
nsAccessibilityAtoms::linkedPanel,
|
|
|
|
PR_TRUE);
|
2009-02-10 10:03:30 +00:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
|
|
|
if (rv != NS_OK_NO_RELATION_TARGET)
|
|
|
|
return NS_OK;
|
2007-11-12 06:02:42 +00:00
|
|
|
|
|
|
|
// If there is no 'linkedPanel' attribute on xul:tab element then we
|
|
|
|
// assume tab and tabpanels are related 1 to 1. We follow algorithm from
|
|
|
|
// the setter 'selectedIndex' of tabbox.xml#tabs binding.
|
|
|
|
|
2010-01-11 14:14:06 +00:00
|
|
|
nsAccessible* tabsAcc = GetParent();
|
2008-10-17 10:10:43 +00:00
|
|
|
NS_ENSURE_TRUE(nsAccUtils::Role(tabsAcc) == nsIAccessibleRole::ROLE_PAGETABLIST,
|
2007-11-12 06:02:42 +00:00
|
|
|
NS_ERROR_FAILURE);
|
|
|
|
|
|
|
|
PRInt32 tabIndex = -1;
|
|
|
|
|
2010-01-11 14:14:06 +00:00
|
|
|
PRInt32 childCount = tabsAcc->GetChildCount();
|
|
|
|
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
|
|
|
nsAccessible* childAcc = tabsAcc->GetChildAt(childIdx);
|
2008-10-17 10:10:43 +00:00
|
|
|
if (nsAccUtils::Role(childAcc) == nsIAccessibleRole::ROLE_PAGETAB)
|
2007-11-12 06:02:42 +00:00
|
|
|
tabIndex++;
|
|
|
|
|
|
|
|
if (childAcc == this)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
2010-01-11 14:14:06 +00:00
|
|
|
nsAccessible* tabBoxAcc = tabsAcc->GetParent();
|
2008-10-17 10:10:43 +00:00
|
|
|
NS_ENSURE_TRUE(nsAccUtils::Role(tabBoxAcc) == nsIAccessibleRole::ROLE_PANE,
|
2007-11-12 06:02:42 +00:00
|
|
|
NS_ERROR_FAILURE);
|
|
|
|
|
2010-01-11 14:14:06 +00:00
|
|
|
childCount = tabBoxAcc->GetChildCount();
|
|
|
|
for (PRInt32 childIdx = 0; childIdx < childCount; childIdx++) {
|
|
|
|
nsAccessible* childAcc = tabBoxAcc->GetChildAt(childIdx);
|
2008-10-17 10:10:43 +00:00
|
|
|
if (nsAccUtils::Role(childAcc) == nsIAccessibleRole::ROLE_PROPERTYPAGE) {
|
2009-02-10 10:03:30 +00:00
|
|
|
if (tabIndex == 0)
|
|
|
|
return nsRelUtils::AddTarget(aRelationType, aRelation, childAcc);
|
2007-11-12 06:02:42 +00:00
|
|
|
|
|
|
|
tabIndex--;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2010-01-06 10:36:50 +00:00
|
|
|
void
|
|
|
|
nsXULTabAccessible::GetPositionAndSizeInternal(PRInt32 *aPosInSet,
|
|
|
|
PRInt32 *aSetSize)
|
2007-03-27 12:17:11 +00:00
|
|
|
{
|
2010-01-06 10:36:50 +00:00
|
|
|
nsAccUtils::GetPositionAndSizeForXULSelectControlItem(mDOMNode, aPosInSet,
|
|
|
|
aSetSize);
|
|
|
|
}
|
2007-03-27 12:17:11 +00:00
|
|
|
|
|
|
|
|
2010-01-06 10:36:50 +00:00
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsXULTabBoxAccessible
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
2007-03-27 12:17:11 +00:00
|
|
|
|
2001-12-17 01:21:29 +00:00
|
|
|
/**
|
|
|
|
* XUL TabBox
|
|
|
|
* to facilitate naming of the tabPanels object we will give this the name
|
|
|
|
* of the selected tab in the tabs object.
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** Constructor */
|
|
|
|
nsXULTabBoxAccessible::nsXULTabBoxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
|
2003-04-01 20:02:51 +00:00
|
|
|
nsAccessibleWrap(aNode, aShell)
|
2001-12-17 01:21:29 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/** We are a window*/
|
2009-03-07 15:38:58 +00:00
|
|
|
nsresult
|
|
|
|
nsXULTabBoxAccessible::GetRoleInternal(PRUint32 *aRole)
|
2001-12-17 01:21:29 +00:00
|
|
|
{
|
2009-03-07 15:38:58 +00:00
|
|
|
*aRole = nsIAccessibleRole::ROLE_PANE;
|
2001-12-17 01:21:29 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* XUL Tabs - the s really stands for strip. this is a collection of tab objects
|
|
|
|
*/
|
|
|
|
|
|
|
|
/** Constructor */
|
|
|
|
nsXULTabsAccessible::nsXULTabsAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
|
2005-02-01 03:43:37 +00:00
|
|
|
nsXULSelectableAccessible(aNode, aShell)
|
2001-12-17 01:21:29 +00:00
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
/** We are a Page Tab List */
|
2009-03-07 15:38:58 +00:00
|
|
|
nsresult
|
|
|
|
nsXULTabsAccessible::GetRoleInternal(PRUint32 *aRole)
|
2001-12-17 01:21:29 +00:00
|
|
|
{
|
2009-03-07 15:38:58 +00:00
|
|
|
*aRole = nsIAccessibleRole::ROLE_PAGETABLIST;
|
2001-12-17 01:21:29 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2003-06-02 08:32:46 +00:00
|
|
|
|
|
|
|
/** no actions */
|
2003-07-31 08:09:39 +00:00
|
|
|
NS_IMETHODIMP nsXULTabsAccessible::GetNumActions(PRUint8 *_retval)
|
2003-06-02 08:32:46 +00:00
|
|
|
{
|
2006-07-31 04:31:13 +00:00
|
|
|
*_retval = 0;
|
2003-06-02 08:32:46 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
/** no value */
|
2003-07-31 08:09:39 +00:00
|
|
|
NS_IMETHODIMP nsXULTabsAccessible::GetValue(nsAString& _retval)
|
2003-06-02 08:32:46 +00:00
|
|
|
{
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
2008-10-10 12:26:55 +00:00
|
|
|
nsresult
|
|
|
|
nsXULTabsAccessible::GetNameInternal(nsAString& aName)
|
2003-06-02 08:32:46 +00:00
|
|
|
{
|
2008-10-10 12:26:55 +00:00
|
|
|
// no name
|
2003-06-02 08:32:46 +00:00
|
|
|
return NS_OK;
|
|
|
|
}
|
2007-11-12 06:02:42 +00:00
|
|
|
|
|
|
|
////////////////////////////////////////////////////////////////////////////////
|
|
|
|
// nsXULTabpanelAccessible
|
|
|
|
|
|
|
|
nsXULTabpanelAccessible::
|
|
|
|
nsXULTabpanelAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
|
|
|
|
nsAccessibleWrap(aNode, aShell)
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
2009-03-07 15:38:58 +00:00
|
|
|
nsresult
|
|
|
|
nsXULTabpanelAccessible::GetRoleInternal(PRUint32 *aRole)
|
2007-11-12 06:02:42 +00:00
|
|
|
{
|
|
|
|
*aRole = nsIAccessibleRole::ROLE_PROPERTYPAGE;
|
|
|
|
return NS_OK;
|
|
|
|
}
|
|
|
|
|
|
|
|
NS_IMETHODIMP
|
2009-02-10 10:03:30 +00:00
|
|
|
nsXULTabpanelAccessible::GetRelationByType(PRUint32 aRelationType,
|
|
|
|
nsIAccessibleRelation **aRelation)
|
2007-11-12 06:02:42 +00:00
|
|
|
{
|
2009-02-10 10:03:30 +00:00
|
|
|
nsresult rv = nsAccessibleWrap::GetRelationByType(aRelationType, aRelation);
|
2007-11-12 06:02:42 +00:00
|
|
|
NS_ENSURE_SUCCESS(rv, rv);
|
|
|
|
|
2009-02-10 10:03:30 +00:00
|
|
|
if (aRelationType != nsIAccessibleRelation::RELATION_LABELLED_BY)
|
2007-11-12 06:02:42 +00:00
|
|
|
return NS_OK;
|
|
|
|
|
|
|
|
// Expose 'LABELLED_BY' relation on tabpanel accessible for tab accessible.
|
|
|
|
nsCOMPtr<nsIAccessible> tabBoxAcc;
|
|
|
|
GetParent(getter_AddRefs(tabBoxAcc));
|
2008-10-17 10:10:43 +00:00
|
|
|
NS_ENSURE_TRUE(nsAccUtils::Role(tabBoxAcc) == nsIAccessibleRole::ROLE_PANE,
|
2007-11-12 06:02:42 +00:00
|
|
|
NS_ERROR_FAILURE);
|
|
|
|
|
|
|
|
PRInt32 tabpanelIndex = -1;
|
|
|
|
nsCOMPtr<nsIAccessible> tabsAcc;
|
|
|
|
|
|
|
|
PRBool isTabpanelFound = PR_FALSE;
|
|
|
|
nsCOMPtr<nsIAccessible> childAcc;
|
|
|
|
tabBoxAcc->GetFirstChild(getter_AddRefs(childAcc));
|
|
|
|
while (childAcc && (!tabsAcc || !isTabpanelFound)) {
|
2008-10-17 10:10:43 +00:00
|
|
|
if (nsAccUtils::Role(childAcc) == nsIAccessibleRole::ROLE_PAGETABLIST)
|
2007-11-12 06:02:42 +00:00
|
|
|
tabsAcc = childAcc;
|
|
|
|
|
|
|
|
if (!isTabpanelFound &&
|
2008-10-17 10:10:43 +00:00
|
|
|
nsAccUtils::Role(childAcc) == nsIAccessibleRole::ROLE_PROPERTYPAGE)
|
2007-11-12 06:02:42 +00:00
|
|
|
tabpanelIndex++;
|
|
|
|
|
|
|
|
if (childAcc == this)
|
|
|
|
isTabpanelFound = PR_TRUE;
|
|
|
|
|
|
|
|
nsCOMPtr<nsIAccessible> acc;
|
|
|
|
childAcc->GetNextSibling(getter_AddRefs(acc));
|
|
|
|
childAcc.swap(acc);
|
|
|
|
}
|
|
|
|
|
|
|
|
if (!tabsAcc || tabpanelIndex == -1)
|
|
|
|
return NS_OK;
|
|
|
|
|
|
|
|
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
|
|
|
|
nsIAtom *atomID = content->GetID();
|
|
|
|
|
|
|
|
nsCOMPtr<nsIAccessible> foundTabAcc;
|
|
|
|
tabsAcc->GetFirstChild(getter_AddRefs(childAcc));
|
|
|
|
while (childAcc) {
|
2008-10-17 10:10:43 +00:00
|
|
|
if (nsAccUtils::Role(childAcc) == nsIAccessibleRole::ROLE_PAGETAB) {
|
2007-11-12 06:02:42 +00:00
|
|
|
if (atomID) {
|
|
|
|
nsCOMPtr<nsIAccessNode> tabAccNode(do_QueryInterface(childAcc));
|
|
|
|
nsCOMPtr<nsIDOMNode> tabNode;
|
|
|
|
tabAccNode->GetDOMNode(getter_AddRefs(tabNode));
|
|
|
|
nsCOMPtr<nsIContent> tabContent(do_QueryInterface(tabNode));
|
|
|
|
NS_ENSURE_TRUE(tabContent, NS_ERROR_FAILURE);
|
|
|
|
|
|
|
|
if (tabContent->AttrValueIs(kNameSpaceID_None,
|
|
|
|
nsAccessibilityAtoms::linkedPanel, atomID,
|
|
|
|
eCaseMatters)) {
|
2009-02-10 10:03:30 +00:00
|
|
|
return nsRelUtils::AddTarget(aRelationType, aRelation, childAcc);
|
2007-11-12 06:02:42 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
if (tabpanelIndex == 0) {
|
|
|
|
foundTabAcc = childAcc;
|
|
|
|
if (!atomID)
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
|
|
|
|
tabpanelIndex--;
|
|
|
|
}
|
|
|
|
|
|
|
|
nsCOMPtr<nsIAccessible> acc;
|
|
|
|
childAcc->GetNextSibling(getter_AddRefs(acc));
|
|
|
|
childAcc.swap(acc);
|
|
|
|
}
|
|
|
|
|
2009-02-27 11:01:33 +00:00
|
|
|
return nsRelUtils::AddTarget(aRelationType, aRelation, foundTabAcc);
|
2007-11-12 06:02:42 +00:00
|
|
|
}
|
|
|
|
|