From e063612d52ee65e4e983a7e6d6613fec1faf6299 Mon Sep 17 00:00:00 2001 From: "aaronleventhal@moonset.net" Date: Thu, 19 Apr 2007 09:15:04 -0700 Subject: [PATCH] Backing out bug 255088 to fix orange tbox --- accessible/src/base/nsDocAccessible.cpp | 40 ++++++++++--------------- 1 file changed, 16 insertions(+), 24 deletions(-) diff --git a/accessible/src/base/nsDocAccessible.cpp b/accessible/src/base/nsDocAccessible.cpp index 0529fc81f91..12eeda9b633 100644 --- a/accessible/src/base/nsDocAccessible.cpp +++ b/accessible/src/base/nsDocAccessible.cpp @@ -909,35 +909,17 @@ nsDocAccessible::AttributeChanged(nsIDocument *aDocument, nsIContent* aContent, return; // Document has been shut down } + if (aNameSpaceID == kNameSpaceID_WAIProperties) { + ARIAAttributeChanged(aContent, aAttribute); + return; + } + nsCOMPtr targetNode(do_QueryInterface(aContent)); NS_ASSERTION(targetNode, "No node for attr modified"); if (!targetNode) { return; } - // Universal boolean properties that don't require a role. - if (aAttribute == nsAccessibilityAtoms::disabled) { - // Fire the state change whether disabled attribute is - // set for XUL, HTML or ARIA namespace. - // Checking the namespace would not seem to gain us anything, because - // disabled really is going to mean the same thing in any namespace. - nsCOMPtr event = - new nsAccStateChangeEvent(targetNode, - nsIAccessibleStates::EXT_STATE_ENABLED, - PR_TRUE); - FireDelayedAccessibleEvent(event); - event = new nsAccStateChangeEvent(targetNode, - nsIAccessibleStates::EXT_STATE_SENSITIVE, - PR_TRUE); - FireDelayedAccessibleEvent(event); - return; - } - - if (aNameSpaceID == kNameSpaceID_WAIProperties) { - ARIAAttributeChanged(aContent, aAttribute); - return; - } - if (aNameSpaceID == kNameSpaceID_XHTML2_Unofficial || aNameSpaceID == kNameSpaceID_XHTML) { if (aAttribute == nsAccessibilityAtoms::role) @@ -996,6 +978,16 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute) if (!targetNode) return; + // Universal boolean properties that don't require a role. + if (aAttribute == nsAccessibilityAtoms::disabled) { + nsCOMPtr event = + new nsAccStateChangeEvent(targetNode, + nsIAccessibleStates::EXT_STATE_ENABLED, + PR_TRUE); + FireDelayedAccessibleEvent(event); + return; + } + if (aAttribute == nsAccessibilityAtoms::required) { nsCOMPtr event = new nsAccStateChangeEvent(targetNode, @@ -1018,7 +1010,7 @@ nsDocAccessible::ARIAAttributeChanged(nsIContent* aContent, nsIAtom* aAttribute) // The activedescendant universal property redirects accessible focus events // to the element with the id that activedescendant points to nsCOMPtr currentFocus = GetCurrentFocus(); - if (currentFocus == targetNode) { + if (SameCOMIdentity(currentFocus, aContent)) { nsRefPtr rootAcc = GetRootAccessible(); if (rootAcc) rootAcc->FireAccessibleFocusEvent(nsnull, currentFocus, nsnull, PR_TRUE);