Merge m-c to tm.

This commit is contained in:
Robert Sayre 2009-03-10 16:49:12 -04:00
commit ae096d4187
530 changed files with 12445 additions and 6489 deletions

View File

@ -190,18 +190,19 @@ SYMBOL_INDEX_NAME = \
buildsymbols:
ifdef MOZ_CRASHREPORTER
echo building symbol store
mkdir -p $(DIST)/crashreporter-symbols/$(BUILDID)
$(RM) -rf $(DIST)/crashreporter-symbols
$(NSINSTALL) -D $(DIST)/crashreporter-symbols
$(PYTHON) $(topsrcdir)/toolkit/crashreporter/tools/symbolstore.py \
$(MAKE_SYM_STORE_ARGS) \
$(foreach dir,$(SYM_STORE_SOURCE_DIRS),-s $(dir)) \
$(DUMP_SYMS_BIN) \
$(DIST)/crashreporter-symbols/$(BUILDID) \
$(DIST)/crashreporter-symbols \
$(MAKE_SYM_STORE_PATH) > \
$(DIST)/crashreporter-symbols/$(BUILDID)/$(SYMBOL_INDEX_NAME)
$(DIST)/crashreporter-symbols/$(SYMBOL_INDEX_NAME)
echo packing symbols
mkdir -p $(topsrcdir)/../$(BUILDID)
cd $(DIST)/crashreporter-symbols/$(BUILDID) && \
zip -r9D ../../$(SYMBOL_ARCHIVE_BASENAME).zip .
cd $(DIST)/crashreporter-symbols && \
zip -r9D ../$(SYMBOL_ARCHIVE_BASENAME).zip .
endif # MOZ_CRASHREPORTER
uploadsymbols:

View File

