Backed out 3 changesets (bug 1259023) for various broken things CLOSED TREE
authorWes Kocher <wkocher@mozilla.com>
Mon, 28 Mar 2016 12:12:19 -0700
changeset 290753 6378e50f68ff730702eaf321b4a02f0e437c6161
parent 290752 2f84b90500fee80fee16938e92758a5be4fbf63e
child 290754 110003172c5b120c6d6a0aacb63c96661666efa5
push id19656
push usergwagner@mozilla.com
push dateMon, 04 Apr 2016 13:43:23 +0000
treeherderb2g-inbound@e99061fde28a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs1259023
milestone48.0a1
backs outb92ce093fe6582c6d5a4879941f46e9a529cc20e
358d513417fbac311304d801dddfd5c6018f96dd
800306e9c5733599972acd349c299664db9b3e76
Backed out 3 changesets (bug 1259023) for various broken things CLOSED TREE Backed out changeset b92ce093fe65 (bug 1259023) Backed out changeset 358d513417fb (bug 1259023) Backed out changeset 800306e9c573 (bug 1259023) MozReview-Commit-ID: BjU3psmxY5b
accessible/atk/AccessibleWrap.cpp
accessible/atk/nsMai.h
accessible/base/AccessibleOrProxy.cpp
accessible/base/AccessibleOrProxy.h
accessible/base/moz.build
accessible/xpcom/xpcAccessible.cpp
--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -788,19 +788,34 @@ GetLocaleCB(AtkObject* aAtkObj)
 }
 
 AtkObject *
 getParentCB(AtkObject *aAtkObj)
 {
   if (aAtkObj->accessible_parent)
     return aAtkObj->accessible_parent;
 
-  AccessibleOrProxy acc = GetInternalObj(aAtkObj);
-  AccessibleOrProxy parent = acc.Parent();
-  AtkObject* atkParent = GetWrapperFor(parent);
+  AtkObject* atkParent = nullptr;
+  if (AccessibleWrap* wrapper = GetAccessibleWrap(aAtkObj)) {
+    Accessible* parent = wrapper->Parent();
+    atkParent = parent ? AccessibleWrap::GetAtkObject(parent) : nullptr;
+  } else if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
+    ProxyAccessible* parent = proxy->Parent();
+    if (parent) {
+      atkParent = GetWrapperFor(parent);
+    } else {
+      // Otherwise this should be the proxy for the tab's top level document.
+      Accessible* outerDocParent = proxy->OuterDocOfRemoteBrowser();
+      NS_ASSERTION(outerDocParent, "this document should have an outerDoc as a parent");
+      if (outerDocParent) {
+        atkParent = AccessibleWrap::GetAtkObject(outerDocParent);
+      }
+    }
+  }
+
   if (atkParent)
     atk_object_set_parent(aAtkObj, atkParent);
 
   return aAtkObj->accessible_parent;
 }
 
 gint
 getChildCountCB(AtkObject *aAtkObj)
@@ -1081,26 +1096,16 @@ GetInternalObj(AtkObject* aObj)
 }
 
 AtkObject*
 GetWrapperFor(ProxyAccessible* aProxy)
 {
   return reinterpret_cast<AtkObject*>(aProxy->GetWrapper() & ~IS_PROXY);
 }
 
-AtkObject*
-GetWrapperFor(AccessibleOrProxy aObj)
-{
-  if (aObj.IsProxy()) {
-      return GetWrapperFor(aObj.AsProxy());
-      }
-
-      return AccessibleWrap::GetAtkObject(aObj.AsAccessible());
-      }
-
 static uint16_t
 GetInterfacesForProxy(ProxyAccessible* aProxy, uint32_t aInterfaces)
 {
   uint16_t interfaces = 1 << MAI_INTERFACE_COMPONENT;
   if (aInterfaces & Interfaces::HYPERTEXT)
     interfaces |= (1 << MAI_INTERFACE_HYPERTEXT) | (1 << MAI_INTERFACE_TEXT)
         | (1 << MAI_INTERFACE_EDITABLE_TEXT);
 
--- a/accessible/atk/nsMai.h
+++ b/accessible/atk/nsMai.h
@@ -64,17 +64,16 @@ typedef struct _MaiAtkSocketClass
 {
   AtkSocketClass parent_class;
 } MaiAtkSocketClass;
 
 mozilla::a11y::AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj);
 mozilla::a11y::ProxyAccessible* GetProxy(AtkObject* aAtkObj);
 mozilla::a11y::AccessibleOrProxy GetInternalObj(AtkObject* aObj);
 AtkObject* GetWrapperFor(mozilla::a11y::ProxyAccessible* aProxy);
-AtkObject* GetWrapperFor(mozilla::a11y::AccessibleOrProxy aObj);
 
 extern int atkMajorVersion, atkMinorVersion;
 
 /**
  * Return true if the loaded version of libatk-1.0.so is at least
  * aMajor.aMinor.0.
  */
 static inline bool
