mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 386978 - get rid FireToolkitEvent, r=aaronlev
This commit is contained in:
parent
34b87bf55f
commit
9b63b96f07
@ -41,7 +41,7 @@
|
|||||||
interface nsIAccessible;
|
interface nsIAccessible;
|
||||||
interface nsIAccessibleEvent;
|
interface nsIAccessibleEvent;
|
||||||
|
|
||||||
[uuid(e4865da3-f292-4f1a-9c56-dd307f1bdc17)]
|
[uuid(96518e2e-b142-4b5d-9324-0fa5ba4f8bab)]
|
||||||
interface nsPIAccessible : nsISupports
|
interface nsPIAccessible : nsISupports
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
@ -69,18 +69,6 @@ interface nsPIAccessible : nsISupports
|
|||||||
*/
|
*/
|
||||||
void invalidateChildren();
|
void invalidateChildren();
|
||||||
|
|
||||||
/**
|
|
||||||
* Fire accessible event.
|
|
||||||
*
|
|
||||||
* @param aEvent - DOM event
|
|
||||||
* @param aTarget - target of DOM event
|
|
||||||
* @param aData - additional information for accessible event.
|
|
||||||
*
|
|
||||||
* XXX: eventually this method will be removed (see bug 377022)
|
|
||||||
*/
|
|
||||||
void fireToolkitEvent(in unsigned long aEvent, in nsIAccessible aTarget,
|
|
||||||
in voidPtr aData);
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Fire accessible event.
|
* Fire accessible event.
|
||||||
*/
|
*/
|
||||||
|
@ -37,6 +37,10 @@
|
|||||||
* ***** END LICENSE BLOCK ***** */
|
* ***** END LICENSE BLOCK ***** */
|
||||||
|
|
||||||
#include "nsAccessibilityUtils.h"
|
#include "nsAccessibilityUtils.h"
|
||||||
|
|
||||||
|
#include "nsPIAccessible.h"
|
||||||
|
#include "nsAccessibleEventData.h"
|
||||||
|
|
||||||
#include "nsIDOMXULSelectCntrlEl.h"
|
#include "nsIDOMXULSelectCntrlEl.h"
|
||||||
#include "nsIDOMXULSelectCntrlItemEl.h"
|
#include "nsIDOMXULSelectCntrlItemEl.h"
|
||||||
#include "nsIEventListenerManager.h"
|
#include "nsIEventListenerManager.h"
|
||||||
@ -163,3 +167,18 @@ nsAccUtils::HasListener(nsIContent *aContent, const nsAString& aEventType)
|
|||||||
return listenerManager && listenerManager->HasListenersFor(aEventType);
|
return listenerManager && listenerManager->HasListenersFor(aEventType);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsresult
|
||||||
|
nsAccUtils::FireAccEvent(PRUint32 aEventType, nsIAccessible *aAccessible)
|
||||||
|
{
|
||||||
|
NS_ENSURE_ARG(aAccessible);
|
||||||
|
|
||||||
|
nsCOMPtr<nsPIAccessible> pAccessible(do_QueryInterface(aAccessible));
|
||||||
|
NS_ASSERTION(pAccessible, "Accessible doesn't implement nsPIAccessible");
|
||||||
|
|
||||||
|
nsCOMPtr<nsIAccessibleEvent> event =
|
||||||
|
new nsAccEvent(aEventType, aAccessible, nsnull);
|
||||||
|
NS_ENSURE_TRUE(event, NS_ERROR_OUT_OF_MEMORY);
|
||||||
|
|
||||||
|
return pAccessible->FireAccessibleEvent(event);
|
||||||
|
}
|
||||||
|
|
||||||
|
@ -40,6 +40,7 @@
|
|||||||
#define nsAccessibilityUtils_h_
|
#define nsAccessibilityUtils_h_
|
||||||
|
|
||||||
#include "nsAccessibilityAtoms.h"
|
#include "nsAccessibilityAtoms.h"
|
||||||
|
#include "nsIAccessible.h"
|
||||||
|
|
||||||
#include "nsIDOMNode.h"
|
#include "nsIDOMNode.h"
|
||||||
#include "nsIPersistentProperties2.h"
|
#include "nsIPersistentProperties2.h"
|
||||||
@ -101,7 +102,16 @@ public:
|
|||||||
static void SetAccAttrsForXULSelectControlItem(nsIDOMNode *aNode,
|
static void SetAccAttrsForXULSelectControlItem(nsIDOMNode *aNode,
|
||||||
nsIPersistentProperties *aAttributes);
|
nsIPersistentProperties *aAttributes);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return true if the given node has registered event listener of the given
|
||||||
|
* type.
|
||||||
|
*/
|
||||||
static PRBool HasListener(nsIContent *aContent, const nsAString& aEventType);
|
static PRBool HasListener(nsIContent *aContent, const nsAString& aEventType);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Fire accessible event of the given type for the given accessible.
|
||||||
|
*/
|
||||||
|
static nsresult FireAccEvent(PRUint32 aEventType, nsIAccessible *aAccessible);
|
||||||
};
|
};
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -2007,22 +2007,6 @@ PRBool nsAccessible::IsNodeRelevant(nsIDOMNode *aNode)
|
|||||||
return aNode == relevantNode;
|
return aNode == relevantNode;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP nsAccessible::FireToolkitEvent(PRUint32 aEvent, nsIAccessible *aTarget, void * aData)
|
|
||||||
{
|
|
||||||
// Don't fire event for accessible that has been shut down
|
|
||||||
if (!mWeakShell)
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
NS_ENSURE_TRUE(IsNodeRelevant(mDOMNode), NS_ERROR_FAILURE);
|
|
||||||
|
|
||||||
nsCOMPtr<nsIAccessibleDocument> docAccessible(GetDocAccessible());
|
|
||||||
nsCOMPtr<nsPIAccessible> eventHandlingAccessible(do_QueryInterface(docAccessible));
|
|
||||||
if (eventHandlingAccessible)
|
|
||||||
return eventHandlingAccessible->FireToolkitEvent(aEvent, aTarget, aData);
|
|
||||||
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
}
|
|
||||||
|
|
||||||
NS_IMETHODIMP
|
NS_IMETHODIMP
|
||||||
nsAccessible::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
|
nsAccessible::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
|
||||||
{
|
{
|
||||||
|
@ -757,8 +757,8 @@ NS_IMETHODIMP nsDocAccessible::FireAnchorJumpEvent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (mIsAnchorJumped) {
|
if (mIsAnchorJumped) {
|
||||||
FireToolkitEvent(nsIAccessibleEvent::EVENT_DOCUMENT_ATTRIBUTES_CHANGED,
|
nsAccUtils::
|
||||||
this, nsnull);
|
FireAccEvent(nsIAccessibleEvent::EVENT_DOCUMENT_ATTRIBUTES_CHANGED, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
@ -816,7 +816,7 @@ NS_IMETHODIMP nsDocAccessible::FireDocLoadEvents(PRUint32 aEventType)
|
|||||||
FireAccessibleEvent(accEvent);
|
FireAccessibleEvent(accEvent);
|
||||||
}
|
}
|
||||||
|
|
||||||
FireToolkitEvent(aEventType, this, nsnull);
|
nsAccUtils::FireAccEvent(aEventType, this);
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -830,8 +830,8 @@ void nsDocAccessible::ScrollTimerCallback(nsITimer *aTimer, void *aClosure)
|
|||||||
// We only want to fire accessibilty scroll event when scrolling stops or pauses
|
// We only want to fire accessibilty scroll event when scrolling stops or pauses
|
||||||
// Therefore, we wait for no scroll events to occur between 2 ticks of this timer
|
// Therefore, we wait for no scroll events to occur between 2 ticks of this timer
|
||||||
// That indicates a pause in scrolling, so we fire the accessibilty scroll event
|
// That indicates a pause in scrolling, so we fire the accessibilty scroll event
|
||||||
docAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_SCROLLING_END, docAcc,
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_SCROLLING_END, docAcc);
|
||||||
nsnull);
|
|
||||||
docAcc->mScrollPositionChangedTicks = 0;
|
docAcc->mScrollPositionChangedTicks = 0;
|
||||||
if (docAcc->mScrollWatchTimer) {
|
if (docAcc->mScrollWatchTimer) {
|
||||||
docAcc->mScrollWatchTimer->Cancel();
|
docAcc->mScrollWatchTimer->Cancel();
|
||||||
@ -1278,8 +1278,8 @@ NS_IMETHODIMP nsDocAccessible::FlushPendingEvents()
|
|||||||
PRInt32 selectionCount;
|
PRInt32 selectionCount;
|
||||||
accessibleText->GetSelectionCount(&selectionCount);
|
accessibleText->GetSelectionCount(&selectionCount);
|
||||||
if (selectionCount) { // There's a selection so fire selection change as well
|
if (selectionCount) { // There's a selection so fire selection change as well
|
||||||
FireToolkitEvent(nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED,
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED,
|
||||||
accessible, nsnull);
|
accessible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1328,8 +1328,8 @@ void nsDocAccessible::RefreshNodes(nsIDOMNode *aStartNode, PRUint32 aChangeEvent
|
|||||||
if (!popup) {
|
if (!popup) {
|
||||||
// Popup elements already fire these via DOMMenuInactive
|
// Popup elements already fire these via DOMMenuInactive
|
||||||
// handling in nsRootAccessible::HandleEvent
|
// handling in nsRootAccessible::HandleEvent
|
||||||
FireToolkitEvent(nsIAccessibleEvent::EVENT_MENUPOPUP_END,
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_MENUPOPUP_END,
|
||||||
accessible, nsnull);
|
accessible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1428,11 +1428,8 @@ NS_IMETHODIMP nsDocAccessible::InvalidateCacheSubtree(nsIContent *aChild,
|
|||||||
aChangeEventType == nsIAccessibleEvent::EVENT_REORDER) {
|
aChangeEventType == nsIAccessibleEvent::EVENT_REORDER) {
|
||||||
// Fire EVENT_HIDE if previous accessible existed for node being hidden.
|
// Fire EVENT_HIDE if previous accessible existed for node being hidden.
|
||||||
// Fire this before the accessible goes away.
|
// Fire this before the accessible goes away.
|
||||||
nsCOMPtr<nsPIAccessible> privateChildAccessible =
|
if (childAccessible)
|
||||||
do_QueryInterface(childAccessible);
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_HIDE, childAccessible);
|
||||||
if (privateChildAccessible)
|
|
||||||
privateChildAccessible->FireToolkitEvent(nsIAccessibleEvent::EVENT_HIDE,
|
|
||||||
childAccessible, nsnull);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Shutdown nsIAccessNode's or nsIAccessibles for any DOM nodes in this subtree
|
// Shutdown nsIAccessNode's or nsIAccessibles for any DOM nodes in this subtree
|
||||||
@ -1539,21 +1536,6 @@ nsDocAccessible::GetAccessibleInParentChain(nsIDOMNode *aNode,
|
|||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
NS_IMETHODIMP
|
|
||||||
nsDocAccessible::FireToolkitEvent(PRUint32 aEvent, nsIAccessible *aTarget,
|
|
||||||
void * aData)
|
|
||||||
{
|
|
||||||
// Don't fire event for accessible that has been shut down.
|
|
||||||
if (!mWeakShell)
|
|
||||||
return NS_ERROR_FAILURE;
|
|
||||||
|
|
||||||
nsCOMPtr<nsIAccessibleEvent> accEvent =
|
|
||||||
new nsAccEvent(aEvent, aTarget, aData);
|
|
||||||
NS_ENSURE_TRUE(accEvent, NS_ERROR_OUT_OF_MEMORY);
|
|
||||||
|
|
||||||
return FireAccessibleEvent(accEvent);
|
|
||||||
}
|
|
||||||
|
|
||||||
void nsDocAccessible::DocLoadCallback(nsITimer *aTimer, void *aClosure)
|
void nsDocAccessible::DocLoadCallback(nsITimer *aTimer, void *aClosure)
|
||||||
{
|
{
|
||||||
// Doc has finished loading, fire "load finished" event
|
// Doc has finished loading, fire "load finished" event
|
||||||
|
@ -90,9 +90,6 @@ class nsDocAccessible : public nsHyperTextAccessibleWrap,
|
|||||||
// nsIDocumentObserver
|
// nsIDocumentObserver
|
||||||
NS_DECL_NSIDOCUMENTOBSERVER
|
NS_DECL_NSIDOCUMENTOBSERVER
|
||||||
|
|
||||||
NS_IMETHOD FireToolkitEvent(PRUint32 aEvent, nsIAccessible* aAccessible,
|
|
||||||
void* aData);
|
|
||||||
|
|
||||||
static void FlushEventsCallback(nsITimer *aTimer, void *aClosure);
|
static void FlushEventsCallback(nsITimer *aTimer, void *aClosure);
|
||||||
|
|
||||||
// nsIAccessNode
|
// nsIAccessNode
|
||||||
|
@ -483,13 +483,13 @@ PRBool nsRootAccessible::FireAccessibleFocusEvent(nsIAccessible *aAccessible,
|
|||||||
PRUint32 naturalRole; // The natural role is the role that this type of element normally has
|
PRUint32 naturalRole; // The natural role is the role that this type of element normally has
|
||||||
finalFocusAccessible->GetRole(&naturalRole);
|
finalFocusAccessible->GetRole(&naturalRole);
|
||||||
if (role != naturalRole) { // Must be a DHTML menuitem
|
if (role != naturalRole) { // Must be a DHTML menuitem
|
||||||
FireToolkitEvent(nsIAccessibleEvent::EVENT_MENU_START, this, nsnull);
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_MENU_START, this);
|
||||||
mIsInDHTMLMenu = nsIAccessibleRole::ROLE_MENUITEM;
|
mIsInDHTMLMenu = nsIAccessibleRole::ROLE_MENUITEM;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (mIsInDHTMLMenu) {
|
else if (mIsInDHTMLMenu) {
|
||||||
FireToolkitEvent(nsIAccessibleEvent::EVENT_MENU_END, this, nsnull);
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_MENU_END, this);
|
||||||
mIsInDHTMLMenu = PR_FALSE;
|
mIsInDHTMLMenu = PR_FALSE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -704,12 +704,12 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
|
|||||||
// for each tree item. Perhaps each tree item will need to cache its
|
// for each tree item. Perhaps each tree item will need to cache its
|
||||||
// selection state and fire an event after a DOM "select" event when
|
// selection state and fire an event after a DOM "select" event when
|
||||||
// that state changes. nsXULTreeAccessible::UpdateTreeSelection();
|
// that state changes. nsXULTreeAccessible::UpdateTreeSelection();
|
||||||
return privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_SELECTION_WITHIN,
|
return nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_SELECTION_WITHIN,
|
||||||
accessible, nsnull);
|
accessible);
|
||||||
}
|
}
|
||||||
|
|
||||||
return privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_SELECTION,
|
return nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_SELECTION,
|
||||||
treeItemAccessible, nsnull);
|
treeItemAccessible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -747,12 +747,10 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
|
|||||||
FireAccessibleFocusEvent(accessible, focusedItem, aEvent);
|
FireAccessibleFocusEvent(accessible, focusedItem, aEvent);
|
||||||
}
|
}
|
||||||
else if (eventType.EqualsLiteral("NameChange")) {
|
else if (eventType.EqualsLiteral("NameChange")) {
|
||||||
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE,
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, accessible);
|
||||||
accessible, nsnull);
|
|
||||||
}
|
}
|
||||||
else if (eventType.EqualsLiteral("AlertActive")) {
|
else if (eventType.EqualsLiteral("AlertActive")) {
|
||||||
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_ALERT,
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_ALERT, accessible);
|
||||||
accessible, nsnull);
|
|
||||||
}
|
}
|
||||||
else if (eventType.EqualsLiteral("popupshown")) {
|
else if (eventType.EqualsLiteral("popupshown")) {
|
||||||
// Don't fire menupopup events for combobox and autocomplete lists
|
// Don't fire menupopup events for combobox and autocomplete lists
|
||||||
@ -769,7 +767,7 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
|
|||||||
event = nsIAccessibleEvent::EVENT_SHOW;
|
event = nsIAccessibleEvent::EVENT_SHOW;
|
||||||
}
|
}
|
||||||
if (event) {
|
if (event) {
|
||||||
privAcc->FireToolkitEvent(event, accessible, nsnull);
|
nsAccUtils::FireAccEvent(event, accessible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -796,8 +794,8 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
|
|||||||
}
|
}
|
||||||
else if (eventType.EqualsLiteral("DOMMenuInactive")) {
|
else if (eventType.EqualsLiteral("DOMMenuInactive")) {
|
||||||
if (Role(accessible) == nsIAccessibleRole::ROLE_MENUPOPUP) {
|
if (Role(accessible) == nsIAccessibleRole::ROLE_MENUPOPUP) {
|
||||||
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_MENUPOPUP_END,
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_MENUPOPUP_END,
|
||||||
accessible, nsnull);
|
accessible);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (eventType.EqualsLiteral("DOMMenuItemActive")) {
|
else if (eventType.EqualsLiteral("DOMMenuItemActive")) {
|
||||||
@ -828,17 +826,14 @@ nsresult nsRootAccessible::HandleEventWithTarget(nsIDOMEvent* aEvent,
|
|||||||
FireAccessibleFocusEvent(accessible, aTargetNode, aEvent, PR_TRUE);
|
FireAccessibleFocusEvent(accessible, aTargetNode, aEvent, PR_TRUE);
|
||||||
}
|
}
|
||||||
else if (eventType.EqualsLiteral("DOMMenuBarActive")) {
|
else if (eventType.EqualsLiteral("DOMMenuBarActive")) {
|
||||||
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_MENU_START,
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_MENU_START, accessible);
|
||||||
accessible, nsnull);
|
|
||||||
}
|
}
|
||||||
else if (eventType.EqualsLiteral("DOMMenuBarInactive")) {
|
else if (eventType.EqualsLiteral("DOMMenuBarInactive")) {
|
||||||
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_MENU_END,
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_MENU_END, accessible);
|
||||||
accessible, nsnull);
|
|
||||||
FireCurrentFocusEvent();
|
FireCurrentFocusEvent();
|
||||||
}
|
}
|
||||||
else if (eventType.EqualsLiteral("ValueChange")) {
|
else if (eventType.EqualsLiteral("ValueChange")) {
|
||||||
privAcc->FireToolkitEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE,
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE, accessible);
|
||||||
accessible, nsnull);
|
|
||||||
}
|
}
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
@ -819,8 +819,9 @@ void nsHTMLSelectOptionAccessible::SelectionChangedIfOption(nsIContent *aPossibl
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
privateMultiSelect->FireToolkitEvent(nsIAccessibleEvent::EVENT_SELECTION_WITHIN,
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_SELECTION_WITHIN,
|
||||||
multiSelect, nsnull);
|
multiSelect);
|
||||||
|
|
||||||
PRUint32 state = State(optionAccessible);
|
PRUint32 state = State(optionAccessible);
|
||||||
PRUint32 eventType;
|
PRUint32 eventType;
|
||||||
if (state & nsIAccessibleStates::STATE_SELECTED) {
|
if (state & nsIAccessibleStates::STATE_SELECTED) {
|
||||||
@ -829,7 +830,8 @@ void nsHTMLSelectOptionAccessible::SelectionChangedIfOption(nsIContent *aPossibl
|
|||||||
else {
|
else {
|
||||||
eventType = nsIAccessibleEvent::EVENT_SELECTION_REMOVE;
|
eventType = nsIAccessibleEvent::EVENT_SELECTION_REMOVE;
|
||||||
}
|
}
|
||||||
privateMultiSelect->FireToolkitEvent(eventType, optionAccessible, nsnull);
|
|
||||||
|
nsAccUtils::FireAccEvent(eventType, optionAccessible);
|
||||||
}
|
}
|
||||||
|
|
||||||
nsIContent* nsHTMLSelectOptionAccessible::GetSelectState(PRUint32* aState,
|
nsIContent* nsHTMLSelectOptionAccessible::GetSelectState(PRUint32* aState,
|
||||||
|
@ -77,6 +77,8 @@ class nsAccessibleWrap : public nsAccessible
|
|||||||
virtual nsresult Shutdown ();
|
virtual nsresult Shutdown ();
|
||||||
virtual nsresult InvalidateChildren ();
|
virtual nsresult InvalidateChildren ();
|
||||||
|
|
||||||
|
NS_IMETHOD FireAccessibleEvent(nsIAccessibleEvent *aEvent);
|
||||||
|
|
||||||
// we'll flatten buttons and checkboxes. usually they have a text node
|
// we'll flatten buttons and checkboxes. usually they have a text node
|
||||||
// child, that is their title. Works in conjunction with IsPruned() below.
|
// child, that is their title. Works in conjunction with IsPruned() below.
|
||||||
PRBool IsFlat() {
|
PRBool IsFlat() {
|
||||||
|
@ -154,6 +154,43 @@ nsAccessibleWrap::Shutdown ()
|
|||||||
return nsAccessible::Shutdown();
|
return nsAccessible::Shutdown();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
nsAccessibleWrap::FireAccessibleEvent(nsIAccessibleEvent *aEvent)
|
||||||
|
{
|
||||||
|
NS_ENSURE_ARG_POINTER(aEvent);
|
||||||
|
|
||||||
|
nsresult rv = nsAccessible::FireAccessibleEvent(aEvent);
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
|
PRUint32 eventType;
|
||||||
|
rv = aEvent->GetEventType(&eventType);
|
||||||
|
NS_ENSURE_SUCCESS(rv, rv);
|
||||||
|
|
||||||
|
// ignore everything but focus-changed and value-changed events for now.
|
||||||
|
if (eventType != nsIAccessibleEvent::EVENT_FOCUS &&
|
||||||
|
eventType != nsIAccessibleEvent::EVENT_VALUE_CHANGE)
|
||||||
|
return NS_OK;
|
||||||
|
|
||||||
|
nsCOMPtr<nsIAccessible> accessible;
|
||||||
|
rv = aEvent->GetAccessible(getter_AddRefs(accessible));
|
||||||
|
NS_ENSURE_STATE(accessible);
|
||||||
|
|
||||||
|
mozAccessible *nativeAcc = nil;
|
||||||
|
accessible->GetNativeInterface((void**)&nativeAcc);
|
||||||
|
if (!nativeAcc)
|
||||||
|
return NS_ERROR_FAILURE;
|
||||||
|
|
||||||
|
switch (eventType) {
|
||||||
|
case nsIAccessibleEvent::EVENT_FOCUS:
|
||||||
|
[nativeAcc didReceiveFocus];
|
||||||
|
break;
|
||||||
|
case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
|
||||||
|
[nativeAcc valueDidChange];
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
|
||||||
|
return NS_OK;
|
||||||
|
}
|
||||||
|
|
||||||
nsresult
|
nsresult
|
||||||
nsAccessibleWrap::InvalidateChildren ()
|
nsAccessibleWrap::InvalidateChildren ()
|
||||||
{
|
{
|
||||||
|
@ -41,17 +41,7 @@
|
|||||||
|
|
||||||
#include "nsDocAccessible.h"
|
#include "nsDocAccessible.h"
|
||||||
|
|
||||||
struct objc_class;
|
typedef nsDocAccessible nsDocAccessibleWrap;
|
||||||
|
|
||||||
class nsDocAccessibleWrap: public nsDocAccessible
|
|
||||||
{
|
|
||||||
public:
|
|
||||||
nsDocAccessibleWrap(nsIDOMNode *aNode, nsIWeakReference *aShell);
|
|
||||||
virtual ~nsDocAccessibleWrap();
|
|
||||||
|
|
||||||
NS_IMETHOD FireToolkitEvent(PRUint32 aEvent, nsIAccessible* aAccessible,
|
|
||||||
void* aData);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -194,11 +194,9 @@ NS_IMETHODIMP nsDocAccessibleWrap::FireAnchorJumpEvent()
|
|||||||
}
|
}
|
||||||
|
|
||||||
nsCOMPtr<nsIAccessible> accessible = GetFirstAvailableAccessible(focusNode, PR_TRUE);
|
nsCOMPtr<nsIAccessible> accessible = GetFirstAvailableAccessible(focusNode, PR_TRUE);
|
||||||
nsCOMPtr<nsPIAccessible> privateAccessible = do_QueryInterface(accessible);
|
nsAccUtils::FireAccEvent(nsIAccessibleEvent::EVENT_SCROLLING_START,
|
||||||
if (privateAccessible) {
|
accessible);
|
||||||
privateAccessible->FireToolkitEvent(nsIAccessibleEvent::EVENT_SCROLLING_START,
|
|
||||||
accessible, nsnull);
|
|
||||||
}
|
|
||||||
return NS_OK;
|
return NS_OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -45,12 +45,6 @@
|
|||||||
|
|
||||||
#include "nsDocAccessible.h"
|
#include "nsDocAccessible.h"
|
||||||
|
|
||||||
class nsDocAccessibleWrap: public nsDocAccessible
|
typedef nsDocAccessible nsDocAccessibleWrap;
|
||||||
{
|
|
||||||
public:
|
|
||||||
nsDocAccessibleWrap(nsIDOMNode *aNode, nsIWeakReference *aShell);
|
|
||||||
virtual ~nsDocAccessibleWrap();
|
|
||||||
NS_IMETHOD FireToolkitEvent(PRUint32 aEvent, nsIAccessible* aAccessible, void* aData);
|
|
||||||
};
|
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user