@ -58,7 +58,7 @@ interface nsIAccessibleRelation;
*
* @status UNDER_REVIEW
*/
[scriptable, uuid(76c72c70-2c4b-4fce-8e75-b121db024333)]
[scriptable, uuid(c81d8f8c-8585-4094-bc7c-71dd01494906)]
interface nsIAccessible : nsISupports
{
/**
@ -147,20 +147,13 @@ interface nsIAccessible : nsISupports
nsIDOMDOMStringList getKeyBindings(in PRUint8 aActionIndex);
/**
* Natural enumerated accessible role for the associated element.
* The values depend on platform because of variations.
* See the ROLE_* constants defined in nsIAccessibleRole.
* This does not take into account role attribute as the finalRole does.
* Enumerated accessible role (see the constants defined in nsIAccessibleRole).
*
* @note The values might depend on platform because of variations. Widgets
* can use ARIA role attribute to force the final role.
*/
readonly attribute unsigned long role;
/**
* Enumerated accessible role. The values depend on platform because of variations.
* See the ROLE_* constants defined in nsIAccessibleRole.
* Widgets can use role attribute to force the final role
*/
readonly attribute unsigned long finalRole;
/**
* Accessible states -- bit fields which describe boolean properties of node.
* Many states are only valid given a certain role attribute that supports

View File

@ -777,7 +777,7 @@ getRoleCB(AtkObject *aAtkObj)
if (aAtkObj->role == ATK_ROLE_INVALID) {
PRUint32 accRole, atkRole;
nsresult rv = accWrap->GetFinalRole(&accRole);
nsresult rv = accWrap->GetRole(&accRole);
NS_ENSURE_SUCCESS(rv, ATK_ROLE_INVALID);
atkRole = atkRoleMap[accRole]; // map to the actual value

View File

@ -122,8 +122,7 @@ getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
nsCOMPtr<nsIAccessible> parentAccessible;
accWrap->GetParent(getter_AddRefs(parentAccessible));
if (parentAccessible) {
PRUint32 role;
parentAccessible->GetRole(&role);
PRUint32 role = nsAccUtils::RoleInternal(parentAccessible);
if (role == ATK_ROLE_MENU_BAR) {
//it is topmenu, change from "Alt+f" to "f;<Alt>f"
@ -149,8 +148,7 @@ getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
nsCOMPtr<nsIAccessible> tempAcc = grandParentAcc;
tempAcc->GetParent(getter_AddRefs(grandParentAcc));
if (grandParentAcc)
grandParentAcc->GetRole(&role);
role = nsAccUtils::RoleInternal(grandParentAcc);
}
allKeyBinding = accessKey + NS_LITERAL_STRING(";<Alt>") +
allKey;

View File

@ -79,7 +79,7 @@ void ConvertTexttoAsterisks(nsAccessibleWrap* accWrap, nsAString& aString)
{
// convert each char to "*" when it's "password text"
PRUint32 accRole;
accWrap->GetRole(&accRole);
accWrap->GetRoleInternal(&accRole);
if (static_cast<AtkRole>(accRole) == ATK_ROLE_PASSWORD_TEXT) {
for (PRUint32 i = 0; i < aString.Length(); i++)
aString.Replace(i, 1, NS_LITERAL_STRING("*"));
@ -187,7 +187,7 @@ getCharacterAtOffsetCB(AtkText *aText, gint aOffset)
// convert char to "*" when it's "password text"
PRUint32 accRole;
accWrap->GetRole(&accRole);
accWrap->GetRoleInternal(&accRole);
if (static_cast<AtkRole>(accRole) == ATK_ROLE_PASSWORD_TEXT) {
uniChar = '*';
}

View File

@ -625,34 +625,34 @@ nsStateMapEntry nsARIAMap::gWAIUnivStateMap[] = {
* @note ARIA attributes that don't have any flags are not included here
*/
nsAttributeCharacteristics nsARIAMap::gWAIUnivAttrMap[] = {
{&nsAccessibilityAtoms::aria_activedescendant, ATTR_EXPOSEOBJ },
{&nsAccessibilityAtoms::aria_activedescendant, ATTR_BYPASSOBJ },
{&nsAccessibilityAtoms::aria_atomic, ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_busy, ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_checked, ATTR_EXPOSEOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_controls, ATTR_EXPOSEOBJ },
{&nsAccessibilityAtoms::aria_describedby, ATTR_EXPOSEOBJ },
{&nsAccessibilityAtoms::aria_disabled, ATTR_EXPOSEOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_checked, ATTR_BYPASSOBJ | ATTR_VALTOKEN }, /* exposes checkable obj attr */
{&nsAccessibilityAtoms::aria_controls, ATTR_BYPASSOBJ },
{&nsAccessibilityAtoms::aria_describedby, ATTR_BYPASSOBJ },
{&nsAccessibilityAtoms::aria_disabled, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_dropeffect, ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_expanded, ATTR_EXPOSEOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_flowto, ATTR_EXPOSEOBJ },
{&nsAccessibilityAtoms::aria_expanded, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_flowto, ATTR_BYPASSOBJ },
{&nsAccessibilityAtoms::aria_grabbed, ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_haspopup, ATTR_EXPOSEOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_invalid, ATTR_EXPOSEOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_labelledby, ATTR_EXPOSEOBJ },
{&nsAccessibilityAtoms::aria_haspopup, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_invalid, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_labelledby, ATTR_BYPASSOBJ },
{&nsAccessibilityAtoms::aria_live, ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_multiline, ATTR_EXPOSEOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_multiselectable, ATTR_EXPOSEOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_owns, ATTR_EXPOSEOBJ },
{&nsAccessibilityAtoms::aria_pressed, ATTR_EXPOSEOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_readonly, ATTR_EXPOSEOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_relevant, ATTR_EXPOSEOBJ },
{&nsAccessibilityAtoms::aria_required, ATTR_EXPOSEOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_selected, ATTR_EXPOSEOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_multiline, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_multiselectable, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_owns, ATTR_BYPASSOBJ },
{&nsAccessibilityAtoms::aria_pressed, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_readonly, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_relevant, ATTR_BYPASSOBJ },
{&nsAccessibilityAtoms::aria_required, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_selected, ATTR_BYPASSOBJ | ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_sort, ATTR_VALTOKEN },
{&nsAccessibilityAtoms::aria_valuenow, ATTR_EXPOSEOBJ },
{&nsAccessibilityAtoms::aria_valuemin, ATTR_EXPOSEOBJ },
{&nsAccessibilityAtoms::aria_valuemax, ATTR_EXPOSEOBJ },
{&nsAccessibilityAtoms::aria_valuetext, ATTR_EXPOSEOBJ }
{&nsAccessibilityAtoms::aria_valuenow, ATTR_BYPASSOBJ },
{&nsAccessibilityAtoms::aria_valuemin, ATTR_BYPASSOBJ },
{&nsAccessibilityAtoms::aria_valuemax, ATTR_BYPASSOBJ },
{&nsAccessibilityAtoms::aria_valuetext, ATTR_BYPASSOBJ }
};
PRUint32 nsARIAMap::gWAIUnivAttrMapLength = NS_ARRAY_LENGTH(nsARIAMap::gWAIUnivAttrMap);

View File

@ -73,11 +73,12 @@ enum ELiveAttrRule
// ARIA attribute characteristic masks, grow as needed
/**
* This mask indicates the attribute should be exposed as an object attribute,
* used to expose semantics not traditionally found in a11y APIs.
* (See for example usage in nsAccessible::GetAttributes)
* This mask indicates the attribute should not be exposed as an object
* attribute via the catch-all logic in nsAccessible::GetAttributes.
* This means it either isn't mean't to be exposed as an object attribute, or
* that it should, but is already handled in other code.
*/
const PRUint8 ATTR_EXPOSEOBJ = 0x0001;
const PRUint8 ATTR_BYPASSOBJ = 0x0001;
/**
* This mask indicates the attribute is expected to have an NMTOKEN or bool value.

View File

@ -380,8 +380,7 @@ nsAccUtils::GetAncestorWithRole(nsIAccessible *aDescendant, PRUint32 aRole)
nsCOMPtr<nsIAccessible> parentAccessible = aDescendant, testRoleAccessible;
while (NS_SUCCEEDED(parentAccessible->GetParent(getter_AddRefs(testRoleAccessible))) &&
testRoleAccessible) {
PRUint32 testRole;
testRoleAccessible->GetFinalRole(&testRole);
PRUint32 testRole = nsAccUtils::Role(testRoleAccessible);
if (testRole == aRole) {
nsIAccessible *returnAccessible = testRoleAccessible;
NS_ADDREF(returnAccessible);
@ -419,8 +418,7 @@ nsAccUtils::GetARIATreeItemParent(nsIAccessible *aStartTreeItem,
if (!accessNode) {
break; // Reached top of tree, no higher level found
}
PRUint32 role;
currentAccessible->GetFinalRole(&role);
PRUint32 role = nsAccUtils::Role(currentAccessible);
if (role != nsIAccessibleRole::ROLE_OUTLINEITEM)
continue;
nsCOMPtr<nsIDOMNode> treeItemNode;
@ -448,8 +446,7 @@ nsAccUtils::GetARIATreeItemParent(nsIAccessible *aStartTreeItem,
aStartTreeItem->GetParent(getter_AddRefs(parentAccessible));
if (!parentAccessible)
return;
PRUint32 role;
parentAccessible->GetFinalRole(&role);
PRUint32 role = nsAccUtils::Role(parentAccessible);
if (role != nsIAccessibleRole::ROLE_GROUPING) {
NS_ADDREF(*aTreeItemParentResult = parentAccessible);
return; // The container for the tree items
@ -458,7 +455,7 @@ nsAccUtils::GetARIATreeItemParent(nsIAccessible *aStartTreeItem,
parentAccessible->GetPreviousSibling(getter_AddRefs(prevAccessible));
if (!prevAccessible)
return;
prevAccessible->GetFinalRole(&role);
role = nsAccUtils::Role(prevAccessible);
if (role == nsIAccessibleRole::ROLE_TEXT_LEAF) {
// XXX Sometimes an empty text accessible is in the hierarchy here,
// although the text does not appear to be rendered, GetRenderedText() says that it is
@ -467,7 +464,7 @@ nsAccUtils::GetARIATreeItemParent(nsIAccessible *aStartTreeItem,
tempAccessible->GetPreviousSibling(getter_AddRefs(prevAccessible));
if (!prevAccessible)
return;
prevAccessible->GetFinalRole(&role);
role = nsAccUtils::Role(prevAccessible);
}
if (role == nsIAccessibleRole::ROLE_OUTLINEITEM) {
// Previous sibling of parent group is a tree item -- this is the conceptual tree item parent
@ -676,6 +673,23 @@ nsAccUtils::GetRoleMapEntry(nsIDOMNode *aNode)
return &nsARIAMap::gLandmarkRoleMap;
}
PRUint32
nsAccUtils::RoleInternal(nsIAccessible *aAcc)
{
PRUint32 role = nsIAccessibleRole::ROLE_NOTHING;
if (aAcc) {
nsAccessible* accessible = nsnull;
CallQueryInterface(aAcc, &accessible);
if (accessible) {
accessible->GetRoleInternal(&role);
NS_RELEASE(accessible);
}
}
return role;
}
PRUint8
nsAccUtils::GetAttributeCharacteristics(nsIAtom* aAtom)
{
@ -815,8 +829,8 @@ nsAccUtils::GetMultiSelectFor(nsIDOMNode *aNode)
while (0 == (state & nsIAccessibleStates::STATE_MULTISELECTABLE)) {
nsIAccessible *current = accessible;
current->GetParent(getter_AddRefs(accessible));
if (!accessible || (NS_SUCCEEDED(accessible->GetFinalRole(&containerRole)) &&
containerRole == nsIAccessibleRole::ROLE_PANE)) {
if (!accessible ||
nsAccUtils::Role(accessible) == nsIAccessibleRole::ROLE_PANE) {
return nsnull;
}
state = State(accessible);

View File

@ -244,11 +244,16 @@ public:
{
PRUint32 role = nsIAccessibleRole::ROLE_NOTHING;
if (aAcc)
aAcc->GetFinalRole(&role);
aAcc->GetRole(&role);
return role;
}
/**
* Return the role from native markup of the given accessible.
*/
static PRUint32 RoleInternal(nsIAccessible *aAcc);
/**
* Return the state for the given accessible.
*/

View File

@ -1193,7 +1193,9 @@ nsAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
return NS_OK;
// Get direct child containing the deepest child at the given point.
nsCOMPtr<nsIAccessible> parent, accessible(*aAccessible);
nsCOMPtr<nsIAccessible> parent, accessible;
accessible.swap(*aAccessible);
while (PR_TRUE) {
accessible->GetParent(getter_AddRefs(parent));
if (!parent) {
@ -1586,7 +1588,8 @@ nsAccessible::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
return obsService->NotifyObservers(aEvent, NS_ACCESSIBLE_EVENT_TOPIC, nsnull);
}
NS_IMETHODIMP nsAccessible::GetFinalRole(PRUint32 *aRole)
NS_IMETHODIMP
nsAccessible::GetRole(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_NOTHING;
@ -1643,7 +1646,10 @@ NS_IMETHODIMP nsAccessible::GetFinalRole(PRUint32 *aRole)
return NS_OK;
}
}
return mDOMNode ? GetRole(aRole) : NS_ERROR_FAILURE; // Node already shut down
return mDOMNode ?
GetRoleInternal(aRole) :
NS_ERROR_FAILURE; // Node already shut down
}
NS_IMETHODIMP
@ -1717,8 +1723,8 @@ nsAccessible::GetAttributes(nsIPersistentProperties **aAttributes)
if (PL_strncmp(attrStr, "aria-", 5))
continue; // Not ARIA
PRUint8 attrFlags = nsAccUtils::GetAttributeCharacteristics(attrAtom);
if (attrFlags & ATTR_EXPOSEOBJ)
continue; // No need to expose obj attribute -- will be exposed some other way
if (attrFlags & ATTR_BYPASSOBJ)
continue; // No need to handle exposing as obj attribute here
if ((attrFlags & ATTR_VALTOKEN) &&
!nsAccUtils::HasDefinedARIAToken(content, attrAtom))
continue; // only expose token based attributes if they are defined
@ -1894,7 +1900,8 @@ PRBool nsAccessible::MappedAttrState(nsIContent *aContent, PRUint32 *aStateInOut
if (aContent->GetAttr(kNameSpaceID_None, *aStateMapEntry->attributeName, attribValue)) {
if (aStateMapEntry->attributeValue == kBoolState) {
// No attribute value map specified in state map entry indicates state cleared
if (attribValue.EqualsLiteral("false")) {
if (attribValue.EqualsLiteral("false") ||
attribValue.EqualsLiteral("mixed")) {
*aStateInOut &= ~aStateMapEntry->state;
}
else {
@ -1987,7 +1994,7 @@ nsAccessible::GetState(PRUint32 *aState, PRUint32 *aExtraState)
}
PRUint32 role;
rv = GetFinalRole(&role);
rv = GetRole(&role);
NS_ENSURE_SUCCESS(rv, rv);
if (role == nsIAccessibleRole::ROLE_ENTRY ||
@ -2244,9 +2251,9 @@ nsAccessible::GetKeyBindings(PRUint8 aActionIndex,
}
/* unsigned long getRole (); */
NS_IMETHODIMP nsAccessible::GetRole(PRUint32 *aRole)
nsresult
nsAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_NOTHING;
if (IsDefunct())
@ -2304,6 +2311,8 @@ nsAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
case eCheckUncheckAction:
if (states & nsIAccessibleStates::STATE_CHECKED)
aName.AssignLiteral("uncheck");
else if (states & nsIAccessibleStates::STATE_MIXED)
aName.AssignLiteral("cycle");
else
aName.AssignLiteral("check");
return NS_OK;

View File

@ -157,6 +157,14 @@ public:
*/
virtual nsresult GetNameInternal(nsAString& aName);
/**
* Returns enumerated accessible role from native markup (see constants in
* nsIAccessibleRole). Doesn't take into account ARIA roles.
*
* @param aRole [out] accessible role.
*/
virtual nsresult GetRoleInternal(PRUint32 *aRole);
/**
* Return the state of accessible that doesn't take into account ARIA states.
* Use nsIAccessible::state to get all states for accessible. If

View File

@ -130,17 +130,17 @@ nsApplicationAccessible::GetName(nsAString& aName)
return NS_OK;
}
NS_IMETHODIMP
nsApplicationAccessible::GetRole(PRUint32 *aRole)
nsresult
nsApplicationAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_APP_ROOT;
return NS_OK;
}
NS_IMETHODIMP
nsApplicationAccessible::GetFinalRole(PRUint32 *aFinalRole)
nsApplicationAccessible::GetRole(PRUint32 *aRole)
{
return GetRole(aFinalRole);
return GetRoleInternal(aRole);
}
nsresult

View File

@ -72,7 +72,6 @@ public:
// nsIAccessible
NS_IMETHOD GetName(nsAString & aName);
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetFinalRole(PRUint32 *aFinalRole);
NS_IMETHOD GetParent(nsIAccessible * *aParent);
NS_IMETHOD GetNextSibling(nsIAccessible * *aNextSibling);
NS_IMETHOD GetPreviousSibling(nsIAccessible **aPreviousSibling);
@ -80,6 +79,7 @@ public:
NS_IMETHOD GetChildAt(PRInt32 aChildNum, nsIAccessible **aChild);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
// nsApplicationAccessible

View File

@ -319,3 +319,10 @@ nsEnumRoleAccessible::nsEnumRoleAccessible(nsIDOMNode* aNode, nsIWeakReference*
}
NS_IMPL_ISUPPORTS_INHERITED0(nsEnumRoleAccessible, nsAccessible)
nsresult
nsEnumRoleAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = mRole;
return NS_OK;
}

View File

@ -123,8 +123,11 @@ class nsEnumRoleAccessible : public nsAccessibleWrap
public:
nsEnumRoleAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell, PRUint32 aRole);
virtual ~nsEnumRoleAccessible() { }
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHODIMP GetRole(PRUint32 *aRole) { *aRole = mRole; return NS_OK; }
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
protected:
PRUint32 mRole;

View File

@ -198,7 +198,8 @@ nsDocAccessible::GetName(nsAString& aName)
return rv;
}
NS_IMETHODIMP nsDocAccessible::GetRole(PRUint32 *aRole)
nsresult
nsDocAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_PANE; // Fall back

View File

@ -75,7 +75,7 @@ class nsDocAccessible : public nsHyperTextAccessibleWrap,
nsDocAccessible(nsIDOMNode *aNode, nsIWeakReference* aShell);
virtual ~nsDocAccessible();
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsIAccessible
NS_IMETHOD SetRoleMapEntry(nsRoleMapEntry* aRoleMapEntry);
NS_IMETHOD GetName(nsAString& aName);
NS_IMETHOD GetDescription(nsAString& aDescription);
@ -101,6 +101,7 @@ class nsDocAccessible : public nsHyperTextAccessibleWrap,
virtual nsIFrame* GetFrame();
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
// nsIAccessibleText

View File

@ -83,13 +83,10 @@ NS_IMETHODIMP nsRadioButtonAccessible::DoAction(PRUint8 aIndex)
return NS_ERROR_INVALID_ARG;
}
/**
*
*/
NS_IMETHODIMP nsRadioButtonAccessible::GetRole(PRUint32 *_retval)
nsresult
nsRadioButtonAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_RADIOBUTTON;
*aRole = nsIAccessibleRole::ROLE_RADIOBUTTON;
return NS_OK;
}

View File

@ -51,10 +51,15 @@ class nsRadioButtonAccessible : public nsFormControlAccessible
public:
nsRadioButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetRole(PRUint32 *_retval);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
enum { eAction_Click = 0 };
};

View File

@ -53,7 +53,8 @@ nsOuterDocAccessible::nsOuterDocAccessible(nsIDOMNode* aNode,
}
/* unsigned long getRole (); */
NS_IMETHODIMP nsOuterDocAccessible::GetRole(PRUint32 *aRole)
nsresult
nsOuterDocAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_INTERNAL_FRAME;
return NS_OK;

View File

@ -55,8 +55,6 @@ public:
nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIAccessible **aAccessible);
NS_IMETHOD GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
@ -68,6 +66,7 @@ public:
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);

View File

@ -164,7 +164,8 @@ NS_IMETHODIMP nsRootAccessible::GetParent(nsIAccessible * *aParent)
}
/* readonly attribute unsigned long accRole; */
NS_IMETHODIMP nsRootAccessible::GetRole(PRUint32 *aRole)
nsresult
nsRootAccessible::GetRoleInternal(PRUint32 *aRole)
{
if (!mDocument) {
return NS_ERROR_FAILURE;
@ -184,7 +185,7 @@ NS_IMETHODIMP nsRootAccessible::GetRole(PRUint32 *aRole)
}
}
return nsDocAccessibleWrap::GetRole(aRole);
return nsDocAccessibleWrap::GetRoleInternal(aRole);
}
#ifdef MOZ_XUL
@ -493,8 +494,8 @@ PRBool nsRootAccessible::FireAccessibleFocusEvent(nsIAccessible *aAccessible,
PRUint32 role = nsAccUtils::Role(finalFocusAccessible);
if (role == nsIAccessibleRole::ROLE_MENUITEM) {
if (!mCurrentARIAMenubar) { // Entering menus
PRUint32 naturalRole; // The natural role is the role that this type of element normally has
finalFocusAccessible->GetRole(&naturalRole);
// The natural role is the role that this type of element normally has
PRUint32 naturalRole = nsAccUtils::RoleInternal(finalFocusAccessible);
if (role != naturalRole) { // Must be a DHTML menuitem
nsCOMPtr<nsIAccessible> menuBarAccessible =
nsAccUtils::GetAncestorWithRole(finalFocusAccessible,

View File

@ -76,7 +76,6 @@ class nsRootAccessible : public nsDocAccessibleWrap,
// nsIAccessible
NS_IMETHOD GetName(nsAString& aName);
NS_IMETHOD GetParent(nsIAccessible * *aParent);
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
nsIAccessibleRelation **aRelation);
@ -91,6 +90,7 @@ class nsRootAccessible : public nsDocAccessibleWrap,
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
void ShutdownAll();

View File

@ -59,9 +59,10 @@ NS_IMPL_ISUPPORTS_INHERITED3(nsTextAccessible, nsAccessNode,
/**
* We are text
*/
NS_IMETHODIMP nsTextAccessible::GetRole(PRUint32 *_retval)
nsresult
nsTextAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_TEXT_LEAF;
*aRole = nsIAccessibleRole::ROLE_TEXT_LEAF;
return NS_OK;
}

View File

@ -54,13 +54,15 @@ public:
nsTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetFirstChild(nsIAccessible **_retval);
NS_IMETHOD GetLastChild(nsIAccessible **_retval);
NS_IMETHOD GetChildCount(PRInt32 *_retval);
// nsPIAccessible
NS_IMETHOD AppendTextTo(nsAString& aText, PRUint32 aStartOffset, PRUint32 aLength);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};

View File

@ -65,9 +65,10 @@ nsFormControlAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetRole(PRUint32 *_retval)
nsresult
nsHTMLCheckboxAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_CHECKBUTTON;
*aRole = nsIAccessibleRole::ROLE_CHECKBUTTON;
return NS_OK;
}
@ -80,13 +81,15 @@ NS_IMETHODIMP nsHTMLCheckboxAccessible::GetNumActions(PRUint8 *_retval)
NS_IMETHODIMP nsHTMLCheckboxAccessible::GetActionName(PRUint8 aIndex, nsAString& aName)
{
if (aIndex == eAction_Click) { // 0 is the magic value for default action
// check or uncheck
// cycle, check or uncheck
PRUint32 state;
nsresult rv = GetStateInternal(&state, nsnull);
NS_ENSURE_SUCCESS(rv, rv);
if (state & nsIAccessibleStates::STATE_CHECKED)
aName.AssignLiteral("uncheck");
else if (state & nsIAccessibleStates::STATE_MIXED)
aName.AssignLiteral("cycle");
else
aName.AssignLiteral("check");
@ -283,9 +286,10 @@ nsHTMLButtonAccessible::GetStateInternal(PRUint32 *aState,
return NS_OK;
}
NS_IMETHODIMP nsHTMLButtonAccessible::GetRole(PRUint32 *_retval)
nsresult
nsHTMLButtonAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_PUSHBUTTON;
*aRole = nsIAccessibleRole::ROLE_PUSHBUTTON;
return NS_OK;
}
@ -356,9 +360,10 @@ NS_IMETHODIMP nsHTML4ButtonAccessible::DoAction(PRUint8 index)
return NS_ERROR_INVALID_ARG;
}
NS_IMETHODIMP nsHTML4ButtonAccessible::GetRole(PRUint32 *_retval)
nsresult
nsHTML4ButtonAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_PUSHBUTTON;
*aRole = nsIAccessibleRole::ROLE_PUSHBUTTON;
return NS_OK;
}
@ -392,7 +397,8 @@ nsHyperTextAccessibleWrap(aNode, aShell)
NS_IMPL_ISUPPORTS_INHERITED3(nsHTMLTextFieldAccessible, nsAccessible, nsHyperTextAccessible, nsIAccessibleText, nsIAccessibleEditableText)
NS_IMETHODIMP nsHTMLTextFieldAccessible::GetRole(PRUint32 *aRole)
nsresult
nsHTMLTextFieldAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_ENTRY;
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
@ -592,9 +598,10 @@ nsHyperTextAccessibleWrap(aNode, aShell)
{
}
NS_IMETHODIMP nsHTMLGroupboxAccessible::GetRole(PRUint32 *_retval)
nsresult
nsHTMLGroupboxAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_GROUPING;
*aRole = nsIAccessibleRole::ROLE_GROUPING;
return NS_OK;
}
@ -651,6 +658,9 @@ nsHTMLGroupboxAccessible::GetRelationByType(PRUint32 aRelationType,
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsHTMLLegendAccessible
nsHTMLLegendAccessible::nsHTMLLegendAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
nsHyperTextAccessibleWrap(aNode, aShell)
{
@ -685,3 +695,10 @@ nsHTMLLegendAccessible::GetRelationByType(PRUint32 aRelationType,
return NS_OK;
}
nsresult
nsHTMLLegendAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_LABEL;
return NS_OK;
}

View File

@ -51,12 +51,12 @@ public:
nsHTMLCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -80,13 +80,13 @@ public:
nsHTMLButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -99,12 +99,12 @@ public:
nsHTML4ButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -119,7 +119,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
@ -130,6 +129,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -139,12 +139,12 @@ public:
nsHTMLGroupboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
nsIAccessibleRelation **aRelation);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
protected:
nsIContent* GetLegend();
@ -156,10 +156,11 @@ public:
nsHTMLLegendAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole) { *aRole = nsIAccessibleRole::ROLE_LABEL; return NS_OK; }
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
nsIAccessibleRelation **aRelation);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
#endif