deleted file mode 100644
--- a/accessible/base/AccessibleOrProxy.cpp
+++ /dev/null
@@ -1,27 +0,0 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
-/* This Source Code Form is subject to the terms of the Mozilla Public
- * License, v. 2.0. If a copy of the MPL was not distributed with this
- * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
-
-#include "AccessibleOrProxy.h"
-
-AccessibleOrProxy
-AccessibleOrProxy::Parent() const
-{
-  if (IsAccessible()) {
-    return AsAccessible()->Parent();
-  }
-
-  ProxyAccessible* proxy = AsProxy();
-  if (!proxy) {
-    return nullptr;
-  }
-
-  if (ProxyAccessible* parent = proxy->Parent()) {
-    return parent;
-  }
-
-  // Otherwise this should be the proxy for the tab's top level document.
-  return proxy->OuterDocOfRemoteBrowser();
-}
--- a/accessible/base/AccessibleOrProxy.h
+++ b/accessible/base/AccessibleOrProxy.h
@@ -101,18 +101,16 @@ public:
   {
     if (IsProxy()) {
       return AsProxy()->Role();
     }
 
     return AsAccessible()->Role();
   }
 
-  AccessibleOrProxy Parent() const;
-
   // XXX these are implementation details that ideally would not be exposed.
   uintptr_t Bits() const { return mBits; }
   void SetBits(uintptr_t aBits) { mBits = aBits; }
 
 private:
   uintptr_t mBits;
   static const uintptr_t IS_PROXY = 0x1;
 };
--- a/accessible/base/moz.build
+++ b/accessible/base/moz.build
@@ -22,17 +22,16 @@ EXPORTS.mozilla.a11y += [
 
 if CONFIG['MOZ_DEBUG']:
     EXPORTS.mozilla.a11y += [
         'Logging.h',
     ]
 
 UNIFIED_SOURCES += [
     'AccCollector.cpp',
-    'AccessibleOrProxy.cpp',
     'AccEvent.cpp',
     'AccGroupInfo.cpp',
     'AccIterator.cpp',
     'ARIAMap.cpp',
     'ARIAStateMap.cpp',
     'Asserts.cpp',
     'DocManager.cpp',
     'EventQueue.cpp',
--- a/accessible/xpcom/xpcAccessible.cpp
+++ b/accessible/xpcom/xpcAccessible.cpp
@@ -20,60 +20,49 @@
 
 using namespace mozilla::a11y;
 
 NS_IMETHODIMP
 xpcAccessible::GetParent(nsIAccessible** aParent)
 {
   NS_ENSURE_ARG_POINTER(aParent);
   *aParent = nullptr;
-  if (IntlGeneric().IsNull())
+  if (!Intl())
     return NS_ERROR_FAILURE;
 
-  AccessibleOrProxy parent = IntlGeneric().Parent();
-  NS_IF_ADDREF(*aParent = ToXPC(parent));
+  NS_IF_ADDREF(*aParent = ToXPC(Intl()->Parent()));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetNextSibling(nsIAccessible** aNextSibling)
 {
   NS_ENSURE_ARG_POINTER(aNextSibling);
   *aNextSibling = nullptr;
 
-  if (IntlGeneric().IsAccessible()) {
-    nsresult rv = NS_OK;
-    NS_IF_ADDREF(*aNextSibling = ToXPC(Intl()->GetSiblingAtOffset(1, &rv)));
-    return rv;
-  }
+  if (!Intl())
+    return NS_ERROR_FAILURE;
 
-  ProxyAccessible* proxy = IntlGeneric().AsProxy();
-  NS_ENSURE_STATE(proxy);
-
-  NS_IF_ADDREF(*aNextSibling = ToXPC(proxy->NextSibling()));
-  return *aNextSibling ? NS_OK : NS_ERROR_FAILURE;
+  nsresult rv = NS_OK;
+  NS_IF_ADDREF(*aNextSibling = ToXPC(Intl()->GetSiblingAtOffset(1, &rv)));
+  return rv;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetPreviousSibling(nsIAccessible** aPreviousSibling)
 {
   NS_ENSURE_ARG_POINTER(aPreviousSibling);
   *aPreviousSibling = nullptr;
 
-  if (IntlGeneric().IsAccessible()) {
-    nsresult rv = NS_OK;
-    NS_IF_ADDREF(*aPreviousSibling = ToXPC(Intl()->GetSiblingAtOffset(-1, &rv)));
-    return rv;
-  }
+  if (!Intl())
+    return NS_ERROR_FAILURE;
 
-  ProxyAccessible* proxy = IntlGeneric().AsProxy();
-  NS_ENSURE_STATE(proxy);
-
-  NS_IF_ADDREF(*aPreviousSibling = ToXPC(proxy->PrevSibling()));
-  return *aPreviousSibling ? NS_OK : NS_ERROR_FAILURE;
+  nsresult rv = NS_OK;
+  NS_IF_ADDREF(*aPreviousSibling = ToXPC(Intl()->GetSiblingAtOffset(-1, &rv)));
+  return rv;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetFirstChild(nsIAccessible** aFirstChild)
 {
   NS_ENSURE_ARG_POINTER(aFirstChild);
   *aFirstChild = nullptr;
 
@@ -156,22 +145,20 @@ xpcAccessible::GetChildren(nsIArray** aC
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetIndexInParent(int32_t* aIndexInParent)
 {
   NS_ENSURE_ARG_POINTER(aIndexInParent);
   *aIndexInParent = -1;
 
-  if (IntlGeneric().IsAccessible()) {
-    *aIndexInParent = Intl()->IndexInParent();
-  } else if (IntlGeneric().IsProxy()) {
-    *aIndexInParent = IntlGeneric().AsProxy()->IndexInParent();
-  }
+  if (!Intl())
+    return NS_ERROR_FAILURE;
 
+  *aIndexInParent = Intl()->IndexInParent();
   return *aIndexInParent != -1 ? NS_OK : NS_ERROR_FAILURE;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetDOMNode(nsIDOMNode** aDOMNode)
 {
   NS_ENSURE_ARG_POINTER(aDOMNode);
   *aDOMNode = nullptr;