зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1695765 - Use Accessible base type in XPCOM instead of AccessibleOrProxy. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D104927
This commit is contained in:
Родитель
f43b9d5fe9
Коммит
d6a5ece8c2
|
@ -22,6 +22,14 @@ namespace a11y {
|
|||
*/
|
||||
class AccessibleOrProxy {
|
||||
public:
|
||||
// XXX: A temporary constructor to aid in the transition to
|
||||
// an Accessible base class.
|
||||
MOZ_IMPLICIT AccessibleOrProxy(Accessible* aAcc)
|
||||
: mBits(aAcc ? (aAcc->IsRemote()
|
||||
? reinterpret_cast<uintptr_t>(aAcc->AsRemote()) |
|
||||
IS_PROXY
|
||||
: reinterpret_cast<uintptr_t>(aAcc->AsLocal()))
|
||||
: 0) {}
|
||||
MOZ_IMPLICIT AccessibleOrProxy(LocalAccessible* aAcc)
|
||||
: mBits(reinterpret_cast<uintptr_t>(aAcc)) {}
|
||||
MOZ_IMPLICIT AccessibleOrProxy(RemoteAccessible* aProxy)
|
||||
|
|
|
@ -527,8 +527,18 @@ uint16_t RuleCache::Match(const AccessibleOrProxy& aAccOrProxy) {
|
|||
}
|
||||
|
||||
uint16_t matchResult = nsIAccessibleTraversalRule::FILTER_IGNORE;
|
||||
DebugOnly<nsresult> rv = mRule->Match(ToXPC(aAccOrProxy), &matchResult);
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
|
||||
// XXX: ToXPC takes an Accessible. This can go away when pivot
|
||||
// removes AoP too.
|
||||
if (aAccOrProxy.IsProxy()) {
|
||||
DebugOnly<nsresult> rv =
|
||||
mRule->Match(ToXPC(aAccOrProxy.AsProxy()), &matchResult);
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
} else {
|
||||
DebugOnly<nsresult> rv =
|
||||
mRule->Match(ToXPC(aAccOrProxy.AsAccessible()), &matchResult);
|
||||
MOZ_ASSERT(NS_SUCCEEDED(rv));
|
||||
}
|
||||
|
||||
return result | matchResult;
|
||||
}
|
||||
|
|
|
@ -807,7 +807,7 @@ xpcAccessibleGeneric* DocAccessibleParent::GetXPCAccessible(
|
|||
xpcAccessibleDocument* doc = GetAccService()->GetXPCDocument(this);
|
||||
MOZ_ASSERT(doc);
|
||||
|
||||
return doc->GetXPCAccessible(aProxy);
|
||||
return doc->GetAccessible(aProxy);
|
||||
}
|
||||
|
||||
#if defined(XP_WIN)
|
||||
|
|
|
@ -32,6 +32,7 @@ EXPORTS += [
|
|||
|
||||
LOCAL_INCLUDES += [
|
||||
"/accessible/base",
|
||||
"/accessible/basetypes",
|
||||
"/accessible/generic",
|
||||
]
|
||||
|
||||
|
|
|
@ -29,9 +29,9 @@ NS_IMETHODIMP
|
|||
xpcAccessible::GetParent(nsIAccessible** aParent) {
|
||||
NS_ENSURE_ARG_POINTER(aParent);
|
||||
*aParent = nullptr;
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
AccessibleOrProxy parent = IntlGeneric().Parent();
|
||||
Accessible* parent = IntlGeneric()->Parent();
|
||||
NS_IF_ADDREF(*aParent = ToXPC(parent));
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -40,39 +40,22 @@ NS_IMETHODIMP
|
|||
xpcAccessible::GetNextSibling(nsIAccessible** aNextSibling) {
|
||||
NS_ENSURE_ARG_POINTER(aNextSibling);
|
||||
*aNextSibling = nullptr;
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (IntlGeneric().IsAccessible()) {
|
||||
nsresult rv = NS_OK;
|
||||
NS_IF_ADDREF(*aNextSibling = ToXPC(Intl()->GetSiblingAtOffset(1, &rv)));
|
||||
return rv;
|
||||
}
|
||||
NS_IF_ADDREF(*aNextSibling = ToXPC(IntlGeneric()->NextSibling()));
|
||||
|
||||
RemoteAccessible* proxy = IntlGeneric().AsProxy();
|
||||
NS_ENSURE_STATE(proxy);
|
||||
|
||||
NS_IF_ADDREF(*aNextSibling = ToXPC(proxy->RemoteNextSibling()));
|
||||
return *aNextSibling ? NS_OK : NS_ERROR_FAILURE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::GetPreviousSibling(nsIAccessible** aPreviousSibling) {
|
||||
NS_ENSURE_ARG_POINTER(aPreviousSibling);
|
||||
*aPreviousSibling = nullptr;
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (IntlGeneric().IsAccessible()) {
|
||||
nsresult rv = NS_OK;
|
||||
NS_IF_ADDREF(*aPreviousSibling =
|
||||
ToXPC(Intl()->GetSiblingAtOffset(-1, &rv)));
|
||||
return rv;
|
||||
}
|
||||
NS_IF_ADDREF(*aPreviousSibling = ToXPC(IntlGeneric()->PrevSibling()));
|
||||
|
||||
RemoteAccessible* proxy = IntlGeneric().AsProxy();
|
||||
NS_ENSURE_STATE(proxy);
|
||||
|
||||
NS_IF_ADDREF(*aPreviousSibling = ToXPC(proxy->RemotePrevSibling()));
|
||||
return *aPreviousSibling ? NS_OK : NS_ERROR_FAILURE;
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
|
@ -80,9 +63,9 @@ xpcAccessible::GetFirstChild(nsIAccessible** aFirstChild) {
|
|||
NS_ENSURE_ARG_POINTER(aFirstChild);
|
||||
*aFirstChild = nullptr;
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
NS_IF_ADDREF(*aFirstChild = ToXPC(IntlGeneric().FirstChild()));
|
||||
NS_IF_ADDREF(*aFirstChild = ToXPC(IntlGeneric()->FirstChild()));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -91,9 +74,9 @@ xpcAccessible::GetLastChild(nsIAccessible** aLastChild) {
|
|||
NS_ENSURE_ARG_POINTER(aLastChild);
|
||||
*aLastChild = nullptr;
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
NS_IF_ADDREF(*aLastChild = ToXPC(IntlGeneric().LastChild()));
|
||||
NS_IF_ADDREF(*aLastChild = ToXPC(IntlGeneric()->LastChild()));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -101,9 +84,9 @@ NS_IMETHODIMP
|
|||
xpcAccessible::GetChildCount(int32_t* aChildCount) {
|
||||
NS_ENSURE_ARG_POINTER(aChildCount);
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
*aChildCount = IntlGeneric().ChildCount();
|
||||
*aChildCount = IntlGeneric()->ChildCount();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -112,14 +95,14 @@ xpcAccessible::GetChildAt(int32_t aChildIndex, nsIAccessible** aChild) {
|
|||
NS_ENSURE_ARG_POINTER(aChild);
|
||||
*aChild = nullptr;
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
// If child index is negative, then return last child.
|
||||
// XXX: do we really need this?
|
||||
if (aChildIndex < 0) aChildIndex = IntlGeneric().ChildCount() - 1;
|
||||
if (aChildIndex < 0) aChildIndex = IntlGeneric()->ChildCount() - 1;
|
||||
|
||||
AccessibleOrProxy child = IntlGeneric().ChildAt(aChildIndex);
|
||||
if (child.IsNull()) return NS_ERROR_INVALID_ARG;
|
||||
Accessible* child = IntlGeneric()->ChildAt(aChildIndex);
|
||||
if (!child) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
NS_ADDREF(*aChild = ToXPC(child));
|
||||
return NS_OK;
|
||||
|
@ -130,16 +113,16 @@ xpcAccessible::GetChildren(nsIArray** aChildren) {
|
|||
NS_ENSURE_ARG_POINTER(aChildren);
|
||||
*aChildren = nullptr;
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
nsresult rv = NS_OK;
|
||||
nsCOMPtr<nsIMutableArray> children =
|
||||
do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
|
||||
NS_ENSURE_SUCCESS(rv, rv);
|
||||
|
||||
uint32_t childCount = IntlGeneric().ChildCount();
|
||||
uint32_t childCount = IntlGeneric()->ChildCount();
|
||||
for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
|
||||
AccessibleOrProxy child = IntlGeneric().ChildAt(childIdx);
|
||||
Accessible* child = IntlGeneric()->ChildAt(childIdx);
|
||||
children->AppendElement(static_cast<nsIAccessible*>(ToXPC(child)));
|
||||
}
|
||||
|
||||
|
@ -151,13 +134,9 @@ NS_IMETHODIMP
|
|||
xpcAccessible::GetIndexInParent(int32_t* aIndexInParent) {
|
||||
NS_ENSURE_ARG_POINTER(aIndexInParent);
|
||||
*aIndexInParent = -1;
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (IntlGeneric().IsAccessible()) {
|
||||
*aIndexInParent = Intl()->IndexInParent();
|
||||
} else if (IntlGeneric().IsProxy()) {
|
||||
*aIndexInParent = IntlGeneric().AsProxy()->IndexInParent();
|
||||
}
|
||||
*aIndexInParent = IntlGeneric()->IndexInParent();
|
||||
|
||||
return *aIndexInParent != -1 ? NS_OK : NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -166,12 +145,12 @@ NS_IMETHODIMP
|
|||
xpcAccessible::GetUniqueID(int64_t* aUniqueID) {
|
||||
NS_ENSURE_ARG_POINTER(aUniqueID);
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (IntlGeneric().IsAccessible()) {
|
||||
if (IntlGeneric()->IsLocal()) {
|
||||
*aUniqueID = reinterpret_cast<uintptr_t>(Intl()->UniqueID());
|
||||
} else if (IntlGeneric().IsProxy()) {
|
||||
*aUniqueID = IntlGeneric().AsProxy()->ID();
|
||||
} else if (IntlGeneric()->IsRemote()) {
|
||||
*aUniqueID = IntlGeneric()->AsRemote()->ID();
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -192,7 +171,11 @@ xpcAccessible::GetDOMNode(nsINode** aDOMNode) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::GetId(nsAString& aID) {
|
||||
RemoteAccessible* proxy = IntlGeneric().AsProxy();
|
||||
if (!IntlGeneric()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
RemoteAccessible* proxy = IntlGeneric()->AsRemote();
|
||||
if (!proxy) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
@ -231,9 +214,9 @@ xpcAccessible::GetRole(uint32_t* aRole) {
|
|||
NS_ENSURE_ARG_POINTER(aRole);
|
||||
*aRole = nsIAccessibleRole::ROLE_NOTHING;
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
*aRole = IntlGeneric().Role();
|
||||
*aRole = IntlGeneric()->Role();
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
@ -241,12 +224,12 @@ NS_IMETHODIMP
|
|||
xpcAccessible::GetState(uint32_t* aState, uint32_t* aExtraState) {
|
||||
NS_ENSURE_ARG_POINTER(aState);
|
||||
|
||||
if (IntlGeneric().IsNull()) {
|
||||
if (!IntlGeneric()) {
|
||||
nsAccUtils::To32States(states::DEFUNCT, aState, aExtraState);
|
||||
} else if (Intl()) {
|
||||
nsAccUtils::To32States(Intl()->State(), aState, aExtraState);
|
||||
} else {
|
||||
nsAccUtils::To32States(IntlGeneric().AsProxy()->State(), aState,
|
||||
nsAccUtils::To32States(IntlGeneric()->AsRemote()->State(), aState,
|
||||
aExtraState);
|
||||
}
|
||||
|
||||
|
@ -257,10 +240,10 @@ NS_IMETHODIMP
|
|||
xpcAccessible::GetName(nsAString& aName) {
|
||||
aName.Truncate();
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
nsAutoString name;
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
proxy->Name(name);
|
||||
} else {
|
||||
Intl()->Name(name);
|
||||
|
@ -273,10 +256,10 @@ xpcAccessible::GetName(nsAString& aName) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::GetDescription(nsAString& aDescription) {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
nsAutoString desc;
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
proxy->Description(desc);
|
||||
} else {
|
||||
Intl()->Description(desc);
|
||||
|
@ -289,10 +272,10 @@ xpcAccessible::GetDescription(nsAString& aDescription) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::GetLanguage(nsAString& aLanguage) {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
nsAutoString lang;
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
proxy->Language(lang);
|
||||
} else {
|
||||
Intl()->Language(lang);
|
||||
|
@ -304,10 +287,10 @@ xpcAccessible::GetLanguage(nsAString& aLanguage) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::GetValue(nsAString& aValue) {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
nsAutoString value;
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
proxy->Value(value);
|
||||
} else {
|
||||
Intl()->Value(value);
|
||||
|
@ -320,10 +303,10 @@ xpcAccessible::GetValue(nsAString& aValue) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::GetHelp(nsAString& aHelp) {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
nsAutoString help;
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -342,9 +325,9 @@ NS_IMETHODIMP
|
|||
xpcAccessible::GetAccessKey(nsAString& aAccessKey) {
|
||||
aAccessKey.Truncate();
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -360,9 +343,9 @@ xpcAccessible::GetAccessKey(nsAString& aAccessKey) {
|
|||
NS_IMETHODIMP
|
||||
xpcAccessible::GetKeyboardShortcut(nsAString& aKeyBinding) {
|
||||
aKeyBinding.Truncate();
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -379,7 +362,7 @@ xpcAccessible::GetAttributes(nsIPersistentProperties** aAttributes) {
|
|||
NS_ENSURE_ARG_POINTER(aAttributes);
|
||||
*aAttributes = nullptr;
|
||||
|
||||
if (IntlGeneric().IsNull()) {
|
||||
if (!IntlGeneric()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -389,7 +372,7 @@ xpcAccessible::GetAttributes(nsIPersistentProperties** aAttributes) {
|
|||
return NS_OK;
|
||||
}
|
||||
|
||||
RemoteAccessible* proxy = IntlGeneric().AsProxy();
|
||||
RemoteAccessible* proxy = IntlGeneric()->AsRemote();
|
||||
AutoTArray<Attribute, 10> attrs;
|
||||
proxy->Attributes(&attrs);
|
||||
|
||||
|
@ -434,13 +417,13 @@ xpcAccessible::GetBounds(int32_t* aX, int32_t* aY, int32_t* aWidth,
|
|||
NS_ENSURE_ARG_POINTER(aHeight);
|
||||
*aHeight = 0;
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
nsIntRect rect;
|
||||
if (LocalAccessible* acc = IntlGeneric().AsAccessible()) {
|
||||
if (LocalAccessible* acc = IntlGeneric()->AsLocal()) {
|
||||
rect = acc->Bounds();
|
||||
} else {
|
||||
rect = IntlGeneric().AsProxy()->Bounds();
|
||||
rect = IntlGeneric()->AsRemote()->Bounds();
|
||||
}
|
||||
|
||||
rect.GetRect(aX, aY, aWidth, aHeight);
|
||||
|
@ -459,15 +442,15 @@ xpcAccessible::GetBoundsInCSSPixels(int32_t* aX, int32_t* aY, int32_t* aWidth,
|
|||
NS_ENSURE_ARG_POINTER(aHeight);
|
||||
*aHeight = 0;
|
||||
|
||||
if (IntlGeneric().IsNull()) {
|
||||
if (!IntlGeneric()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
nsIntRect rect;
|
||||
if (LocalAccessible* acc = IntlGeneric().AsAccessible()) {
|
||||
if (LocalAccessible* acc = IntlGeneric()->AsLocal()) {
|
||||
rect = acc->BoundsInCSSPixels();
|
||||
} else {
|
||||
rect = IntlGeneric().AsProxy()->BoundsInCSSPixels();
|
||||
rect = IntlGeneric()->AsRemote()->BoundsInCSSPixels();
|
||||
}
|
||||
|
||||
rect.GetRect(aX, aY, aWidth, aHeight);
|
||||
|
@ -488,13 +471,13 @@ xpcAccessible::GroupPosition(int32_t* aGroupLevel,
|
|||
*aPositionInGroup = 0;
|
||||
|
||||
GroupPos groupPos;
|
||||
if (LocalAccessible* acc = IntlGeneric().AsAccessible()) {
|
||||
if (LocalAccessible* acc = IntlGeneric()->AsLocal()) {
|
||||
groupPos = acc->GroupPosition();
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
groupPos = IntlGeneric().AsProxy()->GroupPosition();
|
||||
groupPos = IntlGeneric()->AsRemote()->GroupPosition();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -513,15 +496,15 @@ xpcAccessible::GetRelationByType(uint32_t aType,
|
|||
|
||||
NS_ENSURE_ARG(aType <= static_cast<uint32_t>(RelationType::LAST));
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (IntlGeneric().IsAccessible()) {
|
||||
if (IntlGeneric()->IsLocal()) {
|
||||
Relation rel = Intl()->RelationByType(static_cast<RelationType>(aType));
|
||||
NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &rel));
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
RemoteAccessible* proxy = IntlGeneric().AsProxy();
|
||||
RemoteAccessible* proxy = IntlGeneric()->AsRemote();
|
||||
nsTArray<RemoteAccessible*> targets =
|
||||
proxy->RelationByType(static_cast<RelationType>(aType));
|
||||
NS_ADDREF(*aRelation = new nsAccessibleRelation(aType, &targets));
|
||||
|
@ -534,7 +517,7 @@ xpcAccessible::GetRelations(nsIArray** aRelations) {
|
|||
NS_ENSURE_ARG_POINTER(aRelations);
|
||||
*aRelations = nullptr;
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIMutableArray> relations = do_CreateInstance(NS_ARRAY_CONTRACTID);
|
||||
NS_ENSURE_TRUE(relations, NS_ERROR_OUT_OF_MEMORY);
|
||||
|
@ -582,9 +565,9 @@ xpcAccessible::GetFocusedChild(nsIAccessible** aChild) {
|
|||
NS_ENSURE_ARG_POINTER(aChild);
|
||||
*aChild = nullptr;
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -603,9 +586,9 @@ xpcAccessible::GetChildAtPoint(int32_t aX, int32_t aY,
|
|||
NS_ENSURE_ARG_POINTER(aAccessible);
|
||||
*aAccessible = nullptr;
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
NS_IF_ADDREF(*aAccessible = ToXPC(IntlGeneric().ChildAtPoint(
|
||||
NS_IF_ADDREF(*aAccessible = ToXPC(IntlGeneric()->ChildAtPoint(
|
||||
aX, aY, Accessible::EWhichChildAtPoint::DirectChild)));
|
||||
|
||||
return NS_OK;
|
||||
|
@ -617,9 +600,9 @@ xpcAccessible::GetDeepestChildAtPoint(int32_t aX, int32_t aY,
|
|||
NS_ENSURE_ARG_POINTER(aAccessible);
|
||||
*aAccessible = nullptr;
|
||||
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
NS_IF_ADDREF(*aAccessible = ToXPC(IntlGeneric().ChildAtPoint(
|
||||
NS_IF_ADDREF(*aAccessible = ToXPC(IntlGeneric()->ChildAtPoint(
|
||||
aX, aY, Accessible::EWhichChildAtPoint::DeepestChild)));
|
||||
|
||||
return NS_OK;
|
||||
|
@ -631,8 +614,8 @@ xpcAccessible::GetDeepestChildAtPointInProcess(int32_t aX, int32_t aY,
|
|||
NS_ENSURE_ARG_POINTER(aAccessible);
|
||||
*aAccessible = nullptr;
|
||||
|
||||
AccessibleOrProxy generic = IntlGeneric();
|
||||
if (generic.IsNull() || generic.IsProxy()) {
|
||||
Accessible* generic = IntlGeneric();
|
||||
if (!generic || generic->IsRemote()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
|
@ -643,9 +626,9 @@ xpcAccessible::GetDeepestChildAtPointInProcess(int32_t aX, int32_t aY,
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::SetSelected(bool aSelect) {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -660,9 +643,9 @@ xpcAccessible::SetSelected(bool aSelect) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::TakeSelection() {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -677,9 +660,9 @@ xpcAccessible::TakeSelection() {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::TakeFocus() {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
proxy->TakeFocus();
|
||||
} else {
|
||||
Intl()->TakeFocus();
|
||||
|
@ -692,9 +675,9 @@ NS_IMETHODIMP
|
|||
xpcAccessible::GetActionCount(uint8_t* aActionCount) {
|
||||
NS_ENSURE_ARG_POINTER(aActionCount);
|
||||
*aActionCount = 0;
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -709,9 +692,9 @@ xpcAccessible::GetActionCount(uint8_t* aActionCount) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::GetActionName(uint8_t aIndex, nsAString& aName) {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -730,9 +713,9 @@ xpcAccessible::GetActionName(uint8_t aIndex, nsAString& aName) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::GetActionDescription(uint8_t aIndex, nsAString& aDescription) {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -751,9 +734,9 @@ xpcAccessible::GetActionDescription(uint8_t aIndex, nsAString& aDescription) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::DoAction(uint8_t aIndex) {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -766,9 +749,9 @@ xpcAccessible::DoAction(uint8_t aIndex) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::ScrollTo(uint32_t aHow) {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -784,9 +767,9 @@ xpcAccessible::ScrollTo(uint32_t aHow) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY) {
|
||||
if (IntlGeneric().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!IntlGeneric()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
@ -801,7 +784,7 @@ xpcAccessible::ScrollToPoint(uint32_t aCoordinateType, int32_t aX, int32_t aY) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessible::Announce(const nsAString& aAnnouncement, uint16_t aPriority) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric().AsProxy()) {
|
||||
if (RemoteAccessible* proxy = IntlGeneric()->AsRemote()) {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
|
|
|
@ -14,8 +14,8 @@ class nsIAccessible;
|
|||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
||||
class Accessible;
|
||||
class LocalAccessible;
|
||||
class AccessibleOrProxy;
|
||||
|
||||
/**
|
||||
* XPCOM nsIAccessible interface implementation, used by xpcAccessibleGeneric
|
||||
|
@ -97,7 +97,7 @@ class xpcAccessible : public nsIAccessible {
|
|||
|
||||
private:
|
||||
LocalAccessible* Intl();
|
||||
AccessibleOrProxy IntlGeneric();
|
||||
Accessible* IntlGeneric();
|
||||
|
||||
xpcAccessible(const xpcAccessible&) = delete;
|
||||
xpcAccessible& operator=(const xpcAccessible&) = delete;
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace a11y {
|
|||
class xpcAccessibleApplication : public xpcAccessibleGeneric,
|
||||
public nsIAccessibleApplication {
|
||||
public:
|
||||
explicit xpcAccessibleApplication(LocalAccessible* aIntl)
|
||||
explicit xpcAccessibleApplication(Accessible* aIntl)
|
||||
: xpcAccessibleGeneric(aIntl) {}
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
@ -35,9 +35,7 @@ class xpcAccessibleApplication : public xpcAccessibleGeneric,
|
|||
virtual ~xpcAccessibleApplication() { Shutdown(); }
|
||||
|
||||
private:
|
||||
ApplicationAccessible* Intl() {
|
||||
return mIntl.AsAccessible()->AsApplication();
|
||||
}
|
||||
ApplicationAccessible* Intl() { return mIntl->AsLocal()->AsApplication(); }
|
||||
|
||||
xpcAccessibleApplication(const xpcAccessibleApplication&) = delete;
|
||||
xpcAccessibleApplication& operator=(const xpcAccessibleApplication&) = delete;
|
||||
|
|
|
@ -26,13 +26,12 @@ NS_IMETHODIMP_(MozExternalRefCountType) xpcAccessibleDocument::Release(void) {
|
|||
NS_LOG_RELEASE(this, r, "xpcAccessibleDocument");
|
||||
|
||||
// The only reference to the xpcAccessibleDocument is in DocManager's cache.
|
||||
if (r == 1 && !mIntl.IsNull() && mCache.Count() == 0) {
|
||||
if (mIntl.IsAccessible()) {
|
||||
GetAccService()->RemoveFromXPCDocumentCache(
|
||||
mIntl.AsAccessible()->AsDoc());
|
||||
if (r == 1 && !!mIntl && mCache.Count() == 0) {
|
||||
if (mIntl->IsLocal()) {
|
||||
GetAccService()->RemoveFromXPCDocumentCache(mIntl->AsLocal()->AsDoc());
|
||||
} else {
|
||||
GetAccService()->RemoveFromRemoteXPCDocumentCache(
|
||||
mIntl.AsProxy()->AsDoc());
|
||||
mIntl->AsRemote()->AsDoc());
|
||||
}
|
||||
}
|
||||
return r;
|
||||
|
@ -147,9 +146,16 @@ xpcAccessibleDocument::GetVirtualCursor(nsIAccessiblePivot** aVirtualCursor) {
|
|||
// xpcAccessibleDocument
|
||||
|
||||
xpcAccessibleGeneric* xpcAccessibleDocument::GetAccessible(
|
||||
LocalAccessible* aAccessible) {
|
||||
MOZ_ASSERT(!mRemote);
|
||||
if (ToXPCDocument(aAccessible->Document()) != this) {
|
||||
Accessible* aAccessible) {
|
||||
if (aAccessible->IsLocal() &&
|
||||
ToXPCDocument(aAccessible->AsLocal()->Document()) != this) {
|
||||
NS_ERROR(
|
||||
"This XPCOM document is not related with given internal accessible!");
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (aAccessible->IsRemote() &&
|
||||
ToXPCDocument(aAccessible->AsRemote()->Document()) != this) {
|
||||
NS_ERROR(
|
||||
"This XPCOM document is not related with given internal accessible!");
|
||||
return nullptr;
|
||||
|
@ -175,35 +181,6 @@ xpcAccessibleGeneric* xpcAccessibleDocument::GetAccessible(
|
|||
});
|
||||
}
|
||||
|
||||
xpcAccessibleGeneric* xpcAccessibleDocument::GetXPCAccessible(
|
||||
RemoteAccessible* aProxy) {
|
||||
MOZ_ASSERT(mRemote);
|
||||
MOZ_ASSERT(aProxy->Document() == mIntl.AsProxy());
|
||||
if (aProxy->IsDoc()) {
|
||||
return this;
|
||||
}
|
||||
|
||||
return mCache.LookupOrInsertWith(aProxy, [&]() -> xpcAccessibleGeneric* {
|
||||
// XXX support exposing optional interfaces.
|
||||
// XXX support exposing optional interfaces.
|
||||
uint8_t interfaces = 0;
|
||||
if (aProxy->HasNumericValue()) {
|
||||
interfaces |= eValue;
|
||||
}
|
||||
|
||||
if (aProxy->IsLink()) {
|
||||
interfaces |= eHyperLink;
|
||||
}
|
||||
|
||||
if (aProxy->IsHyperText()) {
|
||||
interfaces |= eText;
|
||||
return new xpcAccessibleHyperText(aProxy, interfaces);
|
||||
}
|
||||
|
||||
return new xpcAccessibleGeneric(aProxy, interfaces);
|
||||
});
|
||||
}
|
||||
|
||||
void xpcAccessibleDocument::Shutdown() {
|
||||
for (auto iter = mCache.Iter(); !iter.Done(); iter.Next()) {
|
||||
iter.Data()->Shutdown();
|
||||
|
@ -211,16 +188,3 @@ void xpcAccessibleDocument::Shutdown() {
|
|||
}
|
||||
xpcAccessibleGeneric::Shutdown();
|
||||
}
|
||||
|
||||
xpcAccessibleGeneric* a11y::ToXPC(AccessibleOrProxy aAcc) {
|
||||
if (aAcc.IsNull()) {
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
if (aAcc.IsAccessible()) {
|
||||
return ToXPC(aAcc.AsAccessible());
|
||||
}
|
||||
|
||||
xpcAccessibleDocument* doc = ToXPCDocument(aAcc.AsProxy()->Document());
|
||||
return doc->GetXPCAccessible(aAcc.AsProxy());
|
||||
}
|
||||
|
|
|
@ -51,8 +51,7 @@ class xpcAccessibleDocument : public xpcAccessibleHyperText,
|
|||
/**
|
||||
* Return XPCOM wrapper for the internal accessible.
|
||||
*/
|
||||
xpcAccessibleGeneric* GetAccessible(LocalAccessible* aAccessible);
|
||||
xpcAccessibleGeneric* GetXPCAccessible(RemoteAccessible* aProxy);
|
||||
xpcAccessibleGeneric* GetAccessible(Accessible* aAccessible);
|
||||
|
||||
virtual void Shutdown() override;
|
||||
|
||||
|
@ -61,15 +60,14 @@ class xpcAccessibleDocument : public xpcAccessibleHyperText,
|
|||
|
||||
private:
|
||||
DocAccessible* Intl() {
|
||||
if (LocalAccessible* acc = mIntl.AsAccessible()) {
|
||||
if (LocalAccessible* acc = mIntl->AsLocal()) {
|
||||
return acc->AsDoc();
|
||||
}
|
||||
|
||||
return nullptr;
|
||||
}
|
||||
|
||||
void NotifyOfShutdown(LocalAccessible* aAccessible) {
|
||||
MOZ_ASSERT(!mRemote);
|
||||
void NotifyOfShutdown(Accessible* aAccessible) {
|
||||
xpcAccessibleGeneric* xpcAcc = mCache.Get(aAccessible);
|
||||
if (xpcAcc) {
|
||||
xpcAcc->Shutdown();
|
||||
|
@ -77,22 +75,12 @@ class xpcAccessibleDocument : public xpcAccessibleHyperText,
|
|||
|
||||
mCache.Remove(aAccessible);
|
||||
if (mCache.Count() == 0 && mRefCnt == 1) {
|
||||
GetAccService()->RemoveFromXPCDocumentCache(
|
||||
mIntl.AsAccessible()->AsDoc());
|
||||
}
|
||||
}
|
||||
|
||||
void NotifyOfShutdown(RemoteAccessible* aProxy) {
|
||||
MOZ_ASSERT(mRemote);
|
||||
xpcAccessibleGeneric* xpcAcc = mCache.Get(aProxy);
|
||||
if (xpcAcc) {
|
||||
xpcAcc->Shutdown();
|
||||
}
|
||||
|
||||
mCache.Remove(aProxy);
|
||||
if (mCache.Count() == 0 && mRefCnt == 1) {
|
||||
GetAccService()->RemoveFromRemoteXPCDocumentCache(
|
||||
mIntl.AsProxy()->AsDoc());
|
||||
if (mIntl->IsLocal()) {
|
||||
GetAccService()->RemoveFromXPCDocumentCache(mIntl->AsLocal()->AsDoc());
|
||||
} else {
|
||||
GetAccService()->RemoveFromRemoteXPCDocumentCache(
|
||||
mIntl->AsRemote()->AsDoc());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -109,18 +97,19 @@ class xpcAccessibleDocument : public xpcAccessibleHyperText,
|
|||
bool mRemote;
|
||||
};
|
||||
|
||||
inline xpcAccessibleGeneric* ToXPC(LocalAccessible* aAccessible) {
|
||||
inline xpcAccessibleGeneric* ToXPC(Accessible* aAccessible) {
|
||||
if (!aAccessible) return nullptr;
|
||||
|
||||
if (aAccessible->IsApplication()) return XPCApplicationAcc();
|
||||
|
||||
xpcAccessibleDocument* xpcDoc =
|
||||
GetAccService()->GetXPCDocument(aAccessible->Document());
|
||||
aAccessible->IsLocal()
|
||||
? GetAccService()->GetXPCDocument(aAccessible->AsLocal()->Document())
|
||||
: GetAccService()->GetXPCDocument(
|
||||
aAccessible->AsRemote()->Document());
|
||||
return xpcDoc ? xpcDoc->GetAccessible(aAccessible) : nullptr;
|
||||
}
|
||||
|
||||
xpcAccessibleGeneric* ToXPC(AccessibleOrProxy aAcc);
|
||||
|
||||
inline xpcAccessibleHyperText* ToXPCText(HyperTextAccessible* aAccessible) {
|
||||
if (!aAccessible) return nullptr;
|
||||
|
||||
|
|
|
@ -28,19 +28,19 @@ NS_IMPL_ADDREF(xpcAccessibleGeneric)
|
|||
NS_IMPL_RELEASE(xpcAccessibleGeneric)
|
||||
|
||||
xpcAccessibleGeneric::~xpcAccessibleGeneric() {
|
||||
if (mIntl.IsNull()) {
|
||||
if (!mIntl) {
|
||||
return;
|
||||
}
|
||||
|
||||
xpcAccessibleDocument* xpcDoc = nullptr;
|
||||
if (mIntl.IsAccessible()) {
|
||||
LocalAccessible* acc = mIntl.AsAccessible();
|
||||
if (mIntl->IsLocal()) {
|
||||
LocalAccessible* acc = mIntl->AsLocal();
|
||||
if (!acc->IsDoc() && !acc->IsApplication()) {
|
||||
xpcDoc = GetAccService()->GetXPCDocument(acc->Document());
|
||||
xpcDoc->NotifyOfShutdown(acc);
|
||||
}
|
||||
} else {
|
||||
RemoteAccessible* proxy = mIntl.AsProxy();
|
||||
RemoteAccessible* proxy = mIntl->AsRemote();
|
||||
if (!proxy->IsDoc()) {
|
||||
xpcDoc = GetAccService()->GetXPCDocument(proxy->Document());
|
||||
xpcDoc->NotifyOfShutdown(proxy);
|
||||
|
@ -52,7 +52,7 @@ xpcAccessibleGeneric::~xpcAccessibleGeneric() {
|
|||
// nsIAccessible
|
||||
|
||||
LocalAccessible* xpcAccessibleGeneric::ToInternalAccessible() const {
|
||||
return mIntl.AsAccessible();
|
||||
return mIntl->AsLocal();
|
||||
}
|
||||
|
||||
////////////////////////////////////////////////////////////////////////////////
|
||||
|
|
|
@ -13,7 +13,8 @@
|
|||
#include "xpcAccessibleValue.h"
|
||||
|
||||
#include "LocalAccessible.h"
|
||||
#include "AccessibleOrProxy.h"
|
||||
#include "mozilla/a11y/Accessible.h"
|
||||
#include "mozilla/a11y/RemoteAccessible.h"
|
||||
|
||||
namespace mozilla {
|
||||
namespace a11y {
|
||||
|
@ -26,7 +27,7 @@ class xpcAccessibleGeneric : public xpcAccessible,
|
|||
public xpcAccessibleSelectable,
|
||||
public xpcAccessibleValue {
|
||||
public:
|
||||
explicit xpcAccessibleGeneric(LocalAccessible* aInternal)
|
||||
explicit xpcAccessibleGeneric(Accessible* aInternal)
|
||||
: mIntl(aInternal), mSupportedIfaces(0) {
|
||||
if (aInternal->IsSelect()) mSupportedIfaces |= eSelectable;
|
||||
if (aInternal->HasNumericValue()) mSupportedIfaces |= eValue;
|
||||
|
@ -47,7 +48,7 @@ class xpcAccessibleGeneric : public xpcAccessible,
|
|||
protected:
|
||||
virtual ~xpcAccessibleGeneric();
|
||||
|
||||
AccessibleOrProxy mIntl;
|
||||
Accessible* mIntl;
|
||||
|
||||
enum {
|
||||
eSelectable = 1 << 0,
|
||||
|
@ -69,22 +70,28 @@ class xpcAccessibleGeneric : public xpcAccessible,
|
|||
};
|
||||
|
||||
inline LocalAccessible* xpcAccessible::Intl() {
|
||||
return static_cast<xpcAccessibleGeneric*>(this)->mIntl.AsAccessible();
|
||||
if (!static_cast<xpcAccessibleGeneric*>(this)->mIntl) {
|
||||
return nullptr;
|
||||
}
|
||||
return static_cast<xpcAccessibleGeneric*>(this)->mIntl->AsLocal();
|
||||
}
|
||||
|
||||
inline AccessibleOrProxy xpcAccessible::IntlGeneric() {
|
||||
inline Accessible* xpcAccessible::IntlGeneric() {
|
||||
return static_cast<xpcAccessibleGeneric*>(this)->mIntl;
|
||||
}
|
||||
|
||||
inline AccessibleOrProxy xpcAccessibleHyperLink::Intl() {
|
||||
inline Accessible* xpcAccessibleHyperLink::Intl() {
|
||||
return static_cast<xpcAccessibleGeneric*>(this)->mIntl;
|
||||
}
|
||||
|
||||
inline LocalAccessible* xpcAccessibleSelectable::Intl() {
|
||||
return static_cast<xpcAccessibleGeneric*>(this)->mIntl.AsAccessible();
|
||||
if (!static_cast<xpcAccessibleGeneric*>(this)->mIntl) {
|
||||
return nullptr;
|
||||
}
|
||||
return static_cast<xpcAccessibleGeneric*>(this)->mIntl->AsLocal();
|
||||
}
|
||||
|
||||
inline AccessibleOrProxy xpcAccessibleValue::Intl() {
|
||||
inline Accessible* xpcAccessibleValue::Intl() {
|
||||
return static_cast<xpcAccessibleGeneric*>(this)->mIntl;
|
||||
}
|
||||
|
||||
|
|
|
@ -17,16 +17,16 @@ xpcAccessibleHyperLink::GetStartIndex(int32_t* aStartIndex) {
|
|||
NS_ENSURE_ARG_POINTER(aStartIndex);
|
||||
*aStartIndex = 0;
|
||||
|
||||
if (Intl().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (Intl().IsAccessible()) {
|
||||
*aStartIndex = Intl().AsAccessible()->StartOffset();
|
||||
if (Intl()->IsLocal()) {
|
||||
*aStartIndex = Intl()->AsLocal()->StartOffset();
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
bool isIndexValid = false;
|
||||
uint32_t startOffset = Intl().AsProxy()->StartOffset(&isIndexValid);
|
||||
uint32_t startOffset = Intl()->AsRemote()->StartOffset(&isIndexValid);
|
||||
if (!isIndexValid) return NS_ERROR_FAILURE;
|
||||
|
||||
*aStartIndex = startOffset;
|
||||
|
@ -41,16 +41,16 @@ xpcAccessibleHyperLink::GetEndIndex(int32_t* aEndIndex) {
|
|||
NS_ENSURE_ARG_POINTER(aEndIndex);
|
||||
*aEndIndex = 0;
|
||||
|
||||
if (Intl().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (Intl().IsAccessible()) {
|
||||
*aEndIndex = Intl().AsAccessible()->EndOffset();
|
||||
if (Intl()->IsLocal()) {
|
||||
*aEndIndex = Intl()->AsLocal()->EndOffset();
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
bool isIndexValid = false;
|
||||
uint32_t endOffset = Intl().AsProxy()->EndOffset(&isIndexValid);
|
||||
uint32_t endOffset = Intl()->AsRemote()->EndOffset(&isIndexValid);
|
||||
if (!isIndexValid) return NS_ERROR_FAILURE;
|
||||
|
||||
*aEndIndex = endOffset;
|
||||
|
@ -65,16 +65,16 @@ xpcAccessibleHyperLink::GetAnchorCount(int32_t* aAnchorCount) {
|
|||
NS_ENSURE_ARG_POINTER(aAnchorCount);
|
||||
*aAnchorCount = 0;
|
||||
|
||||
if (Intl().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (Intl().IsAccessible()) {
|
||||
*aAnchorCount = Intl().AsAccessible()->AnchorCount();
|
||||
if (Intl()->IsLocal()) {
|
||||
*aAnchorCount = Intl()->AsLocal()->AnchorCount();
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
bool isCountValid = false;
|
||||
uint32_t anchorCount = Intl().AsProxy()->AnchorCount(&isCountValid);
|
||||
uint32_t anchorCount = Intl()->AsRemote()->AnchorCount(&isCountValid);
|
||||
if (!isCountValid) return NS_ERROR_FAILURE;
|
||||
|
||||
*aAnchorCount = anchorCount;
|
||||
|
@ -88,23 +88,23 @@ NS_IMETHODIMP
|
|||
xpcAccessibleHyperLink::GetURI(int32_t aIndex, nsIURI** aURI) {
|
||||
NS_ENSURE_ARG_POINTER(aURI);
|
||||
|
||||
if (Intl().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (aIndex < 0) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
if (Intl().IsAccessible()) {
|
||||
if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount())) {
|
||||
if (Intl()->IsLocal()) {
|
||||
if (aIndex >= static_cast<int32_t>(Intl()->AsLocal()->AnchorCount())) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
RefPtr<nsIURI>(Intl().AsAccessible()->AnchorURIAt(aIndex)).forget(aURI);
|
||||
RefPtr<nsIURI>(Intl()->AsLocal()->AnchorURIAt(aIndex)).forget(aURI);
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
nsCString spec;
|
||||
bool isURIValid = false;
|
||||
Intl().AsProxy()->AnchorURIAt(aIndex, spec, &isURIValid);
|
||||
Intl()->AsRemote()->AnchorURIAt(aIndex, spec, &isURIValid);
|
||||
if (!isURIValid) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIURI> uri;
|
||||
|
@ -123,21 +123,21 @@ xpcAccessibleHyperLink::GetAnchor(int32_t aIndex, nsIAccessible** aAccessible) {
|
|||
NS_ENSURE_ARG_POINTER(aAccessible);
|
||||
*aAccessible = nullptr;
|
||||
|
||||
if (Intl().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (aIndex < 0) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
if (Intl().IsAccessible()) {
|
||||
if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount())) {
|
||||
if (Intl()->IsLocal()) {
|
||||
if (aIndex >= static_cast<int32_t>(Intl()->AsLocal()->AnchorCount())) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
|
||||
NS_IF_ADDREF(*aAccessible = ToXPC(Intl().AsAccessible()->AnchorAt(aIndex)));
|
||||
NS_IF_ADDREF(*aAccessible = ToXPC(Intl()->AsLocal()->AnchorAt(aIndex)));
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
NS_IF_ADDREF(*aAccessible = ToXPC(Intl().AsProxy()->AnchorAt(aIndex)));
|
||||
NS_IF_ADDREF(*aAccessible = ToXPC(Intl()->AsRemote()->AnchorAt(aIndex)));
|
||||
#endif
|
||||
}
|
||||
|
||||
|
@ -149,15 +149,15 @@ xpcAccessibleHyperLink::GetValid(bool* aValid) {
|
|||
NS_ENSURE_ARG_POINTER(aValid);
|
||||
*aValid = false;
|
||||
|
||||
if (Intl().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (Intl().IsAccessible()) {
|
||||
*aValid = Intl().AsAccessible()->IsLinkValid();
|
||||
if (Intl()->IsLocal()) {
|
||||
*aValid = Intl()->AsLocal()->IsLinkValid();
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
*aValid = Intl().AsProxy()->IsLinkValid();
|
||||
*aValid = Intl()->AsRemote()->IsLinkValid();
|
||||
#endif
|
||||
}
|
||||
|
||||
|
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#include "nsIAccessibleHyperLink.h"
|
||||
|
||||
#include "AccessibleOrProxy.h"
|
||||
#include "mozilla/a11y/Accessible.h"
|
||||
|
||||
class nsIAccessible;
|
||||
|
||||
|
@ -39,7 +39,7 @@ class xpcAccessibleHyperLink : public nsIAccessibleHyperLink {
|
|||
xpcAccessibleHyperLink(const xpcAccessibleHyperLink&) = delete;
|
||||
xpcAccessibleHyperLink& operator=(const xpcAccessibleHyperLink&) = delete;
|
||||
|
||||
AccessibleOrProxy Intl();
|
||||
Accessible* Intl();
|
||||
};
|
||||
|
||||
} // namespace a11y
|
||||
|
|
|
@ -42,15 +42,15 @@ xpcAccessibleHyperText::GetCharacterCount(int32_t* aCharacterCount) {
|
|||
NS_ENSURE_ARG_POINTER(aCharacterCount);
|
||||
*aCharacterCount = 0;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
*aCharacterCount = Intl()->CharacterCount();
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
*aCharacterCount = mIntl.AsProxy()->CharacterCount();
|
||||
*aCharacterCount = mIntl->AsRemote()->CharacterCount();
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -61,13 +61,13 @@ xpcAccessibleHyperText::GetText(int32_t aStartOffset, int32_t aEndOffset,
|
|||
nsAString& aText) {
|
||||
aText.Truncate();
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->TextSubstring(aStartOffset, aEndOffset, aText);
|
||||
} else {
|
||||
nsString text;
|
||||
mIntl.AsProxy()->TextSubstring(aStartOffset, aEndOffset, text);
|
||||
mIntl->AsRemote()->TextSubstring(aStartOffset, aEndOffset, text);
|
||||
aText = text;
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -82,15 +82,15 @@ xpcAccessibleHyperText::GetTextBeforeOffset(
|
|||
*aStartOffset = *aEndOffset = 0;
|
||||
aText.Truncate();
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->TextBeforeOffset(aOffset, aBoundaryType, aStartOffset, aEndOffset,
|
||||
aText);
|
||||
} else {
|
||||
nsString text;
|
||||
mIntl.AsProxy()->GetTextBeforeOffset(aOffset, aBoundaryType, text,
|
||||
aStartOffset, aEndOffset);
|
||||
mIntl->AsRemote()->GetTextBeforeOffset(aOffset, aBoundaryType, text,
|
||||
aStartOffset, aEndOffset);
|
||||
aText = text;
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -106,15 +106,15 @@ xpcAccessibleHyperText::GetTextAtOffset(int32_t aOffset,
|
|||
*aStartOffset = *aEndOffset = 0;
|
||||
aText.Truncate();
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->TextAtOffset(aOffset, aBoundaryType, aStartOffset, aEndOffset,
|
||||
aText);
|
||||
} else {
|
||||
nsString text;
|
||||
mIntl.AsProxy()->GetTextAtOffset(aOffset, aBoundaryType, text, aStartOffset,
|
||||
aEndOffset);
|
||||
mIntl->AsRemote()->GetTextAtOffset(aOffset, aBoundaryType, text,
|
||||
aStartOffset, aEndOffset);
|
||||
aText = text;
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -131,15 +131,15 @@ xpcAccessibleHyperText::GetTextAfterOffset(int32_t aOffset,
|
|||
*aStartOffset = *aEndOffset = 0;
|
||||
aText.Truncate();
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->TextAfterOffset(aOffset, aBoundaryType, aStartOffset, aEndOffset,
|
||||
aText);
|
||||
} else {
|
||||
nsString text;
|
||||
mIntl.AsProxy()->GetTextAfterOffset(aOffset, aBoundaryType, text,
|
||||
aStartOffset, aEndOffset);
|
||||
mIntl->AsRemote()->GetTextAfterOffset(aOffset, aBoundaryType, text,
|
||||
aStartOffset, aEndOffset);
|
||||
aText = text;
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -151,15 +151,15 @@ xpcAccessibleHyperText::GetCharacterAtOffset(int32_t aOffset,
|
|||
NS_ENSURE_ARG_POINTER(aCharacter);
|
||||
*aCharacter = L'\0';
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
*aCharacter = Intl()->CharAt(aOffset);
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
*aCharacter = mIntl.AsProxy()->CharAt(aOffset);
|
||||
*aCharacter = mIntl->AsRemote()->CharAt(aOffset);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -175,10 +175,10 @@ xpcAccessibleHyperText::GetTextAttributes(
|
|||
*aStartOffset = *aEndOffset = 0;
|
||||
*aAttributes = nullptr;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIPersistentProperties> props;
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
props = Intl()->TextAttributes(aIncludeDefAttrs, aOffset, aStartOffset,
|
||||
aEndOffset);
|
||||
} else {
|
||||
|
@ -186,8 +186,8 @@ xpcAccessibleHyperText::GetTextAttributes(
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
AutoTArray<Attribute, 10> attrs;
|
||||
mIntl.AsProxy()->TextAttributes(aIncludeDefAttrs, aOffset, &attrs,
|
||||
aStartOffset, aEndOffset);
|
||||
mIntl->AsRemote()->TextAttributes(aIncludeDefAttrs, aOffset, &attrs,
|
||||
aStartOffset, aEndOffset);
|
||||
uint32_t attrCount = attrs.Length();
|
||||
nsAutoString unused;
|
||||
for (uint32_t i = 0; i < attrCount; i++) {
|
||||
|
@ -206,17 +206,17 @@ xpcAccessibleHyperText::GetDefaultTextAttributes(
|
|||
NS_ENSURE_ARG_POINTER(aAttributes);
|
||||
*aAttributes = nullptr;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIPersistentProperties> props;
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
props = Intl()->DefaultTextAttributes();
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
AutoTArray<Attribute, 10> attrs;
|
||||
mIntl.AsProxy()->DefaultTextAttributes(&attrs);
|
||||
mIntl->AsRemote()->DefaultTextAttributes(&attrs);
|
||||
uint32_t attrCount = attrs.Length();
|
||||
nsAutoString unused;
|
||||
for (uint32_t i = 0; i < attrCount; i++) {
|
||||
|
@ -240,16 +240,16 @@ xpcAccessibleHyperText::GetCharacterExtents(int32_t aOffset, int32_t* aX,
|
|||
NS_ENSURE_ARG_POINTER(aHeight);
|
||||
*aX = *aY = *aWidth = *aHeight;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
nsIntRect rect;
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
rect = Intl()->CharBounds(aOffset, aCoordType);
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
rect = mIntl.AsProxy()->CharBounds(aOffset, aCoordType);
|
||||
rect = mIntl->AsRemote()->CharBounds(aOffset, aCoordType);
|
||||
#endif
|
||||
}
|
||||
rect.GetRect(aX, aY, aWidth, aHeight);
|
||||
|
@ -267,16 +267,16 @@ xpcAccessibleHyperText::GetRangeExtents(int32_t aStartOffset,
|
|||
NS_ENSURE_ARG_POINTER(aHeight);
|
||||
*aX = *aY = *aWidth = *aHeight = 0;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
nsIntRect rect;
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
rect = Intl()->TextBounds(aStartOffset, aEndOffset, aCoordType);
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
rect = mIntl.AsProxy()->TextBounds(aStartOffset, aEndOffset, aCoordType);
|
||||
rect = mIntl->AsRemote()->TextBounds(aStartOffset, aEndOffset, aCoordType);
|
||||
#endif
|
||||
}
|
||||
rect.GetRect(aX, aY, aWidth, aHeight);
|
||||
|
@ -290,12 +290,12 @@ xpcAccessibleHyperText::GetOffsetAtPoint(int32_t aX, int32_t aY,
|
|||
NS_ENSURE_ARG_POINTER(aOffset);
|
||||
*aOffset = -1;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
*aOffset = Intl()->OffsetAtPoint(aX, aY, aCoordType);
|
||||
} else {
|
||||
*aOffset = mIntl.AsProxy()->OffsetAtPoint(aX, aY, aCoordType);
|
||||
*aOffset = mIntl->AsRemote()->OffsetAtPoint(aX, aY, aCoordType);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -305,24 +305,24 @@ xpcAccessibleHyperText::GetCaretOffset(int32_t* aCaretOffset) {
|
|||
NS_ENSURE_ARG_POINTER(aCaretOffset);
|
||||
*aCaretOffset = -1;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
*aCaretOffset = Intl()->CaretOffset();
|
||||
} else {
|
||||
*aCaretOffset = mIntl.AsProxy()->CaretOffset();
|
||||
*aCaretOffset = mIntl->AsRemote()->CaretOffset();
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleHyperText::SetCaretOffset(int32_t aCaretOffset) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->SetCaretOffset(aCaretOffset);
|
||||
} else {
|
||||
mIntl.AsProxy()->SetCaretOffset(aCaretOffset);
|
||||
mIntl->AsRemote()->SetCaretOffset(aCaretOffset);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -332,15 +332,15 @@ xpcAccessibleHyperText::GetSelectionCount(int32_t* aSelectionCount) {
|
|||
NS_ENSURE_ARG_POINTER(aSelectionCount);
|
||||
*aSelectionCount = 0;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
*aSelectionCount = Intl()->SelectionCount();
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
*aSelectionCount = mIntl.AsProxy()->SelectionCount();
|
||||
*aSelectionCount = mIntl->AsRemote()->SelectionCount();
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -354,11 +354,11 @@ xpcAccessibleHyperText::GetSelectionBounds(int32_t aSelectionNum,
|
|||
NS_ENSURE_ARG_POINTER(aEndOffset);
|
||||
*aStartOffset = *aEndOffset = 0;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (aSelectionNum < 0) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
if (aSelectionNum >= Intl()->SelectionCount()) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
Intl()->SelectionBoundsAt(aSelectionNum, aStartOffset, aEndOffset);
|
||||
|
@ -367,8 +367,8 @@ xpcAccessibleHyperText::GetSelectionBounds(int32_t aSelectionNum,
|
|||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
nsString unused;
|
||||
mIntl.AsProxy()->SelectionBoundsAt(aSelectionNum, unused, aStartOffset,
|
||||
aEndOffset);
|
||||
mIntl->AsRemote()->SelectionBoundsAt(aSelectionNum, unused, aStartOffset,
|
||||
aEndOffset);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -378,11 +378,11 @@ NS_IMETHODIMP
|
|||
xpcAccessibleHyperText::SetSelectionBounds(int32_t aSelectionNum,
|
||||
int32_t aStartOffset,
|
||||
int32_t aEndOffset) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (aSelectionNum < 0) return NS_ERROR_INVALID_ARG;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
if (!Intl()->SetSelectionBoundsAt(aSelectionNum, aStartOffset,
|
||||
aEndOffset)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
|
@ -391,8 +391,8 @@ xpcAccessibleHyperText::SetSelectionBounds(int32_t aSelectionNum,
|
|||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
if (!mIntl.AsProxy()->SetSelectionBoundsAt(aSelectionNum, aStartOffset,
|
||||
aEndOffset)) {
|
||||
if (!mIntl->AsRemote()->SetSelectionBoundsAt(aSelectionNum, aStartOffset,
|
||||
aEndOffset)) {
|
||||
return NS_ERROR_INVALID_ARG;
|
||||
}
|
||||
#endif
|
||||
|
@ -402,24 +402,24 @@ xpcAccessibleHyperText::SetSelectionBounds(int32_t aSelectionNum,
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleHyperText::AddSelection(int32_t aStartOffset, int32_t aEndOffset) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->AddToSelection(aStartOffset, aEndOffset);
|
||||
} else {
|
||||
mIntl.AsProxy()->AddToSelection(aStartOffset, aEndOffset);
|
||||
mIntl->AsRemote()->AddToSelection(aStartOffset, aEndOffset);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleHyperText::RemoveSelection(int32_t aSelectionNum) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->RemoveFromSelection(aSelectionNum);
|
||||
} else {
|
||||
mIntl.AsProxy()->RemoveFromSelection(aSelectionNum);
|
||||
mIntl->AsRemote()->RemoveFromSelection(aSelectionNum);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -428,12 +428,12 @@ NS_IMETHODIMP
|
|||
xpcAccessibleHyperText::ScrollSubstringTo(int32_t aStartOffset,
|
||||
int32_t aEndOffset,
|
||||
uint32_t aScrollType) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->ScrollSubstringTo(aStartOffset, aEndOffset, aScrollType);
|
||||
} else {
|
||||
mIntl.AsProxy()->ScrollSubstringTo(aStartOffset, aEndOffset, aScrollType);
|
||||
mIntl->AsRemote()->ScrollSubstringTo(aStartOffset, aEndOffset, aScrollType);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -443,14 +443,14 @@ xpcAccessibleHyperText::ScrollSubstringToPoint(int32_t aStartOffset,
|
|||
int32_t aEndOffset,
|
||||
uint32_t aCoordinateType,
|
||||
int32_t aX, int32_t aY) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->ScrollSubstringToPoint(aStartOffset, aEndOffset, aCoordinateType,
|
||||
aX, aY);
|
||||
} else {
|
||||
mIntl.AsProxy()->ScrollSubstringToPoint(aStartOffset, aEndOffset,
|
||||
aCoordinateType, aX, aY);
|
||||
mIntl->AsRemote()->ScrollSubstringToPoint(aStartOffset, aEndOffset,
|
||||
aCoordinateType, aX, aY);
|
||||
}
|
||||
return NS_OK;
|
||||
}
|
||||
|
@ -558,16 +558,16 @@ xpcAccessibleHyperText::GetRangeAtPoint(int32_t aX, int32_t aY,
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleHyperText::SetTextContents(const nsAString& aText) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->ReplaceText(aText);
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
nsString text(aText);
|
||||
mIntl.AsProxy()->ReplaceText(text);
|
||||
mIntl->AsRemote()->ReplaceText(text);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -575,16 +575,16 @@ xpcAccessibleHyperText::SetTextContents(const nsAString& aText) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleHyperText::InsertText(const nsAString& aText, int32_t aOffset) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->InsertText(aText, aOffset);
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
nsString text(aText);
|
||||
mIntl.AsProxy()->InsertText(text, aOffset);
|
||||
mIntl->AsRemote()->InsertText(text, aOffset);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -592,15 +592,15 @@ xpcAccessibleHyperText::InsertText(const nsAString& aText, int32_t aOffset) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleHyperText::CopyText(int32_t aStartOffset, int32_t aEndOffset) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->CopyText(aStartOffset, aEndOffset);
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
mIntl.AsProxy()->CopyText(aStartOffset, aEndOffset);
|
||||
mIntl->AsRemote()->CopyText(aStartOffset, aEndOffset);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -608,15 +608,15 @@ xpcAccessibleHyperText::CopyText(int32_t aStartOffset, int32_t aEndOffset) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleHyperText::CutText(int32_t aStartOffset, int32_t aEndOffset) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->CutText(aStartOffset, aEndOffset);
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
mIntl.AsProxy()->CutText(aStartOffset, aEndOffset);
|
||||
mIntl->AsRemote()->CutText(aStartOffset, aEndOffset);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -624,15 +624,15 @@ xpcAccessibleHyperText::CutText(int32_t aStartOffset, int32_t aEndOffset) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleHyperText::DeleteText(int32_t aStartOffset, int32_t aEndOffset) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
Intl()->DeleteText(aStartOffset, aEndOffset);
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
mIntl.AsProxy()->DeleteText(aStartOffset, aEndOffset);
|
||||
mIntl->AsRemote()->DeleteText(aStartOffset, aEndOffset);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -640,16 +640,16 @@ xpcAccessibleHyperText::DeleteText(int32_t aStartOffset, int32_t aEndOffset) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleHyperText::PasteText(int32_t aOffset) {
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
RefPtr<HyperTextAccessible> acc = Intl();
|
||||
acc->PasteText(aOffset);
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
mIntl.AsProxy()->PasteText(aOffset);
|
||||
mIntl->AsRemote()->PasteText(aOffset);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -663,15 +663,15 @@ xpcAccessibleHyperText::GetLinkCount(int32_t* aLinkCount) {
|
|||
NS_ENSURE_ARG_POINTER(aLinkCount);
|
||||
*aLinkCount = 0;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
*aLinkCount = Intl()->LinkCount();
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
*aLinkCount = mIntl.AsProxy()->LinkCount();
|
||||
*aLinkCount = mIntl->AsRemote()->LinkCount();
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -683,15 +683,15 @@ xpcAccessibleHyperText::GetLinkAt(int32_t aIndex,
|
|||
NS_ENSURE_ARG_POINTER(aLink);
|
||||
*aLink = nullptr;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
NS_IF_ADDREF(*aLink = ToXPC(Intl()->LinkAt(aIndex)));
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
NS_IF_ADDREF(*aLink = ToXPC(mIntl.AsProxy()->LinkAt(aIndex)));
|
||||
NS_IF_ADDREF(*aLink = ToXPC(mIntl->AsRemote()->LinkAt(aIndex)));
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
@ -704,7 +704,7 @@ xpcAccessibleHyperText::GetLinkIndex(nsIAccessibleHyperLink* aLink,
|
|||
NS_ENSURE_ARG_POINTER(aIndex);
|
||||
*aIndex = -1;
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
nsCOMPtr<nsIAccessible> xpcLink(do_QueryInterface(aLink));
|
||||
if (LocalAccessible* accLink = xpcLink->ToInternalAccessible()) {
|
||||
|
@ -715,9 +715,9 @@ xpcAccessibleHyperText::GetLinkIndex(nsIAccessibleHyperLink* aLink,
|
|||
#else
|
||||
xpcAccessibleHyperText* linkHyperText =
|
||||
static_cast<xpcAccessibleHyperText*>(xpcLink.get());
|
||||
RemoteAccessible* proxyLink = linkHyperText->mIntl.AsProxy();
|
||||
RemoteAccessible* proxyLink = linkHyperText->mIntl->AsRemote();
|
||||
if (proxyLink) {
|
||||
*aIndex = mIntl.AsProxy()->LinkIndexOf(proxyLink);
|
||||
*aIndex = mIntl->AsRemote()->LinkIndexOf(proxyLink);
|
||||
}
|
||||
#endif
|
||||
}
|
||||
|
@ -731,15 +731,15 @@ xpcAccessibleHyperText::GetLinkIndexAtOffset(int32_t aOffset,
|
|||
NS_ENSURE_ARG_POINTER(aLinkIndex);
|
||||
*aLinkIndex = -1; // API says this magic value means 'not found'
|
||||
|
||||
if (mIntl.IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!mIntl) return NS_ERROR_FAILURE;
|
||||
|
||||
if (mIntl.IsAccessible()) {
|
||||
if (mIntl->IsLocal()) {
|
||||
*aLinkIndex = Intl()->LinkIndexAtOffset(aOffset);
|
||||
} else {
|
||||
#if defined(XP_WIN)
|
||||
return NS_ERROR_NOT_IMPLEMENTED;
|
||||
#else
|
||||
*aLinkIndex = mIntl.AsProxy()->LinkIndexAtOffset(aOffset);
|
||||
*aLinkIndex = mIntl->AsRemote()->LinkIndexAtOffset(aOffset);
|
||||
#endif
|
||||
}
|
||||
return NS_OK;
|
||||
|
|
|
@ -22,11 +22,9 @@ class xpcAccessibleHyperText : public xpcAccessibleGeneric,
|
|||
public nsIAccessibleEditableText,
|
||||
public nsIAccessibleHyperText {
|
||||
public:
|
||||
explicit xpcAccessibleHyperText(LocalAccessible* aIntl)
|
||||
explicit xpcAccessibleHyperText(Accessible* aIntl)
|
||||
: xpcAccessibleGeneric(aIntl) {
|
||||
if (aIntl->IsHyperText() && aIntl->AsHyperText()->IsTextRole()) {
|
||||
mSupportedIfaces |= eText;
|
||||
}
|
||||
if (aIntl->IsHyperText() && aIntl->IsTextRole()) mSupportedIfaces |= eText;
|
||||
}
|
||||
|
||||
xpcAccessibleHyperText(RemoteAccessible* aProxy, uint32_t aInterfaces)
|
||||
|
@ -45,7 +43,7 @@ class xpcAccessibleHyperText : public xpcAccessibleGeneric,
|
|||
|
||||
private:
|
||||
HyperTextAccessible* Intl() {
|
||||
if (LocalAccessible* acc = mIntl.AsAccessible()) {
|
||||
if (LocalAccessible* acc = mIntl->AsLocal()) {
|
||||
return acc->AsHyperText();
|
||||
}
|
||||
|
||||
|
|
|
@ -17,12 +17,9 @@ namespace a11y {
|
|||
class xpcAccessibleImage : public xpcAccessibleGeneric,
|
||||
public nsIAccessibleImage {
|
||||
public:
|
||||
explicit xpcAccessibleImage(LocalAccessible* aIntl)
|
||||
explicit xpcAccessibleImage(Accessible* aIntl)
|
||||
: xpcAccessibleGeneric(aIntl) {}
|
||||
|
||||
xpcAccessibleImage(RemoteAccessible* aProxy, uint32_t aInterfaces)
|
||||
: xpcAccessibleGeneric(aProxy, aInterfaces) {}
|
||||
|
||||
NS_DECL_ISUPPORTS_INHERITED
|
||||
|
||||
NS_IMETHOD GetImagePosition(uint32_t aCoordType, int32_t* aX,
|
||||
|
@ -34,7 +31,7 @@ class xpcAccessibleImage : public xpcAccessibleGeneric,
|
|||
|
||||
private:
|
||||
ImageAccessible* Intl() {
|
||||
return mIntl.IsAccessible() ? mIntl.AsAccessible()->AsImage() : nullptr;
|
||||
return mIntl->IsLocal() ? mIntl->AsLocal()->AsImage() : nullptr;
|
||||
}
|
||||
|
||||
xpcAccessibleImage(const xpcAccessibleImage&) = delete;
|
||||
|
|
|
@ -19,7 +19,7 @@ namespace a11y {
|
|||
class xpcAccessibleTable : public xpcAccessibleHyperText,
|
||||
public nsIAccessibleTable {
|
||||
public:
|
||||
explicit xpcAccessibleTable(LocalAccessible* aIntl)
|
||||
explicit xpcAccessibleTable(Accessible* aIntl)
|
||||
: xpcAccessibleHyperText(aIntl) {}
|
||||
|
||||
xpcAccessibleTable(RemoteAccessible* aProxy, uint32_t aInterfaces)
|
||||
|
@ -69,7 +69,7 @@ class xpcAccessibleTable : public xpcAccessibleHyperText,
|
|||
|
||||
private:
|
||||
TableAccessible* Intl() {
|
||||
return mIntl.IsAccessible() ? mIntl.AsAccessible()->AsTable() : nullptr;
|
||||
return mIntl->IsLocal() ? mIntl->AsLocal()->AsTable() : nullptr;
|
||||
}
|
||||
|
||||
xpcAccessibleTable(const xpcAccessibleTable&) = delete;
|
||||
|
|
|
@ -20,7 +20,7 @@ namespace a11y {
|
|||
class xpcAccessibleTableCell : public xpcAccessibleHyperText,
|
||||
public nsIAccessibleTableCell {
|
||||
public:
|
||||
explicit xpcAccessibleTableCell(LocalAccessible* aIntl)
|
||||
explicit xpcAccessibleTableCell(Accessible* aIntl)
|
||||
: xpcAccessibleHyperText(aIntl) {}
|
||||
|
||||
xpcAccessibleTableCell(RemoteAccessible* aProxy, uint32_t aInterfaces)
|
||||
|
@ -43,7 +43,7 @@ class xpcAccessibleTableCell : public xpcAccessibleHyperText,
|
|||
|
||||
private:
|
||||
TableCellAccessible* Intl() {
|
||||
if (LocalAccessible* acc = mIntl.AsAccessible()) {
|
||||
if (LocalAccessible* acc = mIntl->AsLocal()) {
|
||||
return acc->AsTableCell();
|
||||
}
|
||||
|
||||
|
|
|
@ -15,17 +15,17 @@ xpcAccessibleValue::GetMaximumValue(double* aValue) {
|
|||
NS_ENSURE_ARG_POINTER(aValue);
|
||||
*aValue = 0;
|
||||
|
||||
if (Intl().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
|
||||
if (Intl()->IsLocal() && Intl()->AsLocal()->IsDefunct()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
double value;
|
||||
if (Intl().IsAccessible()) {
|
||||
value = Intl().AsAccessible()->MaxValue();
|
||||
if (Intl()->IsLocal()) {
|
||||
value = Intl()->AsLocal()->MaxValue();
|
||||
} else {
|
||||
value = Intl().AsProxy()->MaxValue();
|
||||
value = Intl()->AsRemote()->MaxValue();
|
||||
}
|
||||
|
||||
if (!IsNaN(value)) *aValue = value;
|
||||
|
@ -38,17 +38,17 @@ xpcAccessibleValue::GetMinimumValue(double* aValue) {
|
|||
NS_ENSURE_ARG_POINTER(aValue);
|
||||
*aValue = 0;
|
||||
|
||||
if (Intl().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
|
||||
if (Intl()->IsLocal() && Intl()->AsLocal()->IsDefunct()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
double value;
|
||||
if (Intl().IsAccessible()) {
|
||||
value = Intl().AsAccessible()->MinValue();
|
||||
if (Intl()->IsLocal()) {
|
||||
value = Intl()->AsLocal()->MinValue();
|
||||
} else {
|
||||
value = Intl().AsProxy()->MinValue();
|
||||
value = Intl()->AsRemote()->MinValue();
|
||||
}
|
||||
|
||||
if (!IsNaN(value)) *aValue = value;
|
||||
|
@ -61,17 +61,17 @@ xpcAccessibleValue::GetCurrentValue(double* aValue) {
|
|||
NS_ENSURE_ARG_POINTER(aValue);
|
||||
*aValue = 0;
|
||||
|
||||
if (Intl().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
|
||||
if (Intl()->IsLocal() && Intl()->AsLocal()->IsDefunct()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
double value;
|
||||
if (Intl().IsAccessible()) {
|
||||
value = Intl().AsAccessible()->CurValue();
|
||||
if (Intl()->IsLocal()) {
|
||||
value = Intl()->AsLocal()->CurValue();
|
||||
} else {
|
||||
value = Intl().AsProxy()->CurValue();
|
||||
value = Intl()->AsRemote()->CurValue();
|
||||
}
|
||||
|
||||
if (!IsNaN(value)) *aValue = value;
|
||||
|
@ -81,16 +81,16 @@ xpcAccessibleValue::GetCurrentValue(double* aValue) {
|
|||
|
||||
NS_IMETHODIMP
|
||||
xpcAccessibleValue::SetCurrentValue(double aValue) {
|
||||
if (Intl().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
|
||||
if (Intl()->IsLocal() && Intl()->AsLocal()->IsDefunct()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
if (Intl().IsAccessible()) {
|
||||
Intl().AsAccessible()->SetCurValue(aValue);
|
||||
if (Intl()->IsLocal()) {
|
||||
Intl()->AsLocal()->SetCurValue(aValue);
|
||||
} else {
|
||||
Intl().AsProxy()->SetCurValue(aValue);
|
||||
Intl()->AsRemote()->SetCurValue(aValue);
|
||||
}
|
||||
|
||||
return NS_OK;
|
||||
|
@ -101,17 +101,17 @@ xpcAccessibleValue::GetMinimumIncrement(double* aValue) {
|
|||
NS_ENSURE_ARG_POINTER(aValue);
|
||||
*aValue = 0;
|
||||
|
||||
if (Intl().IsNull()) return NS_ERROR_FAILURE;
|
||||
if (!Intl()) return NS_ERROR_FAILURE;
|
||||
|
||||
if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
|
||||
if (Intl()->IsLocal() && Intl()->AsLocal()->IsDefunct()) {
|
||||
return NS_ERROR_FAILURE;
|
||||
}
|
||||
|
||||
double value;
|
||||
if (Intl().IsAccessible()) {
|
||||
value = Intl().AsAccessible()->Step();
|
||||
if (Intl()->IsLocal()) {
|
||||
value = Intl()->AsLocal()->Step();
|
||||
} else {
|
||||
value = Intl().AsProxy()->Step();
|
||||
value = Intl()->AsRemote()->Step();
|
||||
}
|
||||
|
||||
if (!IsNaN(value)) *aValue = value;
|
||||
|
|
|
@ -31,7 +31,7 @@ class xpcAccessibleValue : public nsIAccessibleValue {
|
|||
virtual ~xpcAccessibleValue() {}
|
||||
|
||||
private:
|
||||
AccessibleOrProxy Intl();
|
||||
Accessible* Intl();
|
||||
|
||||
xpcAccessibleValue(const xpcAccessibleValue&) = delete;
|
||||
xpcAccessibleValue& operator=(const xpcAccessibleValue&) = delete;
|
||||
|
|
Загрузка…
Ссылка в новой задаче