View File

@ -147,10 +147,10 @@ nsHTMLImageAccessible::GetNameInternal(nsAString& aName)
return NS_OK;
}
/* wstring getRole (); */
NS_IMETHODIMP nsHTMLImageAccessible::GetRole(PRUint32 *_retval)
nsresult
nsHTMLImageAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = mMapElement ? nsIAccessibleRole::ROLE_IMAGE_MAP :
*aRole = mMapElement ? nsIAccessibleRole::ROLE_IMAGE_MAP :
nsIAccessibleRole::ROLE_GRAPHIC;
return NS_OK;
}

View File

@ -58,7 +58,6 @@ public:
nsHTMLImageAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -76,6 +75,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);

View File

@ -57,11 +57,9 @@ NS_IMPL_ISUPPORTS_INHERITED1(nsHTMLLinkAccessible, nsHyperTextAccessibleWrap,
////////////////////////////////////////////////////////////////////////////////
// nsIAccessible
NS_IMETHODIMP
nsHTMLLinkAccessible::GetRole(PRUint32 *aRole)
nsresult
nsHTMLLinkAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_LINK;
return NS_OK;
}

View File

@ -50,7 +50,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
@ -61,6 +60,7 @@ public:
NS_IMETHOD GetURI(PRInt32 aIndex, nsIURI **aURI);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:

View File

@ -355,7 +355,8 @@ nsHTMLSelectListAccessible::GetStateInternal(PRUint32 *aState,
return NS_OK;
}
NS_IMETHODIMP nsHTMLSelectListAccessible::GetRole(PRUint32 *aRole)
nsresult
nsHTMLSelectListAccessible::GetRoleInternal(PRUint32 *aRole)
{
if (nsAccUtils::Role(mParent) == nsIAccessibleRole::ROLE_COMBOBOX)
*aRole = nsIAccessibleRole::ROLE_COMBOBOX_LIST;
@ -486,9 +487,8 @@ nsHyperTextAccessibleWrap(aDOMNode, aShell)
// where there is no DOM node for it.
accService->GetAccessibleInWeakShell(parentNode, mWeakShell, getter_AddRefs(parentAccessible));
if (parentAccessible) {
PRUint32 role;
parentAccessible->GetRole(&role);
if (role == nsIAccessibleRole::ROLE_COMBOBOX) {
if (nsAccUtils::RoleInternal(parentAccessible) ==
nsIAccessibleRole::ROLE_COMBOBOX) {
nsCOMPtr<nsIAccessible> comboAccessible(parentAccessible);
comboAccessible->GetLastChild(getter_AddRefs(parentAccessible));
}
@ -498,7 +498,8 @@ nsHyperTextAccessibleWrap(aDOMNode, aShell)
}
/** We are a ListItem */
NS_IMETHODIMP nsHTMLSelectOptionAccessible::GetRole(PRUint32 *aRole)
nsresult
nsHTMLSelectOptionAccessible::GetRoleInternal(PRUint32 *aRole)
{
if (nsAccUtils::Role(mParent) == nsIAccessibleRole::ROLE_COMBOBOX_LIST)
*aRole = nsIAccessibleRole::ROLE_COMBOBOX_OPTION;
@ -903,8 +904,8 @@ nsHTMLSelectOptionAccessible(aDOMNode, aShell)
{
}
NS_IMETHODIMP
nsHTMLSelectOptGroupAccessible::GetRole(PRUint32 *aRole)
nsresult
nsHTMLSelectOptGroupAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_HEADING;
return NS_OK;
@ -969,9 +970,10 @@ nsAccessibleWrap(aDOMNode, aShell)
}
/** We are a combobox */
NS_IMETHODIMP nsHTMLComboboxAccessible::GetRole(PRUint32 *_retval)
nsresult
nsHTMLComboboxAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_COMBOBOX;
*aRole = nsIAccessibleRole::ROLE_COMBOBOX;
return NS_OK;
}
@ -1349,9 +1351,10 @@ void nsHTMLComboboxButtonAccessible::GetBoundsRect(nsRect& aBounds, nsIFrame** a
}
/** We are a button. */
NS_IMETHODIMP nsHTMLComboboxButtonAccessible::GetRole(PRUint32 *_retval)
nsresult
nsHTMLComboboxButtonAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_PUSHBUTTON;
*aRole = nsIAccessibleRole::ROLE_PUSHBUTTON;
return NS_OK;
}

View File

@ -125,10 +125,8 @@ public:
nsHTMLSelectListAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
virtual ~nsHTMLSelectListAccessible() {}
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
@ -161,10 +159,10 @@ public:
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
@ -194,12 +192,12 @@ public:
virtual ~nsHTMLSelectOptGroupAccessible() {}
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
@ -224,7 +222,6 @@ public:
virtual ~nsHTMLComboboxAccessible() {}
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD GetDescription(nsAString& aDescription);
NS_IMETHOD DoAction(PRUint8 index);
@ -235,6 +232,7 @@ public:
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
@ -284,13 +282,13 @@ public:
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetParent(nsIAccessible **_retval);
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetName(nsAString& aName);
// nsIAccessNode
NS_IMETHOD GetUniqueID(void **aUniqueID);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:

View File

@ -71,7 +71,8 @@ nsHyperTextAccessibleWrap(aDomNode, aShell)
}
/* unsigned long getRole (); */
NS_IMETHODIMP nsHTMLTableCellAccessible::GetRole(PRUint32 *aResult)
nsresult
nsHTMLTableCellAccessible::GetRoleInternal(PRUint32 *aResult)
{
*aResult = nsIAccessibleRole::ROLE_CELL;
return NS_OK;
@ -188,7 +189,8 @@ void nsHTMLTableAccessible::CacheChildren()
}
/* unsigned long getRole (); */
NS_IMETHODIMP nsHTMLTableAccessible::GetRole(PRUint32 *aResult)
nsresult
nsHTMLTableAccessible::GetRoleInternal(PRUint32 *aResult)
{
*aResult = nsIAccessibleRole::ROLE_TABLE;
return NS_OK;
@ -1207,10 +1209,10 @@ nsHTMLTableAccessible(aDomNode, aShell)
{
}
NS_IMETHODIMP
nsHTMLTableHeadAccessible::GetRole(PRUint32 *aResult)
nsresult
nsHTMLTableHeadAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aResult = nsIAccessibleRole::ROLE_COLUMNHEADER;
*aRole = nsIAccessibleRole::ROLE_COLUMNHEADER;
return NS_OK;
}
@ -1247,6 +1249,9 @@ nsHTMLTableHeadAccessible::GetRows(PRInt32 *aRows)
return rows->GetLength((PRUint32 *)aRows);
}
////////////////////////////////////////////////////////////////////////////////
// nsHTMLCaptionAccessible
NS_IMETHODIMP
nsHTMLCaptionAccessible::GetRelationByType(PRUint32 aRelationType,
nsIAccessibleRelation **aRelation)
@ -1264,5 +1269,9 @@ nsHTMLCaptionAccessible::GetRelationByType(PRUint32 aRelationType,
return NS_OK;
}
nsresult
nsHTMLCaptionAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_CAPTION;
return NS_OK;
}

View File

@ -49,10 +49,8 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
};
@ -73,13 +71,13 @@ public:
NS_DECL_NSIACCESSIBLETABLE
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aResult);
NS_IMETHOD GetDescription(nsAString& aDescription);
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
nsIAccessibleRelation **aRelation);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
@ -142,14 +140,14 @@ public:
nsHTMLTableHeadAccessible(nsIDOMNode *aDomNode, nsIWeakReference *aShell);
/* nsIAccessible */
NS_IMETHOD GetRole(PRUint32 *aResult);
/* nsIAccessibleTable */
NS_IMETHOD GetCaption(nsIAccessible **aCaption);
NS_IMETHOD GetSummary(nsAString &aSummary);
NS_IMETHOD GetColumnHeader(nsIAccessibleTable **aColumnHeader);
NS_IMETHOD GetRows(PRInt32 *aRows);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
class nsHTMLCaptionAccessible : public nsHyperTextAccessibleWrap
@ -159,11 +157,11 @@ public:
nsHyperTextAccessibleWrap(aDomNode, aShell) { }
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole)
{ *aRole = nsIAccessibleRole::ROLE_CAPTION; return NS_OK; }
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
nsIAccessibleRelation **aRelation);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
#endif

View File

@ -61,7 +61,8 @@ nsHTMLTextAccessible::GetName(nsAString& aName)
return AppendTextTo(aName, 0, PR_UINT32_MAX);
}
NS_IMETHODIMP nsHTMLTextAccessible::GetRole(PRUint32 *aRole)
nsresult
nsHTMLTextAccessible::GetRoleInternal(PRUint32 *aRole)
{
nsIFrame *frame = GetFrame();
// Don't return on null frame -- we still return a role
@ -71,7 +72,7 @@ NS_IMETHODIMP nsHTMLTextAccessible::GetRole(PRUint32 *aRole)
return NS_OK;
}
return nsTextAccessible::GetRole(aRole);
return nsTextAccessible::GetRoleInternal(aRole);
}
nsresult
@ -101,7 +102,7 @@ nsHTMLTextAccessible::GetAttributesInternal(nsIPersistentProperties *aAttributes
}
PRUint32 role;
GetRole(&role);
GetRoleInternal(&role);
if (role == nsIAccessibleRole::ROLE_STATICTEXT) {
nsAutoString oldValueUnused;
aAttributes->SetStringProperty(NS_LITERAL_CSTRING("auto-generated"),
@ -116,7 +117,8 @@ nsLeafAccessible(aDomNode, aShell)
{
}
NS_IMETHODIMP nsHTMLHRAccessible::GetRole(PRUint32 *aRole)
nsresult
nsHTMLHRAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_SEPARATOR;
return NS_OK;
@ -127,7 +129,8 @@ nsLeafAccessible(aDomNode, aShell)
{
}
NS_IMETHODIMP nsHTMLBRAccessible::GetRole(PRUint32 *aRole)
nsresult
nsHTMLBRAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_WHITESPACE;
return NS_OK;
@ -174,7 +177,8 @@ nsHTMLLabelAccessible::GetNameInternal(nsAString& aName)
return nsTextEquivUtils::GetNameFromSubtree(this, aName);
}
NS_IMETHODIMP nsHTMLLabelAccessible::GetRole(PRUint32 *aRole)
nsresult
nsHTMLLabelAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_LABEL;
return NS_OK;
@ -236,6 +240,13 @@ nsHTMLLIAccessible::Shutdown()
return rv;
}
nsresult
nsHTMLLIAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_LISTITEM;
return NS_OK;
}
nsresult
nsHTMLLIAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
@ -314,8 +325,8 @@ nsHTMLListBulletAccessible::GetName(nsAString &aName)
return NS_OK;
}
NS_IMETHODIMP
nsHTMLListBulletAccessible::GetRole(PRUint32 *aRole)
nsresult
nsHTMLListBulletAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_STATICTEXT;
return NS_OK;
@ -359,8 +370,16 @@ nsHTMLListBulletAccessible::AppendTextTo(nsAString& aText, PRUint32 aStartOffset
return NS_OK;
}
////////////////////////////////////////////////////////////////////////////////
// nsHTMLListAccessible
nsresult
nsHTMLListAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_LIST;
return NS_OK;
}
nsresult
nsHTMLListAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{

View File

@ -53,10 +53,10 @@ public:
// nsIAccessible
NS_IMETHOD GetName(nsAString& aName);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -64,7 +64,9 @@ class nsHTMLHRAccessible : public nsLeafAccessible
{
public:
nsHTMLHRAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
class nsHTMLBRAccessible : public nsLeafAccessible
@ -72,11 +74,9 @@ class nsHTMLBRAccessible : public nsLeafAccessible
public:
nsHTMLBRAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -88,13 +88,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetFirstChild(nsIAccessible **aFirstChild);
NS_IMETHOD GetLastChild(nsIAccessible **aLastChild);
NS_IMETHOD GetChildCount(PRInt32 *aAccChildCount);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -108,7 +108,6 @@ public:
NS_IMETHOD GetUniqueID(void **aUniqueID);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetName(nsAString& aName);
// Don't cache via unique ID -- bullet accessible shares the same dom node as
@ -121,6 +120,7 @@ public:
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
// nsPIAccessible
@ -143,10 +143,8 @@ public:
nsHTMLListAccessible(nsIDOMNode *aDOMNode, nsIWeakReference* aShell):
nsHyperTextAccessibleWrap(aDOMNode, aShell) { }
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole) { *aRole = nsIAccessibleRole::ROLE_LIST; return NS_OK; }
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -157,13 +155,13 @@ public:
const nsAString& aBulletText);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole) { *aRole = nsIAccessibleRole::ROLE_LISTITEM; return NS_OK; }
NS_IMETHOD GetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
// nsAccessNode
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:

View File

