Bug 1213382 - proxy more accessible selection methods, r=tbsaunde

--HG--
extra : rebase_source : 1d8d688d4b1ab671aed5ba28bdcc14b2c4b94f70
This commit is contained in:
Olli Pettay 2015-10-13 22:08:00 +03:00
parent cbe8e23af4
commit 42685fa873
10 changed files with 45 additions and 26 deletions

View File

@ -533,11 +533,6 @@ public:
*/
virtual void SetSelected(bool aSelect);
/**
* Extend selection to this accessible.
*/
void ExtendSelection() { };
/**
* Select the accessible within its container.
*/

View File

@ -30,7 +30,7 @@ class Accessible;
* Mozilla creates the implementations of nsIAccessible on demand.
* See http://www.mozilla.org/projects/ui/accessibility for more information.
*/
[scriptable, uuid(66b110b0-c25a-4784-8623-f6ba40c7cfee)]
[scriptable, uuid(de2869d9-563c-4943-996b-31a4daa4d097)]
interface nsIAccessible : nsISupports
{
/**
@ -231,12 +231,6 @@ interface nsIAccessible : nsISupports
*/
void setSelected(in boolean isSelected);
/**
* Extend the current selection from its current accessible anchor node
* to this accessible
*/
void extendSelection();
/**
* Select this accessible node only
*/

View File

@ -1621,6 +1621,28 @@ DocAccessibleChild::RecvUnselectAll(const uint64_t& aID,
return true;
}
bool
DocAccessibleChild::RecvTakeSelection(const uint64_t& aID)
{
Accessible* acc = IdToAccessible(aID);
if (acc) {
acc->TakeSelection();
}
return true;
}
bool
DocAccessibleChild::RecvSetSelected(const uint64_t& aID, const bool& aSelect)
{
Accessible* acc = IdToAccessible(aID);
if (acc) {
acc->SetSelected(aSelect);
}
return true;
}
bool
DocAccessibleChild::RecvDoAction(const uint64_t& aID,
const uint8_t& aIndex,

View File

@ -401,6 +401,10 @@ public:
virtual bool RecvUnselectAll(const uint64_t& aID,
bool* aSuccess) override;
virtual bool RecvTakeSelection(const uint64_t& aID) override;
virtual bool RecvSetSelected(const uint64_t& aID,
const bool& aSelect) override;
virtual bool RecvDoAction(const uint64_t& aID,
const uint8_t& aIndex,
bool* aSuccess) override;

View File

@ -216,6 +216,9 @@ child:
prio(high) sync SelectAll(uint64_t aID) returns(bool aSuccess);
prio(high) sync UnselectAll(uint64_t aID) returns(bool aSuccess);
async TakeSelection(uint64_t aID);
async SetSelected(uint64_t aID, bool aSelected);
prio(high) sync DoAction(uint64_t aID, uint8_t aIndex) returns(bool aSuccess);
prio(high) sync ActionCount(uint64_t aID) returns(uint8_t aCount);
prio(high) sync ActionDescriptionAt(uint64_t aID, uint8_t aIndex) returns(nsString aDescription);

View File

@ -906,6 +906,18 @@ ProxyAccessible::UnselectAll()
return success;
}
void
ProxyAccessible::TakeSelection()
{
unused << mDoc->SendTakeSelection(mID);
}
void
ProxyAccessible::SetSelected(bool aSelect)
{
unused << mDoc->SendSetSelected(mID, aSelect);
}
bool
ProxyAccessible::DoAction(uint8_t aIndex)
{

View File

@ -309,6 +309,9 @@ public:
bool SelectAll();
bool UnselectAll();
void TakeSelection();
void SetSelected(bool aSelect);
bool DoAction(uint8_t aIndex);
uint8_t ActionCount();
void ActionDescriptionAt(uint8_t aIndex, nsString& aDescription);

View File

@ -913,9 +913,6 @@ AccessibleWrap::accSelect(
if (flagsSelect & SELFLAG_REMOVESELECTION)
xpAccessible->SetSelected(false);
if (flagsSelect & SELFLAG_EXTENDSELECTION)
xpAccessible->ExtendSelection();
return S_OK;
}

View File

@ -498,16 +498,6 @@ xpcAccessible::SetSelected(bool aSelect)
return NS_OK;
}
NS_IMETHODIMP
xpcAccessible::ExtendSelection()
{
if (!Intl())
return NS_ERROR_FAILURE;
Intl()->ExtendSelection();
return NS_OK;
}
NS_IMETHODIMP
xpcAccessible::TakeSelection()
{

View File

@ -73,7 +73,6 @@ public:
final override;
NS_IMETHOD SetSelected(bool aSelect) final override;
NS_IMETHOD ExtendSelection() final override;
NS_IMETHOD TakeSelection() final override;
NS_IMETHOD TakeFocus() final override;