Merge backout of bug 648988
authorMarco Zehe <marco.zehe@googlemail.com>
Thu, 14 Apr 2011 08:47:15 +0200
changeset 68038 846bd98c5fe42de2c5f104c4c4294fd855379971
parent 68036 5eb3152040936ef146c8f0ac08b4ba536e707e42 (current diff)
parent 68037 25feb8bd6294fb40a3b8332d91dd6ef9dcce5897 (diff)
child 68040 ad3a05e0656fe7f070d2bf97ce0306b29b4af206
push id1
push userroot
push dateTue, 26 Apr 2011 22:38:44 +0000
treeherdermozilla-beta@bfdb6e623a36 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs648988
milestone5.0a2
Merge backout of bug 648988
--- a/accessible/src/base/nsAccessible.cpp
+++ b/accessible/src/base/nsAccessible.cpp
@@ -690,16 +690,19 @@ nsAccessible::IsVisible(PRBool* aIsOffsc
     *aIsOffscreen = PR_FALSE;
   }
   return isVisible;
 }
 
 PRUint64
 nsAccessible::NativeState()
 {
+  if (IsDefunct())
+    return states::DEFUNCT;
+
   PRUint64 state = 0;
   nsEventStates intrinsicState = mContent->IntrinsicState();
 
   if (intrinsicState.HasState(NS_EVENT_STATE_INVALID))
     state |= states::INVALID;
 
   if (intrinsicState.HasState(NS_EVENT_STATE_REQUIRED))
     state |= states::REQUIRED;
@@ -1519,20 +1522,20 @@ nsAccessible::GetState(PRUint32* aState,
 
   nsAccUtils::To32States(State(), aState, aExtraState);
   return NS_OK;
 }
 
 PRUint64
 nsAccessible::State()
 {
-  if (IsDefunct())
-    return states::DEFUNCT;
-
   PRUint64 state = NativeState();
+  if (state & states::DEFUNCT)
+    return state;
+
   // Apply ARIA states to be sure accessible states will be overriden.
   ApplyARIAState(&state);
 
   if (mRoleMapEntry && mRoleMapEntry->role == nsIAccessibleRole::ROLE_PAGETAB) {
     if (state & states::FOCUSED) {
       state |= states::SELECTED;
     } else {
       // Expose 'selected' state on ARIA tab if the focus is on internal element
--- a/accessible/src/base/nsApplicationAccessible.cpp
+++ b/accessible/src/base/nsApplicationAccessible.cpp
@@ -139,17 +139,17 @@ nsApplicationAccessible::GetKeyboardShor
 {
   aKeyboardShortcut.Truncate();
   return NS_OK;
 }
 
 PRUint64
 nsApplicationAccessible::State()
 {
-  return IsDefunct() ? states::DEFUNCT : 0;
+  return NativeState();
 }
 
 NS_IMETHODIMP
 nsApplicationAccessible::GetAttributes(nsIPersistentProperties **aAttributes)
 {
   NS_ENSURE_ARG_POINTER(aAttributes);
   *aAttributes = nsnull;
   return NS_OK;
@@ -370,17 +370,17 @@ PRUint32
 nsApplicationAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_APP_ROOT;
 }
 
 PRUint64
 nsApplicationAccessible::NativeState()
 {
-  return 0;
+  return IsDefunct() ? states::DEFUNCT : 0;
 }
 
 void
 nsApplicationAccessible::InvalidateChildren()
 {
   // Do nothing because application children are kept updated by AppendChild()
   // and RemoveChild() method calls.
 }
--- a/accessible/src/base/nsDocAccessible.cpp
+++ b/accessible/src/base/nsDocAccessible.cpp
@@ -289,16 +289,20 @@ nsDocAccessible::GetDescription(nsAStrin
 
   return NS_OK;
 }
 
 // nsAccessible public method
 PRUint64
 nsDocAccessible::NativeState()
 {
+
+  if (IsDefunct())
+    return states::DEFUNCT;
+
   // The root content of the document might be removed so that mContent is
   // out of date.
   PRUint64 state = (mContent->GetCurrentDoc() == mDocument) ?
     0 : states::STALE;
 
 #ifdef MOZ_XUL
   nsCOMPtr<nsIXULDocument> xulDoc(do_QueryInterface(mDocument));
   if (!xulDoc)
--- a/accessible/src/html/nsHTMLTextAccessible.cpp
+++ b/accessible/src/html/nsHTMLTextAccessible.cpp
@@ -145,17 +145,17 @@ PRUint32
 nsHTMLBRAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_WHITESPACE;
 }
 
 PRUint64
 nsHTMLBRAccessible::NativeState()
 {
-  return states::READONLY;
+  return IsDefunct() ? states::DEFUNCT : states::READONLY;
 }
 
 nsresult
 nsHTMLBRAccessible::GetNameInternal(nsAString& aName)
 {
   aName = static_cast<PRUnichar>('\n');    // Newline char
   return NS_OK;
 }
--- a/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp
+++ b/accessible/src/msaa/nsHTMLWin32ObjectAccessible.cpp
@@ -72,17 +72,20 @@ nsHTMLWin32ObjectOwnerAccessible::Native
   return nsIAccessibleRole::ROLE_EMBEDDED_OBJECT;
 }
 
 PRUint64
 nsHTMLWin32ObjectOwnerAccessible::NativeState()
 {
   // XXX: No HWND means this is windowless plugin which is not accessible in
   // the meantime.
-  return mHwnd ? nsAccessibleWrap::NativeState() : states::UNAVAILABLE;
+  if (mHwnd)
+    return nsAccessibleWrap::NativeState();
+
+  return IsDefunct() ? states::DEFUNCT : states::UNAVAILABLE;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLWin32ObjectOwnerAccessible: nsAccessible protected implementation
 
 void
 nsHTMLWin32ObjectOwnerAccessible::CacheChildren()
 {
--- a/accessible/src/xforms/nsXFormsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsAccessible.cpp
@@ -148,16 +148,20 @@ nsXFormsAccessible::GetValue(nsAString& 
   NS_ENSURE_TRUE(sXFormsService, NS_ERROR_FAILURE);
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   return sXFormsService->GetValue(DOMNode, aValue);
 }
 
 PRUint64
 nsXFormsAccessible::NativeState()
 {
+
+  if (IsDefunct())
+    return states::DEFUNCT;
+
   NS_ENSURE_TRUE(sXFormsService, 0);
 
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
 
   PRBool isRelevant = PR_FALSE;
   nsresult rv = sXFormsService->IsRelevant(DOMNode, &isRelevant);
   NS_ENSURE_SUCCESS(rv, 0);
 
--- a/accessible/src/xforms/nsXFormsWidgetsAccessible.cpp
+++ b/accessible/src/xforms/nsXFormsWidgetsAccessible.cpp
@@ -55,16 +55,20 @@ PRUint32
 nsXFormsDropmarkerWidgetAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_PUSHBUTTON;
 }
 
 PRUint64
 nsXFormsDropmarkerWidgetAccessible::NativeState()
 {
+
+  if (IsDefunct())
+    return states::DEFUNCT;
+
   PRBool isOpen = PR_FALSE;
   nsCOMPtr<nsIDOMNode> DOMNode(do_QueryInterface(mContent));
   nsresult rv = sXFormsService->IsDropmarkerOpen(DOMNode, &isOpen);
   NS_ENSURE_SUCCESS(rv, 0);
 
   return isOpen ? states::PRESSED: 0;
 }
 
--- a/accessible/src/xul/nsXULFormControlAccessible.cpp
+++ b/accessible/src/xul/nsXULFormControlAccessible.cpp
@@ -325,16 +325,20 @@ PRUint32
 nsXULDropmarkerAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_PUSHBUTTON;
 }
 
 PRUint64
 nsXULDropmarkerAccessible::NativeState()
 {
+
+  if (IsDefunct())
+    return states::DEFUNCT;
+
   return DropmarkerOpen(PR_FALSE) ? states::PRESSED : 0;
 }
 
                       
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULCheckboxAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -806,17 +810,17 @@ PRUint32
 nsXULToolbarSeparatorAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_SEPARATOR;
 }
 
 PRUint64
 nsXULToolbarSeparatorAccessible::NativeState()
 {
-  return 0;
+  return IsDefunct() ? states::DEFUNCT : 0;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULTextFieldAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsXULTextFieldAccessible::
  nsXULTextFieldAccessible(nsIContent *aContent, nsIWeakReference *aShell) :
--- a/accessible/src/xul/nsXULListboxAccessible.cpp
+++ b/accessible/src/xul/nsXULListboxAccessible.cpp
@@ -62,17 +62,17 @@ PRUint32
 nsXULColumnsAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_LIST;
 }
 
 PRUint64
 nsXULColumnsAccessible::NativeState()
 {
-  return states::READONLY;
+  return IsDefunct() ? states::DEFUNCT : states::READONLY;
 }
 
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsXULColumnItemAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 nsXULColumnItemAccessible::
@@ -85,17 +85,17 @@ PRUint32
 nsXULColumnItemAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_COLUMNHEADER;
 }
 
 PRUint64
 nsXULColumnItemAccessible::NativeState()
 {
-  return states::READONLY;
+  return IsDefunct() ? states::DEFUNCT : states::READONLY;
 }
 
 NS_IMETHODIMP
 nsXULColumnItemAccessible::GetNumActions(PRUint8 *aNumActions)
 {
   NS_ENSURE_ARG_POINTER(aNumActions);
 
   *aNumActions = 1;
@@ -901,18 +901,22 @@ nsXULListitemAccessible::NativeRole()
     return nsIAccessibleRole::ROLE_COMBOBOX_OPTION;
 
   return nsIAccessibleRole::ROLE_RICH_OPTION;
 }
 
 PRUint64
 nsXULListitemAccessible::NativeState()
 {
-  if (mIsCheckbox)
+  if (mIsCheckbox) {
     return nsXULMenuitemAccessible::NativeState();
+  }
+
+  if (IsDefunct())
+    return states::DEFUNCT;
 
   PRUint64 states = states::FOCUSABLE | states::SELECTABLE;
 
   nsCOMPtr<nsIDOMXULSelectControlItemElement> listItem =
     do_QueryInterface(mContent);
 
   if (listItem) {
     PRBool isSelected;
--- a/accessible/src/xul/nsXULTreeAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeAccessible.cpp
@@ -922,16 +922,20 @@ nsXULTreeItemAccessibleBase::GroupPositi
   *aPositionInGroup = posInSet;
 
   return NS_OK;
 }
 
 PRUint64
 nsXULTreeItemAccessibleBase::NativeState()
 {
+
+  if (IsDefunct())
+    return states::DEFUNCT;
+
   // focusable and selectable states
   PRUint64 state = states::FOCUSABLE | states::SELECTABLE;
 
   // expanded/collapsed state
   if (IsExpandable()) {
     PRBool isContainerOpen;
     mTreeView->IsContainerOpen(mRow, &isContainerOpen);
     state |= isContainerOpen ? states::EXPANDED : states::COLLAPSED;
--- a/accessible/src/xul/nsXULTreeGridAccessible.cpp
+++ b/accessible/src/xul/nsXULTreeGridAccessible.cpp
@@ -1160,16 +1160,20 @@ PRUint32
 nsXULTreeGridCellAccessible::NativeRole()
 {
   return nsIAccessibleRole::ROLE_GRID_CELL;
 }
 
 PRUint64
 nsXULTreeGridCellAccessible::NativeState()
 {
+
+  if (IsDefunct())
+    return states::DEFUNCT;
+
   // selectable/selected state
   PRUint64 states = states::SELECTABLE;
 
   nsCOMPtr<nsITreeSelection> selection;
   mTreeView->GetSelection(getter_AddRefs(selection));
   if (selection) {
     PRBool isSelected = PR_FALSE;
     selection->IsSelected(mRow, &isSelected);