@ -133,7 +133,8 @@ nsAccessibleWrap(aNode, aShell)
{
}
NS_IMETHODIMP nsHyperTextAccessible::GetRole(PRUint32 *aRole)
nsresult
nsHyperTextAccessible::GetRoleInternal(PRUint32 *aRole)
{
nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
if (!content) {
@ -211,7 +212,7 @@ void nsHyperTextAccessible::CacheChildren()
// Special case for text entry fields, go directly to editor's root for children
if (mAccChildCount == eChildCountUninitialized) {
PRUint32 role;
GetRole(&role);
GetRoleInternal(&role);
if (role != nsIAccessibleRole::ROLE_ENTRY && role != nsIAccessibleRole::ROLE_PASSWORD_TEXT) {
nsAccessible::CacheChildren();
return;

View File

@ -82,11 +82,9 @@ public:
NS_DECL_NSIACCESSIBLEEDITABLETEXT
NS_DECLARE_STATIC_IID_ACCESSOR(NS_HYPERTEXTACCESSIBLE_IMPL_CID)
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
void CacheChildren();

View File

@ -135,7 +135,7 @@ GetNativeFromGeckoAccessible(nsIAccessible *anAccessible)
if ((self = [super init])) {
mGeckoAccessible = geckoAccessible;
mIsExpired = NO;
geckoAccessible->GetFinalRole(&mRole);
geckoAccessible->GetRole(&mRole);
// Check for OS X "role skew"; the role constants in nsIAccessible.idl need to match the ones
// in nsRoleMap.h.

View File

@ -387,19 +387,17 @@ __try {
// use the ARIA owns property to calculate that if it's present.
PRInt32 numChildren = 0;
PRUint32 currentRole = 0;
rv = xpAccessible->GetFinalRole(&currentRole);
if (NS_SUCCEEDED(rv) &&
currentRole == nsIAccessibleRole::ROLE_OUTLINEITEM) {
PRUint32 currentRole = nsAccUtils::Role(xpAccessible);
if (currentRole == nsIAccessibleRole::ROLE_OUTLINEITEM) {
nsCOMPtr<nsIAccessible> child;
xpAccessible->GetFirstChild(getter_AddRefs(child));
while (child) {
child->GetFinalRole(&currentRole);
currentRole = nsAccUtils::Role(child);
if (currentRole == nsIAccessibleRole::ROLE_GROUPING) {
nsCOMPtr<nsIAccessible> groupChild;
child->GetFirstChild(getter_AddRefs(groupChild));
while (groupChild) {
groupChild->GetFinalRole(&currentRole);
currentRole = nsAccUtils::Role(groupChild);
numChildren +=
(currentRole == nsIAccessibleRole::ROLE_OUTLINEITEM);
nsCOMPtr<nsIAccessible> nextGroupChild;
@ -476,7 +474,7 @@ __try {
#endif
PRUint32 xpRole = 0, msaaRole = 0;
if (NS_FAILED(xpAccessible->GetFinalRole(&xpRole)))
if (NS_FAILED(xpAccessible->GetRole(&xpRole)))
return E_FAIL;
msaaRole = gWindowsRoleMap[xpRole].msaaRole;
@ -1277,7 +1275,7 @@ __try {
*aRole = 0;
PRUint32 xpRole = 0;
nsresult rv = GetFinalRole(&xpRole);
nsresult rv = GetRole(&xpRole);
if (NS_FAILED(rv))
return GetHRESULT(rv);

View File

@ -276,8 +276,8 @@ __try {
return E_FAIL;
}
nsIFontMetrics *fm;
rc->GetFontMetrics(fm);
nsCOMPtr<nsIFontMetrics> fm;
rc->GetFontMetrics(*getter_AddRefs(fm));
if (!fm) {
return E_FAIL;
}

View File

@ -49,7 +49,8 @@ nsXULTreeAccessible(aDOMNode, aShell)
{
}
NS_IMETHODIMP nsXULTreeAccessibleWrap::GetRole(PRUint32 *aRole)
nsresult
nsXULTreeAccessibleWrap::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_STATE(mTree);
@ -80,7 +81,8 @@ nsXULTreeitemAccessible(aParent, aDOMNode, aShell, aRow, aColumn)
{
}
NS_IMETHODIMP nsXULTreeitemAccessibleWrap::GetRole(PRUint32 *aRole)
nsresult
nsXULTreeitemAccessibleWrap::GetRoleInternal(PRUint32 *aRole)
{
// No primary column means we're in a list
// In fact, history and mail turn off the primary flag when switching to a flat view

View File

@ -48,7 +48,9 @@ class nsXULTreeAccessibleWrap : public nsXULTreeAccessible
public:
nsXULTreeAccessibleWrap(nsIDOMNode *aDOMNode, nsIWeakReference *aShell);
virtual ~nsXULTreeAccessibleWrap() {}
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
class nsXULTreeitemAccessibleWrap : public nsXULTreeitemAccessible
@ -58,9 +60,12 @@ public:
PRInt32 aRow, nsITreeColumn* aColumn);
virtual ~nsXULTreeitemAccessibleWrap() {}
// nsIAccessible
NS_IMETHOD GetBounds(PRInt32 *x, PRInt32 *y, PRInt32 *width, PRInt32 *height);
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetName(nsAString &aName);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
#endif

View File

@ -264,11 +264,9 @@ nsXFormsContainerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
{
}
NS_IMETHODIMP
nsXFormsContainerAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsContainerAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_GROUPING;
return NS_OK;
}

View File

@ -127,12 +127,12 @@ class nsXFormsContainerAccessible : public nsXFormsAccessible
public:
nsXFormsContainerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// Returns ROLE_GROUP.
NS_IMETHOD GetRole(PRUint32 *aRole);
// Allows accessible nodes in anonymous content of xforms element by
// always returning PR_TRUE value.
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};

View File

@ -46,11 +46,9 @@ nsXFormsLabelAccessible::
{
}
NS_IMETHODIMP
nsXFormsLabelAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsLabelAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_LABEL;
return NS_OK;
}
@ -81,11 +79,9 @@ nsXFormsOutputAccessible::
{
}
NS_IMETHODIMP
nsXFormsOutputAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsOutputAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_STATICTEXT;
return NS_OK;
}
@ -98,11 +94,9 @@ nsXFormsTriggerAccessible::
{
}
NS_IMETHODIMP
nsXFormsTriggerAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsTriggerAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_PUSHBUTTON;
return NS_OK;
}
@ -152,11 +146,9 @@ nsXFormsInputAccessible::
NS_IMPL_ISUPPORTS_INHERITED3(nsXFormsInputAccessible, nsAccessible, nsHyperTextAccessible, nsIAccessibleText, nsIAccessibleEditableText)
NS_IMETHODIMP
nsXFormsInputAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsInputAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_ENTRY;
return NS_OK;
}
@ -197,11 +189,9 @@ nsXFormsInputBooleanAccessible::
{
}
NS_IMETHODIMP
nsXFormsInputBooleanAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsInputBooleanAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_CHECKBUTTON;
return NS_OK;
}
@ -267,11 +257,9 @@ nsXFormsInputDateAccessible::
{
}
NS_IMETHODIMP
nsXFormsInputDateAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsInputDateAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_DROPLIST;
return NS_OK;
}
@ -284,11 +272,9 @@ nsXFormsSecretAccessible::
{
}
NS_IMETHODIMP
nsXFormsSecretAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsSecretAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_PASSWORD_TEXT;
return NS_OK;
}
@ -319,11 +305,9 @@ nsXFormsRangeAccessible::
{
}
NS_IMETHODIMP
nsXFormsRangeAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsRangeAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_SLIDER;
return NS_OK;
}
@ -438,11 +422,9 @@ nsXFormsChoicesAccessible::
{
}
NS_IMETHODIMP
nsXFormsChoicesAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsChoicesAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_GROUPING;
return NS_OK;
}
@ -469,11 +451,9 @@ nsXFormsSelectFullAccessible::
{
}
NS_IMETHODIMP
nsXFormsSelectFullAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsSelectFullAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_GROUPING;
return NS_OK;
}
@ -493,11 +473,9 @@ nsXFormsItemCheckgroupAccessible::
{
}
NS_IMETHODIMP
nsXFormsItemCheckgroupAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsItemCheckgroupAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_CHECKBUTTON;
return NS_OK;
}
@ -539,11 +517,9 @@ nsXFormsItemRadiogroupAccessible::
{
}
NS_IMETHODIMP
nsXFormsItemRadiogroupAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsItemRadiogroupAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_RADIOBUTTON;
return NS_OK;
}
@ -581,11 +557,9 @@ nsXFormsSelectComboboxAccessible::
{
}
NS_IMETHODIMP
nsXFormsSelectComboboxAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsSelectComboboxAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_COMBOBOX;
return NS_OK;
}
@ -630,11 +604,9 @@ nsXFormsItemComboboxAccessible::
{
}
NS_IMETHODIMP
nsXFormsItemComboboxAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsItemComboboxAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_LISTITEM;
return NS_OK;
}

View File

@ -51,11 +51,11 @@ public:
nsXFormsLabelAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetDescription(nsAString& aDescription);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
/**
@ -67,7 +67,8 @@ class nsXFormsOutputAccessible : public nsXFormsAccessible
public:
nsXFormsOutputAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
/**
@ -79,12 +80,15 @@ class nsXFormsTriggerAccessible : public nsXFormsAccessible
public:
nsXFormsTriggerAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
/**
@ -98,10 +102,13 @@ public:
NS_DECL_ISUPPORTS_INHERITED
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsIAccessible
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
/**
@ -114,12 +121,12 @@ public:
nsXFormsInputBooleanAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -132,7 +139,8 @@ class nsXFormsInputDateAccessible : public nsXFormsContainerAccessible
public:
nsXFormsInputDateAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
/**
@ -145,10 +153,10 @@ public:
nsXFormsSecretAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetValue(nsAString& aValue);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -162,9 +170,6 @@ class nsXFormsRangeAccessible : public nsXFormsAccessible
public:
nsXFormsRangeAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsIAccessibleValue
NS_IMETHOD GetMaximumValue(double *aMaximumValue);
NS_IMETHOD GetMinimumValue(double *aMinimumValue);
@ -172,6 +177,7 @@ public:
NS_IMETHOD GetCurrentValue(double *aCurrentValue);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -200,9 +206,11 @@ class nsXFormsChoicesAccessible : public nsXFormsAccessible
public:
nsXFormsChoicesAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
void CacheChildren();
};
@ -217,8 +225,8 @@ class nsXFormsSelectFullAccessible : public nsXFormsSelectableAccessible
public:
nsXFormsSelectFullAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
void CacheChildren();
};
@ -235,10 +243,10 @@ public:
nsXFormsItemCheckgroupAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -255,10 +263,10 @@ public:
nsXFormsItemRadiogroupAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -273,14 +281,12 @@ class nsXFormsSelectComboboxAccessible : public nsXFormsSelectableAccessible
public:
nsXFormsSelectComboboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// Allows accessible nodes in anonymous content of xforms element by
// always returning PR_TRUE value.
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -297,10 +303,10 @@ public:
nsXFormsItemComboboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};

View File

@ -46,11 +46,9 @@ nsXFormsDropmarkerWidgetAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
{
}
NS_IMETHODIMP
nsXFormsDropmarkerWidgetAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsDropmarkerWidgetAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_PUSHBUTTON;
return NS_OK;
}
@ -128,11 +126,9 @@ nsXFormsCalendarWidgetAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell):
{
}
NS_IMETHODIMP
nsXFormsCalendarWidgetAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsCalendarWidgetAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_CALENDAR;
return NS_OK;
}
@ -146,11 +142,9 @@ nsXFormsComboboxPopupWidgetAccessible::
{
}
NS_IMETHODIMP
nsXFormsComboboxPopupWidgetAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXFormsComboboxPopupWidgetAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_LIST;
return NS_OK;
}

View File

@ -55,13 +55,12 @@ public:
nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetNumActions(PRUint8 *aCount);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -74,7 +73,8 @@ class nsXFormsCalendarWidgetAccessible : public nsAccessibleWrap
public:
nsXFormsCalendarWidgetAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
@ -89,12 +89,12 @@ public:
nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetDescription(nsAString& aDescription);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:

View File

@ -47,7 +47,8 @@ nsXULAlertAccessible::nsXULAlertAccessible(nsIDOMNode* aNode, nsIWeakReference*
{
}
NS_IMETHODIMP nsXULAlertAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULAlertAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_ALERT;
return NS_OK;

View File

@ -51,10 +51,10 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetName(nsAString& aName);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};

View File

@ -56,9 +56,10 @@ nsFormControlAccessible(aNode, aShell)
/**
* We are a pushbutton
*/
NS_IMETHODIMP nsXULColorPickerTileAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULColorPickerTileAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_PUSHBUTTON;
*aRole = nsIAccessibleRole::ROLE_PUSHBUTTON;
return NS_OK;
}
@ -130,9 +131,10 @@ nsXULColorPickerAccessible::GetStateInternal(PRUint32 *aState,
return NS_OK;
}
NS_IMETHODIMP nsXULColorPickerAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULColorPickerAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_BUTTONDROPDOWNGRID;
*aRole = nsIAccessibleRole::ROLE_BUTTONDROPDOWNGRID;
return NS_OK;
}

View File

@ -48,10 +48,10 @@ public:
nsXULColorPickerTileAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetValue(nsAString& _retval);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -60,10 +60,8 @@ class nsXULColorPickerAccessible : public nsXULColorPickerTileAccessible
public:
nsXULColorPickerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};

View File

@ -105,9 +105,10 @@ NS_IMETHODIMP nsXULButtonAccessible::DoAction(PRUint8 index)
/**
* We are a pushbutton
*/
NS_IMETHODIMP nsXULButtonAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULButtonAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_PUSHBUTTON;
*aRole = nsIAccessibleRole::ROLE_PUSHBUTTON;
return NS_OK;
}
@ -193,9 +194,8 @@ void nsXULButtonAccessible::CacheChildren()
// child -- because this is the scenario where we have a dropmarker child
if (dropMarkerAccessible) {
PRUint32 role;
if (NS_SUCCEEDED(dropMarkerAccessible->GetRole(&role)) &&
role == nsIAccessibleRole::ROLE_PUSHBUTTON) {
if (nsAccUtils::RoleInternal(dropMarkerAccessible) ==
nsIAccessibleRole::ROLE_PUSHBUTTON) {
SetFirstChild(dropMarkerAccessible);
nsCOMPtr<nsPIAccessible> privChildAcc = do_QueryInterface(dropMarkerAccessible);
privChildAcc->SetNextSibling(nsnull);
@ -283,9 +283,10 @@ NS_IMETHODIMP nsXULDropmarkerAccessible::DoAction(PRUint8 index)
/**
* We are a pushbutton
*/
NS_IMETHODIMP nsXULDropmarkerAccessible::GetRole(PRUint32 *aResult)
nsresult
nsXULDropmarkerAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aResult = nsIAccessibleRole::ROLE_PUSHBUTTON;
*aRole = nsIAccessibleRole::ROLE_PUSHBUTTON;
return NS_OK;
}
@ -326,9 +327,10 @@ nsFormControlAccessible(aNode, aShell)
/**
* We are a CheckButton
*/
NS_IMETHODIMP nsXULCheckboxAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULCheckboxAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_CHECKBUTTON;
*aRole = nsIAccessibleRole::ROLE_CHECKBUTTON;
return NS_OK;
}
@ -412,7 +414,8 @@ nsAccessibleWrap(aNode, aShell)
{
}
NS_IMETHODIMP nsXULGroupboxAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULGroupboxAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_GROUPING;
return NS_OK;
@ -475,9 +478,10 @@ nsFormControlAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsXULProgressMeterAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULProgressMeterAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_PROGRESSBAR;
*aRole = nsIAccessibleRole::ROLE_PROGRESSBAR;
return NS_OK;
}
@ -601,9 +605,10 @@ nsXULSelectableAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsXULRadioGroupAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULRadioGroupAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_GROUPING;
*aRole = nsIAccessibleRole::ROLE_GROUPING;
return NS_OK;
}
@ -637,9 +642,10 @@ nsAccessibleWrap(aNode, aShell)
/**
* We are a statusbar
*/
NS_IMETHODIMP nsXULStatusBarAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULStatusBarAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_STATUSBAR;
*aRole = nsIAccessibleRole::ROLE_STATUSBAR;
return NS_OK;
}
@ -713,9 +719,10 @@ nsAccessibleWrap(aNode, aShell)
{
}
NS_IMETHODIMP nsXULToolbarAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULToolbarAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_TOOLBAR;
*aRole = nsIAccessibleRole::ROLE_TOOLBAR;
return NS_OK;
}
@ -728,9 +735,10 @@ nsLeafAccessible(aNode, aShell)
{
}
NS_IMETHODIMP nsXULToolbarSeparatorAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULToolbarSeparatorAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_SEPARATOR;
*aRole = nsIAccessibleRole::ROLE_SEPARATOR;
return NS_OK;
}
@ -865,7 +873,8 @@ nsXULTextFieldAccessible::GetStateInternal(PRUint32 *aState,
return NS_OK;
}
NS_IMETHODIMP nsXULTextFieldAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULTextFieldAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_ENTRY;
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));

