зеркало из https://github.com/mozilla/gecko-dev.git
Bug 1765651 - Put DOMNodeID in Accessible. r=morgan
Differential Revision: https://phabricator.services.mozilla.com/D144234
This commit is contained in:
Родитель
24097d7651
Коммит
395df0c9f2
|
@ -645,12 +645,7 @@ int32_t AccessibleWrap::GetInputType(const nsString& aInputTypeAttr) {
|
|||
}
|
||||
|
||||
void AccessibleWrap::WrapperDOMNodeID(nsString& aDOMNodeID) {
|
||||
if (mContent) {
|
||||
nsAtom* id = mContent->GetID();
|
||||
if (id) {
|
||||
id->ToString(aDOMNodeID);
|
||||
}
|
||||
}
|
||||
DOMNodeID(aDOMNodeID);
|
||||
}
|
||||
|
||||
bool AccessibleWrap::WrapperRangeInfo(double* aCurVal, double* aMinVal,
|
||||
|
|
|
@ -256,6 +256,11 @@ class Accessible {
|
|||
*/
|
||||
virtual nsAtom* LandmarkRole() const;
|
||||
|
||||
/**
|
||||
* Return the id of the dom node this accessible represents.
|
||||
*/
|
||||
virtual void DOMNodeID(nsString& aID) const = 0;
|
||||
|
||||
//////////////////////////////////////////////////////////////////////////////
|
||||
// ActionAccessible
|
||||
|
||||
|
|
|
@ -3516,6 +3516,15 @@ Maybe<float> LocalAccessible::Opacity() const {
|
|||
return Nothing();
|
||||
}
|
||||
|
||||
void LocalAccessible::DOMNodeID(nsString& aID) const {
|
||||
aID.Truncate();
|
||||
if (mContent) {
|
||||
if (nsAtom* id = mContent->GetID()) {
|
||||
id->ToString(aID);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void LocalAccessible::StaticAsserts() const {
|
||||
static_assert(
|
||||
eLastStateFlag <= (1 << kStateFlagsBits) - 1,
|
||||
|
|
|
@ -791,6 +791,8 @@ class LocalAccessible : public nsISupports, public Accessible {
|
|||
|
||||
virtual Maybe<float> Opacity() const override;
|
||||
|
||||
virtual void DOMNodeID(nsString& aID) const override;
|
||||
|
||||
protected:
|
||||
virtual ~LocalAccessible();
|
||||
|
||||
|
|
|
@ -286,11 +286,7 @@ class RemoteAccessibleBase : public Accessible, public HyperTextAccessibleBase {
|
|||
virtual TableAccessibleBase* AsTableBase() override;
|
||||
virtual TableCellAccessibleBase* AsTableCellBase() override;
|
||||
|
||||
/**
|
||||
* Return the id of the dom node this accessible represents. Note this
|
||||
* should probably only be used for testing.
|
||||
*/
|
||||
virtual void DOMNodeID(nsString& aID) const;
|
||||
virtual void DOMNodeID(nsString& aID) const override;
|
||||
|
||||
// HyperTextAccessibleBase
|
||||
virtual already_AddRefed<AccAttributes> DefaultTextAttributes() override;
|
||||
|
|
|
@ -741,13 +741,7 @@ struct RoleDescrComparator {
|
|||
MOZ_ASSERT(mGeckoAccessible);
|
||||
|
||||
nsAutoString id;
|
||||
if (LocalAccessible* acc = mGeckoAccessible->AsLocal()) {
|
||||
if (acc->GetContent()) {
|
||||
nsCoreUtils::GetID(acc->GetContent(), id);
|
||||
}
|
||||
} else {
|
||||
mGeckoAccessible->AsRemote()->DOMNodeID(id);
|
||||
}
|
||||
mGeckoAccessible->DOMNodeID(id);
|
||||
|
||||
return nsCocoaUtils::ToNSString(id);
|
||||
}
|
||||
|
|
Загрузка…
Ссылка в новой задаче