View File

@ -54,12 +54,12 @@ public:
nsXULButtonAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
@ -73,12 +73,12 @@ public:
nsXULCheckboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -89,12 +89,12 @@ public:
nsXULDropmarkerAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
private:
@ -107,11 +107,11 @@ public:
nsXULGroupboxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
nsIAccessibleRelation **aRelation);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetNameInternal(nsAString& aName);
};
@ -122,8 +122,10 @@ class nsXULProgressMeterAccessible : public nsFormControlAccessible
public:
nsXULProgressMeterAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetValue(nsAString &aValue);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
class nsXULRadioButtonAccessible : public nsRadioButtonAccessible
@ -142,10 +144,8 @@ class nsXULRadioGroupAccessible : public nsXULSelectableAccessible
public:
nsXULRadioGroupAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -153,7 +153,9 @@ class nsXULStatusBarAccessible : public nsAccessibleWrap
{
public:
nsXULStatusBarAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
class nsXULToolbarButtonAccessible : public nsXULButtonAccessible
@ -168,7 +170,9 @@ class nsXULToolbarAccessible : public nsAccessibleWrap
{
public:
nsXULToolbarAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetRole(PRUint32 *_retval);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
class nsXULToolbarSeparatorAccessible : public nsLeafAccessible
@ -176,10 +180,8 @@ class nsXULToolbarSeparatorAccessible : public nsLeafAccessible
public:
nsXULToolbarSeparatorAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -194,7 +196,6 @@ public:
// nsIAccessible
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -204,6 +205,7 @@ public:
NS_IMETHOD GetAssociatedEditor(nsIEditor **aEditor);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:

View File

@ -425,9 +425,8 @@ nsXULMenuitemAccessible::GetKeyboardShortcut(nsAString& aAccessKey)
nsCOMPtr<nsIAccessible> parentAccessible(GetParent());
if (parentAccessible) {
PRUint32 role;
parentAccessible->GetRole(&role);
if (role == nsIAccessibleRole::ROLE_MENUBAR) {
if (nsAccUtils::RoleInternal(parentAccessible) ==
nsIAccessibleRole::ROLE_MENUBAR) {
// If top level menu item, add Alt+ or whatever modifier text to string
// No need to cache pref service, this happens rarely
if (gMenuAccesskeyModifier == -1) {
@ -473,7 +472,8 @@ nsXULMenuitemAccessible::GetDefaultKeyBinding(nsAString& aKeyBinding)
return NS_OK;
}
NS_IMETHODIMP nsXULMenuitemAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULMenuitemAccessible::GetRoleInternal(PRUint32 *aRole)
{
nsCOMPtr<nsIDOMXULContainerElement> xulContainer(do_QueryInterface(mDOMNode));
if (xulContainer) {
@ -577,9 +577,10 @@ nsXULMenuSeparatorAccessible::GetNameInternal(nsAString& aName)
return NS_OK;
}
NS_IMETHODIMP nsXULMenuSeparatorAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULMenuSeparatorAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_SEPARATOR;
*aRole = nsIAccessibleRole::ROLE_SEPARATOR;
return NS_OK;
}
@ -694,7 +695,8 @@ nsXULMenupopupAccessible::GetNameInternal(nsAString& aName)
return NS_OK;
}
NS_IMETHODIMP nsXULMenupopupAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULMenupopupAccessible::GetRoleInternal(PRUint32 *aRole)
{
nsCOMPtr<nsIContent> content(do_QueryInterface(mDOMNode));
if (!content) {
@ -743,9 +745,10 @@ nsXULMenubarAccessible::GetNameInternal(nsAString& aName)
return NS_OK;
}
NS_IMETHODIMP nsXULMenubarAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULMenubarAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_MENUBAR;
*aRole = nsIAccessibleRole::ROLE_MENUBAR;
return NS_OK;
}

View File

@ -81,7 +81,6 @@ public:
NS_IMETHOD GetDescription(nsAString& aDescription);
NS_IMETHOD GetKeyboardShortcut(nsAString& _retval);
NS_IMETHOD GetDefaultKeyBinding(nsAString& aKeyBinding);
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
@ -91,6 +90,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
@ -103,13 +103,13 @@ public:
nsXULMenuSeparatorAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD DoAction(PRUint8 index);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -118,11 +118,9 @@ class nsXULMenupopupAccessible : public nsXULSelectableAccessible
public:
nsXULMenupopupAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
// nsXULMenupopupAccessible
@ -136,11 +134,9 @@ class nsXULMenubarAccessible : public nsAccessibleWrap
public:
nsXULMenubarAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};

View File

@ -58,11 +58,9 @@ nsXULColumnsAccessible::
{
}
NS_IMETHODIMP
nsXULColumnsAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULColumnsAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_LIST;
return NS_OK;
}
@ -98,11 +96,9 @@ nsXULColumnItemAccessible::
{
}
NS_IMETHODIMP
nsXULColumnItemAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULColumnItemAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_COLUMNHEADER;
return NS_OK;
}
@ -239,7 +235,8 @@ NS_IMETHODIMP nsXULListboxAccessible::GetValue(nsAString& _retval)
return NS_ERROR_FAILURE;
}
NS_IMETHODIMP nsXULListboxAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULListboxAccessible::GetRoleInternal(PRUint32 *aRole)
{
nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
if (content) {
@ -887,10 +884,8 @@ nsXULListitemAccessible::GetNameInternal(nsAString& aName)
return GetXULName(aName);
}
/**
*
*/
NS_IMETHODIMP nsXULListitemAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULListitemAccessible::GetRoleInternal(PRUint32 *aRole)
{
nsCOMPtr<nsIAccessible> listAcc = GetListAccessible();
NS_ENSURE_STATE(listAcc);
@ -997,11 +992,9 @@ nsXULListCellAccessible::
{
}
NS_IMETHODIMP
nsXULListCellAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULListCellAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_CELL;
return NS_OK;
}
@ -1027,7 +1020,8 @@ nsXULComboboxAccessible::Init()
}
/** We are a combobox */
NS_IMETHODIMP nsXULComboboxAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULComboboxAccessible::GetRoleInternal(PRUint32 *aRole)
{
nsCOMPtr<nsIContent> content = do_QueryInterface(mDOMNode);
if (!content) {

View File

@ -55,10 +55,8 @@ class nsXULColumnsAccessible : public nsAccessibleWrap
public:
nsXULColumnsAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -72,13 +70,12 @@ public:
nsXULColumnItemAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 aIndex);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
enum { eAction_Click = 0 };
@ -117,10 +114,10 @@ public:
NS_DECL_NSIACCESSIBLETABLE
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetValue(nsAString& aValue);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:
@ -141,7 +138,6 @@ public:
virtual ~nsXULListitemAccessible() {}
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetActionName(PRUint8 index, nsAString& aName);
// Don't use XUL menuitems's description attribute
NS_IMETHOD GetDescription(nsAString& aDesc) { return nsAccessibleWrap::GetDescription(aDesc); }
@ -149,6 +145,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
@ -167,8 +164,8 @@ class nsXULListCellAccessible : public nsHyperTextAccessibleWrap
public:
nsXULListCellAccessible(nsIDOMNode* aDOMNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
/** ------------------------------------------------------ */
@ -187,7 +184,6 @@ public:
virtual ~nsXULComboboxAccessible() {}
/* ----- nsIAccessible ----- */
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD GetDescription(nsAString& aDescription);
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
@ -199,6 +195,7 @@ public:
virtual nsresult Init();
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};

View File

@ -51,11 +51,9 @@ nsXULSliderAccessible::nsXULSliderAccessible(nsIDOMNode* aNode,
// nsIAccessible
NS_IMETHODIMP
nsXULSliderAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULSliderAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_SLIDER;
return NS_OK;
}
@ -233,11 +231,9 @@ nsXULThumbAccessible::nsXULThumbAccessible(nsIDOMNode* aNode,
// nsIAccessible
NS_IMETHODIMP
nsXULThumbAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULThumbAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_INDICATOR;
return NS_OK;
}

View File

@ -49,7 +49,6 @@ public:
nsXULSliderAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetValue(nsAString& aValue);
// nsIAccessibleValue
@ -62,6 +61,9 @@ public:
// nsPIAccessible
NS_IMETHOD GetAllowsAnonChildAccessibles(PRBool *aAllowsAnonChildren);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
protected:
already_AddRefed<nsIContent> GetSliderNode();
@ -81,8 +83,8 @@ class nsXULThumbAccessible : public nsAccessibleWrap
public:
nsXULThumbAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
#endif

View File

@ -87,9 +87,10 @@ NS_IMETHODIMP nsXULTabAccessible::DoAction(PRUint8 index)
}
/** We are a tab */
NS_IMETHODIMP nsXULTabAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULTabAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_PAGETAB;
*aRole = nsIAccessibleRole::ROLE_PAGETAB;
return NS_OK;
}
@ -227,9 +228,10 @@ nsAccessibleWrap(aNode, aShell)
}
/** We are a window*/
NS_IMETHODIMP nsXULTabBoxAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULTabBoxAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_PANE;
*aRole = nsIAccessibleRole::ROLE_PANE;
return NS_OK;
}
@ -253,9 +255,10 @@ nsXULSelectableAccessible(aNode, aShell)
}
/** We are a Page Tab List */
NS_IMETHODIMP nsXULTabsAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULTabsAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_PAGETABLIST;
*aRole = nsIAccessibleRole::ROLE_PAGETABLIST;
return NS_OK;
}
@ -288,11 +291,9 @@ nsXULTabpanelAccessible::
{
}
NS_IMETHODIMP
nsXULTabpanelAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULTabpanelAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_PROPERTYPAGE;
return NS_OK;
}

View File

@ -54,7 +54,6 @@ public:
nsXULTabAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
NS_IMETHOD DoAction(PRUint8 index);
@ -63,6 +62,7 @@ public:
// nsAccessible
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -75,7 +75,9 @@ class nsXULTabBoxAccessible : public nsAccessibleWrap
{
public:
nsXULTabBoxAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
NS_IMETHOD GetRole(PRUint32 *_retval);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
/**
@ -87,12 +89,12 @@ public:
nsXULTabsAccessible(nsIDOMNode* aNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetValue(nsAString& _retval);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
/**
@ -107,9 +109,11 @@ public:
nsXULTabpanelAccessible(nsIDOMNode *aNode, nsIWeakReference *aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
nsIAccessibleRelation **aRelation);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
};
#endif

View File

@ -67,6 +67,13 @@ nsXULTextAccessible::GetNameInternal(nsAString& aName)
return NS_OK;
}
nsresult
nsXULTextAccessible::GetRoleInternal(PRUint32 *aRole)
{
*aRole = nsIAccessibleRole::ROLE_LABEL;
return NS_OK;
}
nsresult
nsXULTextAccessible::GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState)
{
@ -127,9 +134,10 @@ nsXULTooltipAccessible::GetStateInternal(PRUint32 *aState,
return NS_OK;
}
NS_IMETHODIMP nsXULTooltipAccessible::GetRole(PRUint32 *_retval)
nsresult
nsXULTooltipAccessible::GetRoleInternal(PRUint32 *aRole)
{
*_retval = nsIAccessibleRole::ROLE_TOOLTIP;
*aRole = nsIAccessibleRole::ROLE_TOOLTIP;
return NS_OK;
}
@ -176,11 +184,9 @@ nsXULLinkAccessible::GetNameInternal(nsAString& aName)
return nsTextEquivUtils::GetNameFromSubtree(this, aName);
}
NS_IMETHODIMP
nsXULLinkAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULLinkAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ENSURE_ARG_POINTER(aRole);
*aRole = nsIAccessibleRole::ROLE_LINK;
return NS_OK;
}

View File

@ -53,12 +53,12 @@ public:
nsXULTextAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole) { *aRole = nsIAccessibleRole::ROLE_LABEL; return NS_OK; }
NS_IMETHOD GetRelationByType(PRUint32 aRelationType,
nsIAccessibleRelation **aRelation);
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -68,10 +68,8 @@ class nsXULTooltipAccessible : public nsLeafAccessible
public:
nsXULTooltipAccessible(nsIDOMNode* aDomNode, nsIWeakReference* aShell);
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
};
@ -84,7 +82,6 @@ public:
NS_DECL_ISUPPORTS_INHERITED
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *aRole);
NS_IMETHOD GetValue(nsAString& aValue);
NS_IMETHOD GetNumActions(PRUint8 *aNumActions);
@ -96,6 +93,7 @@ public:
// nsAccessible
virtual nsresult GetNameInternal(nsAString& aName);
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:

View File

@ -238,7 +238,8 @@ nsXULTreeAccessible::Shutdown()
return NS_OK;
}
NS_IMETHODIMP nsXULTreeAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULTreeAccessible::GetRoleInternal(PRUint32 *aRole)
{
NS_ASSERTION(mTree, "No tree view");
PRInt32 colCount = 0;
@ -318,9 +319,9 @@ NS_IMETHODIMP nsXULTreeAccessible::GetFocusedChild(nsIAccessible **aFocusedChild
return NS_OK;
}
// nsIAccessible::getChildAtPoint(in long x, in long y)
// nsIAccessible::getDeepestChildAtPoint(in long x, in long y)
NS_IMETHODIMP
nsXULTreeAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
nsXULTreeAccessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIAccessible **aAccessible)
{
nsIFrame *frame = GetFrame();
@ -349,20 +350,12 @@ nsXULTreeAccessible::GetChildAtPoint(PRInt32 aX, PRInt32 aY,
// If we failed to find tree cell for the given point then it might be
// tree columns.
if (row == -1 || !column)
return nsXULSelectableAccessible::GetChildAtPoint(aX, aY, aAccessible);
return nsXULSelectableAccessible::
GetDeepestChildAtPoint(aX, aY, aAccessible);
return GetCachedTreeitemAccessible(row, column, aAccessible);
}
// nsIAccessible::getDeepestChildAtPoint(in long x, in long y)
NS_IMETHODIMP
nsXULTreeAccessible::GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIAccessible **aAccessible)
{
// Call getChildAtPoint until tree doesn't support complex content.
return GetChildAtPoint(aX, aY, aAccessible);
}
// Ask treeselection to get all selected children
NS_IMETHODIMP nsXULTreeAccessible::GetSelectedChildren(nsIArray **_retval)
{
@ -834,7 +827,8 @@ nsXULTreeitemAccessible::Init()
return GetName(mCachedName);
}
NS_IMETHODIMP nsXULTreeitemAccessible::GetRole(PRUint32 *aRole)
nsresult
nsXULTreeitemAccessible::GetRoleInternal(PRUint32 *aRole)
{
PRInt32 colCount = 0;
if (NS_SUCCEEDED(nsXULTreeAccessible::GetColumnCount(mTree, &colCount)) && colCount > 1)

View File

@ -62,7 +62,6 @@ public:
virtual ~nsXULTreeAccessible() {}
// nsIAccessible
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetValue(nsAString& _retval);
NS_IMETHOD GetFirstChild(nsIAccessible **_retval);
@ -70,8 +69,6 @@ public:
NS_IMETHOD GetChildCount(PRInt32 *_retval);
NS_IMETHOD GetFocusedChild(nsIAccessible **aFocusedChild);
NS_IMETHOD GetChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIAccessible **aAccessible);
NS_IMETHOD GetDeepestChildAtPoint(PRInt32 aX, PRInt32 aY,
nsIAccessible **aAccessible);
@ -79,6 +76,7 @@ public:
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
// nsXULTreeAccessible
@ -115,7 +113,6 @@ public:
// nsIAccessible
NS_IMETHOD GetName(nsAString& aName);
NS_IMETHOD GetRole(PRUint32 *_retval);
NS_IMETHOD GetNumActions(PRUint8 *_retval);
NS_IMETHOD GetActionName(PRUint8 aIndex, nsAString& aName);
virtual nsresult GetAttributesInternal(nsIPersistentProperties *aAttributes);
@ -141,6 +138,7 @@ public:
virtual nsresult Shutdown();
// nsAccessible
virtual nsresult GetRoleInternal(PRUint32 *aRole);
virtual nsresult GetStateInternal(PRUint32 *aState, PRUint32 *aExtraState);
protected:

View File

@ -0,0 +1,37 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="bug 471493 'crash [@ nsPropertyTable::GetPropertyInternal]'"
onload="doTest();">
<script type="application/javascript">
<![CDATA[
function doTest()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var accRetrieval = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
var treecol = document.getElementById("col");
var x = treecol.boxObject.screenX;
var y = treecol.boxObject.screenY;
var tree = document.getElementById("tree");
var treeAcc = accRetrieval.getAccessibleFor(tree);
treeAcc.getChildAtPoint(x + 1, y + 1);
}
]]>
</script>
<tree id="tree" flex="1">
<treecols>
<treecol id="col" flex="1" primary="true" label="column"/>
<treecol id="scol" flex="1" label="column 2"/>
</treecols>
<treechildren id="treechildren"/>
</tree>
</window>

View File

@ -0,0 +1 @@
load 471493.xul

View File

@ -51,6 +51,7 @@ _TEST_FILES =\
attributes.js \
common.js \
events.js \
layout.js \
namerules.xml \
nsIAccessible_actions.js \
nsIAccessible_name.css \
@ -61,11 +62,15 @@ _TEST_FILES =\
nsIAccessibleEditableText.js \
relations.js \
role.js \
test_actions_aria.html \
test_actions_inputs.html \
test_actions.xul \
test_aria_activedescendant.html \
test_aria_role_article.html \
test_aria_role_equation.html \
test_aria_token_attrs.html \
test_bug420863.html \
$(warning test_childAtPoint.xul temporarily disabled) \
test_cssattrs.html \
test_events_caretmove.html \
test_events_mutation.html \
@ -74,10 +79,8 @@ _TEST_FILES =\
test_groupattrs.html \
test_name_markup.html \
$(warning test_table_indexes.html temporarily disabled) \
test_nsIAccessible_actions.html \
$(warning test_nsIAccessible_actions.xul temporarily disabled) \
test_nsIAccessible_applicationAccessible.html \
test_nsIAccessible_comboboxes.xul \
$(warning test_nsIAccessible_comboboxes.xul temporarily disabled) \
test_nsIAccessible_name.html \
test_nsIAccessible_name_button.html \
test_nsIAccessible_name_link.html \
@ -90,10 +93,6 @@ _TEST_FILES =\
test_nsIAccessibleHyperLink.xul \
test_nsIAccessibleHyperText.html \
test_nsIAccessibleImage.html \
test_nsIAccessibleTable_1.html \
test_nsIAccessibleTable_2.html \
test_nsIAccessibleTable_3.html \
test_nsIAccessibleTable_4.html \
$(warning test_nsIAccessibleTable_listboxes.xul temporarily disabled) \
test_nsIAccessNode_utils.html \
test_nsOuterDocAccessible.html \
@ -107,6 +106,10 @@ _TEST_FILES =\
test_states_doc.html \
test_states_docarticle.html \
test_states_frames.html \
test_table_1.html \
test_table_2.html \
test_table_3.html \
test_table_4.html \
test_textattrs.html \
test_textboxes.html \
test_textboxes.xul \

View File

@ -44,37 +44,6 @@ const nsIDOMWindow = Components.interfaces.nsIDOMWindow;
const nsIPropertyElement = Components.interfaces.nsIPropertyElement;
////////////////////////////////////////////////////////////////////////////////
// Roles
const ROLE_PUSHBUTTON = nsIAccessibleRole.ROLE_PUSHBUTTON;
const ROLE_CELL = nsIAccessibleRole.ROLE_CELL;
const ROLE_CHROME_WINDOW = nsIAccessibleRole.ROLE_CHROME_WINDOW;
const ROLE_COMBOBOX = nsIAccessibleRole.ROLE_COMBOBOX;
const ROLE_COMBOBOX_LIST = nsIAccessibleRole.ROLE_COMBOBOX_LIST;
const ROLE_COMBOBOX_OPTION = nsIAccessibleRole.ROLE_COMBOBOX_OPTION;
const ROLE_DOCUMENT = nsIAccessibleRole.ROLE_DOCUMENT;
const ROLE_ENTRY = nsIAccessibleRole.ROLE_ENTRY;
const ROLE_FLAT_EQUATION = nsIAccessibleRole.ROLE_FLAT_EQUATION;
const ROLE_FORM = nsIAccessibleRole.ROLE_FORM;
const ROLE_GRAPHIC = nsIAccessibleRole.ROLE_GRAPHIC;
const ROLE_GRID_CELL = nsIAccessibleRole.ROLE_GRID_CELL;
const ROLE_GROUPING = nsIAccessibleRole.ROLE_GROUPING;
const ROLE_HEADING = nsIAccessibleRole.ROLE_HEADING;
const ROLE_IMAGE_MAP = nsIAccessibleRole.ROLE_IMAGE_MAP;
const ROLE_INTERNAL_FRAME = nsIAccessibleRole.ROLE_INTERNAL_FRAME;
const ROLE_LABEL = nsIAccessibleRole.ROLE_LABEL;
const ROLE_LINK = nsIAccessibleRole.ROLE_LINK;
const ROLE_LIST = nsIAccessibleRole.ROLE_LIST;
const ROLE_LISTBOX = nsIAccessibleRole.ROLE_LISTBOX;
const ROLE_OPTION = nsIAccessibleRole.ROLE_OPTION;
const ROLE_PARAGRAPH = nsIAccessibleRole.ROLE_PARAGRAPH;
const ROLE_PASSWORD_TEXT = nsIAccessibleRole.ROLE_PASSWORD_TEXT;
const ROLE_SECTION = nsIAccessibleRole.ROLE_SECTION;
const ROLE_TEXT_CONTAINER = nsIAccessibleRole.ROLE_TEXT_CONTAINER;
const ROLE_TEXT_LEAF = nsIAccessibleRole.ROLE_TEXT_LEAF;
const ROLE_TOGGLE_BUTTON = nsIAccessibleRole.ROLE_TOGGLE_BUTTON;
////////////////////////////////////////////////////////////////////////////////
// States
@ -265,11 +234,13 @@ function getAccessible(aAccOrElmOrID, aInterfaces, aElmObj, aDoNotFailIf)
}
/**
* Return true if the given identifier has an accessible.
* Return true if the given identifier has an accessible, or exposes the wanted
* interfaces.
*/
function isAccessible(aAccOrElmOrID)
function isAccessible(aAccOrElmOrID, aInterfaces)
{
return getAccessible(aAccOrElmOrID, null, null, DONOTFAIL_IF_NO_ACC) ?
return getAccessible(aAccOrElmOrID, aInterfaces, null,
DONOTFAIL_IF_NO_ACC | DONOTFAIL_IF_NO_INTERFACE) ?
true : false;
}

View File

@ -0,0 +1,58 @@
/**
* Tests if the given accessible at the given point is expected.
*
* @param aIdentifier [in] accessible identifier
* @param aX [in] x coordinate of the point relative accessible
* @param aY [in] y coordinate of the point relative accessible
* @param aFindDeepestChild [in] points whether deepest or nearest child should
* be returned
* @param aChildIdentifier [in] expected child accessible
*/
function testChildAtPoint(aIdentifier, aX, aY, aFindDeepestChild,
aChildIdentifier)
{
var childAcc = getAccessible(aChildIdentifier);
if (!childAcc)
return;
var actualChildAcc = getChildAtPoint(aIdentifier, aX, aY, aFindDeepestChild);
var msg = "Wrong " + (aFindDeepestChild ? "deepest" : "direct");
msg += " child accessible [" + prettyName(actualChildAcc);
msg += "] at the point (" + aX + ", " + aY + ") of accessible [";
msg += prettyName(aIdentifier) + "]";
is(childAcc, actualChildAcc, msg);
}
/**
* Return child accessible at the given point.
*
* @param aIdentifier [in] accessible identifier
* @param aX [in] x coordinate of the point relative accessible
* @param aY [in] y coordinate of the point relative accessible
* @param aFindDeepestChild [in] points whether deepest or nearest child should
* be returned
* @return the child accessible at the given point
*/
function getChildAtPoint(aIdentifier, aX, aY, aFindDeepestChild)
{
var nodeObj = { value: null };
var acc = getAccessible(aIdentifier, null, nodeObj);
var node = nodeObj.value;
if (!acc || !node)
return;
var deltaX = node.boxObject.screenX;
var deltaY = node.boxObject.screenY;
var x = deltaX + aX;
var y = deltaY + aY;
try {
if (aFindDeepestChild)
return acc.getDeepestChildAtPoint(x, y);
return acc.getChildAtPoint(x, y);
} catch (e) { }
return null;
}

View File

@ -55,7 +55,7 @@ function testThis(aID, aAcc, aNames, aRoles, aStates, aUndesiredStates, aIndex)
is(aAcc.name, aNames[aIndex],
"wrong name for " + aID + " at index " + aIndex + "!");
var role = aAcc.role;
var role = getRole(aAcc);
is(role, aRoles[aIndex],
"Wrong role for " + aID + " at index " + aIndex + "!");
testStates(aID, aAcc, aStates, aUndesiredStates, aIndex);

View File

@ -50,6 +50,16 @@ function testStates(aAccOrElmOrID, aState, aExtraState, aAbsentState,
is(state & STATE_COLLAPSED, 0,
"Expanded " + aAccOrElmOrID + " cannot be collapsed!");
if (state & STATE_CHECKED || state & STATE_MIXED)
is(state & STATE_CHECKABLE, STATE_CHECKABLE,
"Checked or mixed element must be checkable!");
if (state & STATE_CHECKED)
is(state & STATE_MIXED, 0, "Checked element cannot be state mixed!");
if (state & STATE_MIXED)
is(state & STATE_CHECKED, 0, "Mixed element cannot be state checked!");
if ((state & STATE_UNAVAILABLE)
&& (getRole(aAccOrElmOrID) != ROLE_GROUPING))
is(state & STATE_FOCUSABLE, STATE_FOCUSABLE,
@ -73,7 +83,7 @@ function testStatesInSubtree(aAccOrElmOrID, aState, aExtraState, aAbsentState)
if (!acc)
return;
if (acc.finalRole != ROLE_TEXT_LEAF)
if (getRole(acc) != ROLE_TEXT_LEAF)
// Right now, text leafs don't get tested because the states are not being
// propagated.
testStates(acc, aState, aExtraState, aAbsentState);

View File

@ -1,3 +1,52 @@
////////////////////////////////////////////////////////////////////////////////
// Role constants
const ROLE_ALERT = nsIAccessibleRole.ROLE_ALERT;
const ROLE_PUSHBUTTON = nsIAccessibleRole.ROLE_PUSHBUTTON;
const ROLE_CELL = nsIAccessibleRole.ROLE_CELL;
const ROLE_CHROME_WINDOW = nsIAccessibleRole.ROLE_CHROME_WINDOW;
const ROLE_COMBOBOX = nsIAccessibleRole.ROLE_COMBOBOX;
const ROLE_COMBOBOX_LIST = nsIAccessibleRole.ROLE_COMBOBOX_LIST;
const ROLE_COMBOBOX_OPTION = nsIAccessibleRole.ROLE_COMBOBOX_OPTION;
const ROLE_DOCUMENT = nsIAccessibleRole.ROLE_DOCUMENT;
const ROLE_ENTRY = nsIAccessibleRole.ROLE_ENTRY;
const ROLE_FLAT_EQUATION = nsIAccessibleRole.ROLE_FLAT_EQUATION;
const ROLE_FORM = nsIAccessibleRole.ROLE_FORM;
const ROLE_GRAPHIC = nsIAccessibleRole.ROLE_GRAPHIC;
const ROLE_GRID_CELL = nsIAccessibleRole.ROLE_GRID_CELL;
const ROLE_GROUPING = nsIAccessibleRole.ROLE_GROUPING;
const ROLE_HEADING = nsIAccessibleRole.ROLE_HEADING;
const ROLE_IMAGE_MAP = nsIAccessibleRole.ROLE_IMAGE_MAP;
const ROLE_INTERNAL_FRAME = nsIAccessibleRole.ROLE_INTERNAL_FRAME;
const ROLE_LABEL = nsIAccessibleRole.ROLE_LABEL;
const ROLE_LINK = nsIAccessibleRole.ROLE_LINK;
const ROLE_LIST = nsIAccessibleRole.ROLE_LIST;
const ROLE_LISTBOX = nsIAccessibleRole.ROLE_LISTBOX;
const ROLE_NOTHING = nsIAccessibleRole.ROLE_NOTHING;
const ROLE_OPTION = nsIAccessibleRole.ROLE_OPTION;
const ROLE_PARAGRAPH = nsIAccessibleRole.ROLE_PARAGRAPH;
const ROLE_PASSWORD_TEXT = nsIAccessibleRole.ROLE_PASSWORD_TEXT;
const ROLE_SECTION = nsIAccessibleRole.ROLE_SECTION;
const ROLE_TABLE = nsIAccessibleRole.ROLE_TABLE;
const ROLE_TEXT_CONTAINER = nsIAccessibleRole.ROLE_TEXT_CONTAINER;
const ROLE_TEXT_LEAF = nsIAccessibleRole.ROLE_TEXT_LEAF;
const ROLE_TOGGLE_BUTTON = nsIAccessibleRole.ROLE_TOGGLE_BUTTON;
////////////////////////////////////////////////////////////////////////////////
// Public methods
/**
* Test that the role of the given accessible is the role passed in.
*
* @param aAccOrElmOrID the accessible, DOM element or ID to be tested.
* @param aRole The role that is to be expected.
*/
function testRole(aAccOrElmOrID, aRole)
{
var role = getRole(aAccOrElmOrID);
is(role, aRole, "Wrong role for " + prettyName(aAccOrElmOrID) + "!");
}
/**
* Return the role of the given accessible. Return -1 if accessible could not
* be retrieved.
@ -13,22 +62,10 @@ function getRole(aAccOrElmOrID)
var role = -1;
try {
role = acc.finalRole;
role = acc.role;
} catch(e) {
ok(false, "Role for " + aAccOrElmOrID + " could not be retrieved!");
}
return role;
}
/**
* Test that the role of the given accessible is the role passed in.
*
* @param aAccOrElmOrID the accessible, DOM element or ID to be tested.
* @param aRole The role that is to be expected.
*/
function testRole(aAccOrElmOrID, aRole)
{
var role = getRole(aAccOrElmOrID);
is(role, aRole, "Wrong role for " + aAccOrElmOrID + "!");
}

View File

@ -38,7 +38,7 @@ function testThis(aID, aName, aValue, aDescription, aRole, aState,
is(acc.name, aName, "Wrong name for " + aID + "!");
testValue(aID, acc, aValue, aRole);
is(acc.description, aDescription, "Wrong description for " + aID + "!");
is(acc.role, aRole, "Wrong role for " + aID + "!");
testRole(aID, aRole);
testStates(acc, aState, aExtraState, aAbsentState);

View File

@ -40,6 +40,11 @@
actionName: "uncheck",
events: CLICK_EVENTS
},
{
ID: "checkbox_mixed",
actionName: "cycle",
events: CLICK_EVENTS
},
{
ID: "combobox_collapsed",
actionName: "open",
@ -118,11 +123,13 @@
<div id="clickable" onclick="">Clickable text</div>
<div id="button" role="button">Button</span>
<div id="button" role="button">Button</div>
<div id="checkbox_unchecked" role="checkbox">Checkbox</span>
<div id="checkbox_unchecked" role="checkbox">Checkbox</div>
<div id="checkbox_checked" role="checkbox" aria-checked="true">Checkbox</span>
<div id="checkbox_checked" role="checkbox" aria-checked="true">Checkbox</div>
<div id="checkbox_mixed" role="checkbox" aria-checked="mixed">Checkbox</div>
<div id="combobox_collapsed" role="combobox">
<div id="option" role="option">Option of collapsed combobox</div>

View File

@ -0,0 +1,83 @@
<html>
<head>
<title>nsIAccessible actions testing for inputs</title>
<link rel="stylesheet" type="text/css"
href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/nsIAccessible_actions.js"></script>
<script type="application/javascript">
function doTest()
{
var actionsArray = [
{
ID: "button",
actionName: "press",
events: CLICK_EVENTS
},
{
ID: "checkbox_unchecked",
actionName: "check",
events: CLICK_EVENTS
},
{
ID: "checkbox_checked",
actionName: "uncheck",
events: CLICK_EVENTS
},
{
ID: "checkbox_mixed",
actionName: "cycle",
events: CLICK_EVENTS
},
{
ID: "radio",
actionName: "select",
events: CLICK_EVENTS
}
];
document.getElementById("checkbox_mixed").indeterminate = true;
testActions(actionsArray);
}
SimpleTest.waitForExplicitFinish();
addLoadEvent(doTest);
</script>
</head>
<body>
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=477975"
title="nsIAccessible actions testing">
Mozilla Bug 477975
</a>
<p id="display"></p>
<div id="content" style="display: none"></div>
<pre id="test">
</pre>
<button id="button" value="button">Button</button>
<input id="checkbox_unchecked" type="checkbox">Checkbox</input>
<input id="checkbox_checked" type="checkbox" checked="true">Checkbox</input>
<input id="checkbox_mixed" type="checkbox">Checkbox</input>
<fieldset>
<input id="radio" type="radio">Radio</input>
</fieldset>
</body>
</html>

View File

@ -14,17 +14,18 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=429666
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="application/javascript">
function doTest()
{
// Test article exposed as document
testRole("testArticle", ROLE_DOCUMENT);
var articleAcc = getAccessible("testArticle");
if (articleAcc) {
is(articleAcc.finalRole, ROLE_DOCUMENT,
"Wrong role for article!");
if (articleAcc)
is(articleAcc.name, "Test article", "Wrong name for article!");
}
SimpleTest.finish();
}

View File

@ -14,17 +14,17 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=428479
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="application/javascript">
function testThis(aID)
{
getRole(aID, ROLE_FLAT_EQUATION);
var eqAcc = getAccessible(aID);
if (eqAcc) {
is(eqAcc.finalRole, ROLE_FLAT_EQUATION,
"Wrong role for " + aID +"!");
if (eqAcc)
is(eqAcc.name, "x^2 + y^2 + z^2", "Wrong name for " + aID + "!");
}
}
function doTest()
{

View File

@ -14,6 +14,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=452388
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/nsIAccessible_states.js"></script>
@ -62,21 +64,11 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=452388
testStates("button_pressed_absent", 0, 0, STATE_PRESSED | STATE_CHECKABLE);
// test aria-pressed state mapping to roles PUSHBUTTON vs TOGGLEBUTTON
var aButton = getAccessible("button_pressed_true");
if (aButton)
is(aButton.finalRole, ROLE_TOGGLE_BUTTON, "Wrong role for togglebutton!");
aButton = getAccessible("button_pressed_false");
if (aButton)
is(aButton.finalRole, ROLE_TOGGLE_BUTTON, "Wrong role for togglebutton!");
aButton = getAccessible("button_pressed_empty");
if (aButton)
is(aButton.finalRole, ROLE_PUSHBUTTON, "Wrong role for button!");
aButton = getAccessible("button_pressed_undefined");
if (aButton)
is(aButton.finalRole, ROLE_PUSHBUTTON, "Wrong role for button!");
aButton = getAccessible("button_pressed_absent");
if (aButton)
is(aButton.finalRole, ROLE_PUSHBUTTON, "Wrong role for button!");
testRole("button_pressed_true", ROLE_TOGGLE_BUTTON);
testRole("button_pressed_false", ROLE_TOGGLE_BUTTON);
testRole("button_pressed_empty", ROLE_PUSHBUTTON);
testRole("button_pressed_undefined", ROLE_PUSHBUTTON);
testRole("button_pressed_absent", ROLE_PUSHBUTTON);
SimpleTest.finish();
}

View File

@ -0,0 +1,74 @@
<?xml version="1.0"?>
<?xml-stylesheet href="chrome://global/skin" type="text/css"?>
<?xml-stylesheet href="chrome://mochikit/content/tests/SimpleTest/test.css"
type="text/css"?>
<window xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
title="nsIAccessible::getChildAtPoint and getDeepestChildAtPoint">
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js" />
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/treeview.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/layout.js" />
<script type="application/javascript">
<![CDATA[
function doTest()
{
// Initialize the tree
var view = new inTreeView();
view.mRowCount = 5;
var tree = getNode("tree");
var treeBox = tree.treeBoxObject;
treeBox.view = view;
// Tests
var treecols = getNode("treecols");
var x = treecols.boxObject.x;
var y = treecols.boxObject.y;
testChildAtPoint(tree, x, y, false, treecols);
testChildAtPoint(tree, x, y, true, "col1");
SimpleTest.finish();
}
SimpleTest.waitForExplicitFinish();
addA11yLoadEvent(doTest);
]]>
</script>
<hbox flex="1" style="overflow: auto;">
<body xmlns="http://www.w3.org/1999/xhtml">
<a target="_blank"
href="https://bugzilla.mozilla.org/show_bug.cgi?id=471493"
title=" crash [@ nsPropertyTable::GetPropertyInternal]">
Mozilla Bug 471493
</a><br/>
<p id="display"></p>
<div id="content" style="display: none">
</div>
<pre id="test">
</pre>
</body>
<tree id="tree" flex="1">
<treecols id="treecols">
<treecol id="col1" flex="1" primary="true" label="column"/>
<treecol id="col2" flex="1" label="column 2"/>
</treecols>
<treechildren id="treechildren"/>
</tree>
</hbox>
</window>

View File

@ -11,6 +11,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=441737
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/nsIAccessible_states.js"></script>
@ -23,8 +25,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=441737
// nsIAccessible
is(docAcc.name, "nsIAccessibleDocument chrome tests",
"Name for document accessible not correct!");
is(docAcc.role, nsIAccessibleRole.ROLE_DOCUMENT,
"Wrong role for document!");
testRole(docAcc, ROLE_DOCUMENT);
// check if it is focusable, read-only.
testStates(docAcc, (STATE_READONLY | STATE_FOCUSABLE));

View File

@ -10,15 +10,16 @@
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="application/javascript">
<![CDATA[
var gAccService = null;
var Ci = Components.interfaces;
function doTest()
{
gAccService = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
var id = "";
var listbox = null, acc = null;
@ -26,12 +27,11 @@
// Simple listbox. There is no nsIAccessibleTable interface.
id = "listbox1";
listbox = document.getElementById(id);
acc = gAccService.getAccessibleFor(listbox);
acc = getAccessible(id);
// query nsIAccessibleTable
try {
acc.QueryInterface(Ci.nsIAccessibleTable);
acc.QueryInterface(nsIAccessibleTable);
ok(false,
id + " shouldn't implement nsIAccessibleTable interface.");
} catch(e) {
@ -39,28 +39,16 @@
}
// role
is(acc.role, Ci.nsIAccessibleRole.ROLE_LISTBOX,
id + " has wrong role.");
testRole(id, ROLE_LISTBOX);
//////////////////////////////////////////////////////////////////////////
// Multicolumn listbox.
id = "listbox2";
listbox = document.getElementById(id);
acc = gAccService.getAccessibleFor(listbox);
acc = getAccessible(id, [nsIAccessibleTable]);
// role
is(acc.role, Ci.nsIAccessibleRole.ROLE_TABLE,
id + " has wrong role.");
// query nsIAccessibleTable
try {
acc.QueryInterface(Ci.nsIAccessibleTable);
ok(true,
id + " implements nsIAccessibleTable interface.");
} catch(e) {
ok(false, id + " doesn't implement nsIAccessibleTable interface.");
}
testRole(acc, ROLE_TABLE);
// rows count
var rowsCount = acc.rows;
@ -74,21 +62,10 @@
// Multicolumn listbox with header.
id = "listbox3";
listbox = document.getElementById(id);
acc = gAccService.getAccessibleFor(listbox);
acc = getAccessible(id, [nsIAccessibleTable]);
// role
is(acc.role, Ci.nsIAccessibleRole.ROLE_TABLE,
id + " has wrong role.");
// query nsIAccessibleTable
try {
acc.QueryInterface(Ci.nsIAccessibleTable);
ok(true,
id + " implements nsIAccessibleTable interface.");
} catch(e) {
ok(false, id + " doesn't implement nsIAccessibleTable interface.");
}
testRole(acc, ROLE_TABLE);
// rows count
var rowsCount = acc.rows;

View File

@ -13,8 +13,11 @@
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/nsIAccessible_name.js"></script>
<script type="application/javascript">
@ -140,8 +143,7 @@
// Element from anonymous content of direct child of toolbaritem.
var dropmarkerAcc = textboxAcc.lastChild;
is(dropmarkerAcc.finalRole, nsIAccessibleRole.ROLE_PUSHBUTTON,
"The last child of autocomplete textbox 'toolbaritem_textbox' should be dropmarker.");
testRole(dropmarkerAcc, ROLE_PUSHBUTTON);
is(dropmarkerAcc.name, "ooospspss",
"Wrong name for dropmarker of autocomplete textbox 'toolbaritem_textbox'.");

View File

@ -10,6 +10,8 @@
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/nsIAccessible_selects.js"></script>

View File

@ -30,6 +30,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=475006
testAttrs("checkedRadio", {"checkable" : "true"}, true);
testAttrs("checkedTreeitem", {"checkable" : "true"}, true);
testAttrs("dropeffect", {"dropeffect" : "copy"}, true);
testAttrs("sortAscending", {"sort" : "ascending"}, true);
testAttrs("sortDescending", {"sort" : "descending"}, true);
testAttrs("sortNone", {"sort" : "none"}, true);
testAttrs("sortOther", {"sort" : "other"}, true);
// live object attribute
testAttrs("live", {"live" : "polite"}, true);
@ -80,6 +84,10 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=475006
<div id="checkedRadio" role="radio" aria-checked="true"></div>
<div id="checkedTreeitem" role="treeitem" aria-checked="true"></div>
<div id="dropeffect" aria-dropeffect="copy"></div>
<div id="sortAscending" role="columnheader" aria-sort="ascending"></div>
<div id="sortDescending" role="columnheader" aria-sort="descending"></div>
<div id="sortNone" role="columnheader" aria-sort="none"></div>
<div id="sortOther" role="columnheader" aria-sort="other"></div>
<div id="live" aria-live="polite">excuse <div id="liveChild">me</div></div>
<div id="live2" role="marquee" aria-live="polite">excuse <div id="live2Child">me</div></div>

View File

@ -8,10 +8,13 @@
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/relations.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="application/javascript">
function doTest()
@ -95,7 +98,7 @@
parentOfDocAcc = getAccessible(docAcc.parent, [nsIAccessNode]);
parentDocAcc = getAccessible(parentOfDocAcc.accessibleDocument,
[nsIAccessible]);
} while (parentDocAcc.finalRole != ROLE_CHROME_WINDOW)
} while (getRole(parentDocAcc) != ROLE_CHROME_WINDOW)
testRelation(parentDocAcc, RELATION_EMBEDS, docAcc);

View File

@ -15,6 +15,8 @@
src="chrome://mochikit/content/a11y/accessible/common.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/relations.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js" />
<script type="application/javascript">
<![CDATA[
@ -93,7 +95,7 @@
parentOfDocAcc = getAccessible(docAcc.parent, [nsIAccessNode]);
parentDocAcc = getAccessible(parentOfDocAcc.accessibleDocument,
[nsIAccessible]);
} while (parentDocAcc.finalRole != ROLE_CHROME_WINDOW)
} while (getRole(parentDocAcc) != ROLE_CHROME_WINDOW)
testRelation(parentDocAcc, RELATION_EMBEDS, docAcc);

View File

@ -30,9 +30,12 @@
checkboxElem.checked = false;
testStates(checkboxElem, 0, 0, STATE_CHECKED);
checkboxElem.indeterminate = true;
testStates(checkboxElem, STATE_MIXED, 0, STATE_CHECKED);
testStates(checkboxElem, STATE_MIXED, 0);
}
testStates("aria_checked_checkbox", STATE_CHECKED);
testStates("aria_mixed_checkbox", STATE_MIXED);
// test disabled group and all its descendants to see if they are
// disabled, too. See bug 429285.
testStatesInSubtree("group", STATE_UNAVAILABLE);
@ -69,6 +72,14 @@
<input type="checkbox" id="check1" value="I agree" checked="true"/>
<div id="aria_checked_checkbox" role="checkbox" aria-checked="true">
I agree
</div>
<div id="aria_mixed_checkbox" role="checkbox" aria-checked="mixed">
I might agree
</div>
<!-- Test that aria-disabled state gets propagated to all descendants -->
<div id="group" role="group" aria-disabled="true">
<button>hi</button>

View File

@ -3,23 +3,23 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript">
function doTest()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var table = document.getElementById("table");
var accService = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
var accTable = accService.getAccessibleFor(table).
QueryInterface(Components.interfaces.nsIAccessibleTable);
var accTable = getAccessible("table", [nsIAccessibleTable]);
var caption = accTable.caption;
is(caption.firstChild.name, "Test Table", "wrong text inside caption");
const nsIAccessNode = Components.interfaces.nsIAccessible;
is(caption.children.queryElementAt(0, nsIAccessNode).name, "Test Table",
is(caption.children.queryElementAt(0, nsIAccessible).name, "Test Table",
"wrong text inside caption");
is(accTable.summary, "this is a test table for nsIAccessibleTable",
@ -31,34 +31,33 @@ function doTest()
if (s.rangeCount > 0)
s.removeAllRanges();
var cell = document.getElementById("col2b");
var cell = getNode("col2b");
var range = document.createRange();
range.selectNode(cell);
s.addRange(range);
is(accTable.selectedCellsCount, 1, "only one cell selected");
cell = document.getElementById("col2a");
cell = getNode("col2a");
range.selectNode(cell);
s.addRange(range);
cell = document.getElementById("col2c");
cell = getNode("col2c");
range.selectNode(cell);
s.addRange(range);
is(accTable.selectedColumnsCount, 1, "only one column selected");
cell = document.getElementById("row2a");
cell = getNode("row2a");
range.selectNode(cell);
s.addRange(range);
cell = document.getElementById("row2b");
cell = getNode("row2b");
range.selectNode(cell);
s.addRange(range);
cell = document.getElementById("row2c");
cell = getNode("row2c");
range.selectNode(cell);
s.addRange(range);
is(accTable.selectedRowsCount, 1, "no cells selected");
var rowheader;
var works;
works = true;
var works = true;
try {
rowheader = accTable.rowHeader;
}

View File

@ -4,21 +4,20 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> nsIAccessibleTable Interface Test Case </title>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="text/javascript">
function doTest()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var accService = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
// bug 410052
var table = document.getElementById("table");
var accTable = accService.getAccessibleFor(table).
QueryInterface(Components.interfaces.nsIAccessibleTable);
var accTable = getAccessible("table", [nsIAccessibleTable]);
is(accTable.getIndexAt(2,4), 17, "wrong index returned");
is(accTable.getColumnAtIndex(18), 5, "got wrong column");
@ -32,9 +31,7 @@ function doTest()
is(accTable.cellRefAt(2,1).firstChild.name, "c1", "wrong cell");
// bug 417912
var table2 = document.getElementById("table2");
var accTable2 = accService.getAccessibleFor(table2).
QueryInterface(Components.interfaces.nsIAccessibleTable);
var accTable2 = getAccessible("table2", [nsIAccessibleTable]);
testCellAt(accTable2, 0, 0, true);
testCellAt(accTable2, 0, 1, true);
testCellAt(accTable2, 0, 2, true);

View File

@ -4,32 +4,29 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<title> nsIAccessibleTable Interface Test Case </title>
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="text/javascript">
function doTest()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var table = document.getElementById("table");
var accService = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
var accTable = accService.getAccessibleFor(table).
QueryInterface(Components.interfaces.nsIAccessibleTable);
var accTable = getAccessible("table", [nsIAccessibleTable]);
is(accTable.getSelectedCells({}).length, 0, "no cell selected");
for (var i = 0; i < 4; i++) {
accTable.selectRow(i);
for (var j = 0; j < 4; j++) {
if (i == j) {
for (var j = 0; j < 4; j++)
if (i == j)
ok(accTable.isRowSelected(i),"row not selected");
}
else {
else
todo(!accTable.isRowSelected(i),"row selected");
}
}
}
todo_is(accTable.selectedRowsCount, 1, "only one row should be selected");
todo_is(accTable.getSelectedRows({}).length, 1,
"only one row should be selected");
@ -48,15 +45,12 @@ function doTest()
is(accTable.selectedCellsCount, 0, "no cell selected");
for (var i = 0; i < 8; i++) {
accTable.selectColumn(i);
for (var j = 0; j < 8; j++) {
if (i ==j) {
for (var j = 0; j < 8; j++)
if (i ==j)
ok(accTable.isColumnSelected(i),"column not selected");
}
else {
else
todo(!accTable.isColumnSelected(i),"column is selected");
}
}
}
todo_is(accTable.selectedColumnsCount, 1,
"only one column should be selected");
todo_is(accTable.getSelectedColumns({}).length, 1,

View File

@ -3,67 +3,46 @@
<head>
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<link rel="stylesheet" type="text/css" href="chrome://mochikit/content/tests/SimpleTest/test.css" />
<script type="application/javascript" src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript" src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/MochiKit/packed.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/tests/SimpleTest/SimpleTest.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="text/javascript">
function doTest()
{
netscape.security.PrivilegeManager.enablePrivilege("UniversalXPConnect");
var accService = Components.classes["@mozilla.org/accessibleRetrieval;1"].
getService(Components.interfaces.nsIAccessibleRetrieval);
var Ci = Components.interfaces;
// Test table with display:inline. We shouldn't create table accessible and
// table cell accessible in this case
var table1 = document.getElementById("table1");
var accNotCreated = false;
try {
var accTable1 = accService.getAccessibleFor(table1);
} catch (e) {
accNotCreated = true;
}
var accNotCreated = (!isAccessible("table1"));
ok(accNotCreated, "wrongly created table accessible");
if (accNotCreated) {
var div = document.getElementById("div");
var accDiv = accService.getAccessibleFor(div);
var accDiv = getAccessible("div");
is(accDiv.firstChild.name, "cell", "wrongly created table cell accessible");
}
// Test table with display:inline and have an another outside table
var table2 = document.getElementById("table2");
accNotCreated = false;
try {
var accTable2 = accService.getAccessibleFor(table2);
} catch (e) {
accNotCreated = true;
}
accNotCreated = (!isAccessible("table2"));
ok(accNotCreated, "wrongly created table accessible");
var cell = document.getElementById("cell");
accNotCreated = false;
try {
var accCell = accService.getAccessibleFor(cell);
} catch (e) {
accNotCreated = true;
}
accNotCreated = (!isAccessible("cell"));
ok(accNotCreated, "wrongly created table cell accessible");
// Test table with role=alert.
var table3 = document.getElementById("table3");
var accTable3;
var tableInterfaceExposed = true;
try {
accTable3 = accService.getAccessibleFor(table3).
QueryInterface(Components.interfaces.nsIAccessibleTable);
} catch (e) {
var accTable3 = getAccessible("table3", [nsIAccessibleTable], null, DONOTFAIL_IF_NO_INTERFACE);
if (!accTable3)
tableInterfaceExposed = false;
}
ok(tableInterfaceExposed, "table interface is not exposed");
if (tableInterfaceExposed) {
is(accTable3.finalRole, Ci.nsIAccessibleRole.ROLE_ALERT, "wrong role");
testRole(accTable3, ROLE_ALERT);
is(accTable3.cellRefAt(0,0).firstChild.name, "cell0", "wrong cell");
is(accTable3.cellRefAt(0,1).firstChild.name, "cell1", "wrong cell");
@ -71,28 +50,17 @@ function doTest()
// Test table with role=log and aria property in tr. We create accessible for
// tr in this case.
var table4 = document.getElementById("table4");
var accTable4;
tableInterfaceExposed = true;
try {
accTable4 = accService.getAccessibleFor(table4).
QueryInterface(Components.interfaces.nsIAccessibleTable);
} catch (e) {
var accTable4 = getAccessible("table4", [nsIAccessibleTable], null, DONOTFAIL_IF_NO_INTERFACE);
if (!accTable4)
tableInterfaceExposed = false;
}
ok(tableInterfaceExposed, "table interface is not exposed");
if (tableInterfaceExposed) {
var tr = document.getElementById("tr");
accNotCreated = false;
try {
var accTr = accService.getAccessibleFor(tr);
} catch (e) {
accNotCreated = true;
}
accNotCreated = (!isAccessible("tr"));
ok(!accNotCreated, "missed tr accessible");
is(accTable4.role, Ci.nsIAccessibleRole.ROLE_TABLE, "wrong role");
testRole(accTable4, ROLE_NOTHING); // XXX: it's a bug, should be ROLE_TABLE
is(accTable4.cellRefAt(0,0).firstChild.name, "cell0", "wrong cell");
is(accTable4.cellRefAt(0,1).firstChild.name, "cell1", "wrong cell");
@ -103,21 +71,9 @@ function doTest()
// Test table with display:inline and an outside table. We shouldn't be fooled
// by the outside table and shouldn't create table accessible and table cell
// accessible in this case
var table5 = document.getElementById("table5");
accNotCreated = false;
try {
var accTable1 = accService.getAccessibleFor(table1);
} catch (e) {
accNotCreated = true;
}
accNotCreated = (!isAccessible("table5"));
ok(accNotCreated, "wrongly created table accessible");
var t5Cell = document.getElementById("t5_cell");
accNotCreated = false;
try {
var accCell = accService.getAccessibleFor(t5Cell);
} catch (e) {
accNotCreated = true;
}
accNotCreated = (!isAccessible("t5_cell"));
ok(accNotCreated, "wrongly created table cell accessible");
SimpleTest.finish();

View File

@ -14,6 +14,8 @@ https://bugzilla.mozilla.org/show_bug.cgi?id=442648
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js"></script>
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/nsIAccessible_states.js"></script>

View File

@ -13,6 +13,8 @@
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/common.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/role.js" />
<script type="application/javascript"
src="chrome://mochikit/content/a11y/accessible/nsIAccessible_states.js" />

3
aclocal.m4 vendored
View File

@ -11,6 +11,9 @@ builtin(include, build/autoconf/pkg.m4)dnl
builtin(include, build/autoconf/freetype2.m4)dnl
builtin(include, build/autoconf/codeset.m4)dnl
builtin(include, build/autoconf/altoptions.m4)dnl
builtin(include, build/autoconf/mozprog.m4)dnl
MOZ_PROG_CHECKMSYS()
# Read the user's .mozconfig script. We can't do this in
# configure.in: autoconf puts the argument parsing code above anything

View File

@ -77,7 +77,7 @@ ifdef SOURCE_STAMP
DEFINES += -DMOZ_SOURCE_STAMP="$(SOURCE_STAMP)"
endif
SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed s/^ssh:/http:/)
SOURCE_REPO := $(shell hg -R $(topsrcdir) showconfig paths.default 2>/dev/null | sed -e "s/^ssh:/http:/")
ifdef SOURCE_REPO
DEFINES += -DMOZ_SOURCE_REPO="$(SOURCE_REPO)"
endif

Some files were not shown because too many files have changed in this diff Show More