Merge mozilla-central to autoland. CLOSED TREE
authorCosmin Sabou <csabou@mozilla.com>
Fri, 30 Nov 2018 17:08:22 +0200
changeset 508174 8e37b680ffbee7909c025c15ddb4c873419caf11
parent 508173 d7e24b993fa283d4ed3dbad0f5c424d38e4dede0 (current diff)
parent 508166 bf92aff5b93de1726b12207adc54dd138178250d (diff)
child 508175 1f77d2e610e24d08d28411c919829fe7d566777e
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Merge mozilla-central to autoland. CLOSED TREE
dom/base/nsContentUtils.cpp
dom/base/nsContentUtils.h
--- a/.clang-format-ignore
+++ b/.clang-format-ignore
@@ -57,16 +57,20 @@ intl/unicharutil/util/nsUnicodeScriptCod
 media/mp4parse-rust/mp4parse.h
 widget/gtk/wayland/gtk-primary-selection-client-protocol.h
 widget/gtk/wayland/gtk-primary-selection-protocol.c
 
 # Ignored because these files are used to generate a windows.h STL wrapper,
 # and reformatting them can break generating that wrapper.
 config/windows-h-.*.h
 
+# Exclude tools/clang-tidy/test from automatic reformatting, since it can
+# break some of the tests in that directory.
+tools/clang-tidy/test/.*
+
 # The XPTCall stubs files have some inline assembly macros
 # that get reformatted badly. See bug 1510781.
 xpcom/reflect/xptcall/md/win32/.*
 xpcom/reflect/xptcall/md/unix/.*
 
 # Generated from ./tools/rewriting/ThirdPartyPaths.txt
 # awk '{print ""$1".*"}' ./tools/rewriting/ThirdPartyPaths.txt
 browser/components/translation/cld2/.*
new file mode 100644
--- /dev/null
+++ b/.hg-format-source
@@ -0,0 +1,47 @@
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:uriloader/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:media/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:docshell/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:netwerk/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:ipc/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:intl/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:taskcluster/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:servo/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:devtools/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:python/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:gfx/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:image/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:js/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:editor/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:parser/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:widget/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:mfbt/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:services/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:caps/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:chrome/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:extensions/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:view/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:xpfe/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:accessible/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:browser/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:toolkit/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:addon-sdk/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:config/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:embedding/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:security/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:dom/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:tools/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:gradle/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:storage/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:nsprpub/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:db/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:layout/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:xpcom/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:testing/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:other-licenses/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:modules/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:build/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:memory/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:mobile/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:startupcache/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:hal/**", "tool": "clang-format"}
+{"configpaths": [".clang-format", ".clang-format-ignore"], "pattern": "glob:mozglue/**", "tool": "clang-format"}
--- a/.hgtags
+++ b/.hgtags
@@ -148,8 +148,9 @@ 4f6e597104dabedfecfafa2ab63dc79fd7f8bc7a
 190b827aaa2b5e6fb9af7a0defb238ccc35f8b9e FIREFOX_BETA_63_BASE
 034c5ef24e98b0ce85fa849face079f568eb397c FIREFOX_NIGHTLY_63_END
 4a230b07f0cbf48e87dcb4265ea2d00893bb1b62 FIREFOX_BETA_64_BASE
 4a230b07f0cbf48e87dcb4265ea2d00893bb1b62 FIREFOX_BETA_64_BASE
 224715760a637bc37c14794839468a954f1f2695 FIREFOX_BETA_64_BASE
 224715760a637bc37c14794839468a954f1f2695 FIREFOX_BETA_64_BASE
 ad179a6fc14cbd41d10a018ac4a3822db119de3b FIREFOX_BETA_64_BASE
 c44fbdd5173548c9035256dda8fd3512f67118a8 FIREFOX_NIGHTLY_64_END
+58a0412e15574f063cd380517a0369bfb48b22e0 PRE_TREEWIDE_CLANG_FORMAT
--- a/accessible/android/ARIAGridAccessibleWrap.h
+++ b/accessible/android/ARIAGridAccessibleWrap.h
@@ -11,12 +11,12 @@
 #include "ARIAGridAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class ARIAGridAccessible ARIAGridAccessibleWrap;
 typedef class ARIAGridCellAccessible ARIAGridCellAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/AccessibleWrap.cpp
+++ b/accessible/android/AccessibleWrap.cpp
@@ -24,49 +24,50 @@ using namespace mozilla::a11y;
 
 // IDs should be a positive 32bit integer.
 IDSet sIDSet(31UL);
 
 //-----------------------------------------------------
 // construction
 //-----------------------------------------------------
 AccessibleWrap::AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc)
-  : Accessible(aContent, aDoc)
-{
+    : Accessible(aContent, aDoc) {
   if (aDoc) {
     mID = AcquireID();
     DocAccessibleWrap* doc = static_cast<DocAccessibleWrap*>(aDoc);
     doc->AddID(mID, this);
   }
 }
 
 //-----------------------------------------------------
 // destruction
 //-----------------------------------------------------
 AccessibleWrap::~AccessibleWrap() {}
 
-nsresult
-AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
-{
+nsresult AccessibleWrap::HandleAccEvent(AccEvent* aEvent) {
   auto accessible = static_cast<AccessibleWrap*>(aEvent->GetAccessible());
   NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
-  DocAccessibleWrap* doc = static_cast<DocAccessibleWrap*>(accessible->Document());
+  DocAccessibleWrap* doc =
+      static_cast<DocAccessibleWrap*>(accessible->Document());
   if (doc) {
     switch (aEvent->GetEventType()) {
       case nsIAccessibleEvent::EVENT_FOCUS: {
-        if (DocAccessibleWrap* topContentDoc = doc->GetTopLevelContentDoc(accessible)) {
+        if (DocAccessibleWrap* topContentDoc =
+                doc->GetTopLevelContentDoc(accessible)) {
           topContentDoc->CacheFocusPath(accessible);
         }
         break;
       }
       case nsIAccessibleEvent::EVENT_VIRTUALCURSOR_CHANGED: {
         AccVCChangeEvent* vcEvent = downcast_accEvent(aEvent);
-        auto newPosition = static_cast<AccessibleWrap*>(vcEvent->NewAccessible());
+        auto newPosition =
+            static_cast<AccessibleWrap*>(vcEvent->NewAccessible());
         if (newPosition) {
-          if (DocAccessibleWrap* topContentDoc = doc->GetTopLevelContentDoc(accessible)) {
+          if (DocAccessibleWrap* topContentDoc =
+                  doc->GetTopLevelContentDoc(accessible)) {
             topContentDoc->CacheFocusPath(newPosition);
           }
         }
         break;
       }
     }
   }
 
@@ -85,17 +86,17 @@ AccessibleWrap::HandleAccEvent(AccEvent*
 
   if (doc) {
     if (!nsCoreUtils::IsContentDocument(doc->DocumentNode())) {
       return NS_OK;
     }
   }
 
   SessionAccessibility* sessionAcc =
-    SessionAccessibility::GetInstanceFor(accessible);
+      SessionAccessibility::GetInstanceFor(accessible);
   if (!sessionAcc) {
     return NS_OK;
   }
 
   switch (aEvent->GetEventType()) {
     case nsIAccessibleEvent::EVENT_FOCUS:
       sessionAcc->SendFocusEvent(accessible);
       break;
@@ -110,36 +111,34 @@ AccessibleWrap::HandleAccEvent(AccEvent*
             sessionAcc->SendHoverEnterEvent(newPosition);
           } else {
             sessionAcc->SendAccessibilityFocusedEvent(newPosition);
           }
         }
 
         if (vcEvent->BoundaryType() != nsIAccessiblePivot::NO_BOUNDARY) {
           sessionAcc->SendTextTraversedEvent(
-            newPosition, vcEvent->NewStartOffset(), vcEvent->NewEndOffset());
+              newPosition, vcEvent->NewStartOffset(), vcEvent->NewEndOffset());
         }
       }
       break;
     }
     case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED: {
       AccCaretMoveEvent* event = downcast_accEvent(aEvent);
       sessionAcc->SendTextSelectionChangedEvent(accessible,
                                                 event->GetCaretOffset());
       break;
     }
     case nsIAccessibleEvent::EVENT_TEXT_INSERTED:
     case nsIAccessibleEvent::EVENT_TEXT_REMOVED: {
       AccTextChangeEvent* event = downcast_accEvent(aEvent);
-      sessionAcc->SendTextChangedEvent(accessible,
-                                       event->ModifiedText(),
-                                       event->GetStartOffset(),
-                                       event->GetLength(),
-                                       event->IsTextInserted(),
-                                       event->IsFromUserInput());
+      sessionAcc->SendTextChangedEvent(
+          accessible, event->ModifiedText(), event->GetStartOffset(),
+          event->GetLength(), event->IsTextInserted(),
+          event->IsFromUserInput());
       break;
     }
     case nsIAccessibleEvent::EVENT_STATE_CHANGE: {
       AccStateChangeEvent* event = downcast_accEvent(aEvent);
       auto state = event->GetState();
       if (state & states::CHECKED) {
         sessionAcc->SendClickedEvent(accessible, event->IsStateEnabled());
       }
@@ -150,20 +149,18 @@ AccessibleWrap::HandleAccEvent(AccEvent*
 
       if (state & states::BUSY) {
         sessionAcc->SendWindowStateChangedEvent(accessible);
       }
       break;
     }
     case nsIAccessibleEvent::EVENT_SCROLLING: {
       AccScrollingEvent* event = downcast_accEvent(aEvent);
-      sessionAcc->SendScrollingEvent(accessible,
-                                     event->ScrollX(),
-                                     event->ScrollY(),
-                                     event->MaxScrollX(),
+      sessionAcc->SendScrollingEvent(accessible, event->ScrollX(),
+                                     event->ScrollY(), event->MaxScrollX(),
                                      event->MaxScrollY());
       break;
     }
     case nsIAccessibleEvent::EVENT_SHOW:
     case nsIAccessibleEvent::EVENT_HIDE: {
       AccMutationEvent* event = downcast_accEvent(aEvent);
       auto parent = static_cast<AccessibleWrap*>(event->Parent());
       sessionAcc->SendWindowContentChangedEvent(parent);
@@ -171,72 +168,58 @@ AccessibleWrap::HandleAccEvent(AccEvent*
     }
     default:
       break;
   }
 
   return NS_OK;
 }
 
-void
-AccessibleWrap::Shutdown()
-{
+void AccessibleWrap::Shutdown() {
   if (mDoc) {
     if (mID > 0) {
       if (auto doc = static_cast<DocAccessibleWrap*>(mDoc.get())) {
         doc->RemoveID(mID);
       }
       ReleaseID(mID);
       mID = 0;
     }
   }
 
   Accessible::Shutdown();
 }
 
-int32_t
-AccessibleWrap::AcquireID()
-{
-  return sIDSet.GetID();
-}
+int32_t AccessibleWrap::AcquireID() { return sIDSet.GetID(); }
 
-void
-AccessibleWrap::ReleaseID(int32_t aID)
-{
-  sIDSet.ReleaseID(aID);
-}
+void AccessibleWrap::ReleaseID(int32_t aID) { sIDSet.ReleaseID(aID); }
 
-void
-AccessibleWrap::SetTextContents(const nsAString& aText) {
+void AccessibleWrap::SetTextContents(const nsAString& aText) {
   if (IsHyperText()) {
     AsHyperText()->ReplaceText(aText);
   }
 }
 
-void
-AccessibleWrap::GetTextContents(nsAString& aText) {
+void AccessibleWrap::GetTextContents(nsAString& aText) {
   // For now it is a simple wrapper for getting entire range of TextSubstring.
   // In the future this may be smarter and retrieve a flattened string.
   if (IsHyperText()) {
     AsHyperText()->TextSubstring(0, -1, aText);
   }
 }
 
-bool
-AccessibleWrap::GetSelectionBounds(int32_t* aStartOffset, int32_t* aEndOffset) {
+bool AccessibleWrap::GetSelectionBounds(int32_t* aStartOffset,
+                                        int32_t* aEndOffset) {
   if (IsHyperText()) {
     return AsHyperText()->SelectionBoundsAt(0, aStartOffset, aEndOffset);
   }
 
   return false;
 }
 
-uint32_t
-AccessibleWrap::GetFlags(role aRole, uint64_t aState)
-{
+uint32_t AccessibleWrap::GetFlags(role aRole, uint64_t aState) {
   uint32_t flags = 0;
   if (aState & states::CHECKABLE) {
     flags |= java::SessionAccessibility::FLAG_CHECKABLE;
   }
 
   if (aState & states::CHECKED) {
     flags |= java::SessionAccessibility::FLAG_CHECKED;
   }
@@ -283,231 +266,210 @@ AccessibleWrap::GetFlags(role aRole, uin
 
   if (aRole == roles::PASSWORD_TEXT) {
     flags |= java::SessionAccessibility::FLAG_PASSWORD;
   }
 
   return flags;
 }
 
-void
-AccessibleWrap::GetRoleDescription(role aRole,
-                                   nsAString& aGeckoRole,
-                                   nsAString& aRoleDescription)
-{
+void AccessibleWrap::GetRoleDescription(role aRole, nsAString& aGeckoRole,
+                                        nsAString& aRoleDescription) {
   nsresult rv = NS_OK;
 
   nsCOMPtr<nsIStringBundleService> sbs =
-    do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
+      do_GetService(NS_STRINGBUNDLE_CONTRACTID, &rv);
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to get string bundle service");
     return;
   }
 
   nsCOMPtr<nsIStringBundle> bundle;
   rv = sbs->CreateBundle(ROLE_STRINGS_URL, getter_AddRefs(bundle));
   if (NS_FAILED(rv)) {
     NS_WARNING("Failed to get string bundle");
     return;
   }
 
   GetAccService()->GetStringRole(aRole, aGeckoRole);
-  rv = bundle->GetStringFromName(NS_ConvertUTF16toUTF8(aGeckoRole).get(), aRoleDescription);
+  rv = bundle->GetStringFromName(NS_ConvertUTF16toUTF8(aGeckoRole).get(),
+                                 aRoleDescription);
   if (NS_FAILED(rv)) {
     aRoleDescription.AssignLiteral("");
   }
 }
 
 already_AddRefed<nsIPersistentProperties>
-AccessibleWrap::AttributeArrayToProperties(const nsTArray<Attribute>& aAttributes)
-{
+AccessibleWrap::AttributeArrayToProperties(
+    const nsTArray<Attribute>& aAttributes) {
   RefPtr<nsPersistentProperties> props = new nsPersistentProperties();
   nsAutoString unused;
 
   for (size_t i = 0; i < aAttributes.Length(); i++) {
     props->SetStringProperty(aAttributes.ElementAt(i).Name(),
-                             aAttributes.ElementAt(i).Value(),
-                             unused);
+                             aAttributes.ElementAt(i).Value(), unused);
   }
 
   return props.forget();
 }
 
-int32_t
-AccessibleWrap::GetAndroidClass(role aRole)
-{
-#define ROLE(geckoRole,                                                        \
-             stringRole,                                                       \
-             atkRole,                                                          \
-             macRole,                                                          \
-             msaaRole,                                                         \
-             ia2Role,                                                          \
-             androidClass,                                                     \
-             nameRule)                                                         \
-  case roles::geckoRole:                                                       \
+int32_t AccessibleWrap::GetAndroidClass(role aRole) {
+#define ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, \
+             androidClass, nameRule)                                     \
+  case roles::geckoRole:                                                 \
     return androidClass;
 
   switch (aRole) {
 #include "RoleMap.h"
     default:
       return java::SessionAccessibility::CLASSNAME_VIEW;
   }
 
 #undef ROLE
 }
 
-int32_t
-AccessibleWrap::GetInputType(const nsString& aInputTypeAttr)
-{
+int32_t AccessibleWrap::GetInputType(const nsString& aInputTypeAttr) {
   if (aInputTypeAttr.EqualsIgnoreCase("email")) {
-    return java::sdk::InputType::TYPE_CLASS_TEXT | java::sdk::InputType::TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
+    return java::sdk::InputType::TYPE_CLASS_TEXT |
+           java::sdk::InputType::TYPE_TEXT_VARIATION_WEB_EMAIL_ADDRESS;
   }
 
   if (aInputTypeAttr.EqualsIgnoreCase("number")) {
     return java::sdk::InputType::TYPE_CLASS_NUMBER;
   }
 
   if (aInputTypeAttr.EqualsIgnoreCase("password")) {
-    return java::sdk::InputType::TYPE_CLASS_TEXT | java::sdk::InputType::TYPE_TEXT_VARIATION_WEB_PASSWORD;
+    return java::sdk::InputType::TYPE_CLASS_TEXT |
+           java::sdk::InputType::TYPE_TEXT_VARIATION_WEB_PASSWORD;
   }
 
   if (aInputTypeAttr.EqualsIgnoreCase("tel")) {
     return java::sdk::InputType::TYPE_CLASS_PHONE;
   }
 
   if (aInputTypeAttr.EqualsIgnoreCase("text")) {
-    return java::sdk::InputType::TYPE_CLASS_TEXT | java::sdk::InputType::TYPE_TEXT_VARIATION_WEB_EDIT_TEXT;
+    return java::sdk::InputType::TYPE_CLASS_TEXT |
+           java::sdk::InputType::TYPE_TEXT_VARIATION_WEB_EDIT_TEXT;
   }
 
   if (aInputTypeAttr.EqualsIgnoreCase("url")) {
-    return java::sdk::InputType::TYPE_CLASS_TEXT | java::sdk::InputType::TYPE_TEXT_VARIATION_URI;
+    return java::sdk::InputType::TYPE_CLASS_TEXT |
+           java::sdk::InputType::TYPE_TEXT_VARIATION_URI;
   }
 
   return 0;
 }
 
-void
-AccessibleWrap::WrapperDOMNodeID(nsString& aDOMNodeID)
-{
+void AccessibleWrap::WrapperDOMNodeID(nsString& aDOMNodeID) {
   if (mContent) {
     nsAtom* id = mContent->GetID();
     if (id) {
       id->ToString(aDOMNodeID);
     }
   }
 }
 
-bool
-AccessibleWrap::WrapperRangeInfo(double* aCurVal, double* aMinVal,
-                             double* aMaxVal, double* aStep)
-{
+bool AccessibleWrap::WrapperRangeInfo(double* aCurVal, double* aMinVal,
+                                      double* aMaxVal, double* aStep) {
   if (HasNumericValue()) {
     *aCurVal = CurValue();
     *aMinVal = MinValue();
     *aMaxVal = MaxValue();
     *aStep = Step();
     return true;
   }
 
   return false;
 }
 
-mozilla::java::GeckoBundle::LocalRef
-AccessibleWrap::ToBundle()
-{
+mozilla::java::GeckoBundle::LocalRef AccessibleWrap::ToBundle() {
   nsAutoString name;
   Name(name);
   nsAutoString textValue;
   Value(textValue);
   nsAutoString nodeID;
   WrapperDOMNodeID(nodeID);
 
   double curValue = UnspecifiedNaN<double>();
   double minValue = UnspecifiedNaN<double>();
   double maxValue = UnspecifiedNaN<double>();
   double step = UnspecifiedNaN<double>();
   WrapperRangeInfo(&curValue, &minValue, &maxValue, &step);
 
   nsCOMPtr<nsIPersistentProperties> attributes = Attributes();
 
-  return ToBundle(State(), Bounds(), name, textValue, nodeID,
-                  curValue, minValue, maxValue, step, attributes);
+  return ToBundle(State(), Bounds(), name, textValue, nodeID, curValue,
+                  minValue, maxValue, step, attributes);
 }
 
-mozilla::java::GeckoBundle::LocalRef
-AccessibleWrap::ToBundle(const uint64_t aState,
-                         const nsIntRect& aBounds,
-                         const nsString& aName,
-                         const nsString& aTextValue,
-                         const nsString& aDOMNodeID,
-                         const double& aCurVal,
-                         const double& aMinVal,
-                         const double& aMaxVal,
-                         const double& aStep,
-                         nsIPersistentProperties* aAttributes)
-{
+mozilla::java::GeckoBundle::LocalRef AccessibleWrap::ToBundle(
+    const uint64_t aState, const nsIntRect& aBounds, const nsString& aName,
+    const nsString& aTextValue, const nsString& aDOMNodeID,
+    const double& aCurVal, const double& aMinVal, const double& aMaxVal,
+    const double& aStep, nsIPersistentProperties* aAttributes) {
   if (!IsProxy() && IsDefunct()) {
     return nullptr;
   }
 
   GECKOBUNDLE_START(nodeInfo);
   GECKOBUNDLE_PUT(nodeInfo, "id", java::sdk::Integer::ValueOf(VirtualViewID()));
 
   AccessibleWrap* parent = WrapperParent();
-  GECKOBUNDLE_PUT(nodeInfo, "parentId",
-    java::sdk::Integer::ValueOf(parent ? parent->VirtualViewID() : 0));
+  GECKOBUNDLE_PUT(
+      nodeInfo, "parentId",
+      java::sdk::Integer::ValueOf(parent ? parent->VirtualViewID() : 0));
 
   role role = WrapperRole();
   uint32_t flags = GetFlags(role, aState);
   GECKOBUNDLE_PUT(nodeInfo, "flags", java::sdk::Integer::ValueOf(flags));
-  GECKOBUNDLE_PUT(nodeInfo, "className", java::sdk::Integer::ValueOf(AndroidClass()));
+  GECKOBUNDLE_PUT(nodeInfo, "className",
+                  java::sdk::Integer::ValueOf(AndroidClass()));
 
   if (aState & states::EDITABLE) {
     GECKOBUNDLE_PUT(nodeInfo, "hint", jni::StringParam(aName));
     GECKOBUNDLE_PUT(nodeInfo, "text", jni::StringParam(aTextValue));
   } else {
     GECKOBUNDLE_PUT(nodeInfo, "text", jni::StringParam(aName));
   }
 
   nsAutoString geckoRole;
   nsAutoString roleDescription;
   if (VirtualViewID() != kNoID) {
     GetRoleDescription(role, geckoRole, roleDescription);
   }
 
-  GECKOBUNDLE_PUT(
-    nodeInfo, "roleDescription", jni::StringParam(roleDescription));
+  GECKOBUNDLE_PUT(nodeInfo, "roleDescription",
+                  jni::StringParam(roleDescription));
   GECKOBUNDLE_PUT(nodeInfo, "geckoRole", jni::StringParam(geckoRole));
 
-  GECKOBUNDLE_PUT(
-    nodeInfo, "roleDescription", jni::StringParam(roleDescription));
+  GECKOBUNDLE_PUT(nodeInfo, "roleDescription",
+                  jni::StringParam(roleDescription));
   GECKOBUNDLE_PUT(nodeInfo, "geckoRole", jni::StringParam(geckoRole));
 
   if (!aDOMNodeID.IsEmpty()) {
-    GECKOBUNDLE_PUT(
-      nodeInfo, "viewIdResourceName", jni::StringParam(aDOMNodeID));
+    GECKOBUNDLE_PUT(nodeInfo, "viewIdResourceName",
+                    jni::StringParam(aDOMNodeID));
   }
 
   nsIntRect bounds = Bounds();
-  const int32_t data[4] = {
-    bounds.x, bounds.y, bounds.x + bounds.width, bounds.y + bounds.height
-  };
+  const int32_t data[4] = {bounds.x, bounds.y, bounds.x + bounds.width,
+                           bounds.y + bounds.height};
   GECKOBUNDLE_PUT(nodeInfo, "bounds", jni::IntArray::New(data, 4));
 
   if (HasNumericValue()) {
     GECKOBUNDLE_START(rangeInfo);
     if (aMaxVal == 1 && aMinVal == 0) {
-      GECKOBUNDLE_PUT(
-        rangeInfo, "type", java::sdk::Integer::ValueOf(2)); // percent
+      GECKOBUNDLE_PUT(rangeInfo, "type",
+                      java::sdk::Integer::ValueOf(2));  // percent
     } else if (std::round(aStep) != aStep) {
-      GECKOBUNDLE_PUT(
-        rangeInfo, "type", java::sdk::Integer::ValueOf(1)); // float
+      GECKOBUNDLE_PUT(rangeInfo, "type",
+                      java::sdk::Integer::ValueOf(1));  // float
     } else {
-      GECKOBUNDLE_PUT(
-        rangeInfo, "type", java::sdk::Integer::ValueOf(0)); // integer
+      GECKOBUNDLE_PUT(rangeInfo, "type",
+                      java::sdk::Integer::ValueOf(0));  // integer
     }
 
     if (!IsNaN(aCurVal)) {
       GECKOBUNDLE_PUT(rangeInfo, "current", java::sdk::Double::New(aCurVal));
     }
     if (!IsNaN(aMinVal)) {
       GECKOBUNDLE_PUT(rangeInfo, "min", java::sdk::Double::New(aMinVal));
     }
@@ -518,118 +480,115 @@ AccessibleWrap::ToBundle(const uint64_t 
     GECKOBUNDLE_FINISH(rangeInfo);
     GECKOBUNDLE_PUT(nodeInfo, "rangeInfo", rangeInfo);
   }
 
   nsString inputTypeAttr;
   nsAccUtils::GetAccAttr(aAttributes, nsGkAtoms::textInputType, inputTypeAttr);
   int32_t inputType = GetInputType(inputTypeAttr);
   if (inputType) {
-    GECKOBUNDLE_PUT(nodeInfo, "inputType", java::sdk::Integer::ValueOf(inputType));
+    GECKOBUNDLE_PUT(nodeInfo, "inputType",
+                    java::sdk::Integer::ValueOf(inputType));
   }
 
   nsString posinset;
-  nsresult rv = aAttributes->GetStringProperty(NS_LITERAL_CSTRING("posinset"), posinset);
+  nsresult rv =
+      aAttributes->GetStringProperty(NS_LITERAL_CSTRING("posinset"), posinset);
   if (NS_SUCCEEDED(rv)) {
     int32_t rowIndex;
     if (sscanf(NS_ConvertUTF16toUTF8(posinset).get(), "%d", &rowIndex) > 0) {
       GECKOBUNDLE_START(collectionItemInfo);
-      GECKOBUNDLE_PUT(
-        collectionItemInfo, "rowIndex", java::sdk::Integer::ValueOf(rowIndex));
-      GECKOBUNDLE_PUT(
-        collectionItemInfo, "columnIndex", java::sdk::Integer::ValueOf(0));
-      GECKOBUNDLE_PUT(
-        collectionItemInfo, "rowSpan", java::sdk::Integer::ValueOf(1));
-      GECKOBUNDLE_PUT(
-        collectionItemInfo, "columnSpan", java::sdk::Integer::ValueOf(1));
+      GECKOBUNDLE_PUT(collectionItemInfo, "rowIndex",
+                      java::sdk::Integer::ValueOf(rowIndex));
+      GECKOBUNDLE_PUT(collectionItemInfo, "columnIndex",
+                      java::sdk::Integer::ValueOf(0));
+      GECKOBUNDLE_PUT(collectionItemInfo, "rowSpan",
+                      java::sdk::Integer::ValueOf(1));
+      GECKOBUNDLE_PUT(collectionItemInfo, "columnSpan",
+                      java::sdk::Integer::ValueOf(1));
       GECKOBUNDLE_FINISH(collectionItemInfo);
 
       GECKOBUNDLE_PUT(nodeInfo, "collectionItemInfo", collectionItemInfo);
     }
   }
 
   nsString colSize;
   rv = aAttributes->GetStringProperty(NS_LITERAL_CSTRING("child-item-count"),
                                       colSize);
   if (NS_SUCCEEDED(rv)) {
     int32_t rowCount;
     if (sscanf(NS_ConvertUTF16toUTF8(colSize).get(), "%d", &rowCount) > 0) {
       GECKOBUNDLE_START(collectionInfo);
-      GECKOBUNDLE_PUT(
-        collectionInfo, "rowCount", java::sdk::Integer::ValueOf(rowCount));
-      GECKOBUNDLE_PUT(
-        collectionInfo, "columnCount", java::sdk::Integer::ValueOf(1));
+      GECKOBUNDLE_PUT(collectionInfo, "rowCount",
+                      java::sdk::Integer::ValueOf(rowCount));
+      GECKOBUNDLE_PUT(collectionInfo, "columnCount",
+                      java::sdk::Integer::ValueOf(1));
 
       nsString unused;
       rv = aAttributes->GetStringProperty(NS_LITERAL_CSTRING("hierarchical"),
                                           unused);
       if (NS_SUCCEEDED(rv)) {
-        GECKOBUNDLE_PUT(
-          collectionInfo, "isHierarchical", java::sdk::Boolean::TRUE());
+        GECKOBUNDLE_PUT(collectionInfo, "isHierarchical",
+                        java::sdk::Boolean::TRUE());
       }
 
       if (IsSelect()) {
         int32_t selectionMode = (aState & states::MULTISELECTABLE) ? 2 : 1;
-        GECKOBUNDLE_PUT(collectionInfo,
-                        "selectionMode",
+        GECKOBUNDLE_PUT(collectionInfo, "selectionMode",
                         java::sdk::Integer::ValueOf(selectionMode));
       }
       GECKOBUNDLE_FINISH(collectionInfo);
 
       GECKOBUNDLE_PUT(nodeInfo, "collectionInfo", collectionInfo);
     }
   }
 
   auto childCount = ChildCount();
   nsTArray<int32_t> children(childCount);
   for (uint32_t i = 0; i < childCount; i++) {
     auto child = static_cast<AccessibleWrap*>(GetChildAt(i));
     children.AppendElement(child->VirtualViewID());
   }
 
-  GECKOBUNDLE_PUT(nodeInfo,
-                  "children",
+  GECKOBUNDLE_PUT(nodeInfo, "children",
                   jni::IntArray::New(children.Elements(), children.Length()));
   GECKOBUNDLE_FINISH(nodeInfo);
 
   return nodeInfo;
 }
 
-mozilla::java::GeckoBundle::LocalRef
-AccessibleWrap::ToSmallBundle()
-{
+mozilla::java::GeckoBundle::LocalRef AccessibleWrap::ToSmallBundle() {
   return ToSmallBundle(State(), Bounds());
 }
 
-mozilla::java::GeckoBundle::LocalRef
-AccessibleWrap::ToSmallBundle(const uint64_t aState, const nsIntRect& aBounds)
-{
+mozilla::java::GeckoBundle::LocalRef AccessibleWrap::ToSmallBundle(
+    const uint64_t aState, const nsIntRect& aBounds) {
   GECKOBUNDLE_START(nodeInfo);
   GECKOBUNDLE_PUT(nodeInfo, "id", java::sdk::Integer::ValueOf(VirtualViewID()));
 
   AccessibleWrap* parent = WrapperParent();
-  GECKOBUNDLE_PUT(nodeInfo, "parentId",
-    java::sdk::Integer::ValueOf(parent ? parent->VirtualViewID() : 0));
+  GECKOBUNDLE_PUT(
+      nodeInfo, "parentId",
+      java::sdk::Integer::ValueOf(parent ? parent->VirtualViewID() : 0));
 
   uint32_t flags = GetFlags(WrapperRole(), aState);
   GECKOBUNDLE_PUT(nodeInfo, "flags", java::sdk::Integer::ValueOf(flags));
-  GECKOBUNDLE_PUT(nodeInfo, "className", java::sdk::Integer::ValueOf(AndroidClass()));
+  GECKOBUNDLE_PUT(nodeInfo, "className",
+                  java::sdk::Integer::ValueOf(AndroidClass()));
 
-  const int32_t data[4] = {
-    aBounds.x, aBounds.y, aBounds.x + aBounds.width, aBounds.y + aBounds.height
-  };
+  const int32_t data[4] = {aBounds.x, aBounds.y, aBounds.x + aBounds.width,
+                           aBounds.y + aBounds.height};
   GECKOBUNDLE_PUT(nodeInfo, "bounds", jni::IntArray::New(data, 4));
 
   auto childCount = ChildCount();
   nsTArray<int32_t> children(childCount);
   for (uint32_t i = 0; i < childCount; ++i) {
     auto child = static_cast<AccessibleWrap*>(GetChildAt(i));
     children.AppendElement(child->VirtualViewID());
   }
 
-  GECKOBUNDLE_PUT(nodeInfo,
-                  "children",
+  GECKOBUNDLE_PUT(nodeInfo, "children",
                   jni::IntArray::New(children.Elements(), children.Length()));
 
   GECKOBUNDLE_FINISH(nodeInfo);
 
   return nodeInfo;
 }
--- a/accessible/android/AccessibleWrap.h
+++ b/accessible/android/AccessibleWrap.h
@@ -9,90 +9,83 @@
 #include "Accessible.h"
 #include "GeneratedJNIWrappers.h"
 #include "mozilla/a11y/ProxyAccessible.h"
 #include "nsCOMPtr.h"
 
 namespace mozilla {
 namespace a11y {
 
-class AccessibleWrap : public Accessible
-{
-public:
+class AccessibleWrap : public Accessible {
+ public:
   AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~AccessibleWrap();
 
   virtual nsresult HandleAccEvent(AccEvent* aEvent) override;
   virtual void Shutdown() override;
 
   int32_t VirtualViewID() const { return mID; }
 
   virtual void SetTextContents(const nsAString& aText);
 
   virtual void GetTextContents(nsAString& aText);
 
   virtual bool GetSelectionBounds(int32_t* aStartOffset, int32_t* aEndOffset);
 
   mozilla::java::GeckoBundle::LocalRef ToBundle();
 
-  mozilla::java::GeckoBundle::LocalRef ToBundle(const uint64_t aState,
-                                                const nsIntRect& aBounds,
-                                                const nsString& aName,
-                                                const nsString& aTextValue,
-                                                const nsString& aDOMNodeID,
-                                                const double& aCurVal,
-                                                const double& aMinVal,
-                                                const double& aMaxVal,
-                                                const double& aStep,
-                                                nsIPersistentProperties* aAttributes);
+  mozilla::java::GeckoBundle::LocalRef ToBundle(
+      const uint64_t aState, const nsIntRect& aBounds, const nsString& aName,
+      const nsString& aTextValue, const nsString& aDOMNodeID,
+      const double& aCurVal, const double& aMinVal, const double& aMaxVal,
+      const double& aStep, nsIPersistentProperties* aAttributes);
 
-  mozilla::java::GeckoBundle::LocalRef ToSmallBundle(const uint64_t aState, const nsIntRect& aBounds);
+  mozilla::java::GeckoBundle::LocalRef ToSmallBundle(const uint64_t aState,
+                                                     const nsIntRect& aBounds);
 
   mozilla::java::GeckoBundle::LocalRef ToSmallBundle();
 
   virtual void WrapperDOMNodeID(nsString& aDOMNodeID);
 
-  int32_t AndroidClass()
-  {
+  int32_t AndroidClass() {
     return mID == kNoID ? java::SessionAccessibility::CLASSNAME_WEBVIEW
                         : GetAndroidClass(WrapperRole());
   }
 
   static already_AddRefed<nsIPersistentProperties> AttributeArrayToProperties(
-    const nsTArray<Attribute>& aAttributes);
+      const nsTArray<Attribute>& aAttributes);
 
   static const int32_t kNoID = -1;
 
-protected:
-
+ protected:
   // IDs should be a positive 32bit integer.
   static int32_t AcquireID();
   static void ReleaseID(int32_t aID);
 
   static int32_t GetAndroidClass(role aRole);
 
   static int32_t GetInputType(const nsString& aInputTypeAttr);
 
   int32_t mID;
 
-private:
-  virtual AccessibleWrap* WrapperParent() { return static_cast<AccessibleWrap*>(Parent()); }
+ private:
+  virtual AccessibleWrap* WrapperParent() {
+    return static_cast<AccessibleWrap*>(Parent());
+  }
 
-  virtual bool WrapperRangeInfo(double* aCurVal, double* aMinVal, double* aMaxVal, double* aStep);
+  virtual bool WrapperRangeInfo(double* aCurVal, double* aMinVal,
+                                double* aMaxVal, double* aStep);
 
   virtual role WrapperRole() { return Role(); }
 
-  static void GetRoleDescription(role aRole,
-                                 nsAString& aGeckoRole,
+  static void GetRoleDescription(role aRole, nsAString& aGeckoRole,
                                  nsAString& aRoleDescription);
   static uint32_t GetFlags(role aRole, uint64_t aState);
 };
 
-static inline AccessibleWrap*
-WrapperFor(const ProxyAccessible* aProxy)
-{
+static inline AccessibleWrap* WrapperFor(const ProxyAccessible* aProxy) {
   return reinterpret_cast<AccessibleWrap*>(aProxy->GetWrapper());
 }
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/ApplicationAccessibleWrap.h
+++ b/accessible/android/ApplicationAccessibleWrap.h
@@ -9,12 +9,12 @@
 #define mozilla_a11y_ApplicationAccessibleWrap_h__
 
 #include "ApplicationAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef ApplicationAccessible ApplicationAccessibleWrap;
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/DocAccessibleWrap.cpp
+++ b/accessible/android/DocAccessibleWrap.cpp
@@ -18,18 +18,17 @@ using namespace mozilla::a11y;
 const uint32_t kCacheRefreshInterval = 500;
 
 ////////////////////////////////////////////////////////////////////////////////
 // DocAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
 DocAccessibleWrap::DocAccessibleWrap(nsIDocument* aDocument,
                                      nsIPresShell* aPresShell)
-  : DocAccessible(aDocument, aPresShell)
-{
+    : DocAccessible(aDocument, aPresShell) {
   nsCOMPtr<nsIDocShellTreeItem> treeItem(aDocument->GetDocShell());
 
   nsCOMPtr<nsIDocShellTreeItem> parentTreeItem;
   treeItem->GetParent(getter_AddRefs(parentTreeItem));
 
   if (treeItem->ItemType() == nsIDocShellTreeItem::typeContent &&
       (!parentTreeItem ||
        parentTreeItem->ItemType() == nsIDocShellTreeItem::typeChrome)) {
@@ -37,246 +36,218 @@ DocAccessibleWrap::DocAccessibleWrap(nsI
     mID = kNoID;
   } else {
     mID = AcquireID();
   }
 }
 
 DocAccessibleWrap::~DocAccessibleWrap() {}
 
-AccessibleWrap*
-DocAccessibleWrap::GetAccessibleByID(int32_t aID) const
-{
+AccessibleWrap* DocAccessibleWrap::GetAccessibleByID(int32_t aID) const {
   if (AccessibleWrap* acc = mIDToAccessibleMap.Get(aID)) {
     return acc;
   }
 
   // If the ID is not in the hash table, check the IDs of the child docs.
   for (uint32_t i = 0; i < ChildDocumentCount(); i++) {
     auto childDoc = reinterpret_cast<AccessibleWrap*>(GetChildDocumentAt(i));
     if (childDoc->VirtualViewID() == aID) {
       return childDoc;
     }
   }
 
   return nullptr;
 }
 
-void
-DocAccessibleWrap::DoInitialUpdate()
-{
+void DocAccessibleWrap::DoInitialUpdate() {
   DocAccessible::DoInitialUpdate();
   CacheViewport();
 }
 
-nsresult
-DocAccessibleWrap::HandleAccEvent(AccEvent* aEvent)
-{
-  switch(aEvent->GetEventType()) {
+nsresult DocAccessibleWrap::HandleAccEvent(AccEvent* aEvent) {
+  switch (aEvent->GetEventType()) {
     case nsIAccessibleEvent::EVENT_SHOW:
     case nsIAccessibleEvent::EVENT_HIDE:
     case nsIAccessibleEvent::EVENT_SCROLLING_END:
       CacheViewport();
       break;
     case nsIAccessibleEvent::EVENT_SCROLLING:
       UpdateFocusPathBounds();
       break;
     default:
       break;
   }
 
   return DocAccessible::HandleAccEvent(aEvent);
 }
 
-void
-DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer, void* aDocAccParam)
-{
-  RefPtr<DocAccessibleWrap> docAcc(dont_AddRef(
-    reinterpret_cast<DocAccessibleWrap*>(aDocAccParam)));
+void DocAccessibleWrap::CacheViewportCallback(nsITimer* aTimer,
+                                              void* aDocAccParam) {
+  RefPtr<DocAccessibleWrap> docAcc(
+      dont_AddRef(reinterpret_cast<DocAccessibleWrap*>(aDocAccParam)));
   if (!docAcc) {
     return;
   }
 
-  nsIPresShell *presShell = docAcc->PresShell();
+  nsIPresShell* presShell = docAcc->PresShell();
   if (!presShell) {
     return;
   }
   nsIFrame* rootFrame = presShell->GetRootFrame();
   if (!rootFrame) {
     return;
   }
 
   nsTArray<nsIFrame*> frames;
   nsIScrollableFrame* sf = presShell->GetRootScrollFrameAsScrollable();
   nsRect scrollPort = sf ? sf->GetScrollPortRect() : rootFrame->GetRect();
 
   nsLayoutUtils::GetFramesForArea(
-    presShell->GetRootFrame(),
-    scrollPort,
-    frames,
-    nsLayoutUtils::FrameForPointFlags::ONLY_VISIBLE);
+      presShell->GetRootFrame(), scrollPort, frames,
+      nsLayoutUtils::FrameForPointFlags::ONLY_VISIBLE);
   AccessibleHashtable inViewAccs;
   for (size_t i = 0; i < frames.Length(); i++) {
     nsIContent* content = frames.ElementAt(i)->GetContent();
     if (!content) {
       continue;
     }
 
     Accessible* visibleAcc = docAcc->GetAccessibleOrContainer(content);
     if (!visibleAcc) {
       continue;
     }
 
-    for (Accessible* acc = visibleAcc; acc && acc != docAcc->Parent(); acc = acc->Parent()) {
+    for (Accessible* acc = visibleAcc; acc && acc != docAcc->Parent();
+         acc = acc->Parent()) {
       if (inViewAccs.Contains(acc->UniqueID())) {
         break;
       }
       inViewAccs.Put(acc->UniqueID(), acc);
     }
   }
 
   if (IPCAccessibilityActive()) {
     DocAccessibleChild* ipcDoc = docAcc->IPCDoc();
     nsTArray<BatchData> cacheData(inViewAccs.Count());
     for (auto iter = inViewAccs.Iter(); !iter.Done(); iter.Next()) {
       Accessible* accessible = iter.Data();
-      auto uid = accessible->IsDoc() && accessible->AsDoc()->IPCDoc() ? 0
-        : reinterpret_cast<uint64_t>(accessible->UniqueID());
-      cacheData.AppendElement(BatchData(accessible->Document()->IPCDoc(),
-                                        uid,
-                                        accessible->State(),
-                                        accessible->Bounds(),
-                                        nsString(),
-                                        nsString(),
-                                        nsString(),
-                                        UnspecifiedNaN<double>(),
-                                        UnspecifiedNaN<double>(),
-                                        UnspecifiedNaN<double>(),
-                                        UnspecifiedNaN<double>(),
-                                        nsTArray<Attribute>()));
+      auto uid = accessible->IsDoc() && accessible->AsDoc()->IPCDoc()
+                     ? 0
+                     : reinterpret_cast<uint64_t>(accessible->UniqueID());
+      cacheData.AppendElement(
+          BatchData(accessible->Document()->IPCDoc(), uid, accessible->State(),
+                    accessible->Bounds(), nsString(), nsString(), nsString(),
+                    UnspecifiedNaN<double>(), UnspecifiedNaN<double>(),
+                    UnspecifiedNaN<double>(), UnspecifiedNaN<double>(),
+                    nsTArray<Attribute>()));
     }
 
     ipcDoc->SendBatch(eBatch_Viewport, cacheData);
-  } else if (SessionAccessibility* sessionAcc = SessionAccessibility::GetInstanceFor(docAcc)) {
+  } else if (SessionAccessibility* sessionAcc =
+                 SessionAccessibility::GetInstanceFor(docAcc)) {
     nsTArray<AccessibleWrap*> accessibles(inViewAccs.Count());
     for (auto iter = inViewAccs.Iter(); !iter.Done(); iter.Next()) {
-      accessibles.AppendElement(static_cast<AccessibleWrap*>(iter.Data().get()));
+      accessibles.AppendElement(
+          static_cast<AccessibleWrap*>(iter.Data().get()));
     }
 
     sessionAcc->ReplaceViewportCache(accessibles);
   }
 
   if (docAcc->mCacheRefreshTimer) {
     docAcc->mCacheRefreshTimer = nullptr;
   }
 }
 
-void
-DocAccessibleWrap::CacheViewport()
-{
+void DocAccessibleWrap::CacheViewport() {
   if (VirtualViewID() == kNoID && !mCacheRefreshTimer) {
     NS_NewTimerWithFuncCallback(getter_AddRefs(mCacheRefreshTimer),
-                                CacheViewportCallback,
-                                this,
-                                kCacheRefreshInterval,
-                                nsITimer::TYPE_ONE_SHOT,
+                                CacheViewportCallback, this,
+                                kCacheRefreshInterval, nsITimer::TYPE_ONE_SHOT,
                                 "a11y::DocAccessibleWrap::CacheViewport");
     if (mCacheRefreshTimer) {
-      NS_ADDREF_THIS(); // Kung fu death grip
+      NS_ADDREF_THIS();  // Kung fu death grip
     }
   }
 }
 
-DocAccessibleWrap*
-DocAccessibleWrap::GetTopLevelContentDoc(AccessibleWrap* aAccessible) {
-  DocAccessibleWrap* doc = static_cast<DocAccessibleWrap*>(aAccessible->Document());
+DocAccessibleWrap* DocAccessibleWrap::GetTopLevelContentDoc(
+    AccessibleWrap* aAccessible) {
+  DocAccessibleWrap* doc =
+      static_cast<DocAccessibleWrap*>(aAccessible->Document());
   while (doc && doc->VirtualViewID() != kNoID) {
     doc = static_cast<DocAccessibleWrap*>(doc->ParentDocument());
   }
 
   return doc;
 }
 
-void
-DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible)
-{
+void DocAccessibleWrap::CacheFocusPath(AccessibleWrap* aAccessible) {
   mFocusPath.Clear();
   if (IPCAccessibilityActive()) {
     DocAccessibleChild* ipcDoc = IPCDoc();
     nsTArray<BatchData> cacheData;
     for (AccessibleWrap* acc = aAccessible; acc && acc != this->Parent();
          acc = static_cast<AccessibleWrap*>(acc->Parent())) {
-      auto uid = acc->IsDoc() && acc->AsDoc()->IPCDoc() ? 0
-        : reinterpret_cast<uint64_t>(acc->UniqueID());
+      auto uid = acc->IsDoc() && acc->AsDoc()->IPCDoc()
+                     ? 0
+                     : reinterpret_cast<uint64_t>(acc->UniqueID());
       nsAutoString name;
       acc->Name(name);
       nsAutoString textValue;
       acc->Value(textValue);
       nsAutoString nodeID;
       acc->WrapperDOMNodeID(nodeID);
       nsCOMPtr<nsIPersistentProperties> props = acc->Attributes();
       nsTArray<Attribute> attributes;
       nsAccUtils::PersistentPropertiesToArray(props, &attributes);
-      cacheData.AppendElement(BatchData(acc->Document()->IPCDoc(),
-                                        uid,
-                                        acc->State(),
-                                        acc->Bounds(),
-                                        name,
-                                        textValue,
-                                        nodeID,
-                                        acc->CurValue(),
-                                        acc->MinValue(),
-                                        acc->MaxValue(),
-                                        acc->Step(),
-                                        attributes));
+      cacheData.AppendElement(
+          BatchData(acc->Document()->IPCDoc(), uid, acc->State(), acc->Bounds(),
+                    name, textValue, nodeID, acc->CurValue(), acc->MinValue(),
+                    acc->MaxValue(), acc->Step(), attributes));
       mFocusPath.Put(acc->UniqueID(), acc);
     }
 
     ipcDoc->SendBatch(eBatch_FocusPath, cacheData);
-  } else if (SessionAccessibility* sessionAcc = SessionAccessibility::GetInstanceFor(this)) {
+  } else if (SessionAccessibility* sessionAcc =
+                 SessionAccessibility::GetInstanceFor(this)) {
     nsTArray<AccessibleWrap*> accessibles;
     for (AccessibleWrap* acc = aAccessible; acc && acc != this->Parent();
          acc = static_cast<AccessibleWrap*>(acc->Parent())) {
       accessibles.AppendElement(acc);
     }
 
     sessionAcc->ReplaceFocusPathCache(accessibles);
   }
 }
 
-void
-DocAccessibleWrap::UpdateFocusPathBounds()
-{
+void DocAccessibleWrap::UpdateFocusPathBounds() {
   if (!mFocusPath.Count()) {
     return;
   }
 
   if (IPCAccessibilityActive()) {
     DocAccessibleChild* ipcDoc = IPCDoc();
     nsTArray<BatchData> boundsData(mFocusPath.Count());
     for (auto iter = mFocusPath.Iter(); !iter.Done(); iter.Next()) {
       Accessible* accessible = iter.Data();
-      auto uid = accessible->IsDoc() && accessible->AsDoc()->IPCDoc() ? 0
-        : reinterpret_cast<uint64_t>(accessible->UniqueID());
-      boundsData.AppendElement(BatchData(accessible->Document()->IPCDoc(),
-                                         uid,
-                                         0,
-                                         accessible->Bounds(),
-                                         nsString(),
-                                         nsString(),
-                                         nsString(),
-                                         UnspecifiedNaN<double>(),
-                                         UnspecifiedNaN<double>(),
-                                         UnspecifiedNaN<double>(),
-                                         UnspecifiedNaN<double>(),
-                                         nsTArray<Attribute>()));
+      auto uid = accessible->IsDoc() && accessible->AsDoc()->IPCDoc()
+                     ? 0
+                     : reinterpret_cast<uint64_t>(accessible->UniqueID());
+      boundsData.AppendElement(BatchData(
+          accessible->Document()->IPCDoc(), uid, 0, accessible->Bounds(),
+          nsString(), nsString(), nsString(), UnspecifiedNaN<double>(),
+          UnspecifiedNaN<double>(), UnspecifiedNaN<double>(),
+          UnspecifiedNaN<double>(), nsTArray<Attribute>()));
     }
 
     ipcDoc->SendBatch(eBatch_BoundsUpdate, boundsData);
-  } else if (SessionAccessibility* sessionAcc = SessionAccessibility::GetInstanceFor(this)) {
+  } else if (SessionAccessibility* sessionAcc =
+                 SessionAccessibility::GetInstanceFor(this)) {
     nsTArray<AccessibleWrap*> accessibles(mFocusPath.Count());
     for (auto iter = mFocusPath.Iter(); !iter.Done(); iter.Next()) {
-      accessibles.AppendElement(static_cast<AccessibleWrap*>(iter.Data().get()));
+      accessibles.AppendElement(
+          static_cast<AccessibleWrap*>(iter.Data().get()));
     }
 
     sessionAcc->UpdateCachedBounds(accessibles);
   }
 }
--- a/accessible/android/DocAccessibleWrap.h
+++ b/accessible/android/DocAccessibleWrap.h
@@ -7,60 +7,58 @@
 #define mozilla_a11y_DocAccessibleWrap_h__
 
 #include "DocAccessible.h"
 #include "nsITimer.h"
 
 namespace mozilla {
 namespace a11y {
 
-class DocAccessibleWrap : public DocAccessible
-{
-public:
+class DocAccessibleWrap : public DocAccessible {
+ public:
   DocAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
   virtual ~DocAccessibleWrap();
 
   virtual nsresult HandleAccEvent(AccEvent* aEvent) override;
 
   /**
    * Manage the mapping from id to Accessible.
    */
-  void AddID(uint32_t aID, AccessibleWrap* aAcc)
-  {
+  void AddID(uint32_t aID, AccessibleWrap* aAcc) {
     mIDToAccessibleMap.Put(aID, aAcc);
   }
   void RemoveID(uint32_t aID) { mIDToAccessibleMap.Remove(aID); }
   AccessibleWrap* GetAccessibleByID(int32_t aID) const;
 
   DocAccessibleWrap* GetTopLevelContentDoc(AccessibleWrap* aAccessible);
 
   void CacheFocusPath(AccessibleWrap* aAccessible);
 
   enum {
     eBatch_Viewport = 0,
     eBatch_FocusPath = 1,
     eBatch_BoundsUpdate = 2,
   };
 
-protected:
+ protected:
   /*
    * This provides a mapping from 32 bit id to accessible objects.
    */
   nsDataHashtable<nsUint32HashKey, AccessibleWrap*> mIDToAccessibleMap;
 
   virtual void DoInitialUpdate() override;
 
-private:
+ private:
   void CacheViewport();
 
   void UpdateFocusPathBounds();
 
   static void CacheViewportCallback(nsITimer* aTimer, void* aDocAccParam);
 
   nsCOMPtr<nsITimer> mCacheRefreshTimer;
 
   AccessibleHashtable mFocusPath;
 };
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/HTMLTableAccessibleWrap.h
+++ b/accessible/android/HTMLTableAccessibleWrap.h
@@ -12,12 +12,12 @@
 
 namespace mozilla {
 namespace a11y {
 
 typedef class HTMLTableAccessible HTMLTableAccessibleWrap;
 typedef class HTMLTableCellAccessible HTMLTableCellAccessibleWrap;
 typedef class HTMLTableHeaderCellAccessible HTMLTableHeaderCellAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/HyperTextAccessibleWrap.h
+++ b/accessible/android/HyperTextAccessibleWrap.h
@@ -8,12 +8,12 @@
 
 #include "HyperTextAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class HyperTextAccessible HyperTextAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/ImageAccessibleWrap.h
+++ b/accessible/android/ImageAccessibleWrap.h
@@ -10,12 +10,12 @@
 
 #include "ImageAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class ImageAccessible ImageAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/Platform.cpp
+++ b/accessible/android/Platform.cpp
@@ -10,81 +10,66 @@
 #include "SessionAccessibility.h"
 #include "mozilla/a11y/ProxyAccessible.h"
 #include "nsIAccessibleEvent.h"
 #include "nsIAccessiblePivot.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
-void
-a11y::PlatformInit()
-{
-}
+void a11y::PlatformInit() {}
 
-void
-a11y::PlatformShutdown()
-{
-}
+void a11y::PlatformShutdown() {}
 
-void
-a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces)
-{
+void a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces) {
   AccessibleWrap* wrapper = nullptr;
   if (aProxy->IsDoc()) {
     wrapper = new DocProxyAccessibleWrap(aProxy->AsDoc());
   } else {
     wrapper = new ProxyAccessibleWrap(aProxy);
   }
 
   wrapper->AddRef();
   aProxy->SetWrapper(reinterpret_cast<uintptr_t>(wrapper));
 }
 
-void
-a11y::ProxyDestroyed(ProxyAccessible* aProxy)
-{
+void a11y::ProxyDestroyed(ProxyAccessible* aProxy) {
   AccessibleWrap* wrapper =
-    reinterpret_cast<AccessibleWrap*>(aProxy->GetWrapper());
+      reinterpret_cast<AccessibleWrap*>(aProxy->GetWrapper());
 
   // If aProxy is a document that was created, but
   // RecvPDocAccessibleConstructor failed then aProxy->GetWrapper() will be
   // null.
   if (!wrapper) {
     return;
   }
 
   wrapper->Shutdown();
   aProxy->SetWrapper(0);
   wrapper->Release();
 }
 
-void
-a11y::ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType)
-{
+void a11y::ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType) {
   SessionAccessibility* sessionAcc =
-    SessionAccessibility::GetInstanceFor(aTarget);
+      SessionAccessibility::GetInstanceFor(aTarget);
   if (!sessionAcc) {
     return;
   }
 
   switch (aEventType) {
     case nsIAccessibleEvent::EVENT_FOCUS:
       sessionAcc->SendFocusEvent(WrapperFor(aTarget));
       break;
   }
 }
 
-void
-a11y::ProxyStateChangeEvent(ProxyAccessible* aTarget,
-                            uint64_t aState,
-                            bool aEnabled)
-{
+void a11y::ProxyStateChangeEvent(ProxyAccessible* aTarget, uint64_t aState,
+                                 bool aEnabled) {
   SessionAccessibility* sessionAcc =
-    SessionAccessibility::GetInstanceFor(aTarget);
+      SessionAccessibility::GetInstanceFor(aTarget);
 
   if (!sessionAcc) {
     return;
   }
 
   if (aState & states::CHECKED) {
     sessionAcc->SendClickedEvent(WrapperFor(aTarget), aEnabled);
   }
@@ -93,126 +78,99 @@ a11y::ProxyStateChangeEvent(ProxyAccessi
     sessionAcc->SendSelectedEvent(WrapperFor(aTarget), aEnabled);
   }
 
   if (aState & states::BUSY) {
     sessionAcc->SendWindowStateChangedEvent(WrapperFor(aTarget));
   }
 }
 
-void
-a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
-{
+void a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset) {
   SessionAccessibility* sessionAcc =
-    SessionAccessibility::GetInstanceFor(aTarget);
+      SessionAccessibility::GetInstanceFor(aTarget);
 
   if (sessionAcc) {
     sessionAcc->SendTextSelectionChangedEvent(WrapperFor(aTarget), aOffset);
   }
 }
 
-void
-a11y::ProxyTextChangeEvent(ProxyAccessible* aTarget,
-                           const nsString& aStr,
-                           int32_t aStart,
-                           uint32_t aLen,
-                           bool aIsInsert,
-                           bool aFromUser)
-{
+void a11y::ProxyTextChangeEvent(ProxyAccessible* aTarget, const nsString& aStr,
+                                int32_t aStart, uint32_t aLen, bool aIsInsert,
+                                bool aFromUser) {
   SessionAccessibility* sessionAcc =
-    SessionAccessibility::GetInstanceFor(aTarget);
+      SessionAccessibility::GetInstanceFor(aTarget);
 
   if (sessionAcc) {
-    sessionAcc->SendTextChangedEvent(
-      WrapperFor(aTarget), aStr, aStart, aLen, aIsInsert, aFromUser);
+    sessionAcc->SendTextChangedEvent(WrapperFor(aTarget), aStr, aStart, aLen,
+                                     aIsInsert, aFromUser);
   }
 }
 
-void
-a11y::ProxyShowHideEvent(ProxyAccessible* aTarget,
-                         ProxyAccessible* aParent,
-                         bool aInsert,
-                         bool aFromUser)
-{
+void a11y::ProxyShowHideEvent(ProxyAccessible* aTarget,
+                              ProxyAccessible* aParent, bool aInsert,
+                              bool aFromUser) {
   SessionAccessibility* sessionAcc =
-    SessionAccessibility::GetInstanceFor(aTarget);
+      SessionAccessibility::GetInstanceFor(aTarget);
   if (sessionAcc) {
     sessionAcc->SendWindowContentChangedEvent(WrapperFor(aParent));
   }
 }
 
-void
-a11y::ProxySelectionEvent(ProxyAccessible*, ProxyAccessible*, uint32_t)
-{
-}
+void a11y::ProxySelectionEvent(ProxyAccessible*, ProxyAccessible*, uint32_t) {}
 
-void
-a11y::ProxyVirtualCursorChangeEvent(ProxyAccessible* aTarget,
-                                    ProxyAccessible* aOldPosition,
-                                    int32_t aOldStartOffset,
-                                    int32_t aOldEndOffset,
-                                    ProxyAccessible* aNewPosition,
-                                    int32_t aNewStartOffset,
-                                    int32_t aNewEndOffset,
-                                    int16_t aReason,
-                                    int16_t aBoundaryType,
-                                    bool aFromUser)
-{
+void a11y::ProxyVirtualCursorChangeEvent(
+    ProxyAccessible* aTarget, ProxyAccessible* aOldPosition,
+    int32_t aOldStartOffset, int32_t aOldEndOffset,
+    ProxyAccessible* aNewPosition, int32_t aNewStartOffset,
+    int32_t aNewEndOffset, int16_t aReason, int16_t aBoundaryType,
+    bool aFromUser) {
   if (!aNewPosition) {
     return;
   }
 
   SessionAccessibility* sessionAcc =
-    SessionAccessibility::GetInstanceFor(aTarget);
+      SessionAccessibility::GetInstanceFor(aTarget);
 
   if (!sessionAcc) {
     return;
   }
 
   if (aOldPosition != aNewPosition) {
     if (aReason == nsIAccessiblePivot::REASON_POINT) {
       sessionAcc->SendHoverEnterEvent(WrapperFor(aNewPosition));
     } else {
       sessionAcc->SendAccessibilityFocusedEvent(WrapperFor(aNewPosition));
     }
   }
 
   if (aBoundaryType != nsIAccessiblePivot::NO_BOUNDARY) {
-    sessionAcc->SendTextTraversedEvent(
-      WrapperFor(aNewPosition), aNewStartOffset, aNewEndOffset);
+    sessionAcc->SendTextTraversedEvent(WrapperFor(aNewPosition),
+                                       aNewStartOffset, aNewEndOffset);
   }
 }
 
-void
-a11y::ProxyScrollingEvent(ProxyAccessible* aTarget,
-                          uint32_t aEventType,
-                          uint32_t aScrollX,
-                          uint32_t aScrollY,
-                          uint32_t aMaxScrollX,
-                          uint32_t aMaxScrollY)
-{
+void a11y::ProxyScrollingEvent(ProxyAccessible* aTarget, uint32_t aEventType,
+                               uint32_t aScrollX, uint32_t aScrollY,
+                               uint32_t aMaxScrollX, uint32_t aMaxScrollY) {
   if (aEventType == nsIAccessibleEvent::EVENT_SCROLLING) {
     SessionAccessibility* sessionAcc =
-      SessionAccessibility::GetInstanceFor(aTarget);
+        SessionAccessibility::GetInstanceFor(aTarget);
 
     if (sessionAcc) {
-      sessionAcc->SendScrollingEvent(
-        WrapperFor(aTarget), aScrollX, aScrollY, aMaxScrollX, aMaxScrollY);
+      sessionAcc->SendScrollingEvent(WrapperFor(aTarget), aScrollX, aScrollY,
+                                     aMaxScrollX, aMaxScrollY);
     }
   }
 }
 
-void
-a11y::ProxyBatch(ProxyAccessible* aDocument,
-                 const uint64_t aBatchType,
-                 const nsTArray<ProxyAccessible*>& aAccessibles,
-                 const nsTArray<BatchData>& aData)
-{
+void a11y::ProxyBatch(ProxyAccessible* aDocument, const uint64_t aBatchType,
+                      const nsTArray<ProxyAccessible*>& aAccessibles,
+                      const nsTArray<BatchData>& aData) {
   SessionAccessibility* sessionAcc =
-    SessionAccessibility::GetInstanceFor(aDocument);
+      SessionAccessibility::GetInstanceFor(aDocument);
   if (!sessionAcc) {
     return;
   }
 
   nsTArray<AccessibleWrap*> accWraps(aAccessibles.Length());
   for (size_t i = 0; i < aAccessibles.Length(); i++) {
     accWraps.AppendElement(WrapperFor(aAccessibles.ElementAt(i)));
   }
--- a/accessible/android/ProxyAccessibleWrap.cpp
+++ b/accessible/android/ProxyAccessibleWrap.cpp
@@ -4,161 +4,120 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "ProxyAccessibleWrap.h"
 #include "nsPersistentProperties.h"
 
 using namespace mozilla::a11y;
 
 ProxyAccessibleWrap::ProxyAccessibleWrap(ProxyAccessible* aProxy)
-  : AccessibleWrap(nullptr, nullptr)
-{
+    : AccessibleWrap(nullptr, nullptr) {
   mType = eProxyType;
   mBits.proxy = aProxy;
 
   if (aProxy->mHasValue) {
     mStateFlags |= eHasNumericValue;
   }
 
   if (aProxy->mIsSelection) {
     mGenericTypes |= eSelect;
   }
 
   if (aProxy->mIsHyperText) {
     mGenericTypes |= eHyperText;
   }
 
   auto doc = reinterpret_cast<DocProxyAccessibleWrap*>(
-    Proxy()->Document()->GetWrapper());
+      Proxy()->Document()->GetWrapper());
   if (doc) {
     mID = AcquireID();
     doc->AddID(mID, this);
   }
 }
 
-void
-ProxyAccessibleWrap::Shutdown()
-{
+void ProxyAccessibleWrap::Shutdown() {
   auto doc = reinterpret_cast<DocProxyAccessibleWrap*>(
-    Proxy()->Document()->GetWrapper());
+      Proxy()->Document()->GetWrapper());
   if (mID && doc) {
     doc->RemoveID(mID);
     ReleaseID(mID);
     mID = 0;
   }
 
   mBits.proxy = nullptr;
   mStateFlags |= eIsDefunct;
 }
 
 // Accessible
 
-already_AddRefed<nsIPersistentProperties>
-ProxyAccessibleWrap::Attributes()
-{
+already_AddRefed<nsIPersistentProperties> ProxyAccessibleWrap::Attributes() {
   AutoTArray<Attribute, 10> attrs;
   Proxy()->Attributes(&attrs);
   return AttributeArrayToProperties(attrs);
 }
 
-uint32_t
-ProxyAccessibleWrap::ChildCount() const
-{
+uint32_t ProxyAccessibleWrap::ChildCount() const {
   return Proxy()->ChildrenCount();
 }
 
-Accessible*
-ProxyAccessibleWrap::GetChildAt(uint32_t aIndex) const
-{
+Accessible* ProxyAccessibleWrap::GetChildAt(uint32_t aIndex) const {
   ProxyAccessible* child = Proxy()->ChildAt(aIndex);
   return child ? WrapperFor(child) : nullptr;
 }
 
-ENameValueFlag
-ProxyAccessibleWrap::Name(nsString& aName) const
-{
+ENameValueFlag ProxyAccessibleWrap::Name(nsString& aName) const {
   Proxy()->Name(aName);
   return eNameOK;
 }
 
-void
-ProxyAccessibleWrap::Value(nsString& aValue) const
-{
+void ProxyAccessibleWrap::Value(nsString& aValue) const {
   Proxy()->Value(aValue);
 }
 
-uint64_t
-ProxyAccessibleWrap::State()
-{ 
-  return Proxy()->State();
-}
+uint64_t ProxyAccessibleWrap::State() { return Proxy()->State(); }
 
-nsIntRect
-ProxyAccessibleWrap::Bounds() const
-{
-  return Proxy()->Bounds();
-}
+nsIntRect ProxyAccessibleWrap::Bounds() const { return Proxy()->Bounds(); }
 
-void
-ProxyAccessibleWrap::ScrollTo(uint32_t aHow) const
-{
+void ProxyAccessibleWrap::ScrollTo(uint32_t aHow) const {
   Proxy()->ScrollTo(aHow);
 }
 
 // Other
 
-void
-ProxyAccessibleWrap::SetTextContents(const nsAString& aText)
-{
+void ProxyAccessibleWrap::SetTextContents(const nsAString& aText) {
   Proxy()->ReplaceText(PromiseFlatString(aText));
 }
 
-void
-ProxyAccessibleWrap::GetTextContents(nsAString& aText)
-{
+void ProxyAccessibleWrap::GetTextContents(nsAString& aText) {
   nsAutoString text;
   Proxy()->TextSubstring(0, -1, text);
   aText.Assign(text);
 }
 
-bool
-ProxyAccessibleWrap::GetSelectionBounds(int32_t* aStartOffset,
-                                        int32_t* aEndOffset)
-{
+bool ProxyAccessibleWrap::GetSelectionBounds(int32_t* aStartOffset,
+                                             int32_t* aEndOffset) {
   nsAutoString unused;
   return Proxy()->SelectionBoundsAt(0, unused, aStartOffset, aEndOffset);
 }
 
-role
-ProxyAccessibleWrap::WrapperRole()
-{
-  return Proxy()->Role();
-}
+role ProxyAccessibleWrap::WrapperRole() { return Proxy()->Role(); }
 
-AccessibleWrap*
-ProxyAccessibleWrap::WrapperParent()
-{
+AccessibleWrap* ProxyAccessibleWrap::WrapperParent() {
   return Proxy()->Parent() ? WrapperFor(Proxy()->Parent()) : nullptr;
 }
 
-bool
-ProxyAccessibleWrap::WrapperRangeInfo(double* aCurVal,
-                                      double* aMinVal,
-                                      double* aMaxVal,
-                                      double* aStep)
-{
+bool ProxyAccessibleWrap::WrapperRangeInfo(double* aCurVal, double* aMinVal,
+                                           double* aMaxVal, double* aStep) {
   if (HasNumericValue()) {
     ProxyAccessible* proxy = Proxy();
     *aCurVal = proxy->CurValue();
     *aMinVal = proxy->MinValue();
     *aMaxVal = proxy->MaxValue();
     *aStep = proxy->Step();
     return true;
   }
 
   return false;
 }
 
-void
-ProxyAccessibleWrap::WrapperDOMNodeID(nsString& aDOMNodeID)
-{
+void ProxyAccessibleWrap::WrapperDOMNodeID(nsString& aDOMNodeID) {
   Proxy()->DOMNodeID(aDOMNodeID);
 }
--- a/accessible/android/ProxyAccessibleWrap.h
+++ b/accessible/android/ProxyAccessibleWrap.h
@@ -16,19 +16,18 @@ namespace a11y {
 
 /**
  * A wrapper for Accessible proxies. The public methods here should be overriden
  * from AccessibleWrap or its super classes.
  * This gives us an abstraction layer so SessionAccessibility doesn't have
  * to distinguish between a local or remote accessibles.
  * NOTE: This shouldn't be regarded as a full Accessible implementation.
  */
-class ProxyAccessibleWrap : public AccessibleWrap
-{
-public:
+class ProxyAccessibleWrap : public AccessibleWrap {
+ public:
   explicit ProxyAccessibleWrap(ProxyAccessible* aProxy);
 
   virtual void Shutdown() override;
 
   // Accessible
 
   virtual already_AddRefed<nsIPersistentProperties> Attributes() override;
 
@@ -47,94 +46,89 @@ public:
   virtual void ScrollTo(uint32_t aHow) const override;
 
   // AccessibleWrap
 
   virtual void SetTextContents(const nsAString& aText) override;
 
   virtual void GetTextContents(nsAString& aText) override;
 
-  virtual bool GetSelectionBounds(int32_t* aStartOffset, int32_t* aEndOffset) override;
+  virtual bool GetSelectionBounds(int32_t* aStartOffset,
+                                  int32_t* aEndOffset) override;
 
   virtual void WrapperDOMNodeID(nsString& aDOMNodeID) override;
 
-private:
+ private:
   virtual role WrapperRole() override;
 
   virtual AccessibleWrap* WrapperParent() override;
 
-  virtual bool WrapperRangeInfo(double* aCurVal, double* aMinVal, double* aMaxVal, double* aStep) override;
+  virtual bool WrapperRangeInfo(double* aCurVal, double* aMinVal,
+                                double* aMaxVal, double* aStep) override;
 };
 
-class DocProxyAccessibleWrap : public ProxyAccessibleWrap
-{
-public:
+class DocProxyAccessibleWrap : public ProxyAccessibleWrap {
+ public:
   explicit DocProxyAccessibleWrap(DocAccessibleParent* aProxy)
-    : ProxyAccessibleWrap(aProxy)
-  {
+      : ProxyAccessibleWrap(aProxy) {
     mGenericTypes |= eDocument;
 
     if (auto parent = ParentDocument()) {
       mID = AcquireID();
       parent->AddID(mID, this);
     } else {
       // top level
       mID = kNoID;
     }
   }
 
-  virtual void Shutdown() override
-  {
+  virtual void Shutdown() override {
     if (mID) {
       auto parent = ParentDocument();
       if (parent) {
         MOZ_ASSERT(mID != kNoID, "A non root accessible always has a parent");
         parent->RemoveID(mID);
         ReleaseID(mID);
       }
     }
     mID = 0;
     mBits.proxy = nullptr;
     mStateFlags |= eIsDefunct;
   }
 
-  DocProxyAccessibleWrap* ParentDocument()
-  {
+  DocProxyAccessibleWrap* ParentDocument() {
     DocAccessibleParent* proxy = static_cast<DocAccessibleParent*>(Proxy());
     MOZ_ASSERT(proxy);
     if (DocAccessibleParent* parent = proxy->ParentDoc()) {
       return reinterpret_cast<DocProxyAccessibleWrap*>(parent->GetWrapper());
     }
 
     return nullptr;
   }
 
-  DocProxyAccessibleWrap* GetChildDocumentAt(uint32_t aIndex)
-  {
+  DocProxyAccessibleWrap* GetChildDocumentAt(uint32_t aIndex) {
     auto doc = Proxy()->AsDoc();
     if (doc && doc->ChildDocCount() > aIndex) {
       return reinterpret_cast<DocProxyAccessibleWrap*>(
-        doc->ChildDocAt(aIndex)->GetWrapper());
+          doc->ChildDocAt(aIndex)->GetWrapper());
     }
 
     return nullptr;
   }
 
-  void AddID(uint32_t aID, AccessibleWrap* aAcc)
-  {
+  void AddID(uint32_t aID, AccessibleWrap* aAcc) {
     mIDToAccessibleMap.Put(aID, aAcc);
   }
   void RemoveID(uint32_t aID) { mIDToAccessibleMap.Remove(aID); }
-  AccessibleWrap* GetAccessibleByID(uint32_t aID) const
-  {
+  AccessibleWrap* GetAccessibleByID(uint32_t aID) const {
     return mIDToAccessibleMap.Get(aID);
   }
 
-private:
+ private:
   /*
    * This provides a mapping from 32 bit id to accessible objects.
    */
   nsDataHashtable<nsUint32HashKey, AccessibleWrap*> mIDToAccessibleMap;
 };
-}
-}
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/RootAccessibleWrap.cpp
+++ b/accessible/android/RootAccessibleWrap.cpp
@@ -10,25 +10,21 @@
 #include "DocAccessibleParent.h"
 #include "ProxyAccessibleWrap.h"
 #include "SessionAccessibility.h"
 
 using namespace mozilla::a11y;
 
 RootAccessibleWrap::RootAccessibleWrap(nsIDocument* aDoc,
                                        nsIPresShell* aPresShell)
-  : RootAccessible(aDoc, aPresShell)
-{
-}
+    : RootAccessible(aDoc, aPresShell) {}
 
 RootAccessibleWrap::~RootAccessibleWrap() {}
 
-AccessibleWrap*
-RootAccessibleWrap::GetContentAccessible()
-{
+AccessibleWrap* RootAccessibleWrap::GetContentAccessible() {
   if (ProxyAccessible* proxy = GetPrimaryRemoteTopLevelContentDoc()) {
     return WrapperFor(proxy);
   }
 
   // Find first document that is not defunct or hidden.
   // This is exclusively for Fennec which has a deck of browser elements.
   // Otherwise, standard GeckoView will only have one browser element.
   for (size_t i = 0; i < ChildDocumentCount(); i++) {
@@ -36,64 +32,59 @@ RootAccessibleWrap::GetContentAccessible
     if (childDoc && !childDoc->IsDefunct() && !childDoc->IsHidden()) {
       return childDoc;
     }
   }
 
   return nullptr;
 }
 
-AccessibleWrap*
-RootAccessibleWrap::FindAccessibleById(int32_t aID)
-{
+AccessibleWrap* RootAccessibleWrap::FindAccessibleById(int32_t aID) {
   AccessibleWrap* contentAcc = GetContentAccessible();
 
   if (!contentAcc) {
     return nullptr;
   }
 
   if (aID == AccessibleWrap::kNoID) {
     return contentAcc;
   }
 
   if (contentAcc->IsProxy()) {
     return FindAccessibleById(static_cast<DocProxyAccessibleWrap*>(contentAcc),
                               aID);
   }
 
   return FindAccessibleById(
-    static_cast<DocAccessibleWrap*>(contentAcc->AsDoc()), aID);
+      static_cast<DocAccessibleWrap*>(contentAcc->AsDoc()), aID);
 }
 
-AccessibleWrap*
-RootAccessibleWrap::FindAccessibleById(DocProxyAccessibleWrap* aDoc,
-                                       int32_t aID)
-{
+AccessibleWrap* RootAccessibleWrap::FindAccessibleById(
+    DocProxyAccessibleWrap* aDoc, int32_t aID) {
   AccessibleWrap* acc = aDoc->GetAccessibleByID(aID);
   uint32_t index = 0;
   while (!acc) {
     auto child =
-      static_cast<DocProxyAccessibleWrap*>(aDoc->GetChildDocumentAt(index++));
+        static_cast<DocProxyAccessibleWrap*>(aDoc->GetChildDocumentAt(index++));
     if (!child) {
       break;
     }
     acc = FindAccessibleById(child, aID);
   }
 
   return acc;
 }
 
-AccessibleWrap*
-RootAccessibleWrap::FindAccessibleById(DocAccessibleWrap* aDoc, int32_t aID)
-{
+AccessibleWrap* RootAccessibleWrap::FindAccessibleById(DocAccessibleWrap* aDoc,
+                                                       int32_t aID) {
   AccessibleWrap* acc = aDoc->GetAccessibleByID(aID);
   uint32_t index = 0;
   while (!acc) {
     auto child =
-      static_cast<DocAccessibleWrap*>(aDoc->GetChildDocumentAt(index++));
+        static_cast<DocAccessibleWrap*>(aDoc->GetChildDocumentAt(index++));
     if (!child) {
       break;
     }
     acc = FindAccessibleById(child, aID);
   }
 
   return acc;
 }
--- a/accessible/android/RootAccessibleWrap.h
+++ b/accessible/android/RootAccessibleWrap.h
@@ -8,30 +8,29 @@
 
 #include "RootAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 class DocProxyAccessibleWrap;
 
-class RootAccessibleWrap : public RootAccessible
-{
-public:
+class RootAccessibleWrap : public RootAccessible {
+ public:
   RootAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
   virtual ~RootAccessibleWrap();
 
   AccessibleWrap* GetContentAccessible();
 
   AccessibleWrap* FindAccessibleById(int32_t aID);
 
   // Recursively searches for the accessible ID within the document tree.
   AccessibleWrap* FindAccessibleById(DocAccessibleWrap* aDocument, int32_t aID);
 
   // Recursively searches for the accessible ID within the proxy document tree.
   AccessibleWrap* FindAccessibleById(DocProxyAccessibleWrap* aDocument,
                                      int32_t aID);
 };
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/SessionAccessibility.cpp
+++ b/accessible/android/SessionAccessibility.cpp
@@ -16,130 +16,116 @@
 #include "nsIPersistentProperties2.h"
 
 #include "mozilla/dom/TabParent.h"
 #include "mozilla/a11y/DocAccessibleParent.h"
 #include "mozilla/a11y/DocManager.h"
 
 #ifdef DEBUG
 #include <android/log.h>
-#define AALOG(args...)                                                         \
+#define AALOG(args...) \
   __android_log_print(ANDROID_LOG_INFO, "GeckoAccessibilityNative", ##args)
 #else
-#define AALOG(args...)                                                         \
-  do {                                                                         \
+#define AALOG(args...) \
+  do {                 \
   } while (0)
 #endif
 
-template<>
+template <>
 const char nsWindow::NativePtr<mozilla::a11y::SessionAccessibility>::sName[] =
-  "SessionAccessibility";
+    "SessionAccessibility";
 
 using namespace mozilla::a11y;
 
 class Settings final
-  : public mozilla::java::SessionAccessibility::Settings::Natives<Settings>
-{
-public:
-  static void ToggleNativeAccessibility(bool aEnable)
-  {
+    : public mozilla::java::SessionAccessibility::Settings::Natives<Settings> {
+ public:
+  static void ToggleNativeAccessibility(bool aEnable) {
     if (aEnable) {
       GetOrCreateAccService();
     } else {
       MaybeShutdownAccService(nsAccessibilityService::ePlatformAPI);
     }
   }
 };
 
-void
-SessionAccessibility::SetAttached(bool aAttached,
-                                  already_AddRefed<Runnable> aRunnable)
-{
+void SessionAccessibility::SetAttached(bool aAttached,
+                                       already_AddRefed<Runnable> aRunnable) {
   if (RefPtr<nsThread> uiThread = GetAndroidUiThread()) {
     uiThread->Dispatch(NS_NewRunnableFunction(
-      "SessionAccessibility::Attach",
-      [aAttached,
-       sa = java::SessionAccessibility::NativeProvider::GlobalRef(
-           mSessionAccessibility),
-       runnable = RefPtr<Runnable>(aRunnable)] {
-        sa->SetAttached(aAttached);
-        if (runnable) {
-          runnable->Run();
-        }
-      }));
+        "SessionAccessibility::Attach",
+        [aAttached,
+         sa = java::SessionAccessibility::NativeProvider::GlobalRef(
+             mSessionAccessibility),
+         runnable = RefPtr<Runnable>(aRunnable)] {
+          sa->SetAttached(aAttached);
+          if (runnable) {
+            runnable->Run();
+          }
+        }));
   }
 }
 
-void
-SessionAccessibility::Init()
-{
+void SessionAccessibility::Init() {
   java::SessionAccessibility::NativeProvider::Natives<
-    SessionAccessibility>::Init();
+      SessionAccessibility>::Init();
   Settings::Init();
 }
 
-mozilla::jni::Object::LocalRef
-SessionAccessibility::GetNodeInfo(int32_t aID)
-{
+mozilla::jni::Object::LocalRef SessionAccessibility::GetNodeInfo(int32_t aID) {
   java::GeckoBundle::GlobalRef ret = nullptr;
   RefPtr<SessionAccessibility> self(this);
   nsAppShell::SyncRunEvent([this, self, aID, &ret] {
     if (RootAccessibleWrap* rootAcc = GetRoot()) {
       AccessibleWrap* acc = rootAcc->FindAccessibleById(aID);
       if (acc) {
         ret = acc->ToBundle();
       } else {
         AALOG("oops, nothing for %d", aID);
       }
     }
   });
 
   return mozilla::jni::Object::Ref::From(ret);
 }
 
-RootAccessibleWrap*
-SessionAccessibility::GetRoot()
-{
+RootAccessibleWrap* SessionAccessibility::GetRoot() {
   if (!mWindow) {
     return nullptr;
   }
 
   return static_cast<RootAccessibleWrap*>(mWindow->GetRootAccessible());
 }
 
-void
-SessionAccessibility::SetText(int32_t aID, jni::String::Param aText)
-{
+void SessionAccessibility::SetText(int32_t aID, jni::String::Param aText) {
   if (RootAccessibleWrap* rootAcc = GetRoot()) {
     AccessibleWrap* acc = rootAcc->FindAccessibleById(aID);
     if (!acc) {
       return;
     }
 
     acc->SetTextContents(aText->ToString());
   }
 }
 
-SessionAccessibility*
-SessionAccessibility::GetInstanceFor(ProxyAccessible* aAccessible)
-{
+SessionAccessibility* SessionAccessibility::GetInstanceFor(
+    ProxyAccessible* aAccessible) {
   auto tab = static_cast<dom::TabParent*>(aAccessible->Document()->Manager());
   dom::Element* frame = tab->GetOwnerElement();
   MOZ_ASSERT(frame);
   if (!frame) {
     return nullptr;
   }
 
   Accessible* chromeDoc = GetExistingDocAccessible(frame->OwnerDoc());
   return chromeDoc ? GetInstanceFor(chromeDoc) : nullptr;
 }
 
-SessionAccessibility*
-SessionAccessibility::GetInstanceFor(Accessible* aAccessible)
-{
+SessionAccessibility* SessionAccessibility::GetInstanceFor(
+    Accessible* aAccessible) {
   RootAccessible* rootAcc = aAccessible->RootAccessible();
   nsIPresShell* shell = rootAcc->PresShell();
   nsViewManager* vm = shell->GetViewManager();
   if (!vm) {
     return nullptr;
   }
 
   nsCOMPtr<nsIWidget> rootWidget;
@@ -148,126 +134,116 @@ SessionAccessibility::GetInstanceFor(Acc
   // android nsWindow.
   if (RefPtr<nsWindow> window = nsWindow::From(rootWidget)) {
     return window->GetSessionAccessibility();
   }
 
   return nullptr;
 }
 
-void
-SessionAccessibility::SendAccessibilityFocusedEvent(AccessibleWrap* aAccessible)
-{
+void SessionAccessibility::SendAccessibilityFocusedEvent(
+    AccessibleWrap* aAccessible) {
   mSessionAccessibility->SendEvent(
-    java::sdk::AccessibilityEvent::TYPE_VIEW_ACCESSIBILITY_FOCUSED,
-    aAccessible->VirtualViewID(), aAccessible->AndroidClass(), nullptr);
+      java::sdk::AccessibilityEvent::TYPE_VIEW_ACCESSIBILITY_FOCUSED,
+      aAccessible->VirtualViewID(), aAccessible->AndroidClass(), nullptr);
   aAccessible->ScrollTo(nsIAccessibleScrollType::SCROLL_TYPE_ANYWHERE);
 }
 
-void
-SessionAccessibility::SendHoverEnterEvent(AccessibleWrap* aAccessible)
-{
+void SessionAccessibility::SendHoverEnterEvent(AccessibleWrap* aAccessible) {
   mSessionAccessibility->SendEvent(
-    java::sdk::AccessibilityEvent::TYPE_VIEW_HOVER_ENTER,
-    aAccessible->VirtualViewID(), aAccessible->AndroidClass(), nullptr);
+      java::sdk::AccessibilityEvent::TYPE_VIEW_HOVER_ENTER,
+      aAccessible->VirtualViewID(), aAccessible->AndroidClass(), nullptr);
 }
 
-void
-SessionAccessibility::SendFocusEvent(AccessibleWrap* aAccessible)
-{
+void SessionAccessibility::SendFocusEvent(AccessibleWrap* aAccessible) {
   // Suppress focus events from about:blank pages.
   // This is important for tests.
   if (aAccessible->IsDoc() && aAccessible->ChildCount() == 0) {
     return;
   }
 
   mSessionAccessibility->SendEvent(
-    java::sdk::AccessibilityEvent::TYPE_VIEW_FOCUSED,
-    aAccessible->VirtualViewID(), aAccessible->AndroidClass(), nullptr);
+      java::sdk::AccessibilityEvent::TYPE_VIEW_FOCUSED,
+      aAccessible->VirtualViewID(), aAccessible->AndroidClass(), nullptr);
 }
 
-void
-SessionAccessibility::SendScrollingEvent(AccessibleWrap* aAccessible,
-                                         int32_t aScrollX,
-                                         int32_t aScrollY,
-                                         int32_t aMaxScrollX,
-                                         int32_t aMaxScrollY)
-{
+void SessionAccessibility::SendScrollingEvent(AccessibleWrap* aAccessible,
+                                              int32_t aScrollX,
+                                              int32_t aScrollY,
+                                              int32_t aMaxScrollX,
+                                              int32_t aMaxScrollY) {
   int32_t virtualViewId = aAccessible->VirtualViewID();
 
   if (virtualViewId != AccessibleWrap::kNoID) {
     // XXX: Support scrolling in subframes
     return;
   }
 
   GECKOBUNDLE_START(eventInfo);
   GECKOBUNDLE_PUT(eventInfo, "scrollX", java::sdk::Integer::ValueOf(aScrollX));
   GECKOBUNDLE_PUT(eventInfo, "scrollY", java::sdk::Integer::ValueOf(aScrollY));
-  GECKOBUNDLE_PUT(eventInfo, "maxScrollX", java::sdk::Integer::ValueOf(aMaxScrollX));
-  GECKOBUNDLE_PUT(eventInfo, "maxScrollY", java::sdk::Integer::ValueOf(aMaxScrollY));
+  GECKOBUNDLE_PUT(eventInfo, "maxScrollX",
+                  java::sdk::Integer::ValueOf(aMaxScrollX));
+  GECKOBUNDLE_PUT(eventInfo, "maxScrollY",
+                  java::sdk::Integer::ValueOf(aMaxScrollY));
   GECKOBUNDLE_FINISH(eventInfo);
 
   mSessionAccessibility->SendEvent(
-    java::sdk::AccessibilityEvent::TYPE_VIEW_SCROLLED, virtualViewId,
-    aAccessible->AndroidClass(), eventInfo);
+      java::sdk::AccessibilityEvent::TYPE_VIEW_SCROLLED, virtualViewId,
+      aAccessible->AndroidClass(), eventInfo);
 
   SendWindowContentChangedEvent(aAccessible);
 }
 
-void
-SessionAccessibility::SendWindowContentChangedEvent(AccessibleWrap* aAccessible)
-{
+void SessionAccessibility::SendWindowContentChangedEvent(
+    AccessibleWrap* aAccessible) {
   mSessionAccessibility->SendEvent(
-    java::sdk::AccessibilityEvent::TYPE_WINDOW_CONTENT_CHANGED,
-    aAccessible->VirtualViewID(), aAccessible->AndroidClass(), nullptr);
+      java::sdk::AccessibilityEvent::TYPE_WINDOW_CONTENT_CHANGED,
+      aAccessible->VirtualViewID(), aAccessible->AndroidClass(), nullptr);
 }
 
-void
-SessionAccessibility::SendWindowStateChangedEvent(AccessibleWrap* aAccessible)
-{
+void SessionAccessibility::SendWindowStateChangedEvent(
+    AccessibleWrap* aAccessible) {
   // Suppress window state changed events from about:blank pages.
   // This is important for tests.
   if (aAccessible->IsDoc() && aAccessible->ChildCount() == 0) {
     return;
   }
 
   mSessionAccessibility->SendEvent(
-    java::sdk::AccessibilityEvent::TYPE_WINDOW_STATE_CHANGED,
-    aAccessible->VirtualViewID(), aAccessible->AndroidClass(), nullptr);
+      java::sdk::AccessibilityEvent::TYPE_WINDOW_STATE_CHANGED,
+      aAccessible->VirtualViewID(), aAccessible->AndroidClass(), nullptr);
 }
 
-void
-SessionAccessibility::SendTextSelectionChangedEvent(AccessibleWrap* aAccessible,
-                                                    int32_t aCaretOffset)
-{
+void SessionAccessibility::SendTextSelectionChangedEvent(
+    AccessibleWrap* aAccessible, int32_t aCaretOffset) {
   int32_t fromIndex = aCaretOffset;
   int32_t startSel = -1;
   int32_t endSel = -1;
   if (aAccessible->GetSelectionBounds(&startSel, &endSel)) {
     fromIndex = startSel == aCaretOffset ? endSel : startSel;
   }
 
   GECKOBUNDLE_START(eventInfo);
-  GECKOBUNDLE_PUT(eventInfo, "fromIndex", java::sdk::Integer::ValueOf(fromIndex));
-  GECKOBUNDLE_PUT(eventInfo, "toIndex", java::sdk::Integer::ValueOf(aCaretOffset));
+  GECKOBUNDLE_PUT(eventInfo, "fromIndex",
+                  java::sdk::Integer::ValueOf(fromIndex));
+  GECKOBUNDLE_PUT(eventInfo, "toIndex",
+                  java::sdk::Integer::ValueOf(aCaretOffset));
   GECKOBUNDLE_FINISH(eventInfo);
 
   mSessionAccessibility->SendEvent(
-    java::sdk::AccessibilityEvent::TYPE_VIEW_TEXT_SELECTION_CHANGED,
-    aAccessible->VirtualViewID(), aAccessible->AndroidClass(), eventInfo);
+      java::sdk::AccessibilityEvent::TYPE_VIEW_TEXT_SELECTION_CHANGED,
+      aAccessible->VirtualViewID(), aAccessible->AndroidClass(), eventInfo);
 }
 
-void
-SessionAccessibility::SendTextChangedEvent(AccessibleWrap* aAccessible,
-                                           const nsString& aStr,
-                                           int32_t aStart,
-                                           uint32_t aLen,
-                                           bool aIsInsert,
-                                           bool aFromUser)
-{
+void SessionAccessibility::SendTextChangedEvent(AccessibleWrap* aAccessible,
+                                                const nsString& aStr,
+                                                int32_t aStart, uint32_t aLen,
+                                                bool aIsInsert,
+                                                bool aFromUser) {
   if (!aFromUser) {
     // Only dispatch text change events from users, for now.
     return;
   }
 
   nsAutoString text;
   aAccessible->GetTextContents(text);
   nsAutoString beforeText(text);
@@ -275,124 +251,117 @@ SessionAccessibility::SendTextChangedEve
     beforeText.Cut(aStart, aLen);
   } else {
     beforeText.Insert(aStr, aStart);
   }
 
   GECKOBUNDLE_START(eventInfo);
   GECKOBUNDLE_PUT(eventInfo, "text", jni::StringParam(text));
   GECKOBUNDLE_PUT(eventInfo, "beforeText", jni::StringParam(beforeText));
-  GECKOBUNDLE_PUT(eventInfo, "addedCount", java::sdk::Integer::ValueOf(aIsInsert ? aLen : 0));
-  GECKOBUNDLE_PUT(eventInfo, "removedCount", java::sdk::Integer::ValueOf(aIsInsert ? 0 : aLen));
+  GECKOBUNDLE_PUT(eventInfo, "addedCount",
+                  java::sdk::Integer::ValueOf(aIsInsert ? aLen : 0));
+  GECKOBUNDLE_PUT(eventInfo, "removedCount",
+                  java::sdk::Integer::ValueOf(aIsInsert ? 0 : aLen));
   GECKOBUNDLE_FINISH(eventInfo);
 
   mSessionAccessibility->SendEvent(
-    java::sdk::AccessibilityEvent::TYPE_VIEW_TEXT_CHANGED,
-    aAccessible->VirtualViewID(), aAccessible->AndroidClass(), eventInfo);
+      java::sdk::AccessibilityEvent::TYPE_VIEW_TEXT_CHANGED,
+      aAccessible->VirtualViewID(), aAccessible->AndroidClass(), eventInfo);
 }
 
-void
-SessionAccessibility::SendTextTraversedEvent(AccessibleWrap* aAccessible,
-                                             int32_t aStartOffset,
-                                             int32_t aEndOffset)
-{
+void SessionAccessibility::SendTextTraversedEvent(AccessibleWrap* aAccessible,
+                                                  int32_t aStartOffset,
+                                                  int32_t aEndOffset) {
   nsAutoString text;
   aAccessible->GetTextContents(text);
 
   GECKOBUNDLE_START(eventInfo);
   GECKOBUNDLE_PUT(eventInfo, "text", jni::StringParam(text));
-  GECKOBUNDLE_PUT(eventInfo, "fromIndex", java::sdk::Integer::ValueOf(aStartOffset));
-  GECKOBUNDLE_PUT(eventInfo, "toIndex", java::sdk::Integer::ValueOf(aEndOffset));
+  GECKOBUNDLE_PUT(eventInfo, "fromIndex",
+                  java::sdk::Integer::ValueOf(aStartOffset));
+  GECKOBUNDLE_PUT(eventInfo, "toIndex",
+                  java::sdk::Integer::ValueOf(aEndOffset));
   GECKOBUNDLE_FINISH(eventInfo);
 
   mSessionAccessibility->SendEvent(
-    java::sdk::AccessibilityEvent::
-      TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY,
-    aAccessible->VirtualViewID(), aAccessible->AndroidClass(), eventInfo);
+      java::sdk::AccessibilityEvent::
+          TYPE_VIEW_TEXT_TRAVERSED_AT_MOVEMENT_GRANULARITY,
+      aAccessible->VirtualViewID(), aAccessible->AndroidClass(), eventInfo);
 }
 
-void
-SessionAccessibility::SendClickedEvent(AccessibleWrap* aAccessible, bool aChecked)
-{
+void SessionAccessibility::SendClickedEvent(AccessibleWrap* aAccessible,
+                                            bool aChecked) {
   GECKOBUNDLE_START(eventInfo);
   // Boolean::FALSE/TRUE gets clobbered by a macro, so ugh.
-  GECKOBUNDLE_PUT(eventInfo, "checked", java::sdk::Integer::ValueOf(aChecked ? 1 : 0));
+  GECKOBUNDLE_PUT(eventInfo, "checked",
+                  java::sdk::Integer::ValueOf(aChecked ? 1 : 0));
   GECKOBUNDLE_FINISH(eventInfo);
 
   mSessionAccessibility->SendEvent(
-    java::sdk::AccessibilityEvent::TYPE_VIEW_CLICKED,
-    aAccessible->VirtualViewID(), aAccessible->AndroidClass(), eventInfo);
+      java::sdk::AccessibilityEvent::TYPE_VIEW_CLICKED,
+      aAccessible->VirtualViewID(), aAccessible->AndroidClass(), eventInfo);
 }
 
-void
-SessionAccessibility::SendSelectedEvent(AccessibleWrap* aAccessible, bool aSelected)
-{
+void SessionAccessibility::SendSelectedEvent(AccessibleWrap* aAccessible,
+                                             bool aSelected) {
   GECKOBUNDLE_START(eventInfo);
   // Boolean::FALSE/TRUE gets clobbered by a macro, so ugh.
-  GECKOBUNDLE_PUT(eventInfo, "selected", java::sdk::Integer::ValueOf(aSelected ? 1 : 0));
+  GECKOBUNDLE_PUT(eventInfo, "selected",
+                  java::sdk::Integer::ValueOf(aSelected ? 1 : 0));
   GECKOBUNDLE_FINISH(eventInfo);
 
   mSessionAccessibility->SendEvent(
-    java::sdk::AccessibilityEvent::TYPE_VIEW_SELECTED,
-    aAccessible->VirtualViewID(), aAccessible->AndroidClass(), eventInfo);
+      java::sdk::AccessibilityEvent::TYPE_VIEW_SELECTED,
+      aAccessible->VirtualViewID(), aAccessible->AndroidClass(), eventInfo);
 }
 
-void
-SessionAccessibility::ReplaceViewportCache(const nsTArray<AccessibleWrap*>& aAccessibles,
-                                          const nsTArray<BatchData>& aData)
-{
+void SessionAccessibility::ReplaceViewportCache(
+    const nsTArray<AccessibleWrap*>& aAccessibles,
+    const nsTArray<BatchData>& aData) {
   auto infos = jni::ObjectArray::New<java::GeckoBundle>(aAccessibles.Length());
   for (size_t i = 0; i < aAccessibles.Length(); i++) {
     AccessibleWrap* acc = aAccessibles.ElementAt(i);
     if (aData.Length() == aAccessibles.Length()) {
       const BatchData& data = aData.ElementAt(i);
       auto bundle = acc->ToSmallBundle(data.State(), data.Bounds());
       infos->SetElement(i, bundle);
     } else {
       infos->SetElement(i, acc->ToSmallBundle());
     }
   }
 
   mSessionAccessibility->ReplaceViewportCache(infos);
 }
 
-void
-SessionAccessibility::ReplaceFocusPathCache(const nsTArray<AccessibleWrap*>& aAccessibles,
-                                            const nsTArray<BatchData>& aData)
-{
+void SessionAccessibility::ReplaceFocusPathCache(
+    const nsTArray<AccessibleWrap*>& aAccessibles,
+    const nsTArray<BatchData>& aData) {
   auto infos = jni::ObjectArray::New<java::GeckoBundle>(aAccessibles.Length());
   for (size_t i = 0; i < aAccessibles.Length(); i++) {
     AccessibleWrap* acc = aAccessibles.ElementAt(i);
     if (aData.Length() == aAccessibles.Length()) {
       const BatchData& data = aData.ElementAt(i);
       nsCOMPtr<nsIPersistentProperties> props =
-        AccessibleWrap::AttributeArrayToProperties(data.Attributes());
-      auto bundle = acc->ToBundle(data.State(),
-                                  data.Bounds(),
-                                  data.Name(),
-                                  data.TextValue(),
-                                  data.DOMNodeID(),
-                                  data.CurValue(),
-                                  data.MinValue(),
-                                  data.MaxValue(),
-                                  data.Step(),
-                                  props);
+          AccessibleWrap::AttributeArrayToProperties(data.Attributes());
+      auto bundle =
+          acc->ToBundle(data.State(), data.Bounds(), data.Name(),
+                        data.TextValue(), data.DOMNodeID(), data.CurValue(),
+                        data.MinValue(), data.MaxValue(), data.Step(), props);
       infos->SetElement(i, bundle);
     } else {
       infos->SetElement(i, acc->ToBundle());
     }
   }
 
   mSessionAccessibility->ReplaceFocusPathCache(infos);
 }
 
-void
-SessionAccessibility::UpdateCachedBounds(const nsTArray<AccessibleWrap*>& aAccessibles,
-                                         const nsTArray<BatchData>& aData)
-{
+void SessionAccessibility::UpdateCachedBounds(
+    const nsTArray<AccessibleWrap*>& aAccessibles,
+    const nsTArray<BatchData>& aData) {
   auto infos = jni::ObjectArray::New<java::GeckoBundle>(aAccessibles.Length());
   for (size_t i = 0; i < aAccessibles.Length(); i++) {
     AccessibleWrap* acc = aAccessibles.ElementAt(i);
     if (aData.Length() == aAccessibles.Length()) {
       const BatchData& data = aData.ElementAt(i);
       auto bundle = acc->ToSmallBundle(data.State(), data.Bounds());
       infos->SetElement(i, bundle);
     } else {
--- a/accessible/android/SessionAccessibility.h
+++ b/accessible/android/SessionAccessibility.h
@@ -7,127 +7,121 @@
 #define mozilla_a11y_SessionAccessibility_h_
 
 #include "GeneratedJNINatives.h"
 #include "GeneratedJNIWrappers.h"
 #include "nsAppShell.h"
 #include "nsThreadUtils.h"
 #include "nsWindow.h"
 
-#define GECKOBUNDLE_START(name)                                                \
-  nsTArray<jni::String::LocalRef> _##name##_keys;                              \
+#define GECKOBUNDLE_START(name)                   \
+  nsTArray<jni::String::LocalRef> _##name##_keys; \
   nsTArray<jni::Object::LocalRef> _##name##_values;
 
-#define GECKOBUNDLE_PUT(name, key, value)                                      \
-  _##name##_keys.AppendElement(jni::StringParam(NS_LITERAL_STRING(key)));      \
+#define GECKOBUNDLE_PUT(name, key, value)                                 \
+  _##name##_keys.AppendElement(jni::StringParam(NS_LITERAL_STRING(key))); \
   _##name##_values.AppendElement(value);
 
-#define GECKOBUNDLE_FINISH(name)                                               \
-  MOZ_ASSERT(_##name##_keys.Length() == _##name##_values.Length());            \
-  auto _##name##_jkeys =                                                       \
-    jni::ObjectArray::New<jni::String>(_##name##_keys.Length());               \
-  auto _##name##_jvalues =                                                     \
-    jni::ObjectArray::New<jni::Object>(_##name##_values.Length());             \
-  for (size_t i = 0;                                                           \
-       i < _##name##_keys.Length() && i < _##name##_values.Length();           \
-       i++) {                                                                  \
-    _##name##_jkeys->SetElement(i, _##name##_keys.ElementAt(i));               \
-    _##name##_jvalues->SetElement(i, _##name##_values.ElementAt(i));           \
-  }                                                                            \
-  auto name =                                                                  \
-    mozilla::java::GeckoBundle::New(_##name##_jkeys, _##name##_jvalues);
+#define GECKOBUNDLE_FINISH(name)                                            \
+  MOZ_ASSERT(_##name##_keys.Length() == _##name##_values.Length());         \
+  auto _##name##_jkeys =                                                    \
+      jni::ObjectArray::New<jni::String>(_##name##_keys.Length());          \
+  auto _##name##_jvalues =                                                  \
+      jni::ObjectArray::New<jni::Object>(_##name##_values.Length());        \
+  for (size_t i = 0;                                                        \
+       i < _##name##_keys.Length() && i < _##name##_values.Length(); i++) { \
+    _##name##_jkeys->SetElement(i, _##name##_keys.ElementAt(i));            \
+    _##name##_jvalues->SetElement(i, _##name##_values.ElementAt(i));        \
+  }                                                                         \
+  auto name =                                                               \
+      mozilla::java::GeckoBundle::New(_##name##_jkeys, _##name##_jvalues);
 
 namespace mozilla {
 namespace a11y {
 
 class AccessibleWrap;
 class ProxyAccessible;
 class RootAccessibleWrap;
 class BatchData;
 
 class SessionAccessibility final
-  : public java::SessionAccessibility::NativeProvider::Natives<SessionAccessibility>
-{
-public:
-  typedef java::SessionAccessibility::NativeProvider::Natives<SessionAccessibility> Base;
+    : public java::SessionAccessibility::NativeProvider::Natives<
+          SessionAccessibility> {
+ public:
+  typedef java::SessionAccessibility::NativeProvider::Natives<
+      SessionAccessibility>
+      Base;
 
   SessionAccessibility(
-    nsWindow::NativePtr<SessionAccessibility>* aPtr,
-    nsWindow* aWindow,
-    java::SessionAccessibility::NativeProvider::Param aSessionAccessibility)
-    : mWindow(aPtr, aWindow)
-    , mSessionAccessibility(aSessionAccessibility)
-  {
+      nsWindow::NativePtr<SessionAccessibility>* aPtr, nsWindow* aWindow,
+      java::SessionAccessibility::NativeProvider::Param aSessionAccessibility)
+      : mWindow(aPtr, aWindow), mSessionAccessibility(aSessionAccessibility) {
     SetAttached(true, nullptr);
   }
 
-  void OnDetach(already_AddRefed<Runnable> aDisposer)
-  {
+  void OnDetach(already_AddRefed<Runnable> aDisposer) {
     SetAttached(false, std::move(aDisposer));
   }
 
-  const java::SessionAccessibility::NativeProvider::Ref& GetJavaAccessibility()
-  {
+  const java::SessionAccessibility::NativeProvider::Ref&
+  GetJavaAccessibility() {
     return mSessionAccessibility;
   }
 
   static void Init();
   static SessionAccessibility* GetInstanceFor(ProxyAccessible* aAccessible);
   static SessionAccessibility* GetInstanceFor(Accessible* aAccessible);
 
   // Native implementations
   using Base::AttachNative;
   using Base::DisposeNative;
   jni::Object::LocalRef GetNodeInfo(int32_t aID);
   void SetText(int32_t aID, jni::String::Param aText);
   void StartNativeAccessibility();
 
   // Event methods
   void SendFocusEvent(AccessibleWrap* aAccessible);
-  void SendScrollingEvent(AccessibleWrap* aAccessible,
-                          int32_t aScrollX,
-                          int32_t aScrollY,
-                          int32_t aMaxScrollX,
+  void SendScrollingEvent(AccessibleWrap* aAccessible, int32_t aScrollX,
+                          int32_t aScrollY, int32_t aMaxScrollX,
                           int32_t aMaxScrollY);
   void SendAccessibilityFocusedEvent(AccessibleWrap* aAccessible);
   void SendHoverEnterEvent(AccessibleWrap* aAccessible);
   void SendTextSelectionChangedEvent(AccessibleWrap* aAccessible,
                                      int32_t aCaretOffset);
-  void SendTextTraversedEvent(AccessibleWrap* aAccessible,
-                              int32_t aStartOffset,
+  void SendTextTraversedEvent(AccessibleWrap* aAccessible, int32_t aStartOffset,
                               int32_t aEndOffset);
-  void SendTextChangedEvent(AccessibleWrap* aAccessible,
-                            const nsString& aStr,
-                            int32_t aStart,
-                            uint32_t aLen,
-                            bool aIsInsert,
+  void SendTextChangedEvent(AccessibleWrap* aAccessible, const nsString& aStr,
+                            int32_t aStart, uint32_t aLen, bool aIsInsert,
                             bool aFromUser);
   void SendSelectedEvent(AccessibleWrap* aAccessible, bool aSelected);
   void SendClickedEvent(AccessibleWrap* aAccessible, bool aChecked);
   void SendWindowContentChangedEvent(AccessibleWrap* aAccessible);
   void SendWindowStateChangedEvent(AccessibleWrap* aAccessible);
 
   // Cache methods
-  void ReplaceViewportCache(const nsTArray<AccessibleWrap*>& aAccessibles,
-                           const nsTArray<BatchData>& aData = nsTArray<BatchData>());
+  void ReplaceViewportCache(
+      const nsTArray<AccessibleWrap*>& aAccessibles,
+      const nsTArray<BatchData>& aData = nsTArray<BatchData>());
 
-  void ReplaceFocusPathCache(const nsTArray<AccessibleWrap*>& aAccessibles,
-                             const nsTArray<BatchData>& aData = nsTArray<BatchData>());
+  void ReplaceFocusPathCache(
+      const nsTArray<AccessibleWrap*>& aAccessibles,
+      const nsTArray<BatchData>& aData = nsTArray<BatchData>());
 
-  void UpdateCachedBounds(const nsTArray<AccessibleWrap*>& aAccessibles,
-                          const nsTArray<BatchData>& aData = nsTArray<BatchData>());
+  void UpdateCachedBounds(
+      const nsTArray<AccessibleWrap*>& aAccessibles,
+      const nsTArray<BatchData>& aData = nsTArray<BatchData>());
 
   NS_INLINE_DECL_THREADSAFE_REFCOUNTING(SessionAccessibility)
 
-private:
+ private:
   ~SessionAccessibility() {}
 
   void SetAttached(bool aAttached, already_AddRefed<Runnable> aRunnable);
   RootAccessibleWrap* GetRoot();
 
-  nsWindow::WindowPtr<SessionAccessibility> mWindow; // Parent only
+  nsWindow::WindowPtr<SessionAccessibility> mWindow;  // Parent only
   java::SessionAccessibility::NativeProvider::GlobalRef mSessionAccessibility;
 };
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/TextLeafAccessibleWrap.h
+++ b/accessible/android/TextLeafAccessibleWrap.h
@@ -8,12 +8,12 @@
 
 #include "TextLeafAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class TextLeafAccessible TextLeafAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/XULListboxAccessibleWrap.h
+++ b/accessible/android/XULListboxAccessibleWrap.h
@@ -9,12 +9,12 @@
 #include "XULListboxAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class XULListboxAccessible XULListboxAccessibleWrap;
 typedef class XULListCellAccessible XULListCellAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/XULMenuAccessibleWrap.h
+++ b/accessible/android/XULMenuAccessibleWrap.h
@@ -8,12 +8,12 @@
 
 #include "XULMenuAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class XULMenuitemAccessible XULMenuitemAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/android/XULTreeGridAccessibleWrap.h
+++ b/accessible/android/XULTreeGridAccessibleWrap.h
@@ -9,12 +9,12 @@
 #include "XULTreeGridAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class XULTreeGridAccessible XULTreeGridAccessibleWrap;
 typedef class XULTreeGridCellAccessible XULTreeGridCellAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/aom/AccessibleNode.cpp
+++ b/accessible/aom/AccessibleNode.cpp
@@ -13,19 +13,17 @@
 #include "Accessible-inl.h"
 #include "nsAccessibilityService.h"
 #include "DocAccessible.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 using namespace mozilla::dom;
 
-bool
-AccessibleNode::IsAOMEnabled(JSContext* aCx, JSObject* /*unused*/)
-{
+bool AccessibleNode::IsAOMEnabled(JSContext* aCx, JSObject* /*unused*/) {
   static bool sPrefCached = false;
   static bool sPrefCacheValue = false;
 
   if (!sPrefCached) {
     sPrefCached = true;
     Preferences::AddBoolVarCache(&sPrefCacheValue, "accessibility.AOM.enabled");
   }
 
@@ -38,87 +36,75 @@ NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(Ac
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(AccessibleNode)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
   NS_INTERFACE_MAP_ENTRY(nsISupports)
 NS_INTERFACE_MAP_END
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(AccessibleNode)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(AccessibleNode)
 
-AccessibleNode::AccessibleNode(nsINode* aNode) :
-    mDoubleProperties(3),
-    mIntProperties(3),
-    mUIntProperties(6),
-    mBooleanProperties(0),
-    mRelationProperties(3),
-    mStringProperties(16),
-    mDOMNode(aNode)
-{
+AccessibleNode::AccessibleNode(nsINode* aNode)
+    : mDoubleProperties(3),
+      mIntProperties(3),
+      mUIntProperties(6),
+      mBooleanProperties(0),
+      mRelationProperties(3),
+      mStringProperties(16),
+      mDOMNode(aNode) {
   nsAccessibilityService* accService = GetOrCreateAccService();
   if (!accService) {
     return;
   }
 
   DocAccessible* doc = accService->GetDocAccessible(mDOMNode->OwnerDoc());
   if (doc) {
     mIntl = doc->GetAccessible(mDOMNode);
   }
 }
 
-AccessibleNode::~AccessibleNode()
-{
-}
+AccessibleNode::~AccessibleNode() {}
 
-/* virtual */ JSObject*
-AccessibleNode::WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto)
-{
+/* virtual */ JSObject* AccessibleNode::WrapObject(
+    JSContext* aCx, JS::Handle<JSObject*> aGivenProto) {
   return AccessibleNode_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-/* virtual */ ParentObject
-AccessibleNode::GetParentObject() const
-{
+/* virtual */ ParentObject AccessibleNode::GetParentObject() const {
   return mDOMNode->GetParentObject();
 }
 
-void
-AccessibleNode::GetComputedRole(nsAString& aRole)
-{
+void AccessibleNode::GetComputedRole(nsAString& aRole) {
   if (mIntl) {
     nsAccessibilityService* accService = GetOrCreateAccService();
     if (accService) {
       accService->GetStringRole(mIntl->Role(), aRole);
       return;
     }
   }
 
   aRole.AssignLiteral("unknown");
 }
 
-void
-AccessibleNode::GetStates(nsTArray<nsString>& aStates)
-{
+void AccessibleNode::GetStates(nsTArray<nsString>& aStates) {
   nsAccessibilityService* accService = GetOrCreateAccService();
   if (!mIntl || !accService) {
     aStates.AppendElement(NS_LITERAL_STRING("defunct"));
     return;
   }
 
   if (mStates) {
     aStates = mStates->StringArray();
     return;
   }
 
   mStates = accService->GetStringStates(mIntl->State());
   aStates = mStates->StringArray();
 }
 
-void
-AccessibleNode::GetAttributes(nsTArray<nsString>& aAttributes)
-{
+void AccessibleNode::GetAttributes(nsTArray<nsString>& aAttributes) {
   if (!mIntl) {
     return;
   }
 
   nsCOMPtr<nsIPersistentProperties> attrs = mIntl->Attributes();
 
   nsCOMPtr<nsISimpleEnumerator> props;
   attrs->Enumerate(getter_AddRefs(props));
@@ -131,23 +117,22 @@ AccessibleNode::GetAttributes(nsTArray<n
     nsCOMPtr<nsIPropertyElement> prop(do_QueryInterface(supp));
 
     nsAutoCString attr;
     prop->GetKey(attr);
     aAttributes.AppendElement(NS_ConvertUTF8toUTF16(attr));
   }
 }
 
-bool
-AccessibleNode::Is(const Sequence<nsString>& aFlavors)
-{
+bool AccessibleNode::Is(const Sequence<nsString>& aFlavors) {
   nsAccessibilityService* accService = GetOrCreateAccService();
   if (!mIntl || !accService) {
     for (const auto& flavor : aFlavors) {
-      if (!flavor.EqualsLiteral("unknown") && !flavor.EqualsLiteral("defunct")) {
+      if (!flavor.EqualsLiteral("unknown") &&
+          !flavor.EqualsLiteral("defunct")) {
         return false;
       }
     }
     return true;
   }
 
   nsAutoString role;
   accService->GetStringRole(mIntl->Role(), role);
@@ -159,38 +144,34 @@ AccessibleNode::Is(const Sequence<nsStri
   for (const auto& flavor : aFlavors) {
     if (!flavor.Equals(role) && !mStates->Contains(flavor)) {
       return false;
     }
   }
   return true;
 }
 
-bool
-AccessibleNode::Has(const Sequence<nsString>& aAttributes)
-{
+bool AccessibleNode::Has(const Sequence<nsString>& aAttributes) {
   if (!mIntl) {
     return false;
   }
   nsCOMPtr<nsIPersistentProperties> attrs = mIntl->Attributes();
   for (const auto& attr : aAttributes) {
     bool has = false;
     attrs->Has(NS_ConvertUTF16toUTF8(attr).get(), &has);
     if (!has) {
       return false;
     }
   }
   return true;
 }
 
-void
-AccessibleNode::Get(JSContext* aCX, const nsAString& aAttribute,
-                    JS::MutableHandle<JS::Value> aValue,
-                    ErrorResult& aRv)
-{
+void AccessibleNode::Get(JSContext* aCX, const nsAString& aAttribute,
+                         JS::MutableHandle<JS::Value> aValue,
+                         ErrorResult& aRv) {
   if (!mIntl) {
     aRv.Throw(NS_ERROR_DOM_INVALID_STATE_ERR);
     return;
   }
 
   nsCOMPtr<nsIPersistentProperties> attrs = mIntl->Attributes();
   nsAutoString value;
   attrs->GetStringProperty(NS_ConvertUTF16toUTF8(aAttribute), value);
@@ -199,13 +180,9 @@ AccessibleNode::Get(JSContext* aCX, cons
   if (!ToJSValue(aCX, value, &jsval)) {
     aRv.Throw(NS_ERROR_UNEXPECTED);
     return;
   }
 
   aValue.set(jsval);
 }
 
-nsINode*
-AccessibleNode::GetDOMNode()
-{
-  return mDOMNode;
-}
+nsINode* AccessibleNode::GetDOMNode() { return mDOMNode; }
--- a/accessible/aom/AccessibleNode.h
+++ b/accessible/aom/AccessibleNode.h
@@ -14,186 +14,130 @@
 #include "mozilla/dom/BindingDeclarations.h"
 #include "mozilla/dom/Nullable.h"
 
 class nsINode;
 
 namespace mozilla {
 
 namespace a11y {
-  class Accessible;
+class Accessible;
 }
 
 namespace dom {
 
 class DOMStringList;
 struct ParentObject;
 
-#define ANODE_ENUM(name) \
-    e##name,
+#define ANODE_ENUM(name) e##name,
 
 #define ANODE_FUNC(typeName, type, name)                    \
-  dom::Nullable<type> Get##name()                           \
-  {                                                         \
+  dom::Nullable<type> Get##name() {                         \
     return GetProperty(AOM##typeName##Property::e##name);   \
   }                                                         \
                                                             \
-  void Set##name(const dom::Nullable<type>& a##name)        \
-  {                                                         \
+  void Set##name(const dom::Nullable<type>& a##name) {      \
     SetProperty(AOM##typeName##Property::e##name, a##name); \
-  }                                                         \
+  }
 
 #define ANODE_STRING_FUNC(name)                              \
-  void Get##name(nsAString& a##name)                         \
-  {                                                          \
+  void Get##name(nsAString& a##name) {                       \
     return GetProperty(AOMStringProperty::e##name, a##name); \
   }                                                          \
                                                              \
-  void Set##name(const nsAString& a##name)                   \
-  {                                                          \
+  void Set##name(const nsAString& a##name) {                 \
     SetProperty(AOMStringProperty::e##name, a##name);        \
-  }                                                          \
+  }
 
 #define ANODE_RELATION_FUNC(name)                       \
-  already_AddRefed<AccessibleNode> Get##name()          \
-  {                                                     \
+  already_AddRefed<AccessibleNode> Get##name() {        \
     return GetProperty(AOMRelationProperty::e##name);   \
   }                                                     \
                                                         \
-  void Set##name(AccessibleNode* a##name)               \
-  {                                                     \
+  void Set##name(AccessibleNode* a##name) {             \
     SetProperty(AOMRelationProperty::e##name, a##name); \
-  }                                                     \
+  }
 
-#define ANODE_PROPS(typeName, type, ...)                     \
-  enum class AOM##typeName##Property {                       \
-    MOZ_FOR_EACH(ANODE_ENUM, (), (__VA_ARGS__))              \
-  };                                                         \
-  MOZ_FOR_EACH(ANODE_FUNC, (typeName, type,), (__VA_ARGS__)) \
+#define ANODE_PROPS(typeName, type, ...)            \
+  enum class AOM##typeName##Property{               \
+      MOZ_FOR_EACH(ANODE_ENUM, (), (__VA_ARGS__))}; \
+  MOZ_FOR_EACH(ANODE_FUNC, (typeName, type, ), (__VA_ARGS__))
 
-#define ANODE_STRING_PROPS(...)                               \
-  enum class AOMStringProperty {                              \
-    MOZ_FOR_EACH(ANODE_ENUM, (), (__VA_ARGS__))               \
-  };                                                          \
-  MOZ_FOR_EACH(ANODE_STRING_FUNC, (), (__VA_ARGS__))          \
+#define ANODE_STRING_PROPS(...)                 \
+  enum class AOMStringProperty {                \
+    MOZ_FOR_EACH(ANODE_ENUM, (), (__VA_ARGS__)) \
+  };                                            \
+  MOZ_FOR_EACH(ANODE_STRING_FUNC, (), (__VA_ARGS__))
 
-#define ANODE_RELATION_PROPS(...)                               \
-  enum class AOMRelationProperty {                              \
-    MOZ_FOR_EACH(ANODE_ENUM, (), (__VA_ARGS__))                 \
-  };                                                            \
-  MOZ_FOR_EACH(ANODE_RELATION_FUNC, (), (__VA_ARGS__))          \
+#define ANODE_RELATION_PROPS(...)               \
+  enum class AOMRelationProperty {              \
+    MOZ_FOR_EACH(ANODE_ENUM, (), (__VA_ARGS__)) \
+  };                                            \
+  MOZ_FOR_EACH(ANODE_RELATION_FUNC, (), (__VA_ARGS__))
 
-#define ANODE_ACCESSOR_MUTATOR(typeName, type, defVal)                          \
-  nsDataHashtable<nsUint32HashKey, type> m##typeName##Properties;               \
-                                                                                \
-  dom::Nullable<type> GetProperty(AOM##typeName##Property aProperty)            \
-  {                                                                             \
-    type value = defVal;                                                        \
-    if (m##typeName##Properties.Get(static_cast<int>(aProperty), &value)) {     \
-      return dom::Nullable<type>(value);                                        \
-    }                                                                           \
-    return dom::Nullable<type>();                                               \
-  }                                                                             \
-                                                                                \
-  void SetProperty(AOM##typeName##Property aProperty,                           \
-                   const dom::Nullable<type>& aValue)                           \
-  {                                                                             \
-    if (aValue.IsNull()) {                                                      \
-      m##typeName##Properties.Remove(static_cast<int>(aProperty));              \
-    } else {                                                                    \
-      m##typeName##Properties.Put(static_cast<int>(aProperty), aValue.Value()); \
-    }                                                                           \
-  }                                                                             \
+#define ANODE_ACCESSOR_MUTATOR(typeName, type, defVal)                      \
+  nsDataHashtable<nsUint32HashKey, type> m##typeName##Properties;           \
+                                                                            \
+  dom::Nullable<type> GetProperty(AOM##typeName##Property aProperty) {      \
+    type value = defVal;                                                    \
+    if (m##typeName##Properties.Get(static_cast<int>(aProperty), &value)) { \
+      return dom::Nullable<type>(value);                                    \
+    }                                                                       \
+    return dom::Nullable<type>();                                           \
+  }                                                                         \
+                                                                            \
+  void SetProperty(AOM##typeName##Property aProperty,                       \
+                   const dom::Nullable<type>& aValue) {                     \
+    if (aValue.IsNull()) {                                                  \
+      m##typeName##Properties.Remove(static_cast<int>(aProperty));          \
+    } else {                                                                \
+      m##typeName##Properties.Put(static_cast<int>(aProperty),              \
+                                  aValue.Value());                          \
+    }                                                                       \
+  }
 
-class AccessibleNode : public nsISupports,
-                       public nsWrapperCache
-{
-public:
+class AccessibleNode : public nsISupports, public nsWrapperCache {
+ public:
   explicit AccessibleNode(nsINode* aNode);
 
   NS_DECL_CYCLE_COLLECTING_ISUPPORTS;
   NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(AccessibleNode);
 
   JSObject* WrapObject(JSContext* aCx, JS::Handle<JSObject*> aGivenProto) final;
   dom::ParentObject GetParentObject() const;
 
   void GetComputedRole(nsAString& aRole);
   void GetStates(nsTArray<nsString>& aStates);
   void GetAttributes(nsTArray<nsString>& aAttributes);
   nsINode* GetDOMNode();
 
   bool Is(const Sequence<nsString>& aFlavors);
   bool Has(const Sequence<nsString>& aAttributes);
   void Get(JSContext* cx, const nsAString& aAttribute,
-           JS::MutableHandle<JS::Value> aValue,
-           ErrorResult& aRv);
+           JS::MutableHandle<JS::Value> aValue, ErrorResult& aRv);
 
   static bool IsAOMEnabled(JSContext*, JSObject*);
 
-  ANODE_STRING_PROPS(
-    Autocomplete,
-    Checked,
-    Current,
-    HasPopUp,
-    Invalid,
-    KeyShortcuts,
-    Label,
-    Live,
-    Orientation,
-    Placeholder,
-    Pressed,
-    Relevant,
-    Role,
-    RoleDescription,
-    Sort,
-    ValueText
-  )
+  ANODE_STRING_PROPS(Autocomplete, Checked, Current, HasPopUp, Invalid,
+                     KeyShortcuts, Label, Live, Orientation, Placeholder,
+                     Pressed, Relevant, Role, RoleDescription, Sort, ValueText)
+
+  ANODE_PROPS(Boolean, bool, Atomic, Busy, Disabled, Expanded, Hidden, Modal,
+              Multiline, Multiselectable, ReadOnly, Required, Selected)
 
-  ANODE_PROPS(Boolean, bool,
-    Atomic,
-    Busy,
-    Disabled,
-    Expanded,
-    Hidden,
-    Modal,
-    Multiline,
-    Multiselectable,
-    ReadOnly,
-    Required,
-    Selected
-  )
+  ANODE_PROPS(UInt, uint32_t, ColIndex, ColSpan, Level, PosInSet, RowIndex,
+              RowSpan)
+
+  ANODE_PROPS(Int, int32_t, ColCount, RowCount, SetSize)
 
-  ANODE_PROPS(UInt, uint32_t,
-    ColIndex,
-    ColSpan,
-    Level,
-    PosInSet,
-    RowIndex,
-    RowSpan
-  )
+  ANODE_PROPS(Double, double, ValueMax, ValueMin, ValueNow)
 
-  ANODE_PROPS(Int, int32_t,
-    ColCount,
-    RowCount,
-    SetSize
-  )
+  ANODE_RELATION_PROPS(ActiveDescendant, Details, ErrorMessage)
 
-  ANODE_PROPS(Double, double,
-    ValueMax,
-    ValueMin,
-    ValueNow
-  )
-
-  ANODE_RELATION_PROPS(
-    ActiveDescendant,
-    Details,
-    ErrorMessage
-  )
-
-protected:
+ protected:
   AccessibleNode(const AccessibleNode& aCopy) = delete;
   AccessibleNode& operator=(const AccessibleNode& aCopy) = delete;
   virtual ~AccessibleNode();
 
   void GetProperty(AOMStringProperty aProperty, nsAString& aRetval) {
     nsString data;
     if (!mStringProperties.Get(static_cast<int>(aProperty), &data)) {
       SetDOMStringToNull(data);
@@ -205,66 +149,61 @@ protected:
     if (DOMStringIsNull(aValue)) {
       mStringProperties.Remove(static_cast<int>(aProperty));
     } else {
       nsString value(aValue);
       mStringProperties.Put(static_cast<int>(aProperty), value);
     }
   }
 
-  dom::Nullable<bool> GetProperty(AOMBooleanProperty aProperty)
-  {
+  dom::Nullable<bool> GetProperty(AOMBooleanProperty aProperty) {
     int num = static_cast<int>(aProperty);
     if (mBooleanProperties & (1U << (2 * num))) {
       bool data = static_cast<bool>(mBooleanProperties & (1U << (2 * num + 1)));
       return dom::Nullable<bool>(data);
     }
     return dom::Nullable<bool>();
   }
 
   void SetProperty(AOMBooleanProperty aProperty,
-                   const dom::Nullable<bool>& aValue)
-  {
+                   const dom::Nullable<bool>& aValue) {
     int num = static_cast<int>(aProperty);
     if (aValue.IsNull()) {
       mBooleanProperties &= ~(1U << (2 * num));
     } else {
       mBooleanProperties |= (1U << (2 * num));
-      mBooleanProperties = (aValue.Value() ? mBooleanProperties | (1U << (2 * num + 1))
-                                           : mBooleanProperties & ~(1U << (2 * num + 1)));
+      mBooleanProperties =
+          (aValue.Value() ? mBooleanProperties | (1U << (2 * num + 1))
+                          : mBooleanProperties & ~(1U << (2 * num + 1)));
     }
   }
 
   ANODE_ACCESSOR_MUTATOR(Double, double, 0.0)
   ANODE_ACCESSOR_MUTATOR(Int, int32_t, 0)
   ANODE_ACCESSOR_MUTATOR(UInt, uint32_t, 0)
 
-  already_AddRefed<AccessibleNode> GetProperty(AOMRelationProperty aProperty)
-  {
+  already_AddRefed<AccessibleNode> GetProperty(AOMRelationProperty aProperty) {
     return mRelationProperties.Get(static_cast<int>(aProperty));
   }
 
-  void SetProperty(AOMRelationProperty aProperty,
-                   AccessibleNode* aValue)
-  {
+  void SetProperty(AOMRelationProperty aProperty, AccessibleNode* aValue) {
     if (!aValue) {
       mRelationProperties.Remove(static_cast<int>(aProperty));
     } else {
       mRelationProperties.Put(static_cast<int>(aProperty), aValue);
     }
   }
 
-  // The 2k'th bit indicates whether the k'th boolean property is used(1) or not(0)
-  // and 2k+1'th bit contains the property's value(1:true, 0:false)
+  // The 2k'th bit indicates whether the k'th boolean property is used(1) or
+  // not(0) and 2k+1'th bit contains the property's value(1:true, 0:false)
   uint32_t mBooleanProperties;
   nsRefPtrHashtable<nsUint32HashKey, AccessibleNode> mRelationProperties;
   nsDataHashtable<nsUint32HashKey, nsString> mStringProperties;
 
   RefPtr<a11y::Accessible> mIntl;
   RefPtr<nsINode> mDOMNode;
   RefPtr<dom::DOMStringList> mStates;
 };
 
-} // dom
-} // mozilla
+}  // namespace dom
+}  // namespace mozilla
 
-
-#endif // A11Y_JSAPI_ACCESSIBLENODE
+#endif  // A11Y_JSAPI_ACCESSIBLENODE
--- a/accessible/atk/ARIAGridAccessibleWrap.h
+++ b/accessible/atk/ARIAGridAccessibleWrap.h
@@ -10,12 +10,12 @@
 #include "ARIAGridAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class ARIAGridAccessible ARIAGridAccessibleWrap;
 typedef class ARIAGridCellAccessible ARIAGridCellAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -31,19 +31,19 @@
 #include "mozilla/Sprintf.h"
 #include "nsComponentManagerUtils.h"
 #include "nsIPersistentProperties2.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 MaiAtkObject::EAvailableAtkSignals MaiAtkObject::gAvailableAtkSignals =
-  eUnknown;
+    eUnknown;
 
-//defined in ApplicationAccessibleWrap.cpp
+// defined in ApplicationAccessibleWrap.cpp
 extern "C" GType g_atk_hyperlink_impl_type;
 
 /* MaiAtkObject */
 
 enum {
   ACTIVATE,
   CREATE,
   DEACTIVATE,
@@ -51,45 +51,44 @@ enum {
   MAXIMIZE,
   MINIMIZE,
   RESIZE,
   RESTORE,
   LAST_SIGNAL
 };
 
 enum MaiInterfaceType {
-    MAI_INTERFACE_COMPONENT, /* 0 */
-    MAI_INTERFACE_ACTION,
-    MAI_INTERFACE_VALUE,
-    MAI_INTERFACE_EDITABLE_TEXT,
-    MAI_INTERFACE_HYPERTEXT,
-    MAI_INTERFACE_HYPERLINK_IMPL,
-    MAI_INTERFACE_SELECTION,
-    MAI_INTERFACE_TABLE,
-    MAI_INTERFACE_TEXT,
-    MAI_INTERFACE_DOCUMENT,
-    MAI_INTERFACE_IMAGE, /* 10 */
-    MAI_INTERFACE_TABLE_CELL
+  MAI_INTERFACE_COMPONENT, /* 0 */
+  MAI_INTERFACE_ACTION,
+  MAI_INTERFACE_VALUE,
+  MAI_INTERFACE_EDITABLE_TEXT,
+  MAI_INTERFACE_HYPERTEXT,
+  MAI_INTERFACE_HYPERLINK_IMPL,
+  MAI_INTERFACE_SELECTION,
+  MAI_INTERFACE_TABLE,
+  MAI_INTERFACE_TEXT,
+  MAI_INTERFACE_DOCUMENT,
+  MAI_INTERFACE_IMAGE, /* 10 */
+  MAI_INTERFACE_TABLE_CELL
 };
 
-static GType GetAtkTypeForMai(MaiInterfaceType type)
-{
+static GType GetAtkTypeForMai(MaiInterfaceType type) {
   switch (type) {
     case MAI_INTERFACE_COMPONENT:
       return ATK_TYPE_COMPONENT;
     case MAI_INTERFACE_ACTION:
       return ATK_TYPE_ACTION;
     case MAI_INTERFACE_VALUE:
       return ATK_TYPE_VALUE;
     case MAI_INTERFACE_EDITABLE_TEXT:
       return ATK_TYPE_EDITABLE_TEXT;
     case MAI_INTERFACE_HYPERTEXT:
       return ATK_TYPE_HYPERTEXT;
     case MAI_INTERFACE_HYPERLINK_IMPL:
-       return g_atk_hyperlink_impl_type;
+      return g_atk_hyperlink_impl_type;
     case MAI_INTERFACE_SELECTION:
       return ATK_TYPE_SELECTION;
     case MAI_INTERFACE_TABLE:
       return ATK_TYPE_TABLE;
     case MAI_INTERFACE_TEXT:
       return ATK_TYPE_TEXT;
     case MAI_INTERFACE_DOCUMENT:
       return ATK_TYPE_DOCUMENT;
@@ -106,92 +105,88 @@ static GType GetAtkTypeForMai(MaiInterfa
 // The atk interfaces we can expose without checking what version of ATK we are
 // dealing with.  At the moment AtkTableCell is the only interface we can't
 // always expose.
 static const GInterfaceInfo atk_if_infos[] = {
     {(GInterfaceInitFunc)componentInterfaceInitCB,
      (GInterfaceFinalizeFunc) nullptr, nullptr},
     {(GInterfaceInitFunc)actionInterfaceInitCB,
      (GInterfaceFinalizeFunc) nullptr, nullptr},
-    {(GInterfaceInitFunc)valueInterfaceInitCB,
-     (GInterfaceFinalizeFunc) nullptr, nullptr},
+    {(GInterfaceInitFunc)valueInterfaceInitCB, (GInterfaceFinalizeFunc) nullptr,
+     nullptr},
     {(GInterfaceInitFunc)editableTextInterfaceInitCB,
      (GInterfaceFinalizeFunc) nullptr, nullptr},
     {(GInterfaceInitFunc)hypertextInterfaceInitCB,
      (GInterfaceFinalizeFunc) nullptr, nullptr},
     {(GInterfaceInitFunc)hyperlinkImplInterfaceInitCB,
      (GInterfaceFinalizeFunc) nullptr, nullptr},
     {(GInterfaceInitFunc)selectionInterfaceInitCB,
      (GInterfaceFinalizeFunc) nullptr, nullptr},
-    {(GInterfaceInitFunc)tableInterfaceInitCB,
-     (GInterfaceFinalizeFunc) nullptr, nullptr},
-    {(GInterfaceInitFunc)textInterfaceInitCB,
-     (GInterfaceFinalizeFunc) nullptr, nullptr},
+    {(GInterfaceInitFunc)tableInterfaceInitCB, (GInterfaceFinalizeFunc) nullptr,
+     nullptr},
+    {(GInterfaceInitFunc)textInterfaceInitCB, (GInterfaceFinalizeFunc) nullptr,
+     nullptr},
     {(GInterfaceInitFunc)documentInterfaceInitCB,
      (GInterfaceFinalizeFunc) nullptr, nullptr},
-    {(GInterfaceInitFunc)imageInterfaceInitCB,
-     (GInterfaceFinalizeFunc) nullptr, nullptr}
-};
+    {(GInterfaceInitFunc)imageInterfaceInitCB, (GInterfaceFinalizeFunc) nullptr,
+     nullptr}};
 
 static GQuark quark_mai_hyperlink = 0;
 
-AtkHyperlink*
-MaiAtkObject::GetAtkHyperlink()
-{
+AtkHyperlink* MaiAtkObject::GetAtkHyperlink() {
   NS_ASSERTION(quark_mai_hyperlink, "quark_mai_hyperlink not initialized");
   MaiHyperlink* maiHyperlink =
-    (MaiHyperlink*)g_object_get_qdata(G_OBJECT(this), quark_mai_hyperlink);
+      (MaiHyperlink*)g_object_get_qdata(G_OBJECT(this), quark_mai_hyperlink);
   if (!maiHyperlink) {
     maiHyperlink = new MaiHyperlink(accWrap);
     g_object_set_qdata(G_OBJECT(this), quark_mai_hyperlink, maiHyperlink);
   }
 
   return maiHyperlink->GetAtkHyperlink();
 }
 
-void
-MaiAtkObject::Shutdown()
-{
+void MaiAtkObject::Shutdown() {
   accWrap.SetBits(0);
   MaiHyperlink* maiHyperlink =
-    (MaiHyperlink*)g_object_get_qdata(G_OBJECT(this), quark_mai_hyperlink);
+      (MaiHyperlink*)g_object_get_qdata(G_OBJECT(this), quark_mai_hyperlink);
   if (maiHyperlink) {
     delete maiHyperlink;
     g_object_set_qdata(G_OBJECT(this), quark_mai_hyperlink, nullptr);
   }
 }
 
-struct MaiAtkObjectClass
-{
-    AtkObjectClass parent_class;
+struct MaiAtkObjectClass {
+  AtkObjectClass parent_class;
 };
 
-static guint mai_atk_object_signals [LAST_SIGNAL] = { 0, };
+static guint mai_atk_object_signals[LAST_SIGNAL] = {
+    0,
+};
 
 static void MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName);
 
 G_BEGIN_DECLS
 /* callbacks for MaiAtkObject */
-static void classInitCB(AtkObjectClass *aClass);
-static void initializeCB(AtkObject *aAtkObj, gpointer aData);
-static void finalizeCB(GObject *aObj);
+static void classInitCB(AtkObjectClass* aClass);
+static void initializeCB(AtkObject* aAtkObj, gpointer aData);
+static void finalizeCB(GObject* aObj);
 
 /* callbacks for AtkObject virtual functions */
-static const gchar*        getNameCB (AtkObject *aAtkObj);
+static const gchar* getNameCB(AtkObject* aAtkObj);
 /* getDescriptionCB is also used by image interface */
-       const gchar*        getDescriptionCB (AtkObject *aAtkObj);
-static AtkRole             getRoleCB(AtkObject *aAtkObj);
-static AtkAttributeSet*    getAttributesCB(AtkObject *aAtkObj);
+const gchar* getDescriptionCB(AtkObject* aAtkObj);
+static AtkRole getRoleCB(AtkObject* aAtkObj);
+static AtkAttributeSet* getAttributesCB(AtkObject* aAtkObj);
 static const gchar* GetLocaleCB(AtkObject*);
-static AtkObject*          getParentCB(AtkObject *aAtkObj);
-static gint                getChildCountCB(AtkObject *aAtkObj);
-static AtkObject*          refChildCB(AtkObject *aAtkObj, gint aChildIndex);
-static gint                getIndexInParentCB(AtkObject *aAtkObj);
-static AtkStateSet*        refStateSetCB(AtkObject *aAtkObj);
-static AtkRelationSet*     refRelationSetCB(AtkObject *aAtkObj);
+static AtkObject* getParentCB(AtkObject* aAtkObj);
+static gint getChildCountCB(AtkObject* aAtkObj);
+static AtkObject* refChildCB(AtkObject* aAtkObj, gint aChildIndex);
+static gint getIndexInParentCB(AtkObject* aAtkObj);
+static AtkStateSet* refStateSetCB(AtkObject* aAtkObj);
+static AtkRelationSet* refRelationSetCB(AtkObject* aAtkObj);
 
 /* the missing atkobject virtual functions */
 /*
   static AtkLayer            getLayerCB(AtkObject *aAtkObj);
   static gint                getMdiZorderCB(AtkObject *aAtkObj);
   static void                SetNameCB(AtkObject *aAtkObj,
   const gchar *name);
   static void                SetDescriptionCB(AtkObject *aAtkObj,
@@ -218,474 +213,385 @@ static AtkRelationSet*     refRelationSe
   static void                StateChangeCB(AtkObject *aAtkObj,
   const gchar *name,
   gboolean state_set);
   static void                VisibleDataChangedCB(AtkObject *aAtkObj);
 */
 G_END_DECLS
 
 static GType GetMaiAtkType(uint16_t interfacesBits);
-static const char * GetUniqueMaiAtkTypeName(uint16_t interfacesBits);
+static const char* GetUniqueMaiAtkTypeName(uint16_t interfacesBits);
 
 static gpointer parent_class = nullptr;
 
-GType
-mai_atk_object_get_type(void)
-{
-    static GType type = 0;
+GType mai_atk_object_get_type(void) {
+  static GType type = 0;
 
-    if (!type) {
-        static const GTypeInfo tinfo = {
-            sizeof(MaiAtkObjectClass),
-            (GBaseInitFunc)nullptr,
-            (GBaseFinalizeFunc)nullptr,
-            (GClassInitFunc)classInitCB,
-            (GClassFinalizeFunc)nullptr,
-            nullptr, /* class data */
-            sizeof(MaiAtkObject), /* instance size */
-            0, /* nb preallocs */
-            (GInstanceInitFunc)nullptr,
-            nullptr /* value table */
-        };
+  if (!type) {
+    static const GTypeInfo tinfo = {
+        sizeof(MaiAtkObjectClass),
+        (GBaseInitFunc) nullptr,
+        (GBaseFinalizeFunc) nullptr,
+        (GClassInitFunc)classInitCB,
+        (GClassFinalizeFunc) nullptr,
+        nullptr,              /* class data */
+        sizeof(MaiAtkObject), /* instance size */
+        0,                    /* nb preallocs */
+        (GInstanceInitFunc) nullptr,
+        nullptr /* value table */
+    };
 
-        type = g_type_register_static(ATK_TYPE_OBJECT,
-                                      "MaiAtkObject", &tinfo, GTypeFlags(0));
-        quark_mai_hyperlink = g_quark_from_static_string("MaiHyperlink");
-    }
-    return type;
+    type = g_type_register_static(ATK_TYPE_OBJECT, "MaiAtkObject", &tinfo,
+                                  GTypeFlags(0));
+    quark_mai_hyperlink = g_quark_from_static_string("MaiHyperlink");
+  }
+  return type;
 }
 
-AccessibleWrap::
-  AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc) :
-  Accessible(aContent, aDoc), mAtkObject(nullptr)
-{
+AccessibleWrap::AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc)
+    : Accessible(aContent, aDoc), mAtkObject(nullptr) {}
+
+AccessibleWrap::~AccessibleWrap() {
+  NS_ASSERTION(!mAtkObject, "ShutdownAtkObject() is not called");
 }
 
-AccessibleWrap::~AccessibleWrap()
-{
-    NS_ASSERTION(!mAtkObject, "ShutdownAtkObject() is not called");
-}
-
-void
-AccessibleWrap::ShutdownAtkObject()
-{
-  if (!mAtkObject)
-    return;
+void AccessibleWrap::ShutdownAtkObject() {
+  if (!mAtkObject) return;
 
   NS_ASSERTION(IS_MAI_OBJECT(mAtkObject), "wrong type of atk object");
-  if (IS_MAI_OBJECT(mAtkObject))
-    MAI_ATK_OBJECT(mAtkObject)->Shutdown();
+  if (IS_MAI_OBJECT(mAtkObject)) MAI_ATK_OBJECT(mAtkObject)->Shutdown();
 
   g_object_unref(mAtkObject);
   mAtkObject = nullptr;
 }
 
-void
-AccessibleWrap::Shutdown()
-{
+void AccessibleWrap::Shutdown() {
   ShutdownAtkObject();
   Accessible::Shutdown();
 }
 
-void
-AccessibleWrap::GetNativeInterface(void** aOutAccessible)
-{
+void AccessibleWrap::GetNativeInterface(void** aOutAccessible) {
   *aOutAccessible = nullptr;
 
   if (!mAtkObject) {
     if (IsDefunct() || IsText()) {
       // We don't create ATK objects for node which has been shutdown or
       // plain text leaves
       return;
     }
 
     GType type = GetMaiAtkType(CreateMaiInterfaces());
-    if (!type)
-      return;
+    if (!type) return;
 
     mAtkObject = reinterpret_cast<AtkObject*>(g_object_new(type, nullptr));
-    if (!mAtkObject)
-      return;
+    if (!mAtkObject) return;
 
     atk_object_initialize(mAtkObject, this);
     mAtkObject->role = ATK_ROLE_INVALID;
     mAtkObject->layer = ATK_LAYER_INVALID;
   }
 
   *aOutAccessible = mAtkObject;
 }
 
-AtkObject *
-AccessibleWrap::GetAtkObject(void)
-{
-    void *atkObj = nullptr;
-    GetNativeInterface(&atkObj);
-    return static_cast<AtkObject *>(atkObj);
+AtkObject* AccessibleWrap::GetAtkObject(void) {
+  void* atkObj = nullptr;
+  GetNativeInterface(&atkObj);
+  return static_cast<AtkObject*>(atkObj);
 }
 
 // Get AtkObject from Accessible interface
 /* static */
-AtkObject *
-AccessibleWrap::GetAtkObject(Accessible* acc)
-{
-    void *atkObjPtr = nullptr;
-    acc->GetNativeInterface(&atkObjPtr);
-    return atkObjPtr ? ATK_OBJECT(atkObjPtr) : nullptr;
+AtkObject* AccessibleWrap::GetAtkObject(Accessible* acc) {
+  void* atkObjPtr = nullptr;
+  acc->GetNativeInterface(&atkObjPtr);
+  return atkObjPtr ? ATK_OBJECT(atkObjPtr) : nullptr;
 }
 
 /* private */
-uint16_t
-AccessibleWrap::CreateMaiInterfaces(void)
-{
+uint16_t AccessibleWrap::CreateMaiInterfaces(void) {
   uint16_t interfacesBits = 0;
 
   // The Component interface is supported by all accessibles.
   interfacesBits |= 1 << MAI_INTERFACE_COMPONENT;
 
   // Add Action interface if the action count is more than zero.
-  if (ActionCount() > 0)
-    interfacesBits |= 1 << MAI_INTERFACE_ACTION;
+  if (ActionCount() > 0) interfacesBits |= 1 << MAI_INTERFACE_ACTION;
 
   // Text, Editabletext, and Hypertext interface.
   HyperTextAccessible* hyperText = AsHyperText();
   if (hyperText && hyperText->IsTextRole()) {
     interfacesBits |= 1 << MAI_INTERFACE_TEXT;
     interfacesBits |= 1 << MAI_INTERFACE_EDITABLE_TEXT;
     if (!nsAccUtils::MustPrune(this))
       interfacesBits |= 1 << MAI_INTERFACE_HYPERTEXT;
   }
 
   // Value interface.
-  if (HasNumericValue())
-    interfacesBits |= 1 << MAI_INTERFACE_VALUE;
+  if (HasNumericValue()) interfacesBits |= 1 << MAI_INTERFACE_VALUE;
 
   // Document interface.
-  if (IsDoc())
-    interfacesBits |= 1 << MAI_INTERFACE_DOCUMENT;
+  if (IsDoc()) interfacesBits |= 1 << MAI_INTERFACE_DOCUMENT;
 
-  if (IsImage())
-    interfacesBits |= 1 << MAI_INTERFACE_IMAGE;
+  if (IsImage()) interfacesBits |= 1 << MAI_INTERFACE_IMAGE;
 
   // HyperLink interface.
-  if (IsLink())
-    interfacesBits |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
+  if (IsLink()) interfacesBits |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
 
   if (!nsAccUtils::MustPrune(this)) {  // These interfaces require children
     // Table interface.
-    if (AsTable())
-      interfacesBits |= 1 << MAI_INTERFACE_TABLE;
+    if (AsTable()) interfacesBits |= 1 << MAI_INTERFACE_TABLE;
 
-    if (AsTableCell())
-      interfacesBits |= 1 << MAI_INTERFACE_TABLE_CELL;
+    if (AsTableCell()) interfacesBits |= 1 << MAI_INTERFACE_TABLE_CELL;
 
     // Selection interface.
     if (IsSelect()) {
       interfacesBits |= 1 << MAI_INTERFACE_SELECTION;
     }
   }
 
   return interfacesBits;
 }
 
-static GType
-GetMaiAtkType(uint16_t interfacesBits)
-{
-    GType type;
-    static const GTypeInfo tinfo = {
-        sizeof(MaiAtkObjectClass),
-        (GBaseInitFunc) nullptr,
-        (GBaseFinalizeFunc) nullptr,
-        (GClassInitFunc) nullptr,
-        (GClassFinalizeFunc) nullptr,
-        nullptr, /* class data */
-        sizeof(MaiAtkObject), /* instance size */
-        0, /* nb preallocs */
-        (GInstanceInitFunc) nullptr,
-        nullptr /* value table */
-    };
+static GType GetMaiAtkType(uint16_t interfacesBits) {
+  GType type;
+  static const GTypeInfo tinfo = {
+      sizeof(MaiAtkObjectClass),
+      (GBaseInitFunc) nullptr,
+      (GBaseFinalizeFunc) nullptr,
+      (GClassInitFunc) nullptr,
+      (GClassFinalizeFunc) nullptr,
+      nullptr,              /* class data */
+      sizeof(MaiAtkObject), /* instance size */
+      0,                    /* nb preallocs */
+      (GInstanceInitFunc) nullptr,
+      nullptr /* value table */
+  };
 
-    /*
-     * The members we use to register GTypes are GetAtkTypeForMai
-     * and atk_if_infos, which are constant values to each MaiInterface
-     * So we can reuse the registered GType when having
-     * the same MaiInterface types.
-     */
-    const char *atkTypeName = GetUniqueMaiAtkTypeName(interfacesBits);
-    type = g_type_from_name(atkTypeName);
-    if (type) {
-        return type;
-    }
+  /*
+   * The members we use to register GTypes are GetAtkTypeForMai
+   * and atk_if_infos, which are constant values to each MaiInterface
+   * So we can reuse the registered GType when having
+   * the same MaiInterface types.
+   */
+  const char* atkTypeName = GetUniqueMaiAtkTypeName(interfacesBits);
+  type = g_type_from_name(atkTypeName);
+  if (type) {
+    return type;
+  }
 
-    /*
-     * gobject limits the number of types that can directly derive from any
-     * given object type to 4095.
-     */
-    static uint16_t typeRegCount = 0;
-    if (typeRegCount++ >= 4095) {
-        return G_TYPE_INVALID;
-    }
-    type = g_type_register_static(MAI_TYPE_ATK_OBJECT,
-                                  atkTypeName,
-                                  &tinfo, GTypeFlags(0));
+  /*
+   * gobject limits the number of types that can directly derive from any
+   * given object type to 4095.
+   */
+  static uint16_t typeRegCount = 0;
+  if (typeRegCount++ >= 4095) {
+    return G_TYPE_INVALID;
+  }
+  type = g_type_register_static(MAI_TYPE_ATK_OBJECT, atkTypeName, &tinfo,
+                                GTypeFlags(0));
 
-    for (uint32_t index = 0; index < ArrayLength(atk_if_infos); index++) {
-      if (interfacesBits & (1 << index)) {
-        g_type_add_interface_static(type,
-                                    GetAtkTypeForMai((MaiInterfaceType)index),
-                                    &atk_if_infos[index]);
-      }
+  for (uint32_t index = 0; index < ArrayLength(atk_if_infos); index++) {
+    if (interfacesBits & (1 << index)) {
+      g_type_add_interface_static(type,
+                                  GetAtkTypeForMai((MaiInterfaceType)index),
+                                  &atk_if_infos[index]);
     }
+  }
 
-    // Special case AtkTableCell so we can check what version of Atk we are
-    // dealing with.
-    if (IsAtkVersionAtLeast(2, 12) && (interfacesBits & (1 << MAI_INTERFACE_TABLE_CELL))) {
-      const GInterfaceInfo cellInfo = {
+  // Special case AtkTableCell so we can check what version of Atk we are
+  // dealing with.
+  if (IsAtkVersionAtLeast(2, 12) &&
+      (interfacesBits & (1 << MAI_INTERFACE_TABLE_CELL))) {
+    const GInterfaceInfo cellInfo = {
         (GInterfaceInitFunc)tableCellInterfaceInitCB,
-        (GInterfaceFinalizeFunc)nullptr, nullptr};
-      g_type_add_interface_static(type, gAtkTableCellGetTypeFunc(), &cellInfo);
-    }
+        (GInterfaceFinalizeFunc) nullptr, nullptr};
+    g_type_add_interface_static(type, gAtkTableCellGetTypeFunc(), &cellInfo);
+  }
 
-    return type;
+  return type;
 }
 
-static const char*
-GetUniqueMaiAtkTypeName(uint16_t interfacesBits)
-{
-#define MAI_ATK_TYPE_NAME_LEN (30)     /* 10+sizeof(uint16_t)*8/4+1 < 30 */
+static const char* GetUniqueMaiAtkTypeName(uint16_t interfacesBits) {
+#define MAI_ATK_TYPE_NAME_LEN (30) /* 10+sizeof(uint16_t)*8/4+1 < 30 */
 
-    static gchar namePrefix[] = "MaiAtkType";   /* size = 10 */
-    static gchar name[MAI_ATK_TYPE_NAME_LEN + 1];
+  static gchar namePrefix[] = "MaiAtkType"; /* size = 10 */
+  static gchar name[MAI_ATK_TYPE_NAME_LEN + 1];
 
-    SprintfLiteral(name, "%s%x", namePrefix, interfacesBits);
-    name[MAI_ATK_TYPE_NAME_LEN] = '\0';
+  SprintfLiteral(name, "%s%x", namePrefix, interfacesBits);
+  name[MAI_ATK_TYPE_NAME_LEN] = '\0';
 
-    return name;
+  return name;
 }
 
-bool
-AccessibleWrap::IsValidObject()
-{
-    // to ensure we are not shut down
-    return !IsDefunct();
+bool AccessibleWrap::IsValidObject() {
+  // to ensure we are not shut down
+  return !IsDefunct();
 }
 
 /* static functions for ATK callbacks */
-void
-classInitCB(AtkObjectClass *aClass)
-{
-    GObjectClass *gobject_class = G_OBJECT_CLASS(aClass);
+void classInitCB(AtkObjectClass* aClass) {
+  GObjectClass* gobject_class = G_OBJECT_CLASS(aClass);
 
-    parent_class = g_type_class_peek_parent(aClass);
+  parent_class = g_type_class_peek_parent(aClass);
 
-    aClass->get_name = getNameCB;
-    aClass->get_description = getDescriptionCB;
-    aClass->get_parent = getParentCB;
-    aClass->get_n_children = getChildCountCB;
-    aClass->ref_child = refChildCB;
-    aClass->get_index_in_parent = getIndexInParentCB;
-    aClass->get_role = getRoleCB;
-    aClass->get_attributes = getAttributesCB;
-    aClass->get_object_locale = GetLocaleCB;
-    aClass->ref_state_set = refStateSetCB;
-    aClass->ref_relation_set = refRelationSetCB;
+  aClass->get_name = getNameCB;
+  aClass->get_description = getDescriptionCB;
+  aClass->get_parent = getParentCB;
+  aClass->get_n_children = getChildCountCB;
+  aClass->ref_child = refChildCB;
+  aClass->get_index_in_parent = getIndexInParentCB;
+  aClass->get_role = getRoleCB;
+  aClass->get_attributes = getAttributesCB;
+  aClass->get_object_locale = GetLocaleCB;
+  aClass->ref_state_set = refStateSetCB;
+  aClass->ref_relation_set = refRelationSetCB;
 
-    aClass->initialize = initializeCB;
+  aClass->initialize = initializeCB;
 
-    gobject_class->finalize = finalizeCB;
+  gobject_class->finalize = finalizeCB;
 
-    mai_atk_object_signals [ACTIVATE] =
-    g_signal_new ("activate",
-                  MAI_TYPE_ATK_OBJECT,
-                  G_SIGNAL_RUN_LAST,
-                  0, /* default signal handler */
-                  nullptr, nullptr,
-                  g_cclosure_marshal_VOID__VOID,
-                  G_TYPE_NONE, 0);
-    mai_atk_object_signals [CREATE] =
-    g_signal_new ("create",
-                  MAI_TYPE_ATK_OBJECT,
-                  G_SIGNAL_RUN_LAST,
-                  0, /* default signal handler */
-                  nullptr, nullptr,
-                  g_cclosure_marshal_VOID__VOID,
-                  G_TYPE_NONE, 0);
-    mai_atk_object_signals [DEACTIVATE] =
-    g_signal_new ("deactivate",
-                  MAI_TYPE_ATK_OBJECT,
-                  G_SIGNAL_RUN_LAST,
-                  0, /* default signal handler */
-                  nullptr, nullptr,
-                  g_cclosure_marshal_VOID__VOID,
-                  G_TYPE_NONE, 0);
-    mai_atk_object_signals [DESTROY] =
-    g_signal_new ("destroy",
-                  MAI_TYPE_ATK_OBJECT,
-                  G_SIGNAL_RUN_LAST,
-                  0, /* default signal handler */
-                  nullptr, nullptr,
-                  g_cclosure_marshal_VOID__VOID,
-                  G_TYPE_NONE, 0);
-    mai_atk_object_signals [MAXIMIZE] =
-    g_signal_new ("maximize",
-                  MAI_TYPE_ATK_OBJECT,
-                  G_SIGNAL_RUN_LAST,
-                  0, /* default signal handler */
-                  nullptr, nullptr,
-                  g_cclosure_marshal_VOID__VOID,
-                  G_TYPE_NONE, 0);
-    mai_atk_object_signals [MINIMIZE] =
-    g_signal_new ("minimize",
-                  MAI_TYPE_ATK_OBJECT,
-                  G_SIGNAL_RUN_LAST,
-                  0, /* default signal handler */
-                  nullptr, nullptr,
-                  g_cclosure_marshal_VOID__VOID,
-                  G_TYPE_NONE, 0);
-    mai_atk_object_signals [RESIZE] =
-    g_signal_new ("resize",
-                  MAI_TYPE_ATK_OBJECT,
-                  G_SIGNAL_RUN_LAST,
-                  0, /* default signal handler */
-                  nullptr, nullptr,
-                  g_cclosure_marshal_VOID__VOID,
-                  G_TYPE_NONE, 0);
-    mai_atk_object_signals [RESTORE] =
-    g_signal_new ("restore",
-                  MAI_TYPE_ATK_OBJECT,
-                  G_SIGNAL_RUN_LAST,
-                  0, /* default signal handler */
-                  nullptr, nullptr,
-                  g_cclosure_marshal_VOID__VOID,
-                  G_TYPE_NONE, 0);
-
+  mai_atk_object_signals[ACTIVATE] = g_signal_new(
+      "activate", MAI_TYPE_ATK_OBJECT, G_SIGNAL_RUN_LAST,
+      0, /* default signal handler */
+      nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+  mai_atk_object_signals[CREATE] = g_signal_new(
+      "create", MAI_TYPE_ATK_OBJECT, G_SIGNAL_RUN_LAST,
+      0, /* default signal handler */
+      nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+  mai_atk_object_signals[DEACTIVATE] = g_signal_new(
+      "deactivate", MAI_TYPE_ATK_OBJECT, G_SIGNAL_RUN_LAST,
+      0, /* default signal handler */
+      nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+  mai_atk_object_signals[DESTROY] = g_signal_new(
+      "destroy", MAI_TYPE_ATK_OBJECT, G_SIGNAL_RUN_LAST,
+      0, /* default signal handler */
+      nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+  mai_atk_object_signals[MAXIMIZE] = g_signal_new(
+      "maximize", MAI_TYPE_ATK_OBJECT, G_SIGNAL_RUN_LAST,
+      0, /* default signal handler */
+      nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+  mai_atk_object_signals[MINIMIZE] = g_signal_new(
+      "minimize", MAI_TYPE_ATK_OBJECT, G_SIGNAL_RUN_LAST,
+      0, /* default signal handler */
+      nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+  mai_atk_object_signals[RESIZE] = g_signal_new(
+      "resize", MAI_TYPE_ATK_OBJECT, G_SIGNAL_RUN_LAST,
+      0, /* default signal handler */
+      nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
+  mai_atk_object_signals[RESTORE] = g_signal_new(
+      "restore", MAI_TYPE_ATK_OBJECT, G_SIGNAL_RUN_LAST,
+      0, /* default signal handler */
+      nullptr, nullptr, g_cclosure_marshal_VOID__VOID, G_TYPE_NONE, 0);
 }
 
-void
-initializeCB(AtkObject *aAtkObj, gpointer aData)
-{
-    NS_ASSERTION((IS_MAI_OBJECT(aAtkObj)), "Invalid AtkObject");
-    NS_ASSERTION(aData, "Invalid Data to init AtkObject");
-    if (!aAtkObj || !aData)
-        return;
+void initializeCB(AtkObject* aAtkObj, gpointer aData) {
+  NS_ASSERTION((IS_MAI_OBJECT(aAtkObj)), "Invalid AtkObject");
+  NS_ASSERTION(aData, "Invalid Data to init AtkObject");
+  if (!aAtkObj || !aData) return;
 
-    /* call parent init function */
-    /* AtkObjectClass has not a "initialize" function now,
-     * maybe it has later
-     */
+  /* call parent init function */
+  /* AtkObjectClass has not a "initialize" function now,
+   * maybe it has later
+   */
 
-    if (ATK_OBJECT_CLASS(parent_class)->initialize)
-        ATK_OBJECT_CLASS(parent_class)->initialize(aAtkObj, aData);
+  if (ATK_OBJECT_CLASS(parent_class)->initialize)
+    ATK_OBJECT_CLASS(parent_class)->initialize(aAtkObj, aData);
 
   /* initialize object */
   MAI_ATK_OBJECT(aAtkObj)->accWrap.SetBits(reinterpret_cast<uintptr_t>(aData));
 }
 
-void
-finalizeCB(GObject *aObj)
-{
-    if (!IS_MAI_OBJECT(aObj))
-        return;
-    NS_ASSERTION(MAI_ATK_OBJECT(aObj)->accWrap.IsNull(), "AccWrap NOT null");
+void finalizeCB(GObject* aObj) {
+  if (!IS_MAI_OBJECT(aObj)) return;
+  NS_ASSERTION(MAI_ATK_OBJECT(aObj)->accWrap.IsNull(), "AccWrap NOT null");
 
-    // call parent finalize function
-    // finalize of GObjectClass will unref the accessible parent if has
-    if (G_OBJECT_CLASS (parent_class)->finalize)
-        G_OBJECT_CLASS (parent_class)->finalize(aObj);
+  // call parent finalize function
+  // finalize of GObjectClass will unref the accessible parent if has
+  if (G_OBJECT_CLASS(parent_class)->finalize)
+    G_OBJECT_CLASS(parent_class)->finalize(aObj);
 }
 
-const gchar*
-getNameCB(AtkObject* aAtkObj)
-{
+const gchar* getNameCB(AtkObject* aAtkObj) {
   nsAutoString name;
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
   if (accWrap)
     accWrap->Name(name);
   else if (ProxyAccessible* proxy = GetProxy(aAtkObj))
     proxy->Name(name);
   else
     return nullptr;
 
   // XXX Firing an event from here does not seem right
   MaybeFireNameChange(aAtkObj, name);
 
   return aAtkObj->name;
 }
 
-static void
-MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName)
-{
+static void MaybeFireNameChange(AtkObject* aAtkObj, const nsString& aNewName) {
   NS_ConvertUTF16toUTF8 newNameUTF8(aNewName);
-  if (aAtkObj->name && !strcmp(aAtkObj->name, newNameUTF8.get()))
-    return;
+  if (aAtkObj->name && !strcmp(aAtkObj->name, newNameUTF8.get())) return;
 
   // Below we duplicate the functionality of atk_object_set_name(),
   // but without calling atk_object_get_name(). Instead of
   // atk_object_get_name() we directly access aAtkObj->name. This is because
   // atk_object_get_name() would call getNameCB() which would call
   // MaybeFireNameChange() (or atk_object_set_name() before this problem was
   // fixed) and we would get an infinite recursion.
   // See http://bugzilla.mozilla.org/733712
 
   // Do not notify for initial name setting.
   // See bug http://bugzilla.gnome.org/665870
   bool notify = !!aAtkObj->name;
 
   free(aAtkObj->name);
   aAtkObj->name = strdup(newNameUTF8.get());
 
-  if (notify)
-    g_object_notify(G_OBJECT(aAtkObj), "accessible-name");
+  if (notify) g_object_notify(G_OBJECT(aAtkObj), "accessible-name");
 }
 
-const gchar *
-getDescriptionCB(AtkObject *aAtkObj)
-{
+const gchar* getDescriptionCB(AtkObject* aAtkObj) {
   nsAutoString uniDesc;
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
   if (accWrap) {
-    if (accWrap->IsDefunct())
-      return nullptr;
+    if (accWrap->IsDefunct()) return nullptr;
 
     accWrap->Description(uniDesc);
   } else if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
     proxy->Description(uniDesc);
   } else {
     return nullptr;
   }
 
-    NS_ConvertUTF8toUTF16 objDesc(aAtkObj->description);
-    if (!uniDesc.Equals(objDesc))
-        atk_object_set_description(aAtkObj,
-                                   NS_ConvertUTF16toUTF8(uniDesc).get());
+  NS_ConvertUTF8toUTF16 objDesc(aAtkObj->description);
+  if (!uniDesc.Equals(objDesc))
+    atk_object_set_description(aAtkObj, NS_ConvertUTF16toUTF8(uniDesc).get());
 
-    return aAtkObj->description;
+  return aAtkObj->description;
 }
 
-AtkRole
-getRoleCB(AtkObject *aAtkObj)
-{
-  if (aAtkObj->role != ATK_ROLE_INVALID)
-    return aAtkObj->role;
+AtkRole getRoleCB(AtkObject* aAtkObj) {
+  if (aAtkObj->role != ATK_ROLE_INVALID) return aAtkObj->role;
 
   AccessibleOrProxy acc = GetInternalObj(aAtkObj);
   if (acc.IsNull()) {
     return ATK_ROLE_INVALID;
   }
 
 #ifdef DEBUG
   if (AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj)) {
     NS_ASSERTION(nsAccUtils::IsTextInterfaceSupportCorrect(accWrap),
                  "Does not support Text interface when it should");
   }
 #endif
 
-#define ROLE(geckoRole, stringRole, atkRole, macRole, \
-             msaaRole, ia2Role, androidClass, nameRule) \
-  case roles::geckoRole: \
-    aAtkObj->role = atkRole; \
+#define ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, \
+             androidClass, nameRule)                                     \
+  case roles::geckoRole:                                                 \
+    aAtkObj->role = atkRole;                                             \
     break;
 
   switch (acc.Role()) {
 #include "RoleMap.h"
     default:
       MOZ_CRASH("Unknown role.");
   }
 
@@ -701,131 +607,113 @@ getRoleCB(AtkObject *aAtkObj)
     aAtkObj->role = ATK_ROLE_SECTION;
   else if (aAtkObj->role == ATK_ROLE_LANDMARK && !IsAtkVersionAtLeast(2, 12))
     aAtkObj->role = ATK_ROLE_SECTION;
   else if (aAtkObj->role == ATK_ROLE_FOOTNOTE && !IsAtkVersionAtLeast(2, 25, 2))
     aAtkObj->role = ATK_ROLE_SECTION;
   else if (aAtkObj->role == ATK_ROLE_STATIC && !IsAtkVersionAtLeast(2, 16))
     aAtkObj->role = ATK_ROLE_TEXT;
   else if ((aAtkObj->role == ATK_ROLE_MATH_FRACTION ||
-            aAtkObj->role == ATK_ROLE_MATH_ROOT) && !IsAtkVersionAtLeast(2, 16))
+            aAtkObj->role == ATK_ROLE_MATH_ROOT) &&
+           !IsAtkVersionAtLeast(2, 16))
     aAtkObj->role = ATK_ROLE_SECTION;
 
   return aAtkObj->role;
 }
 
-static AtkAttributeSet*
-ConvertToAtkAttributeSet(nsIPersistentProperties* aAttributes)
-{
-    if (!aAttributes)
-        return nullptr;
+static AtkAttributeSet* ConvertToAtkAttributeSet(
+    nsIPersistentProperties* aAttributes) {
+  if (!aAttributes) return nullptr;
 
-    AtkAttributeSet *objAttributeSet = nullptr;
-    nsCOMPtr<nsISimpleEnumerator> propEnum;
-    nsresult rv = aAttributes->Enumerate(getter_AddRefs(propEnum));
-    NS_ENSURE_SUCCESS(rv, nullptr);
+  AtkAttributeSet* objAttributeSet = nullptr;
+  nsCOMPtr<nsISimpleEnumerator> propEnum;
+  nsresult rv = aAttributes->Enumerate(getter_AddRefs(propEnum));
+  NS_ENSURE_SUCCESS(rv, nullptr);
 
-    bool hasMore;
-    while (NS_SUCCEEDED(propEnum->HasMoreElements(&hasMore)) && hasMore) {
-        nsCOMPtr<nsISupports> sup;
-        rv = propEnum->GetNext(getter_AddRefs(sup));
-        NS_ENSURE_SUCCESS(rv, objAttributeSet);
+  bool hasMore;
+  while (NS_SUCCEEDED(propEnum->HasMoreElements(&hasMore)) && hasMore) {
+    nsCOMPtr<nsISupports> sup;
+    rv = propEnum->GetNext(getter_AddRefs(sup));
+    NS_ENSURE_SUCCESS(rv, objAttributeSet);
 
-        nsCOMPtr<nsIPropertyElement> propElem(do_QueryInterface(sup));
-        NS_ENSURE_TRUE(propElem, objAttributeSet);
+    nsCOMPtr<nsIPropertyElement> propElem(do_QueryInterface(sup));
+    NS_ENSURE_TRUE(propElem, objAttributeSet);
 
-        nsAutoCString name;
-        rv = propElem->GetKey(name);
-        NS_ENSURE_SUCCESS(rv, objAttributeSet);
+    nsAutoCString name;
+    rv = propElem->GetKey(name);
+    NS_ENSURE_SUCCESS(rv, objAttributeSet);
 
-        nsAutoString value;
-        rv = propElem->GetValue(value);
-        NS_ENSURE_SUCCESS(rv, objAttributeSet);
+    nsAutoString value;
+    rv = propElem->GetValue(value);
+    NS_ENSURE_SUCCESS(rv, objAttributeSet);
 
-        AtkAttribute *objAttr = (AtkAttribute *)g_malloc(sizeof(AtkAttribute));
-        objAttr->name = g_strdup(name.get());
-        objAttr->value = g_strdup(NS_ConvertUTF16toUTF8(value).get());
-        objAttributeSet = g_slist_prepend(objAttributeSet, objAttr);
-    }
+    AtkAttribute* objAttr = (AtkAttribute*)g_malloc(sizeof(AtkAttribute));
+    objAttr->name = g_strdup(name.get());
+    objAttr->value = g_strdup(NS_ConvertUTF16toUTF8(value).get());
+    objAttributeSet = g_slist_prepend(objAttributeSet, objAttr);
+  }
 
-    //libspi will free it
-    return objAttributeSet;
+  // libspi will free it
+  return objAttributeSet;
 }
 
-AtkAttributeSet*
-GetAttributeSet(Accessible* aAccessible)
-{
+AtkAttributeSet* GetAttributeSet(Accessible* aAccessible) {
   nsCOMPtr<nsIPersistentProperties> attributes = aAccessible->Attributes();
-  if (attributes)
-    return ConvertToAtkAttributeSet(attributes);
+  if (attributes) return ConvertToAtkAttributeSet(attributes);
 
   return nullptr;
 }
 
-AtkAttributeSet *
-getAttributesCB(AtkObject *aAtkObj)
-{
+AtkAttributeSet* getAttributesCB(AtkObject* aAtkObj) {
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
-  if (accWrap)
-    return GetAttributeSet(accWrap);
+  if (accWrap) return GetAttributeSet(accWrap);
 
   ProxyAccessible* proxy = GetProxy(aAtkObj);
-  if (!proxy)
-    return nullptr;
+  if (!proxy) return nullptr;
 
   AutoTArray<Attribute, 10> attrs;
   proxy->Attributes(&attrs);
-  if (attrs.IsEmpty())
-    return nullptr;
+  if (attrs.IsEmpty()) return nullptr;
 
   AtkAttributeSet* objAttributeSet = nullptr;
   for (uint32_t i = 0; i < attrs.Length(); i++) {
-    AtkAttribute *objAttr = (AtkAttribute *)g_malloc(sizeof(AtkAttribute));
+    AtkAttribute* objAttr = (AtkAttribute*)g_malloc(sizeof(AtkAttribute));
     objAttr->name = g_strdup(attrs[i].Name().get());
     objAttr->value = g_strdup(NS_ConvertUTF16toUTF8(attrs[i].Value()).get());
     objAttributeSet = g_slist_prepend(objAttributeSet, objAttr);
   }
 
   return objAttributeSet;
 }
 
-const gchar*
-GetLocaleCB(AtkObject* aAtkObj)
-{
+const gchar* GetLocaleCB(AtkObject* aAtkObj) {
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
-  if (!accWrap)
-    return nullptr;
+  if (!accWrap) return nullptr;
 
   nsAutoString locale;
   accWrap->Language(locale);
   return AccessibleWrap::ReturnString(locale);
 }
 
-AtkObject *
-getParentCB(AtkObject *aAtkObj)
-{
-  if (aAtkObj->accessible_parent)
-    return aAtkObj->accessible_parent;
+AtkObject* getParentCB(AtkObject* aAtkObj) {
+  if (aAtkObj->accessible_parent) return aAtkObj->accessible_parent;
 
   AccessibleOrProxy acc = GetInternalObj(aAtkObj);
   if (acc.IsNull()) {
     return nullptr;
   }
 
   AccessibleOrProxy parent = acc.Parent();
   AtkObject* atkParent = !parent.IsNull() ? GetWrapperFor(parent) : nullptr;
-  if (atkParent)
-    atk_object_set_parent(aAtkObj, atkParent);
+  if (atkParent) atk_object_set_parent(aAtkObj, atkParent);
 
   return aAtkObj->accessible_parent;
 }
 
-gint
-getChildCountCB(AtkObject *aAtkObj)
-{
+gint getChildCountCB(AtkObject* aAtkObj) {
   if (AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj)) {
     if (nsAccUtils::MustPrune(accWrap)) {
       return 0;
     }
 
     uint32_t count = accWrap->EmbeddedChildCount();
     if (count) {
       return static_cast<gint>(count);
@@ -840,19 +728,17 @@ getChildCountCB(AtkObject *aAtkObj)
   ProxyAccessible* proxy = GetProxy(aAtkObj);
   if (proxy && !proxy->MustPruneChildren()) {
     return proxy->EmbeddedChildCount();
   }
 
   return 0;
 }
 
-AtkObject *
-refChildCB(AtkObject *aAtkObj, gint aChildIndex)
-{
+AtkObject* refChildCB(AtkObject* aAtkObj, gint aChildIndex) {
   // aChildIndex should not be less than zero
   if (aChildIndex < 0) {
     return nullptr;
   }
 
   AtkObject* childAtkObj = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
   if (accWrap) {
@@ -862,149 +748,132 @@ refChildCB(AtkObject *aAtkObj, gint aChi
 
     Accessible* accChild = accWrap->GetEmbeddedChildAt(aChildIndex);
     if (accChild) {
       childAtkObj = AccessibleWrap::GetAtkObject(accChild);
     } else {
       OuterDocAccessible* docOwner = accWrap->AsOuterDoc();
       if (docOwner) {
         ProxyAccessible* proxyDoc = docOwner->RemoteChildDoc();
-        if (proxyDoc)
-          childAtkObj = GetWrapperFor(proxyDoc);
+        if (proxyDoc) childAtkObj = GetWrapperFor(proxyDoc);
       }
     }
   } else if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
-    if (proxy->MustPruneChildren())
-      return nullptr;
+    if (proxy->MustPruneChildren()) return nullptr;
 
     ProxyAccessible* child = proxy->EmbeddedChildAt(aChildIndex);
-    if (child)
-      childAtkObj = GetWrapperFor(child);
+    if (child) childAtkObj = GetWrapperFor(child);
   } else {
     return nullptr;
   }
 
   NS_ASSERTION(childAtkObj, "Fail to get AtkObj");
-  if (!childAtkObj)
-    return nullptr;
+  if (!childAtkObj) return nullptr;
 
   g_object_ref(childAtkObj);
 
   if (aAtkObj != childAtkObj->accessible_parent)
     atk_object_set_parent(childAtkObj, aAtkObj);
 
   return childAtkObj;
 }
 
-gint
-getIndexInParentCB(AtkObject* aAtkObj)
-{
+gint getIndexInParentCB(AtkObject* aAtkObj) {
   // We don't use Accessible::IndexInParent() because we don't include text
   // leaf nodes as children in ATK.
   if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
     if (ProxyAccessible* parent = proxy->Parent())
       return parent->IndexOfEmbeddedChild(proxy);
 
-    if (proxy->OuterDocOfRemoteBrowser())
-      return 0;
+    if (proxy->OuterDocOfRemoteBrowser()) return 0;
 
     return -1;
   }
 
-    AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
-    if (!accWrap) {
-        return -1;
-    }
+  AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
+  if (!accWrap) {
+    return -1;
+  }
 
-    Accessible* parent = accWrap->Parent();
-    if (!parent)
-        return -1; // No parent
+  Accessible* parent = accWrap->Parent();
+  if (!parent) return -1;  // No parent
 
-    return parent->GetIndexOfEmbeddedChild(accWrap);
+  return parent->GetIndexOfEmbeddedChild(accWrap);
 }
 
-static void
-TranslateStates(uint64_t aState, AtkStateSet* aStateSet)
-{
+static void TranslateStates(uint64_t aState, AtkStateSet* aStateSet) {
   // atk doesn't have a read only state so read only things shouldn't be
   // editable.
-  if (aState & states::READONLY)
-    aState &= ~states::EDITABLE;
+  if (aState & states::READONLY) aState &= ~states::EDITABLE;
 
   // Convert every state to an entry in AtkStateMap
   uint64_t bitMask = 1;
   for (auto stateIndex = 0U; stateIndex < gAtkStateMapLen; stateIndex++) {
-    if (gAtkStateMap[stateIndex].atkState) { // There's potentially an ATK state for this
+    if (gAtkStateMap[stateIndex]
+            .atkState) {  // There's potentially an ATK state for this
       bool isStateOn = (aState & bitMask) != 0;
       if (gAtkStateMap[stateIndex].stateMapEntryType == kMapOpposite) {
         isStateOn = !isStateOn;
       }
       if (isStateOn) {
         atk_state_set_add_state(aStateSet, gAtkStateMap[stateIndex].atkState);
       }
     }
     bitMask <<= 1;
   }
 }
 
-AtkStateSet *
-refStateSetCB(AtkObject *aAtkObj)
-{
-  AtkStateSet *state_set = nullptr;
+AtkStateSet* refStateSetCB(AtkObject* aAtkObj) {
+  AtkStateSet* state_set = nullptr;
   state_set = ATK_OBJECT_CLASS(parent_class)->ref_state_set(aAtkObj);
 
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
   if (accWrap)
     TranslateStates(accWrap->State(), state_set);
   else if (ProxyAccessible* proxy = GetProxy(aAtkObj))
     TranslateStates(proxy->State(), state_set);
   else
     TranslateStates(states::DEFUNCT, state_set);
 
   return state_set;
 }
 
-static void
-UpdateAtkRelation(RelationType aType, Accessible* aAcc,
-                  AtkRelationType aAtkType, AtkRelationSet* aAtkSet)
-{
-  if (aAtkType == ATK_RELATION_NULL)
-    return;
+static void UpdateAtkRelation(RelationType aType, Accessible* aAcc,
+                              AtkRelationType aAtkType,
+                              AtkRelationSet* aAtkSet) {
+  if (aAtkType == ATK_RELATION_NULL) return;
 
   AtkRelation* atkRelation =
-    atk_relation_set_get_relation_by_type(aAtkSet, aAtkType);
-  if (atkRelation)
-    atk_relation_set_remove(aAtkSet, atkRelation);
+      atk_relation_set_get_relation_by_type(aAtkSet, aAtkType);
+  if (atkRelation) atk_relation_set_remove(aAtkSet, atkRelation);
 
   Relation rel(aAcc->RelationByType(aType));
   nsTArray<AtkObject*> targets;
   Accessible* tempAcc = nullptr;
   while ((tempAcc = rel.Next()))
     targets.AppendElement(AccessibleWrap::GetAtkObject(tempAcc));
 
   if (aType == RelationType::EMBEDS && aAcc->IsRoot()) {
     if (ProxyAccessible* proxyDoc =
-        aAcc->AsRoot()->GetPrimaryRemoteTopLevelContentDoc()) {
+            aAcc->AsRoot()->GetPrimaryRemoteTopLevelContentDoc()) {
       targets.AppendElement(GetWrapperFor(proxyDoc));
     }
   }
 
   if (targets.Length()) {
-    atkRelation = atk_relation_new(targets.Elements(),
-                                   targets.Length(), aAtkType);
+    atkRelation =
+        atk_relation_new(targets.Elements(), targets.Length(), aAtkType);
     atk_relation_set_add(aAtkSet, atkRelation);
     g_object_unref(atkRelation);
   }
 }
 
-AtkRelationSet *
-refRelationSetCB(AtkObject *aAtkObj)
-{
+AtkRelationSet* refRelationSetCB(AtkObject* aAtkObj) {
   AtkRelationSet* relation_set =
-    ATK_OBJECT_CLASS(parent_class)->ref_relation_set(aAtkObj);
+      ATK_OBJECT_CLASS(parent_class)->ref_relation_set(aAtkObj);
 
   const AtkRelationType typeMap[] = {
 #define RELATIONTYPE(gecko, s, atk, m, i) atk,
 #include "RelationTypeMap.h"
 #undef RELATIONTYPE
   };
 
   if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
@@ -1019,642 +888,570 @@ refRelationSetCB(AtkObject *aAtkObj)
 
       size_t targetCount = targetSets[i].Length();
       AutoTArray<AtkObject*, 5> wrappers;
       for (size_t j = 0; j < targetCount; j++)
         wrappers.AppendElement(GetWrapperFor(targetSets[i][j]));
 
       AtkRelationType atkType = typeMap[static_cast<uint32_t>(types[i])];
       AtkRelation* atkRelation =
-        atk_relation_set_get_relation_by_type(relation_set, atkType);
-      if (atkRelation)
-        atk_relation_set_remove(relation_set, atkRelation);
+          atk_relation_set_get_relation_by_type(relation_set, atkType);
+      if (atkRelation) atk_relation_set_remove(relation_set, atkRelation);
 
-      atkRelation = atk_relation_new(wrappers.Elements(), wrappers.Length(),
-                                     atkType);
+      atkRelation =
+          atk_relation_new(wrappers.Elements(), wrappers.Length(), atkType);
       atk_relation_set_add(relation_set, atkRelation);
       g_object_unref(atkRelation);
     }
   }
 
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
-  if (!accWrap)
-    return relation_set;
+  if (!accWrap) return relation_set;
 
 #define RELATIONTYPE(geckoType, geckoTypeName, atkType, msaaType, ia2Type) \
   UpdateAtkRelation(RelationType::geckoType, accWrap, atkType, relation_set);
 
 #include "RelationTypeMap.h"
 
 #undef RELATIONTYPE
 
   return relation_set;
 }
 
 // Check if aAtkObj is a valid MaiAtkObject, and return the AccessibleWrap
 // for it.
-AccessibleWrap*
-GetAccessibleWrap(AtkObject* aAtkObj)
-{
+AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj) {
   bool isMAIObject = IS_MAI_OBJECT(aAtkObj);
-  NS_ENSURE_TRUE(isMAIObject || MAI_IS_ATK_SOCKET(aAtkObj),
-                 nullptr);
+  NS_ENSURE_TRUE(isMAIObject || MAI_IS_ATK_SOCKET(aAtkObj), nullptr);
 
   AccessibleWrap* accWrap = nullptr;
   if (isMAIObject) {
     Accessible* acc = MAI_ATK_OBJECT(aAtkObj)->accWrap.AsAccessible();
     accWrap = static_cast<AccessibleWrap*>(acc);
   } else {
     accWrap = MAI_ATK_SOCKET(aAtkObj)->accWrap;
   }
 
   // Check if the accessible was deconstructed.
-  if (!accWrap)
-    return nullptr;
+  if (!accWrap) return nullptr;
 
   NS_ENSURE_TRUE(accWrap->GetAtkObject() == aAtkObj, nullptr);
 
   AccessibleWrap* appAccWrap = ApplicationAcc();
-  if (appAccWrap != accWrap && !accWrap->IsValidObject())
-    return nullptr;
+  if (appAccWrap != accWrap && !accWrap->IsValidObject()) return nullptr;
 
   return accWrap;
 }
 
-ProxyAccessible*
-GetProxy(AtkObject* aObj)
-{
+ProxyAccessible* GetProxy(AtkObject* aObj) {
   return GetInternalObj(aObj).AsProxy();
 }
 
-AccessibleOrProxy
-GetInternalObj(AtkObject* aObj)
-{
-  if (!aObj || !IS_MAI_OBJECT(aObj))
-    return nullptr;
+AccessibleOrProxy GetInternalObj(AtkObject* aObj) {
+  if (!aObj || !IS_MAI_OBJECT(aObj)) return nullptr;
 
   return MAI_ATK_OBJECT(aObj)->accWrap;
 }
 
-AtkObject*
-GetWrapperFor(ProxyAccessible* aProxy)
-{
+AtkObject* GetWrapperFor(ProxyAccessible* aProxy) {
   return reinterpret_cast<AtkObject*>(aProxy->GetWrapper() & ~IS_PROXY);
 }
 
-AtkObject*
-GetWrapperFor(AccessibleOrProxy aObj)
-{
+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)
-{
+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);
+    interfaces |= (1 << MAI_INTERFACE_HYPERTEXT) | (1 << MAI_INTERFACE_TEXT) |
+                  (1 << MAI_INTERFACE_EDITABLE_TEXT);
 
   if (aInterfaces & Interfaces::HYPERLINK)
     interfaces |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
 
-  if (aInterfaces & Interfaces::VALUE)
-    interfaces |= 1 << MAI_INTERFACE_VALUE;
+  if (aInterfaces & Interfaces::VALUE) interfaces |= 1 << MAI_INTERFACE_VALUE;
 
-  if (aInterfaces & Interfaces::TABLE)
-    interfaces |= 1 << MAI_INTERFACE_TABLE;
+  if (aInterfaces & Interfaces::TABLE) interfaces |= 1 << MAI_INTERFACE_TABLE;
 
   if (aInterfaces & Interfaces::TABLECELL)
     interfaces |= 1 << MAI_INTERFACE_TABLE_CELL;
 
-  if (aInterfaces & Interfaces::IMAGE)
-    interfaces |= 1 << MAI_INTERFACE_IMAGE;
+  if (aInterfaces & Interfaces::IMAGE) interfaces |= 1 << MAI_INTERFACE_IMAGE;
 
   if (aInterfaces & Interfaces::DOCUMENT)
     interfaces |= 1 << MAI_INTERFACE_DOCUMENT;
 
   if (aInterfaces & Interfaces::SELECTION) {
     interfaces |= 1 << MAI_INTERFACE_SELECTION;
   }
 
   if (aInterfaces & Interfaces::ACTION) {
     interfaces |= 1 << MAI_INTERFACE_ACTION;
   }
 
   return interfaces;
 }
 
-void
-a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces)
-{
+void a11y::ProxyCreated(ProxyAccessible* aProxy, uint32_t aInterfaces) {
   GType type = GetMaiAtkType(GetInterfacesForProxy(aProxy, aInterfaces));
   NS_ASSERTION(type, "why don't we have a type!");
 
-  AtkObject* obj =
-    reinterpret_cast<AtkObject *>
-    (g_object_new(type, nullptr));
-  if (!obj)
-    return;
+  AtkObject* obj = reinterpret_cast<AtkObject*>(g_object_new(type, nullptr));
+  if (!obj) return;
 
   uintptr_t inner = reinterpret_cast<uintptr_t>(aProxy) | IS_PROXY;
   atk_object_initialize(obj, reinterpret_cast<gpointer>(inner));
   obj->role = ATK_ROLE_INVALID;
   obj->layer = ATK_LAYER_INVALID;
   aProxy->SetWrapper(reinterpret_cast<uintptr_t>(obj) | IS_PROXY);
 }
 
-void
-a11y::ProxyDestroyed(ProxyAccessible* aProxy)
-{
+void a11y::ProxyDestroyed(ProxyAccessible* aProxy) {
   auto obj = reinterpret_cast<MaiAtkObject*>(aProxy->GetWrapper() & ~IS_PROXY);
   if (!obj) {
     return;
   }
 
   obj->Shutdown();
   g_object_unref(obj);
   aProxy->SetWrapper(0);
 }
 
-nsresult
-AccessibleWrap::HandleAccEvent(AccEvent* aEvent)
-{
+nsresult AccessibleWrap::HandleAccEvent(AccEvent* aEvent) {
   nsresult rv = Accessible::HandleAccEvent(aEvent);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (IPCAccessibilityActive()) {
     return NS_OK;
   }
 
-    Accessible* accessible = aEvent->GetAccessible();
-    NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
+  Accessible* accessible = aEvent->GetAccessible();
+  NS_ENSURE_TRUE(accessible, NS_ERROR_FAILURE);
 
-    // The accessible can become defunct if we have an xpcom event listener
-    // which decides it would be fun to change the DOM and flush layout.
-    if (accessible->IsDefunct())
-        return NS_OK;
+  // The accessible can become defunct if we have an xpcom event listener
+  // which decides it would be fun to change the DOM and flush layout.
+  if (accessible->IsDefunct()) return NS_OK;
 
-    uint32_t type = aEvent->GetEventType();
+  uint32_t type = aEvent->GetEventType();
 
-    AtkObject* atkObj = AccessibleWrap::GetAtkObject(accessible);
+  AtkObject* atkObj = AccessibleWrap::GetAtkObject(accessible);
 
   // We don't create ATK objects for plain text leaves, just return NS_OK in
   // such case.
-    if (!atkObj) {
-        NS_ASSERTION(type == nsIAccessibleEvent::EVENT_SHOW ||
+  if (!atkObj) {
+    NS_ASSERTION(type == nsIAccessibleEvent::EVENT_SHOW ||
                      type == nsIAccessibleEvent::EVENT_HIDE,
-                     "Event other than SHOW and HIDE fired for plain text leaves");
-        return NS_OK;
-    }
+                 "Event other than SHOW and HIDE fired for plain text leaves");
+    return NS_OK;
+  }
 
-    AccessibleWrap* accWrap = GetAccessibleWrap(atkObj);
-    if (!accWrap) {
-        return NS_OK; // Node is shut down
-    }
+  AccessibleWrap* accWrap = GetAccessibleWrap(atkObj);
+  if (!accWrap) {
+    return NS_OK;  // Node is shut down
+  }
 
-    switch (type) {
-    case nsIAccessibleEvent::EVENT_STATE_CHANGE:
-      {
-        AccStateChangeEvent* event = downcast_accEvent(aEvent);
-        MAI_ATK_OBJECT(atkObj)->FireStateChangeEvent(event->GetState(),
-                                                     event->IsStateEnabled());
-        break;
-      }
+  switch (type) {
+    case nsIAccessibleEvent::EVENT_STATE_CHANGE: {
+      AccStateChangeEvent* event = downcast_accEvent(aEvent);
+      MAI_ATK_OBJECT(atkObj)->FireStateChangeEvent(event->GetState(),
+                                                   event->IsStateEnabled());
+      break;
+    }
 
     case nsIAccessibleEvent::EVENT_TEXT_REMOVED:
-    case nsIAccessibleEvent::EVENT_TEXT_INSERTED:
-      {
-        AccTextChangeEvent* event = downcast_accEvent(aEvent);
-        NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
+    case nsIAccessibleEvent::EVENT_TEXT_INSERTED: {
+      AccTextChangeEvent* event = downcast_accEvent(aEvent);
+      NS_ENSURE_TRUE(event, NS_ERROR_FAILURE);
+
+      MAI_ATK_OBJECT(atkObj)->FireTextChangeEvent(
+          event->ModifiedText(), event->GetStartOffset(), event->GetLength(),
+          event->IsTextInserted(), event->IsFromUserInput());
 
-        MAI_ATK_OBJECT(atkObj)-> FireTextChangeEvent(event->ModifiedText(),
-                                                     event->GetStartOffset(),
-                                                     event->GetLength(),
-                                                     event->IsTextInserted(),
-                                                     event->IsFromUserInput());
+      return NS_OK;
+    }
 
+    case nsIAccessibleEvent::EVENT_FOCUS: {
+      a11y::RootAccessible* rootAccWrap = accWrap->RootAccessible();
+      if (rootAccWrap && rootAccWrap->mActivated) {
+        atk_focus_tracker_notify(atkObj);
+        // Fire state change event for focus
+        atk_object_notify_state_change(atkObj, ATK_STATE_FOCUSED, true);
         return NS_OK;
       }
+    } break;
 
-    case nsIAccessibleEvent::EVENT_FOCUS:
-      {
-        a11y::RootAccessible* rootAccWrap = accWrap->RootAccessible();
-        if (rootAccWrap && rootAccWrap->mActivated) {
-            atk_focus_tracker_notify(atkObj);
-            // Fire state change event for focus
-            atk_object_notify_state_change(atkObj, ATK_STATE_FOCUSED, true);
-            return NS_OK;
-        }
-      } break;
+    case nsIAccessibleEvent::EVENT_NAME_CHANGE: {
+      nsAutoString newName;
+      accessible->Name(newName);
+
+      MaybeFireNameChange(atkObj, newName);
 
-    case nsIAccessibleEvent::EVENT_NAME_CHANGE:
-      {
-        nsAutoString newName;
-        accessible->Name(newName);
+      break;
+    }
 
-        MaybeFireNameChange(atkObj, newName);
-
-        break;
+    case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
+    case nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE:
+      if (accessible->HasNumericValue()) {
+        // Make sure this is a numeric value. Don't fire for string value
+        // changes (e.g. text editing) ATK values are always numeric.
+        g_object_notify((GObject*)atkObj, "accessible-value");
       }
-
-  case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
-  case nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE:
-    if (accessible->HasNumericValue()) {
-      // Make sure this is a numeric value. Don't fire for string value changes
-      // (e.g. text editing) ATK values are always numeric.
-      g_object_notify((GObject*)atkObj, "accessible-value");
-    }
-    break;
+      break;
 
     case nsIAccessibleEvent::EVENT_SELECTION:
     case nsIAccessibleEvent::EVENT_SELECTION_ADD:
-    case nsIAccessibleEvent::EVENT_SELECTION_REMOVE:
-    {
+    case nsIAccessibleEvent::EVENT_SELECTION_REMOVE: {
       // XXX: dupe events may be fired
       AccSelChangeEvent* selChangeEvent = downcast_accEvent(aEvent);
-      g_signal_emit_by_name(AccessibleWrap::GetAtkObject(selChangeEvent->Widget()),
-                            "selection_changed");
+      g_signal_emit_by_name(
+          AccessibleWrap::GetAtkObject(selChangeEvent->Widget()),
+          "selection_changed");
       break;
     }
 
-    case nsIAccessibleEvent::EVENT_SELECTION_WITHIN:
-    {
+    case nsIAccessibleEvent::EVENT_SELECTION_WITHIN: {
       g_signal_emit_by_name(atkObj, "selection_changed");
       break;
     }
 
     case nsIAccessibleEvent::EVENT_ALERT:
       // A hack using state change showing events as alert events.
       atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, true);
       break;
 
     case nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED:
-        g_signal_emit_by_name(atkObj, "text_selection_changed");
-        break;
+      g_signal_emit_by_name(atkObj, "text_selection_changed");
+      break;
 
-    case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED:
-      {
-        AccCaretMoveEvent* caretMoveEvent = downcast_accEvent(aEvent);
-        NS_ASSERTION(caretMoveEvent, "Event needs event data");
-        if (!caretMoveEvent)
-            break;
+    case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED: {
+      AccCaretMoveEvent* caretMoveEvent = downcast_accEvent(aEvent);
+      NS_ASSERTION(caretMoveEvent, "Event needs event data");
+      if (!caretMoveEvent) break;
 
-        int32_t caretOffset = caretMoveEvent->GetCaretOffset();
-        g_signal_emit_by_name(atkObj, "text_caret_moved", caretOffset);
-      } break;
+      int32_t caretOffset = caretMoveEvent->GetCaretOffset();
+      g_signal_emit_by_name(atkObj, "text_caret_moved", caretOffset);
+    } break;
 
     case nsIAccessibleEvent::EVENT_TEXT_ATTRIBUTE_CHANGED:
-        g_signal_emit_by_name(atkObj, "text-attributes-changed");
-        break;
+      g_signal_emit_by_name(atkObj, "text-attributes-changed");
+      break;
 
     case nsIAccessibleEvent::EVENT_TABLE_MODEL_CHANGED:
-        g_signal_emit_by_name(atkObj, "model_changed");
-        break;
+      g_signal_emit_by_name(atkObj, "model_changed");
+      break;
 
-    case nsIAccessibleEvent::EVENT_TABLE_ROW_INSERT:
-      {
-        AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
-        NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
+    case nsIAccessibleEvent::EVENT_TABLE_ROW_INSERT: {
+      AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
+      NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
 
-        int32_t rowIndex = tableEvent->GetIndex();
-        int32_t numRows = tableEvent->GetCount();
+      int32_t rowIndex = tableEvent->GetIndex();
+      int32_t numRows = tableEvent->GetCount();
 
-        g_signal_emit_by_name(atkObj, "row_inserted", rowIndex, numRows);
-     } break;
+      g_signal_emit_by_name(atkObj, "row_inserted", rowIndex, numRows);
+    } break;
 
-   case nsIAccessibleEvent::EVENT_TABLE_ROW_DELETE:
-     {
-        AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
-        NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
+    case nsIAccessibleEvent::EVENT_TABLE_ROW_DELETE: {
+      AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
+      NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
 
-        int32_t rowIndex = tableEvent->GetIndex();
-        int32_t numRows = tableEvent->GetCount();
+      int32_t rowIndex = tableEvent->GetIndex();
+      int32_t numRows = tableEvent->GetCount();
 
-        g_signal_emit_by_name(atkObj, "row_deleted", rowIndex, numRows);
-      } break;
+      g_signal_emit_by_name(atkObj, "row_deleted", rowIndex, numRows);
+    } break;
 
-    case nsIAccessibleEvent::EVENT_TABLE_ROW_REORDER:
-      {
-        g_signal_emit_by_name(atkObj, "row_reordered");
-        break;
-      }
+    case nsIAccessibleEvent::EVENT_TABLE_ROW_REORDER: {
+      g_signal_emit_by_name(atkObj, "row_reordered");
+      break;
+    }
 
-    case nsIAccessibleEvent::EVENT_TABLE_COLUMN_INSERT:
-      {
-        AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
-        NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
+    case nsIAccessibleEvent::EVENT_TABLE_COLUMN_INSERT: {
+      AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
+      NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
 
-        int32_t colIndex = tableEvent->GetIndex();
-        int32_t numCols = tableEvent->GetCount();
-        g_signal_emit_by_name(atkObj, "column_inserted", colIndex, numCols);
-      } break;
+      int32_t colIndex = tableEvent->GetIndex();
+      int32_t numCols = tableEvent->GetCount();
+      g_signal_emit_by_name(atkObj, "column_inserted", colIndex, numCols);
+    } break;
 
-    case nsIAccessibleEvent::EVENT_TABLE_COLUMN_DELETE:
-      {
-        AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
-        NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
+    case nsIAccessibleEvent::EVENT_TABLE_COLUMN_DELETE: {
+      AccTableChangeEvent* tableEvent = downcast_accEvent(aEvent);
+      NS_ENSURE_TRUE(tableEvent, NS_ERROR_FAILURE);
 
-        int32_t colIndex = tableEvent->GetIndex();
-        int32_t numCols = tableEvent->GetCount();
-        g_signal_emit_by_name(atkObj, "column_deleted", colIndex, numCols);
-      } break;
+      int32_t colIndex = tableEvent->GetIndex();
+      int32_t numCols = tableEvent->GetCount();
+      g_signal_emit_by_name(atkObj, "column_deleted", colIndex, numCols);
+    } break;
 
     case nsIAccessibleEvent::EVENT_TABLE_COLUMN_REORDER:
-        g_signal_emit_by_name(atkObj, "column_reordered");
-        break;
+      g_signal_emit_by_name(atkObj, "column_reordered");
+      break;
 
     case nsIAccessibleEvent::EVENT_SECTION_CHANGED:
-        g_signal_emit_by_name(atkObj, "visible_data_changed");
-        break;
+      g_signal_emit_by_name(atkObj, "visible_data_changed");
+      break;
 
-    case nsIAccessibleEvent::EVENT_SHOW:
-      {
-        AccMutationEvent* event = downcast_accEvent(aEvent);
-        Accessible* parentAcc = event ? event->Parent() : accessible->Parent();
-        AtkObject* parent = AccessibleWrap::GetAtkObject(parentAcc);
-        NS_ENSURE_STATE(parent);
-        auto obj = reinterpret_cast<MaiAtkObject*>(atkObj);
-        obj->FireAtkShowHideEvent(parent, true, aEvent->IsFromUserInput());
-        return NS_OK;
+    case nsIAccessibleEvent::EVENT_SHOW: {
+      AccMutationEvent* event = downcast_accEvent(aEvent);
+      Accessible* parentAcc = event ? event->Parent() : accessible->Parent();
+      AtkObject* parent = AccessibleWrap::GetAtkObject(parentAcc);
+      NS_ENSURE_STATE(parent);
+      auto obj = reinterpret_cast<MaiAtkObject*>(atkObj);
+      obj->FireAtkShowHideEvent(parent, true, aEvent->IsFromUserInput());
+      return NS_OK;
+    }
+
+    case nsIAccessibleEvent::EVENT_HIDE: {
+      // XXX - Handle native dialog accessibles.
+      if (!accessible->IsRoot() && accessible->HasARIARole() &&
+          accessible->ARIARole() == roles::DIALOG) {
+        guint id = g_signal_lookup("deactivate", MAI_TYPE_ATK_OBJECT);
+        g_signal_emit(atkObj, id, 0);
       }
 
-    case nsIAccessibleEvent::EVENT_HIDE:
-      {
-        // XXX - Handle native dialog accessibles.
-        if (!accessible->IsRoot() && accessible->HasARIARole() &&
-            accessible->ARIARole() == roles::DIALOG) {
-          guint id = g_signal_lookup("deactivate", MAI_TYPE_ATK_OBJECT);
-          g_signal_emit(atkObj, id, 0);
-        }
+      AccMutationEvent* event = downcast_accEvent(aEvent);
+      Accessible* parentAcc = event ? event->Parent() : accessible->Parent();
+      AtkObject* parent = AccessibleWrap::GetAtkObject(parentAcc);
+      NS_ENSURE_STATE(parent);
+      auto obj = reinterpret_cast<MaiAtkObject*>(atkObj);
+      obj->FireAtkShowHideEvent(parent, false, aEvent->IsFromUserInput());
+      return NS_OK;
+    }
 
-        AccMutationEvent* event = downcast_accEvent(aEvent);
-        Accessible* parentAcc = event ? event->Parent() : accessible->Parent();
-        AtkObject* parent = AccessibleWrap::GetAtkObject(parentAcc);
-        NS_ENSURE_STATE(parent);
-        auto obj = reinterpret_cast<MaiAtkObject*>(atkObj);
-        obj->FireAtkShowHideEvent(parent, false, aEvent->IsFromUserInput());
-        return NS_OK;
-      }
-
-        /*
-         * Because dealing with menu is very different between nsIAccessible
-         * and ATK, and the menu activity is important, specially transfer the
-         * following two event.
-         * Need more verification by AT test.
-         */
+      /*
+       * Because dealing with menu is very different between nsIAccessible
+       * and ATK, and the menu activity is important, specially transfer the
+       * following two event.
+       * Need more verification by AT test.
+       */
     case nsIAccessibleEvent::EVENT_MENU_START:
     case nsIAccessibleEvent::EVENT_MENU_END:
-        break;
+      break;
+
+    case nsIAccessibleEvent::EVENT_WINDOW_ACTIVATE: {
+      accessible->AsRoot()->mActivated = true;
+      guint id = g_signal_lookup("activate", MAI_TYPE_ATK_OBJECT);
+      g_signal_emit(atkObj, id, 0);
+
+      // Always fire a current focus event after activation.
+      FocusMgr()->ForceFocusEvent();
+    } break;
+
+    case nsIAccessibleEvent::EVENT_WINDOW_DEACTIVATE: {
+      accessible->AsRoot()->mActivated = false;
+      guint id = g_signal_lookup("deactivate", MAI_TYPE_ATK_OBJECT);
+      g_signal_emit(atkObj, id, 0);
+    } break;
 
-    case nsIAccessibleEvent::EVENT_WINDOW_ACTIVATE:
-      {
-        accessible->AsRoot()->mActivated = true;
+    case nsIAccessibleEvent::EVENT_WINDOW_MAXIMIZE: {
+      guint id = g_signal_lookup("maximize", MAI_TYPE_ATK_OBJECT);
+      g_signal_emit(atkObj, id, 0);
+    } break;
+
+    case nsIAccessibleEvent::EVENT_WINDOW_MINIMIZE: {
+      guint id = g_signal_lookup("minimize", MAI_TYPE_ATK_OBJECT);
+      g_signal_emit(atkObj, id, 0);
+    } break;
+
+    case nsIAccessibleEvent::EVENT_WINDOW_RESTORE: {
+      guint id = g_signal_lookup("restore", MAI_TYPE_ATK_OBJECT);
+      g_signal_emit(atkObj, id, 0);
+    } break;
+
+    case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE:
+      g_signal_emit_by_name(atkObj, "load_complete");
+      // XXX - Handle native dialog accessibles.
+      if (!accessible->IsRoot() && accessible->HasARIARole() &&
+          accessible->ARIARole() == roles::DIALOG) {
         guint id = g_signal_lookup("activate", MAI_TYPE_ATK_OBJECT);
         g_signal_emit(atkObj, id, 0);
-
-        // Always fire a current focus event after activation.
-        FocusMgr()->ForceFocusEvent();
-      } break;
-
-    case nsIAccessibleEvent::EVENT_WINDOW_DEACTIVATE:
-      {
-        accessible->AsRoot()->mActivated = false;
-        guint id = g_signal_lookup("deactivate", MAI_TYPE_ATK_OBJECT);
-        g_signal_emit(atkObj, id, 0);
-      } break;
-
-    case nsIAccessibleEvent::EVENT_WINDOW_MAXIMIZE:
-      {
-        guint id = g_signal_lookup("maximize", MAI_TYPE_ATK_OBJECT);
-        g_signal_emit(atkObj, id, 0);
-      } break;
-
-    case nsIAccessibleEvent::EVENT_WINDOW_MINIMIZE:
-      {
-        guint id = g_signal_lookup("minimize", MAI_TYPE_ATK_OBJECT);
-        g_signal_emit(atkObj, id, 0);
-      } break;
-
-    case nsIAccessibleEvent::EVENT_WINDOW_RESTORE:
-      {
-        guint id = g_signal_lookup("restore", MAI_TYPE_ATK_OBJECT);
-        g_signal_emit(atkObj, id, 0);
-      } break;
-
-    case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE:
-        g_signal_emit_by_name (atkObj, "load_complete");
-        // XXX - Handle native dialog accessibles.
-        if (!accessible->IsRoot() && accessible->HasARIARole() &&
-            accessible->ARIARole() == roles::DIALOG) {
-          guint id = g_signal_lookup("activate", MAI_TYPE_ATK_OBJECT);
-          g_signal_emit(atkObj, id, 0);
-        }
+      }
       break;
 
     case nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD:
-        g_signal_emit_by_name (atkObj, "reload");
+      g_signal_emit_by_name(atkObj, "reload");
       break;
 
     case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED:
-        g_signal_emit_by_name (atkObj, "load_stopped");
+      g_signal_emit_by_name(atkObj, "load_stopped");
       break;
 
     case nsIAccessibleEvent::EVENT_MENUPOPUP_START:
-        atk_focus_tracker_notify(atkObj); // fire extra focus event
-        atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, true);
-        atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, true);
-        break;
+      atk_focus_tracker_notify(atkObj);  // fire extra focus event
+      atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, true);
+      atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, true);
+      break;
 
     case nsIAccessibleEvent::EVENT_MENUPOPUP_END:
-        atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, false);
-        atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, false);
-        break;
-    }
+      atk_object_notify_state_change(atkObj, ATK_STATE_VISIBLE, false);
+      atk_object_notify_state_change(atkObj, ATK_STATE_SHOWING, false);
+      break;
+  }
 
-    return NS_OK;
+  return NS_OK;
 }
 
-void
-a11y::ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType)
-{
+void a11y::ProxyEvent(ProxyAccessible* aTarget, uint32_t aEventType) {
   AtkObject* wrapper = GetWrapperFor(aTarget);
 
   switch (aEventType) {
-  case nsIAccessibleEvent::EVENT_FOCUS:
-    atk_focus_tracker_notify(wrapper);
-    atk_object_notify_state_change(wrapper, ATK_STATE_FOCUSED, true);
-    break;
-  case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE:
-    g_signal_emit_by_name(wrapper, "load_complete");
-    break;
-  case nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD:
-    g_signal_emit_by_name(wrapper, "reload");
-    break;
-  case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED:
-    g_signal_emit_by_name(wrapper, "load_stopped");
-    break;
-  case nsIAccessibleEvent::EVENT_MENUPOPUP_START:
-    atk_focus_tracker_notify(wrapper); // fire extra focus event
-    atk_object_notify_state_change(wrapper, ATK_STATE_VISIBLE, true);
-    atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, true);
-    break;
-  case nsIAccessibleEvent::EVENT_MENUPOPUP_END:
-    atk_object_notify_state_change(wrapper, ATK_STATE_VISIBLE, false);
-    atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, false);
-    break;
-  case nsIAccessibleEvent::EVENT_ALERT:
-    // A hack using state change showing events as alert events.
-    atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, true);
-    break;
-  case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
-    g_object_notify((GObject*)wrapper, "accessible-value");
-    break;
-  case nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED:
-  case nsIAccessibleEvent::EVENT_SELECTION_WITHIN:
-    g_signal_emit_by_name(wrapper, "selection_changed");
-    break;
+    case nsIAccessibleEvent::EVENT_FOCUS:
+      atk_focus_tracker_notify(wrapper);
+      atk_object_notify_state_change(wrapper, ATK_STATE_FOCUSED, true);
+      break;
+    case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE:
+      g_signal_emit_by_name(wrapper, "load_complete");
+      break;
+    case nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD:
+      g_signal_emit_by_name(wrapper, "reload");
+      break;
+    case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED:
+      g_signal_emit_by_name(wrapper, "load_stopped");
+      break;
+    case nsIAccessibleEvent::EVENT_MENUPOPUP_START:
+      atk_focus_tracker_notify(wrapper);  // fire extra focus event
+      atk_object_notify_state_change(wrapper, ATK_STATE_VISIBLE, true);
+      atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, true);
+      break;
+    case nsIAccessibleEvent::EVENT_MENUPOPUP_END:
+      atk_object_notify_state_change(wrapper, ATK_STATE_VISIBLE, false);
+      atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, false);
+      break;
+    case nsIAccessibleEvent::EVENT_ALERT:
+      // A hack using state change showing events as alert events.
+      atk_object_notify_state_change(wrapper, ATK_STATE_SHOWING, true);
+      break;
+    case nsIAccessibleEvent::EVENT_VALUE_CHANGE:
+      g_object_notify((GObject*)wrapper, "accessible-value");
+      break;
+    case nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED:
+    case nsIAccessibleEvent::EVENT_SELECTION_WITHIN:
+      g_signal_emit_by_name(wrapper, "selection_changed");
+      break;
   }
 }
 
-void
-a11y::ProxyStateChangeEvent(ProxyAccessible* aTarget, uint64_t aState,
-                            bool aEnabled)
-{
+void a11y::ProxyStateChangeEvent(ProxyAccessible* aTarget, uint64_t aState,
+                                 bool aEnabled) {
   MaiAtkObject* atkObj = MAI_ATK_OBJECT(GetWrapperFor(aTarget));
   atkObj->FireStateChangeEvent(aState, aEnabled);
 }
 
-void
-a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset)
-{
+void a11y::ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset) {
   AtkObject* wrapper = GetWrapperFor(aTarget);
   g_signal_emit_by_name(wrapper, "text_caret_moved", aOffset);
 }
 
-void
-MaiAtkObject::FireStateChangeEvent(uint64_t aState, bool aEnabled)
-{
+void MaiAtkObject::FireStateChangeEvent(uint64_t aState, bool aEnabled) {
   auto state = aState;
   int32_t stateIndex = -1;
   while (state > 0) {
     ++stateIndex;
     state >>= 1;
   }
 
-  MOZ_ASSERT(stateIndex >= 0 && stateIndex < static_cast<int32_t>(gAtkStateMapLen),
-             "No ATK state for internal state was found");
+  MOZ_ASSERT(
+      stateIndex >= 0 && stateIndex < static_cast<int32_t>(gAtkStateMapLen),
+      "No ATK state for internal state was found");
   if (stateIndex < 0 || stateIndex >= static_cast<int32_t>(gAtkStateMapLen)) {
     return;
   }
 
   if (gAtkStateMap[stateIndex].atkState != kNone) {
     MOZ_ASSERT(gAtkStateMap[stateIndex].stateMapEntryType != kNoStateChange,
-                 "State changes should not fired for this state");
+               "State changes should not fired for this state");
 
     if (gAtkStateMap[stateIndex].stateMapEntryType == kMapOpposite) {
       aEnabled = !aEnabled;
     }
 
     // Fire state change for first state if there is one to map
-    atk_object_notify_state_change(&parent,
-                                   gAtkStateMap[stateIndex].atkState,
+    atk_object_notify_state_change(&parent, gAtkStateMap[stateIndex].atkState,
                                    aEnabled);
   }
 }
 
-void
-a11y::ProxyTextChangeEvent(ProxyAccessible* aTarget, const nsString& aStr,
-                           int32_t aStart, uint32_t aLen, bool aIsInsert,
-                           bool aFromUser)
-{
+void a11y::ProxyTextChangeEvent(ProxyAccessible* aTarget, const nsString& aStr,
+                                int32_t aStart, uint32_t aLen, bool aIsInsert,
+                                bool aFromUser) {
   MaiAtkObject* atkObj = MAI_ATK_OBJECT(GetWrapperFor(aTarget));
   atkObj->FireTextChangeEvent(aStr, aStart, aLen, aIsInsert, aFromUser);
 }
 
 #define OLD_TEXT_INSERTED "text_changed::insert"
 #define OLD_TEXT_REMOVED "text_changed::delete"
 static const char* oldTextChangeStrings[2][2] = {
-  { OLD_TEXT_REMOVED NON_USER_EVENT, OLD_TEXT_INSERTED NON_USER_EVENT },
-  { OLD_TEXT_REMOVED, OLD_TEXT_INSERTED }
-};
+    {OLD_TEXT_REMOVED NON_USER_EVENT, OLD_TEXT_INSERTED NON_USER_EVENT},
+    {OLD_TEXT_REMOVED, OLD_TEXT_INSERTED}};
 
 #define TEXT_INSERTED "text-insert"
 #define TEXT_REMOVED "text-remove"
 #define NON_USER_DETAIL "::system"
 static const char* textChangedStrings[2][2] = {
-  { TEXT_REMOVED NON_USER_DETAIL, TEXT_INSERTED NON_USER_DETAIL },
-  { TEXT_REMOVED, TEXT_INSERTED}
-};
+    {TEXT_REMOVED NON_USER_DETAIL, TEXT_INSERTED NON_USER_DETAIL},
+    {TEXT_REMOVED, TEXT_INSERTED}};
 
-void
-MaiAtkObject::FireTextChangeEvent(const nsString& aStr, int32_t aStart,
-                                  uint32_t aLen, bool aIsInsert,
-                                  bool aFromUser)
-{
+void MaiAtkObject::FireTextChangeEvent(const nsString& aStr, int32_t aStart,
+                                       uint32_t aLen, bool aIsInsert,
+                                       bool aFromUser) {
   if (gAvailableAtkSignals == eUnknown)
-    gAvailableAtkSignals =
-      g_signal_lookup("text-insert", G_OBJECT_TYPE(this)) ?
-        eHaveNewAtkTextSignals : eNoNewAtkSignals;
+    gAvailableAtkSignals = g_signal_lookup("text-insert", G_OBJECT_TYPE(this))
+                               ? eHaveNewAtkTextSignals
+                               : eNoNewAtkSignals;
 
   if (gAvailableAtkSignals == eNoNewAtkSignals) {
     // XXX remove this code and the gHaveNewTextSignals check when we can
     // stop supporting old atk since it doesn't really work anyway
     // see bug 619002
-    const char* signal_name =
-      oldTextChangeStrings[aFromUser][aIsInsert];
+    const char* signal_name = oldTextChangeStrings[aFromUser][aIsInsert];
     g_signal_emit_by_name(this, signal_name, aStart, aLen);
   } else {
-    const char* signal_name =
-      textChangedStrings[aFromUser][aIsInsert];
+    const char* signal_name = textChangedStrings[aFromUser][aIsInsert];
     g_signal_emit_by_name(this, signal_name, aStart, aLen,
                           NS_ConvertUTF16toUTF8(aStr).get());
   }
 }
 
-void
-a11y::ProxyShowHideEvent(ProxyAccessible* aTarget, ProxyAccessible* aParent,
-                         bool aInsert, bool aFromUser)
-{
+void a11y::ProxyShowHideEvent(ProxyAccessible* aTarget,
+                              ProxyAccessible* aParent, bool aInsert,
+                              bool aFromUser) {
   MaiAtkObject* obj = MAI_ATK_OBJECT(GetWrapperFor(aTarget));
   obj->FireAtkShowHideEvent(GetWrapperFor(aParent), aInsert, aFromUser);
 }
 
 #define ADD_EVENT "children_changed::add"
 #define HIDE_EVENT "children_changed::remove"
 
-static const char *kMutationStrings[2][2] = {
-  { HIDE_EVENT NON_USER_EVENT, ADD_EVENT NON_USER_EVENT },
-  { HIDE_EVENT, ADD_EVENT },
+static const char* kMutationStrings[2][2] = {
+    {HIDE_EVENT NON_USER_EVENT, ADD_EVENT NON_USER_EVENT},
+    {HIDE_EVENT, ADD_EVENT},
 };
 
-void
-MaiAtkObject::FireAtkShowHideEvent(AtkObject* aParent, bool aIsAdded,
-                                   bool aFromUser)
-{
-    int32_t indexInParent = getIndexInParentCB(&this->parent);
-    const char *signal_name = kMutationStrings[aFromUser][aIsAdded];
-    g_signal_emit_by_name(aParent, signal_name, indexInParent, this, nullptr);
+void MaiAtkObject::FireAtkShowHideEvent(AtkObject* aParent, bool aIsAdded,
+                                        bool aFromUser) {
+  int32_t indexInParent = getIndexInParentCB(&this->parent);
+  const char* signal_name = kMutationStrings[aFromUser][aIsAdded];
+  g_signal_emit_by_name(aParent, signal_name, indexInParent, this, nullptr);
 }
 
-void
-a11y::ProxySelectionEvent(ProxyAccessible*, ProxyAccessible* aWidget, uint32_t)
-{
+void a11y::ProxySelectionEvent(ProxyAccessible*, ProxyAccessible* aWidget,
+                               uint32_t) {
   MaiAtkObject* obj = MAI_ATK_OBJECT(GetWrapperFor(aWidget));
-    g_signal_emit_by_name(obj, "selection_changed");
+  g_signal_emit_by_name(obj, "selection_changed");
 }
 
 // static
-void
-AccessibleWrap::GetKeyBinding(Accessible* aAccessible, nsAString& aResult)
-{
+void AccessibleWrap::GetKeyBinding(Accessible* aAccessible,
+                                   nsAString& aResult) {
   // Return all key bindings including access key and keyboard shortcut.
 
   // Get access key.
   nsAutoString keyBindingsStr;
   KeyBinding keyBinding = aAccessible->AccessKey();
   if (!keyBinding.IsEmpty()) {
     keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
 
@@ -1689,19 +1486,18 @@ AccessibleWrap::GetKeyBinding(Accessible
   keyBinding = aAccessible->KeyboardShortcut();
   if (!keyBinding.IsEmpty()) {
     keyBinding.AppendToString(keyBindingsStr, KeyBinding::eAtkFormat);
   }
   aResult = keyBindingsStr;
 }
 
 // static
-Accessible*
-AccessibleWrap::GetColumnHeader(TableAccessible* aAccessible, int32_t aColIdx)
-{
+Accessible* AccessibleWrap::GetColumnHeader(TableAccessible* aAccessible,
+                                            int32_t aColIdx) {
   if (!aAccessible) {
     return nullptr;
   }
 
   Accessible* cell = aAccessible->CellAt(0, aColIdx);
   if (!cell) {
     return nullptr;
   }
@@ -1723,19 +1519,18 @@ AccessibleWrap::GetColumnHeader(TableAcc
   if (headerCells.IsEmpty()) {
     return nullptr;
   }
 
   return headerCells[0];
 }
 
 // static
-Accessible*
-AccessibleWrap::GetRowHeader(TableAccessible* aAccessible, int32_t aRowIdx)
-{
+Accessible* AccessibleWrap::GetRowHeader(TableAccessible* aAccessible,
+                                         int32_t aRowIdx) {
   if (!aAccessible) {
     return nullptr;
   }
 
   Accessible* cell = aAccessible->CellAt(aRowIdx, 0);
   if (!cell) {
     return nullptr;
   }
--- a/accessible/atk/AccessibleWrap.h
+++ b/accessible/atk/AccessibleWrap.h
@@ -9,84 +9,83 @@
 
 #include "nsCOMPtr.h"
 #include "Accessible.h"
 
 struct _AtkObject;
 typedef struct _AtkObject AtkObject;
 
 enum AtkProperty {
-  PROP_0,           // gobject convention
+  PROP_0,  // gobject convention
   PROP_NAME,
   PROP_DESCRIPTION,
-  PROP_PARENT,      // ancestry has changed
+  PROP_PARENT,  // ancestry has changed
   PROP_ROLE,
   PROP_LAYER,
   PROP_MDI_ZORDER,
   PROP_TABLE_CAPTION,
   PROP_TABLE_COLUMN_DESCRIPTION,
   PROP_TABLE_COLUMN_HEADER,
   PROP_TABLE_ROW_DESCRIPTION,
   PROP_TABLE_ROW_HEADER,
   PROP_TABLE_SUMMARY,
-  PROP_LAST         // gobject convention
+  PROP_LAST  // gobject convention
 };
 
 struct AtkPropertyChange {
-  int32_t type;     // property type as listed above
-  void *oldvalue;
-  void *newvalue;
+  int32_t type;  // property type as listed above
+  void* oldvalue;
+  void* newvalue;
 };
 
 namespace mozilla {
 namespace a11y {
 
 class MaiHyperlink;
 
 /**
  * AccessibleWrap, and its descendents in atk directory provide the
  * implementation of AtkObject.
  */
-class AccessibleWrap : public Accessible
-{
-public:
+class AccessibleWrap : public Accessible {
+ public:
   AccessibleWrap(nsIContent* aContent, DocAccessible* aDoc);
   virtual ~AccessibleWrap();
   void ShutdownAtkObject();
 
   virtual void Shutdown() override;
 
   // return the atk object for this AccessibleWrap
   virtual void GetNativeInterface(void** aOutAccessible) override;
   virtual nsresult HandleAccEvent(AccEvent* aEvent) override;
 
-  AtkObject * GetAtkObject(void);
+  AtkObject* GetAtkObject(void);
   static AtkObject* GetAtkObject(Accessible* aAccessible);
 
   bool IsValidObject();
 
-  static const char * ReturnString(nsAString &aString) {
+  static const char* ReturnString(nsAString& aString) {
     static nsCString returnedString;
     returnedString = NS_ConvertUTF16toUTF8(aString);
     return returnedString.get();
   }
 
   static void GetKeyBinding(Accessible* aAccessible, nsAString& aResult);
 
   static Accessible* GetColumnHeader(TableAccessible* aAccessible,
                                      int32_t aColIdx);
   static Accessible* GetRowHeader(TableAccessible* aAccessible,
                                   int32_t aRowIdx);
-protected:
 
-  nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject *aObject);
-  nsresult FireAtkTextChangedEvent(AccEvent* aEvent, AtkObject *aObject);
+ protected:
+  nsresult FireAtkStateChangeEvent(AccEvent* aEvent, AtkObject* aObject);
+  nsresult FireAtkTextChangedEvent(AccEvent* aEvent, AtkObject* aObject);
 
-  AtkObject *mAtkObject;
+  AtkObject* mAtkObject;
 
-private:
+ private:
   uint16_t CreateMaiInterfaces();
 };
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif /* __NS_ACCESSIBLE_WRAP_H__ */
--- a/accessible/atk/ApplicationAccessibleWrap.cpp
+++ b/accessible/atk/ApplicationAccessibleWrap.cpp
@@ -11,157 +11,133 @@
 #include "nsAccessibilityService.h"
 
 #include <gtk/gtk.h>
 #include <atk/atk.h>
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
-
 // ApplicationAccessibleWrap
 
-ApplicationAccessibleWrap::ApplicationAccessibleWrap():
-  ApplicationAccessible()
-{
-}
+ApplicationAccessibleWrap::ApplicationAccessibleWrap()
+    : ApplicationAccessible() {}
 
-ApplicationAccessibleWrap::~ApplicationAccessibleWrap()
-{
+ApplicationAccessibleWrap::~ApplicationAccessibleWrap() {
   AccessibleWrap::ShutdownAtkObject();
 }
 
-gboolean
-toplevel_event_watcher(GSignalInvocationHint* ihint,
-                       guint                  n_param_values,
-                       const GValue*          param_values,
-                       gpointer               data)
-{
+gboolean toplevel_event_watcher(GSignalInvocationHint* ihint,
+                                guint n_param_values,
+                                const GValue* param_values, gpointer data) {
   static GQuark sQuark_gecko_acc_obj = 0;
 
   if (!sQuark_gecko_acc_obj)
     sQuark_gecko_acc_obj = g_quark_from_static_string("GeckoAccObj");
 
-  if (nsAccessibilityService::IsShutdown())
-    return TRUE;
+  if (nsAccessibilityService::IsShutdown()) return TRUE;
 
-  GObject* object = reinterpret_cast<GObject*>(g_value_get_object(param_values));
-  if (!GTK_IS_WINDOW(object))
-    return TRUE;
+  GObject* object =
+      reinterpret_cast<GObject*>(g_value_get_object(param_values));
+  if (!GTK_IS_WINDOW(object)) return TRUE;
 
   AtkObject* child = gtk_widget_get_accessible(GTK_WIDGET(object));
 
   // GTK native dialog
   if (!IS_MAI_OBJECT(child) &&
       (atk_object_get_role(child) == ATK_ROLE_DIALOG)) {
-
     if (data == reinterpret_cast<gpointer>(nsIAccessibleEvent::EVENT_SHOW)) {
-
       // Attach the dialog accessible to app accessible tree
       Accessible* windowAcc = GetAccService()->AddNativeRootAccessible(child);
       g_object_set_qdata(G_OBJECT(child), sQuark_gecko_acc_obj,
                          reinterpret_cast<gpointer>(windowAcc));
 
     } else {
-
       // Deattach the dialog accessible
-      Accessible* windowAcc =
-        reinterpret_cast<Accessible*>
-                        (g_object_get_qdata(G_OBJECT(child), sQuark_gecko_acc_obj));
+      Accessible* windowAcc = reinterpret_cast<Accessible*>(
+          g_object_get_qdata(G_OBJECT(child), sQuark_gecko_acc_obj));
       if (windowAcc) {
         GetAccService()->RemoveNativeRootAccessible(windowAcc);
         g_object_set_qdata(G_OBJECT(child), sQuark_gecko_acc_obj, nullptr);
       }
-
     }
   }
 
   return TRUE;
 }
 
-ENameValueFlag
-ApplicationAccessibleWrap::Name(nsString& aName) const
-{
+ENameValueFlag ApplicationAccessibleWrap::Name(nsString& aName) const {
   // ATK doesn't provide a way to obtain an application name (for example,
   // Firefox or Thunderbird) like IA2 does. Thus let's return an application
   // name as accessible name that was used to get a branding name (for example,
   // Minefield aka nightly Firefox or Daily aka nightly Thunderbird).
   AppName(aName);
   return eNameOK;
 }
 
-void
-ApplicationAccessibleWrap::GetNativeInterface(void** aOutAccessible)
-{
+void ApplicationAccessibleWrap::GetNativeInterface(void** aOutAccessible) {
   *aOutAccessible = nullptr;
 
   if (!mAtkObject) {
-    mAtkObject =
-      reinterpret_cast<AtkObject*>(g_object_new(MAI_TYPE_ATK_OBJECT, nullptr));
-    if (!mAtkObject)
-      return;
+    mAtkObject = reinterpret_cast<AtkObject*>(
+        g_object_new(MAI_TYPE_ATK_OBJECT, nullptr));
+    if (!mAtkObject) return;
 
     atk_object_initialize(mAtkObject, this);
     mAtkObject->role = ATK_ROLE_INVALID;
     mAtkObject->layer = ATK_LAYER_INVALID;
   }
 
   *aOutAccessible = mAtkObject;
 }
 
 struct AtkRootAccessibleAddedEvent {
-  AtkObject *app_accessible;
-  AtkObject *root_accessible;
+  AtkObject* app_accessible;
+  AtkObject* root_accessible;
   uint32_t index;
 };
 
-gboolean fireRootAccessibleAddedCB(gpointer data)
-{
-    AtkRootAccessibleAddedEvent* eventData = (AtkRootAccessibleAddedEvent*)data;
-    g_signal_emit_by_name(eventData->app_accessible, "children_changed::add",
-                          eventData->index, eventData->root_accessible, nullptr);
-    g_object_unref(eventData->app_accessible);
-    g_object_unref(eventData->root_accessible);
-    free(data);
+gboolean fireRootAccessibleAddedCB(gpointer data) {
+  AtkRootAccessibleAddedEvent* eventData = (AtkRootAccessibleAddedEvent*)data;
+  g_signal_emit_by_name(eventData->app_accessible, "children_changed::add",
+                        eventData->index, eventData->root_accessible, nullptr);
+  g_object_unref(eventData->app_accessible);
+  g_object_unref(eventData->root_accessible);
+  free(data);
 
-    return FALSE;
+  return FALSE;
 }
 
-bool
-ApplicationAccessibleWrap::InsertChildAt(uint32_t aIdx, Accessible* aChild)
-{
-  if (!ApplicationAccessible::InsertChildAt(aIdx, aChild))
-    return false;
+bool ApplicationAccessibleWrap::InsertChildAt(uint32_t aIdx,
+                                              Accessible* aChild) {
+  if (!ApplicationAccessible::InsertChildAt(aIdx, aChild)) return false;
 
   AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild);
   atk_object_set_parent(atkAccessible, mAtkObject);
 
-    uint32_t count = mChildren.Length();
+  uint32_t count = mChildren.Length();
 
-    // Emit children_changed::add in a timeout
-    // to make sure aRootAccWrap is fully initialized.
-    AtkRootAccessibleAddedEvent* eventData = (AtkRootAccessibleAddedEvent*)
-      malloc(sizeof(AtkRootAccessibleAddedEvent));
-    if (eventData) {
-      eventData->app_accessible = mAtkObject;
-      eventData->root_accessible = atkAccessible;
-      eventData->index = count -1;
-      g_object_ref(mAtkObject);
-      g_object_ref(atkAccessible);
-      g_timeout_add(0, fireRootAccessibleAddedCB, eventData);
-    }
+  // Emit children_changed::add in a timeout
+  // to make sure aRootAccWrap is fully initialized.
+  AtkRootAccessibleAddedEvent* eventData =
+      (AtkRootAccessibleAddedEvent*)malloc(sizeof(AtkRootAccessibleAddedEvent));
+  if (eventData) {
+    eventData->app_accessible = mAtkObject;
+    eventData->root_accessible = atkAccessible;
+    eventData->index = count - 1;
+    g_object_ref(mAtkObject);
+    g_object_ref(atkAccessible);
+    g_timeout_add(0, fireRootAccessibleAddedCB, eventData);
+  }
 
-    return true;
+  return true;
 }
 
-bool
-ApplicationAccessibleWrap::RemoveChild(Accessible* aChild)
-{
+bool ApplicationAccessibleWrap::RemoveChild(Accessible* aChild) {
   int32_t index = aChild->IndexInParent();
 
   AtkObject* atkAccessible = AccessibleWrap::GetAtkObject(aChild);
   atk_object_set_parent(atkAccessible, nullptr);
   g_signal_emit_by_name(mAtkObject, "children_changed::remove", index,
                         atkAccessible, nullptr);
 
   return ApplicationAccessible::RemoveChild(aChild);
 }
-
--- a/accessible/atk/ApplicationAccessibleWrap.h
+++ b/accessible/atk/ApplicationAccessibleWrap.h
@@ -7,29 +7,28 @@
 #ifndef mozilla_a11y_ApplicationAccessibleWrap_h__
 #define mozilla_a11y_ApplicationAccessibleWrap_h__
 
 #include "ApplicationAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
-class ApplicationAccessibleWrap: public ApplicationAccessible
-{
-public:
+class ApplicationAccessibleWrap : public ApplicationAccessible {
+ public:
   ApplicationAccessibleWrap();
   virtual ~ApplicationAccessibleWrap();
 
   // Accessible
   virtual mozilla::a11y::ENameValueFlag Name(nsString& aName) const override;
   virtual bool InsertChildAt(uint32_t aIdx, Accessible* aChild) override;
   virtual bool RemoveChild(Accessible* aChild) override;
 
   /**
    * Return the atk object for app root accessible.
    */
   virtual void GetNativeInterface(void** aOutAccessible) override;
 };
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
-#endif   /* __NS_APP_ROOT_ACCESSIBLE_H__ */
+#endif /* __NS_APP_ROOT_ACCESSIBLE_H__ */
--- a/accessible/atk/AtkSocketAccessible.cpp
+++ b/accessible/atk/AtkSocketAccessible.cpp
@@ -11,116 +11,95 @@
 #include "nsMai.h"
 #include "mozilla/Likely.h"
 
 using namespace mozilla::a11y;
 
 AtkSocketEmbedType AtkSocketAccessible::g_atk_socket_embed = nullptr;
 GType AtkSocketAccessible::g_atk_socket_type = G_TYPE_INVALID;
 const char* AtkSocketAccessible::sATKSocketEmbedSymbol = "atk_socket_embed";
-const char* AtkSocketAccessible::sATKSocketGetTypeSymbol = "atk_socket_get_type";
+const char* AtkSocketAccessible::sATKSocketGetTypeSymbol =
+    "atk_socket_get_type";
 
 bool AtkSocketAccessible::gCanEmbed = FALSE;
 
 extern "C" void mai_atk_component_iface_init(AtkComponentIface* aIface);
 
 G_DEFINE_TYPE_EXTENDED(MaiAtkSocket, mai_atk_socket,
                        AtkSocketAccessible::g_atk_socket_type, 0,
                        G_IMPLEMENT_INTERFACE(ATK_TYPE_COMPONENT,
                                              mai_atk_component_iface_init))
 
-void
-mai_atk_socket_class_init(MaiAtkSocketClass* aAcc)
-{
-}
+void mai_atk_socket_class_init(MaiAtkSocketClass* aAcc) {}
 
-void
-mai_atk_socket_init(MaiAtkSocket* aAcc)
-{
-}
+void mai_atk_socket_init(MaiAtkSocket* aAcc) {}
 
-static AtkObject*
-mai_atk_socket_new(AccessibleWrap* aAccWrap)
-{
+static AtkObject* mai_atk_socket_new(AccessibleWrap* aAccWrap) {
   NS_ENSURE_TRUE(aAccWrap, nullptr);
 
   MaiAtkSocket* acc = nullptr;
   acc = static_cast<MaiAtkSocket*>(g_object_new(MAI_TYPE_ATK_SOCKET, nullptr));
   NS_ENSURE_TRUE(acc, nullptr);
 
   acc->accWrap = aAccWrap;
   return ATK_OBJECT(acc);
 }
 
 extern "C" {
-static AtkObject*
-RefAccessibleAtPoint(AtkComponent* aComponent, gint aX, gint aY,
-                     AtkCoordType aCoordType)
-{
+static AtkObject* RefAccessibleAtPoint(AtkComponent* aComponent, gint aX,
+                                       gint aY, AtkCoordType aCoordType) {
   NS_ENSURE_TRUE(MAI_IS_ATK_SOCKET(aComponent), nullptr);
 
-  return refAccessibleAtPointHelper(ATK_OBJECT(MAI_ATK_SOCKET(aComponent)),
-                                    aX, aY, aCoordType);
+  return refAccessibleAtPointHelper(ATK_OBJECT(MAI_ATK_SOCKET(aComponent)), aX,
+                                    aY, aCoordType);
 }
 
-static void
-GetExtents(AtkComponent* aComponent, gint* aX, gint* aY, gint* aWidth,
-           gint* aHeight, AtkCoordType aCoordType)
-{
+static void GetExtents(AtkComponent* aComponent, gint* aX, gint* aY,
+                       gint* aWidth, gint* aHeight, AtkCoordType aCoordType) {
   *aX = *aY = *aWidth = *aHeight = 0;
 
-  if (!MAI_IS_ATK_SOCKET(aComponent))
-    return;
+  if (!MAI_IS_ATK_SOCKET(aComponent)) return;
 
-  getExtentsHelper(ATK_OBJECT(MAI_ATK_SOCKET(aComponent)),
-                   aX, aY, aWidth, aHeight, aCoordType);
+  getExtentsHelper(ATK_OBJECT(MAI_ATK_SOCKET(aComponent)), aX, aY, aWidth,
+                   aHeight, aCoordType);
 }
 }
 
-void
-mai_atk_component_iface_init(AtkComponentIface* aIface)
-{
+void mai_atk_component_iface_init(AtkComponentIface* aIface) {
   NS_ASSERTION(aIface, "Invalid Interface");
-  if (MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   aIface->ref_accessible_at_point = RefAccessibleAtPoint;
   aIface->get_extents = GetExtents;
 }
 
 AtkSocketAccessible::AtkSocketAccessible(nsIContent* aContent,
                                          DocAccessible* aDoc,
-                                         const nsCString& aPlugId) :
-  AccessibleWrap(aContent, aDoc)
-{
+                                         const nsCString& aPlugId)
+    : AccessibleWrap(aContent, aDoc) {
   mAtkObject = mai_atk_socket_new(this);
-  if (!mAtkObject)
-    return;
+  if (!mAtkObject) return;
 
   // Embeds the children of an AtkPlug, specified by plugId, as the children of
   // this socket.
   // Using G_TYPE macros instead of ATK_SOCKET macros to avoid undefined
   // symbols.
   if (gCanEmbed && G_TYPE_CHECK_INSTANCE_TYPE(mAtkObject, g_atk_socket_type) &&
       !aPlugId.IsVoid()) {
     AtkSocket* accSocket =
-      G_TYPE_CHECK_INSTANCE_CAST(mAtkObject, g_atk_socket_type, AtkSocket);
+        G_TYPE_CHECK_INSTANCE_CAST(mAtkObject, g_atk_socket_type, AtkSocket);
     g_atk_socket_embed(accSocket, (gchar*)aPlugId.get());
   }
 }
 
-void
-AtkSocketAccessible::GetNativeInterface(void** aOutAccessible)
-{
+void AtkSocketAccessible::GetNativeInterface(void** aOutAccessible) {
   *aOutAccessible = mAtkObject;
 }
 
-void
-AtkSocketAccessible::Shutdown()
-{
+void AtkSocketAccessible::Shutdown() {
   if (mAtkObject) {
     if (MAI_IS_ATK_SOCKET(mAtkObject))
       MAI_ATK_SOCKET(mAtkObject)->accWrap = nullptr;
     g_object_unref(mAtkObject);
     mAtkObject = nullptr;
   }
   AccessibleWrap::Shutdown();
 }
--- a/accessible/atk/AtkSocketAccessible.h
+++ b/accessible/atk/AtkSocketAccessible.h
@@ -7,32 +7,30 @@
 #ifndef _AtkSocketAccessible_H_
 #define _AtkSocketAccessible_H_
 
 #include "AccessibleWrap.h"
 
 // This file gets included by nsAccessibilityService.cpp, which can't include
 // atk.h (or glib.h), so we can't rely on it being included.
 #ifdef __ATK_H__
-extern "C" typedef void (*AtkSocketEmbedType) (AtkSocket*, gchar*);
+extern "C" typedef void (*AtkSocketEmbedType)(AtkSocket*, gchar*);
 #else
-extern "C" typedef void (*AtkSocketEmbedType) (void*, void*);
+extern "C" typedef void (*AtkSocketEmbedType)(void*, void*);
 #endif
 
 namespace mozilla {
 namespace a11y {
 
 /**
  * Provides a AccessibleWrap wrapper around AtkSocket for out-of-process
  * accessibles.
  */
-class AtkSocketAccessible : public AccessibleWrap
-{
-public:
-
+class AtkSocketAccessible : public AccessibleWrap {
+ public:
   // Soft references to AtkSocket
   static AtkSocketEmbedType g_atk_socket_embed;
 #ifdef __ATK_H__
   static GType g_atk_socket_type;
 #endif
   static const char* sATKSocketEmbedSymbol;
   static const char* sATKSocketGetTypeSymbol;
 
@@ -45,12 +43,12 @@ public:
   AtkSocketAccessible(nsIContent* aContent, DocAccessible* aDoc,
                       const nsCString& aPlugId);
 
   virtual void Shutdown() override;
 
   virtual void GetNativeInterface(void** aOutAccessible) override;
 };
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/atk/DOMtoATK.cpp
+++ b/accessible/atk/DOMtoATK.cpp
@@ -7,93 +7,92 @@
 #include "DOMtoATK.h"
 #include "nsUTF8Utils.h"
 
 namespace mozilla {
 namespace a11y {
 
 namespace DOMtoATK {
 
-void
-AddBOMs(nsACString& aDest, const nsACString& aSource)
-{
+void AddBOMs(nsACString& aDest, const nsACString& aSource) {
   uint32_t destlength = 0;
 
   // First compute how much room we will need.
-  for (uint32_t srci = 0; srci < aSource.Length(); ) {
+  for (uint32_t srci = 0; srci < aSource.Length();) {
     int bytes = UTF8traits::bytes(aSource[srci]);
     if (bytes >= 4) {
       // Non-BMP character, will add a BOM after it.
       destlength += 3;
     }
     // Skip whole character encoding.
     srci += bytes;
     destlength += bytes;
   }
 
-  uint32_t desti = 0; // Index within aDest.
+  uint32_t desti = 0;  // Index within aDest.
 
   // Add BOMs after non-BMP characters.
   aDest.SetLength(destlength);
-  for (uint32_t srci = 0; srci < aSource.Length(); ) {
+  for (uint32_t srci = 0; srci < aSource.Length();) {
     uint32_t bytes = UTF8traits::bytes(aSource[srci]);
 
-    MOZ_ASSERT(bytes <= aSource.Length() - srci, "We should have the whole sequence");
+    MOZ_ASSERT(bytes <= aSource.Length() - srci,
+               "We should have the whole sequence");
 
     // Copy whole sequence.
     aDest.Replace(desti, bytes, Substring(aSource, srci, bytes));
     desti += bytes;
     srci += bytes;
 
     if (bytes >= 4) {
       // More than 4 bytes in UTF-8 encoding exactly means more than 16 encoded
       // bits.  This is thus a non-BMP character which needed a surrogate
       // pair to get encoded in UTF-16, add a BOM after it.
 
       // And add a BOM after it.
       aDest.Replace(desti, 3, "\xEF\xBB\xBF");
       desti += 3;
     }
   }
-  MOZ_ASSERT(desti == destlength, "Incoherency between computed length"
-                                  "and actually translated length");
+  MOZ_ASSERT(desti == destlength,
+             "Incoherency between computed length"
+             "and actually translated length");
 }
 
-void
-ATKStringConverterHelper::AdjustOffsets(gint* aStartOffset, gint* aEndOffset,
-                                        gint count)
-{
-  MOZ_ASSERT(!mAdjusted, "DOMtoATK::ATKStringConverterHelper::AdjustOffsets needs to be called only once");
+void ATKStringConverterHelper::AdjustOffsets(gint* aStartOffset,
+                                             gint* aEndOffset, gint count) {
+  MOZ_ASSERT(!mAdjusted,
+             "DOMtoATK::ATKStringConverterHelper::AdjustOffsets needs to be "
+             "called only once");
 
   if (*aStartOffset > 0) {
     (*aStartOffset)--;
     mStartShifted = true;
   }
 
   if (*aEndOffset != -1 && *aEndOffset < count) {
     (*aEndOffset)++;
     mEndShifted = true;
   }
 
 #ifdef DEBUG
   mAdjusted = true;
 #endif
 }
 
-gchar*
-ATKStringConverterHelper::FinishUTF16toUTF8(nsCString& aStr)
-{
+gchar* ATKStringConverterHelper::FinishUTF16toUTF8(nsCString& aStr) {
   int skip = 0;
 
   if (mStartShifted) {
     // AdjustOffsets added a leading character.
 
     MOZ_ASSERT(aStr.Length() > 0, "There should be a leading character");
-    MOZ_ASSERT(static_cast<int>(aStr.Length()) >= UTF8traits::bytes(aStr.CharAt(0)),
-               "The leading character should be complete");
+    MOZ_ASSERT(
+        static_cast<int>(aStr.Length()) >= UTF8traits::bytes(aStr.CharAt(0)),
+        "The leading character should be complete");
 
     // drop first character
     skip = UTF8traits::bytes(aStr.CharAt(0));
   }
 
   if (mEndShifted) {
     // AdjustOffsets added a trailing character.
 
@@ -103,59 +102,56 @@ ATKStringConverterHelper::FinishUTF16toU
     // Find beginning of last character.
     for (trail = aStr.Length() - 1; trail >= 0; trail--) {
       if (!UTF8traits::isInSeq(aStr.CharAt(trail))) {
         break;
       }
     }
     MOZ_ASSERT(trail >= 0,
                "There should be at least a whole trailing character");
-    MOZ_ASSERT(trail + UTF8traits::bytes(aStr.CharAt(trail)) == static_cast<int>(aStr.Length()),
+    MOZ_ASSERT(trail + UTF8traits::bytes(aStr.CharAt(trail)) ==
+                   static_cast<int>(aStr.Length()),
                "The trailing character should be complete");
 
     // Drop the last character.
     aStr.Truncate(trail);
   }
 
   // copy and return, libspi will free it
   return g_strdup(aStr.get() + skip);
 }
 
-gchar*
-ATKStringConverterHelper::ConvertAdjusted(const nsAString& aStr)
-{
-  MOZ_ASSERT(mAdjusted, "DOMtoATK::ATKStringConverterHelper::AdjustOffsets needs to be called before ATKStringConverterHelper::ConvertAdjusted");
+gchar* ATKStringConverterHelper::ConvertAdjusted(const nsAString& aStr) {
+  MOZ_ASSERT(mAdjusted,
+             "DOMtoATK::ATKStringConverterHelper::AdjustOffsets needs to be "
+             "called before ATKStringConverterHelper::ConvertAdjusted");
 
   NS_ConvertUTF16toUTF8 cautoStr(aStr);
   if (!cautoStr.get()) {
     return nullptr;
   }
 
   nsAutoCString cautoStrBOMs;
   AddBOMs(cautoStrBOMs, cautoStr);
   return FinishUTF16toUTF8(cautoStrBOMs);
 }
 
-gchar*
-Convert(const nsAString& aStr)
-{
+gchar* Convert(const nsAString& aStr) {
   NS_ConvertUTF16toUTF8 cautoStr(aStr);
   if (!cautoStr.get()) {
     return nullptr;
   }
 
   nsAutoCString cautoStrBOMs;
   AddBOMs(cautoStrBOMs, cautoStr);
   return g_strdup(cautoStrBOMs.get());
 }
 
-void
-ConvertTexttoAsterisks(nsAString& aString)
-{
+void ConvertTexttoAsterisks(nsAString& aString) {
   for (uint32_t i = 0; i < aString.Length(); i++) {
     aString.ReplaceLiteral(i, 1, u"*");
   }
 }
 
-}
+}  // namespace DOMtoATK
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
--- a/accessible/atk/DOMtoATK.h
+++ b/accessible/atk/DOMtoATK.h
@@ -36,128 +36,127 @@
  * - if the end is between the high and low surrogates, the UTF-8 result
  * includes the character but *not* the BOM
  * - all non-BMP characters that are fully in the string are in the UTF-8 result
  * as character followed by BOM
  */
 namespace mozilla {
 namespace a11y {
 
-namespace DOMtoATK
-{
+namespace DOMtoATK {
 
-  /**
-   * Converts a string of accessible text into ATK gchar* string (by adding
-   * BOMs). This can be used when offsets do not need to be adjusted because
-   * ends of the string can not fall between surrogates.
-   */
-  gchar* Convert(const nsAString& aStr);
-
-  /**
-   * Add a BOM after each non-BMP character.
-   */
-  void AddBOMs(nsACString& aDest, const nsACString& aSource);
+/**
+ * Converts a string of accessible text into ATK gchar* string (by adding
+ * BOMs). This can be used when offsets do not need to be adjusted because
+ * ends of the string can not fall between surrogates.
+ */
+gchar* Convert(const nsAString& aStr);
 
-  /**
-   * Replace all characters with asterisks (e.g. for password fields).
-   */
-  void ConvertTexttoAsterisks(nsAString& aString);
+/**
+ * Add a BOM after each non-BMP character.
+ */
+void AddBOMs(nsACString& aDest, const nsACString& aSource);
 
-  /**
-   * Parameterize conversion.
-   */
-  enum class AtkStringConvertFlags : uint32_t {
-    None                   = 0,
-    ConvertTextToAsterisks = 1 << 0,
-  };
-
-  MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(AtkStringConvertFlags)
-
-  class ATKStringConverterHelper {
-  public:
-    ATKStringConverterHelper(void) :
-#ifdef DEBUG
-      mAdjusted (false),
-#endif
-      mStartShifted (false),
-      mEndShifted (false) { }
+/**
+ * Replace all characters with asterisks (e.g. for password fields).
+ */
+void ConvertTexttoAsterisks(nsAString& aString);
 
-    /**
-     * In order to properly get non-BMP values, offsets need to be changed
-     * to get one character more on each end, so that ConvertUTF16toUTF8 can
-     * convert surrogates even if the originally requested offsets fall between
-     * them.
-     */
-    void AdjustOffsets(gint* aStartOffset, gint* aEndOffset, gint count);
+/**
+ * Parameterize conversion.
+ */
+enum class AtkStringConvertFlags : uint32_t {
+  None = 0,
+  ConvertTextToAsterisks = 1 << 0,
+};
 
-    /**
-     * Converts a string of accessible text with adjusted offsets into ATK
-     * gchar* string (by adding BOMs).  Note, AdjustOffsets has to be called
-     * before getting the text passed to this.
-     */
-    gchar* ConvertAdjusted(const nsAString& aStr);
+MOZ_MAKE_ENUM_CLASS_BITWISE_OPERATORS(AtkStringConvertFlags)
 
-  private:
-    /**
-     * Remove the additional characters requested by PrepareUTF16toUTF8.
-     */
-    gchar* FinishUTF16toUTF8(nsCString& aStr);
-
+class ATKStringConverterHelper {
+ public:
+  ATKStringConverterHelper(void)
+      :
 #ifdef DEBUG
-    bool mAdjusted;
+        mAdjusted(false),
 #endif
-    bool mStartShifted;
-    bool mEndShifted;
-  };
-
-  /**
-   * Get text from aAccessible, using ATKStringConverterHelper to properly
-   * introduce appropriate BOMs.
-   */
-  template <class AccessibleOrProxy>
-  gchar* NewATKString(AccessibleOrProxy* aAccessible,
-                      gint aStartOffset, gint aEndOffset,
-                      AtkStringConvertFlags aFlags)
-  {
-    gint startOffset = aStartOffset, endOffset = aEndOffset;
-    ATKStringConverterHelper converter;
-    converter.AdjustOffsets(&startOffset, &endOffset,
-                            gint(aAccessible->CharacterCount()));
-    nsAutoString str;
-    aAccessible->TextSubstring(startOffset, endOffset, str);
-    if (aFlags & AtkStringConvertFlags::ConvertTextToAsterisks)
-      ConvertTexttoAsterisks(str);
-    return converter.ConvertAdjusted(str);
+        mStartShifted(false),
+        mEndShifted(false) {
   }
 
   /**
-   * Get a character from aAccessible, fetching more data as appropriate to
-   * properly get non-BMP characters or a BOM as appropriate.
+   * In order to properly get non-BMP values, offsets need to be changed
+   * to get one character more on each end, so that ConvertUTF16toUTF8 can
+   * convert surrogates even if the originally requested offsets fall between
+   * them.
+   */
+  void AdjustOffsets(gint* aStartOffset, gint* aEndOffset, gint count);
+
+  /**
+   * Converts a string of accessible text with adjusted offsets into ATK
+   * gchar* string (by adding BOMs).  Note, AdjustOffsets has to be called
+   * before getting the text passed to this.
    */
-  template <class AccessibleCharAt>
-  gunichar ATKCharacter(AccessibleCharAt* aAccessible, gint aOffset)
-  {
-    // char16_t is unsigned short in Mozilla, gnuichar is guint32 in glib.
-    gunichar character = static_cast<gunichar>(aAccessible->CharAt(aOffset));
+  gchar* ConvertAdjusted(const nsAString& aStr);
+
+ private:
+  /**
+   * Remove the additional characters requested by PrepareUTF16toUTF8.
+   */
+  gchar* FinishUTF16toUTF8(nsCString& aStr);
+
+#ifdef DEBUG
+  bool mAdjusted;
+#endif
+  bool mStartShifted;
+  bool mEndShifted;
+};
 
-    if (NS_IS_LOW_SURROGATE(character)) {
-      // Trailing surrogate, return BOM instead.
-      return 0xFEFF;
-    }
-
-    if (NS_IS_HIGH_SURROGATE(character)) {
-      // Heading surrogate, get the trailing surrogate and combine them.
-      gunichar characterLow = static_cast<gunichar>(aAccessible->CharAt(aOffset + 1));
+/**
+ * Get text from aAccessible, using ATKStringConverterHelper to properly
+ * introduce appropriate BOMs.
+ */
+template <class AccessibleOrProxy>
+gchar* NewATKString(AccessibleOrProxy* aAccessible, gint aStartOffset,
+                    gint aEndOffset, AtkStringConvertFlags aFlags) {
+  gint startOffset = aStartOffset, endOffset = aEndOffset;
+  ATKStringConverterHelper converter;
+  converter.AdjustOffsets(&startOffset, &endOffset,
+                          gint(aAccessible->CharacterCount()));
+  nsAutoString str;
+  aAccessible->TextSubstring(startOffset, endOffset, str);
+  if (aFlags & AtkStringConvertFlags::ConvertTextToAsterisks)
+    ConvertTexttoAsterisks(str);
+  return converter.ConvertAdjusted(str);
+}
 
-      if (!NS_IS_LOW_SURROGATE(characterLow)) {
-        // It should have been a trailing surrogate... Flag the error.
-        return 0xFFFD;
-      }
-      return SURROGATE_TO_UCS4(character, characterLow);
-    }
+/**
+ * Get a character from aAccessible, fetching more data as appropriate to
+ * properly get non-BMP characters or a BOM as appropriate.
+ */
+template <class AccessibleCharAt>
+gunichar ATKCharacter(AccessibleCharAt* aAccessible, gint aOffset) {
+  // char16_t is unsigned short in Mozilla, gnuichar is guint32 in glib.
+  gunichar character = static_cast<gunichar>(aAccessible->CharAt(aOffset));
 
-    return character;
+  if (NS_IS_LOW_SURROGATE(character)) {
+    // Trailing surrogate, return BOM instead.
+    return 0xFEFF;
   }
 
+  if (NS_IS_HIGH_SURROGATE(character)) {
+    // Heading surrogate, get the trailing surrogate and combine them.
+    gunichar characterLow =
+        static_cast<gunichar>(aAccessible->CharAt(aOffset + 1));
+
+    if (!NS_IS_LOW_SURROGATE(characterLow)) {
+      // It should have been a trailing surrogate... Flag the error.
+      return 0xFFFD;
+    }
+    return SURROGATE_TO_UCS4(character, characterLow);
+  }
+
+  return character;
 }
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace DOMtoATK
+
+}  // namespace a11y
+}  // namespace mozilla
--- a/accessible/atk/DocAccessibleWrap.cpp
+++ b/accessible/atk/DocAccessibleWrap.cpp
@@ -8,18 +8,13 @@
 #include "DocAccessibleWrap.h"
 
 using namespace mozilla::a11y;
 
 ////////////////////////////////////////////////////////////////////////////////
 // DocAccessibleWrap
 ////////////////////////////////////////////////////////////////////////////////
 
-DocAccessibleWrap::
-  DocAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell) :
-  DocAccessible(aDocument, aPresShell), mActivated(false)
-{
-}
+DocAccessibleWrap::DocAccessibleWrap(nsIDocument* aDocument,
+                                     nsIPresShell* aPresShell)
+    : DocAccessible(aDocument, aPresShell), mActivated(false) {}
 
-DocAccessibleWrap::~DocAccessibleWrap()
-{
-}
-
+DocAccessibleWrap::~DocAccessibleWrap() {}
--- a/accessible/atk/DocAccessibleWrap.h
+++ b/accessible/atk/DocAccessibleWrap.h
@@ -11,21 +11,20 @@
 #ifndef mozilla_a11y_DocAccessibleWrap_h__
 #define mozilla_a11y_DocAccessibleWrap_h__
 
 #include "DocAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
-class DocAccessibleWrap : public DocAccessible
-{
-public:
+class DocAccessibleWrap : public DocAccessible {
+ public:
   DocAccessibleWrap(nsIDocument* aDocument, nsIPresShell* aPresShell);
   virtual ~DocAccessibleWrap();
 
   bool mActivated;
 };
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/atk/HTMLTableAccessibleWrap.h
+++ b/accessible/atk/HTMLTableAccessibleWrap.h
@@ -11,13 +11,12 @@
 
 namespace mozilla {
 namespace a11y {
 
 typedef class HTMLTableAccessible HTMLTableAccessibleWrap;
 typedef class HTMLTableCellAccessible HTMLTableCellAccessibleWrap;
 typedef class HTMLTableHeaderCellAccessible HTMLTableHeaderCellAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
-
--- a/accessible/atk/HyperTextAccessibleWrap.h
+++ b/accessible/atk/HyperTextAccessibleWrap.h
@@ -9,13 +9,12 @@
 
 #include "HyperTextAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class HyperTextAccessible HyperTextAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
-
--- a/accessible/atk/ImageAccessibleWrap.h
+++ b/accessible/atk/ImageAccessibleWrap.h
@@ -9,13 +9,12 @@
 
 #include "ImageAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class ImageAccessible ImageAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
-
--- a/accessible/atk/InterfaceInitFuncs.h
+++ b/accessible/atk/InterfaceInitFuncs.h
@@ -9,36 +9,35 @@
 
 #include <atk/atk.h>
 
 namespace mozilla {
 namespace a11y {
 
 class AccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 extern "C" {
 void actionInterfaceInitCB(AtkActionIface* aIface);
 void componentInterfaceInitCB(AtkComponentIface* aIface);
-void documentInterfaceInitCB(AtkDocumentIface *aIface);
+void documentInterfaceInitCB(AtkDocumentIface* aIface);
 void editableTextInterfaceInitCB(AtkEditableTextIface* aIface);
-void hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface *aIface);
+void hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface* aIface);
 void hypertextInterfaceInitCB(AtkHypertextIface* aIface);
 void imageInterfaceInitCB(AtkImageIface* aIface);
 void selectionInterfaceInitCB(AtkSelectionIface* aIface);
-void tableInterfaceInitCB(AtkTableIface *aIface);
-void tableCellInterfaceInitCB(AtkTableCellIface *aIface);
+void tableInterfaceInitCB(AtkTableIface* aIface);
+void tableCellInterfaceInitCB(AtkTableCellIface* aIface);
 void textInterfaceInitCB(AtkTextIface* aIface);
-void valueInterfaceInitCB(AtkValueIface *aIface);
+void valueInterfaceInitCB(AtkValueIface* aIface);
 }
 
 /**
  * XXX these should live in a file of utils for atk.
  */
-AtkObject* refAccessibleAtPointHelper(AtkObject* aAtkObj,
-                                      gint aX, gint aY, AtkCoordType aCoordType);
-void getExtentsHelper(AtkObject* aAtkObj,
-                      gint* aX, gint* aY, gint* aWidth, gint* aHeight,
-                      AtkCoordType aCoordType);
+AtkObject* refAccessibleAtPointHelper(AtkObject* aAtkObj, gint aX, gint aY,
+                                      AtkCoordType aCoordType);
+void getExtentsHelper(AtkObject* aAtkObj, gint* aX, gint* aY, gint* aWidth,
+                      gint* aHeight, AtkCoordType aCoordType);
 
-#endif // ATK_INTERFACE_INIT_FUNCS_H_
+#endif  // ATK_INTERFACE_INIT_FUNCS_H_
--- a/accessible/atk/Platform.cpp
+++ b/accessible/atk/Platform.cpp
@@ -15,147 +15,139 @@
 #include "prlink.h"
 
 #ifdef MOZ_ENABLE_DBUS
 #include <dbus/dbus.h>
 #endif
 #include <gtk/gtk.h>
 
 #ifdef MOZ_WIDGET_GTK
-extern "C" __attribute__((weak,visibility("default"))) int atk_bridge_adaptor_init(int*, char **[]);
+extern "C" __attribute__((weak, visibility("default"))) int
+atk_bridge_adaptor_init(int*, char**[]);
 #endif
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 int atkMajorVersion = 1, atkMinorVersion = 12, atkMicroVersion = 0;
 
 GType (*gAtkTableCellGetTypeFunc)();
 
 extern "C" {
-typedef GType (* AtkGetTypeType) (void);
-typedef void (*GnomeAccessibilityInit) (void);
-typedef void (*GnomeAccessibilityShutdown) (void);
+typedef GType (*AtkGetTypeType)(void);
+typedef void (*GnomeAccessibilityInit)(void);
+typedef void (*GnomeAccessibilityShutdown)(void);
 }
 
 static PRLibrary* sATKLib = nullptr;
 static const char sATKLibName[] = "libatk-1.0.so.0";
 static const char sATKHyperlinkImplGetTypeSymbol[] =
-  "atk_hyperlink_impl_get_type";
+    "atk_hyperlink_impl_get_type";
 
 gboolean toplevel_event_watcher(GSignalInvocationHint*, guint, const GValue*,
                                 gpointer);
 static bool sToplevel_event_hook_added = false;
 static gulong sToplevel_show_hook = 0;
 static gulong sToplevel_hide_hook = 0;
 
 GType g_atk_hyperlink_impl_type = G_TYPE_INVALID;
 
-struct GnomeAccessibilityModule
-{
-    const char *libName;
-    PRLibrary *lib;
-    const char *initName;
-    GnomeAccessibilityInit init;
-    const char *shutdownName;
-    GnomeAccessibilityShutdown shutdown;
+struct GnomeAccessibilityModule {
+  const char* libName;
+  PRLibrary* lib;
+  const char* initName;
+  GnomeAccessibilityInit init;
+  const char* shutdownName;
+  GnomeAccessibilityShutdown shutdown;
 };
 
 static GnomeAccessibilityModule sAtkBridge = {
 #ifdef AIX
     "libatk-bridge.a(libatk-bridge.so.0)", nullptr,
 #else
     "libatk-bridge.so", nullptr,
 #endif
-    "gnome_accessibility_module_init", nullptr,
-    "gnome_accessibility_module_shutdown", nullptr
-};
+    "gnome_accessibility_module_init",     nullptr,
+    "gnome_accessibility_module_shutdown", nullptr};
 
-static nsresult
-LoadGtkModule(GnomeAccessibilityModule& aModule)
-{
-    NS_ENSURE_ARG(aModule.libName);
+static nsresult LoadGtkModule(GnomeAccessibilityModule& aModule) {
+  NS_ENSURE_ARG(aModule.libName);
 
-    if (!(aModule.lib = PR_LoadLibrary(aModule.libName))) {
-        //try to load the module with "gtk-2.0/modules" appended
-        char *curLibPath = PR_GetLibraryPath();
-        nsAutoCString libPath(curLibPath);
+  if (!(aModule.lib = PR_LoadLibrary(aModule.libName))) {
+    // try to load the module with "gtk-2.0/modules" appended
+    char* curLibPath = PR_GetLibraryPath();
+    nsAutoCString libPath(curLibPath);
 #if defined(LINUX) && defined(__x86_64__)
-        libPath.AppendLiteral(":/usr/lib64:/usr/lib");
+    libPath.AppendLiteral(":/usr/lib64:/usr/lib");
 #else
-        libPath.AppendLiteral(":/usr/lib");
+    libPath.AppendLiteral(":/usr/lib");
 #endif
-        PR_FreeLibraryName(curLibPath);
+    PR_FreeLibraryName(curLibPath);
 
-        int16_t loc1 = 0, loc2 = 0;
-        int16_t subLen = 0;
-        while (loc2 >= 0) {
-            loc2 = libPath.FindChar(':', loc1);
-            if (loc2 < 0)
-                subLen = libPath.Length() - loc1;
-            else
-                subLen = loc2 - loc1;
-            nsAutoCString sub(Substring(libPath, loc1, subLen));
-            sub.AppendLiteral("/gtk-3.0/modules/");
-            sub.Append(aModule.libName);
-            aModule.lib = PR_LoadLibrary(sub.get());
-            if (aModule.lib)
-                break;
+    int16_t loc1 = 0, loc2 = 0;
+    int16_t subLen = 0;
+    while (loc2 >= 0) {
+      loc2 = libPath.FindChar(':', loc1);
+      if (loc2 < 0)
+        subLen = libPath.Length() - loc1;
+      else
+        subLen = loc2 - loc1;
+      nsAutoCString sub(Substring(libPath, loc1, subLen));
+      sub.AppendLiteral("/gtk-3.0/modules/");
+      sub.Append(aModule.libName);
+      aModule.lib = PR_LoadLibrary(sub.get());
+      if (aModule.lib) break;
 
-            loc1 = loc2+1;
-        }
-        if (!aModule.lib)
-            return NS_ERROR_FAILURE;
+      loc1 = loc2 + 1;
     }
+    if (!aModule.lib) return NS_ERROR_FAILURE;
+  }
 
-    //we have loaded the library, try to get the function ptrs
-    if (!(aModule.init = PR_FindFunctionSymbol(aModule.lib,
-                                               aModule.initName)) ||
-        !(aModule.shutdown = PR_FindFunctionSymbol(aModule.lib,
-                                                   aModule.shutdownName))) {
-
-        //fail, :(
-        PR_UnloadLibrary(aModule.lib);
-        aModule.lib = nullptr;
-        return NS_ERROR_FAILURE;
-    }
-    return NS_OK;
+  // we have loaded the library, try to get the function ptrs
+  if (!(aModule.init = PR_FindFunctionSymbol(aModule.lib, aModule.initName)) ||
+      !(aModule.shutdown =
+            PR_FindFunctionSymbol(aModule.lib, aModule.shutdownName))) {
+    // fail, :(
+    PR_UnloadLibrary(aModule.lib);
+    aModule.lib = nullptr;
+    return NS_ERROR_FAILURE;
+  }
+  return NS_OK;
 }
 
-void
-a11y::PlatformInit()
-{
-  if (!ShouldA11yBeEnabled())
-    return;
+void a11y::PlatformInit() {
+  if (!ShouldA11yBeEnabled()) return;
 
   sATKLib = PR_LoadLibrary(sATKLibName);
-  if (!sATKLib)
-    return;
+  if (!sATKLib) return;
 
   AtkGetTypeType pfn_atk_hyperlink_impl_get_type =
-    (AtkGetTypeType) PR_FindFunctionSymbol(sATKLib, sATKHyperlinkImplGetTypeSymbol);
+      (AtkGetTypeType)PR_FindFunctionSymbol(sATKLib,
+                                            sATKHyperlinkImplGetTypeSymbol);
   if (pfn_atk_hyperlink_impl_get_type)
     g_atk_hyperlink_impl_type = pfn_atk_hyperlink_impl_get_type();
 
-  AtkGetTypeType pfn_atk_socket_get_type = (AtkGetTypeType)
-    PR_FindFunctionSymbol(sATKLib, AtkSocketAccessible::sATKSocketGetTypeSymbol);
+  AtkGetTypeType pfn_atk_socket_get_type =
+      (AtkGetTypeType)PR_FindFunctionSymbol(
+          sATKLib, AtkSocketAccessible::sATKSocketGetTypeSymbol);
   if (pfn_atk_socket_get_type) {
     AtkSocketAccessible::g_atk_socket_type = pfn_atk_socket_get_type();
-    AtkSocketAccessible::g_atk_socket_embed = (AtkSocketEmbedType)
-      PR_FindFunctionSymbol(sATKLib, AtkSocketAccessible ::sATKSocketEmbedSymbol);
+    AtkSocketAccessible::g_atk_socket_embed =
+        (AtkSocketEmbedType)PR_FindFunctionSymbol(
+            sATKLib, AtkSocketAccessible ::sATKSocketEmbedSymbol);
     AtkSocketAccessible::gCanEmbed =
-      AtkSocketAccessible::g_atk_socket_type != G_TYPE_INVALID &&
-      AtkSocketAccessible::g_atk_socket_embed;
+        AtkSocketAccessible::g_atk_socket_type != G_TYPE_INVALID &&
+        AtkSocketAccessible::g_atk_socket_embed;
   }
 
-  gAtkTableCellGetTypeFunc = (GType (*)())
-    PR_FindFunctionSymbol(sATKLib, "atk_table_cell_get_type");
+  gAtkTableCellGetTypeFunc =
+      (GType(*)())PR_FindFunctionSymbol(sATKLib, "atk_table_cell_get_type");
 
   const char* (*atkGetVersion)() =
-    (const char* (*)()) PR_FindFunctionSymbol(sATKLib, "atk_get_version");
+      (const char* (*)())PR_FindFunctionSymbol(sATKLib, "atk_get_version");
   if (atkGetVersion) {
     const char* version = atkGetVersion();
     if (version) {
       char* endPtr = nullptr;
       atkMajorVersion = strtol(version, &endPtr, 10);
       if (atkMajorVersion != 0L) {
         atkMinorVersion = strtol(endPtr + 1, &endPtr, 10);
         if (atkMinorVersion != 0L)
@@ -178,141 +170,123 @@ a11y::PlatformInit()
     nsresult rv = LoadGtkModule(sAtkBridge);
     if (NS_SUCCEEDED(rv)) {
       (*sAtkBridge.init)();
     }
   }
 
   if (!sToplevel_event_hook_added) {
     sToplevel_event_hook_added = true;
-    sToplevel_show_hook =
-      g_signal_add_emission_hook(g_signal_lookup("show", GTK_TYPE_WINDOW),
-                                 0, toplevel_event_watcher,
-                                 reinterpret_cast<gpointer>(nsIAccessibleEvent::EVENT_SHOW),
-                                 nullptr);
-    sToplevel_hide_hook =
-      g_signal_add_emission_hook(g_signal_lookup("hide", GTK_TYPE_WINDOW), 0,
-                                 toplevel_event_watcher,
-                                 reinterpret_cast<gpointer>(nsIAccessibleEvent::EVENT_HIDE),
-                                 nullptr);
+    sToplevel_show_hook = g_signal_add_emission_hook(
+        g_signal_lookup("show", GTK_TYPE_WINDOW), 0, toplevel_event_watcher,
+        reinterpret_cast<gpointer>(nsIAccessibleEvent::EVENT_SHOW), nullptr);
+    sToplevel_hide_hook = g_signal_add_emission_hook(
+        g_signal_lookup("hide", GTK_TYPE_WINDOW), 0, toplevel_event_watcher,
+        reinterpret_cast<gpointer>(nsIAccessibleEvent::EVENT_HIDE), nullptr);
   }
 }
 
-void
-a11y::PlatformShutdown()
-{
-    if (sToplevel_event_hook_added) {
-      sToplevel_event_hook_added = false;
-      g_signal_remove_emission_hook(g_signal_lookup("show", GTK_TYPE_WINDOW),
-                                    sToplevel_show_hook);
-      g_signal_remove_emission_hook(g_signal_lookup("hide", GTK_TYPE_WINDOW),
-                                    sToplevel_hide_hook);
-    }
+void a11y::PlatformShutdown() {
+  if (sToplevel_event_hook_added) {
+    sToplevel_event_hook_added = false;
+    g_signal_remove_emission_hook(g_signal_lookup("show", GTK_TYPE_WINDOW),
+                                  sToplevel_show_hook);
+    g_signal_remove_emission_hook(g_signal_lookup("hide", GTK_TYPE_WINDOW),
+                                  sToplevel_hide_hook);
+  }
 
-    if (sAtkBridge.lib) {
-        // Do not shutdown/unload atk-bridge,
-        // an exit function registered will take care of it
-        // if (sAtkBridge.shutdown)
-        //     (*sAtkBridge.shutdown)();
-        // PR_UnloadLibrary(sAtkBridge.lib);
-        sAtkBridge.lib = nullptr;
-        sAtkBridge.init = nullptr;
-        sAtkBridge.shutdown = nullptr;
-    }
-    // if (sATKLib) {
-    //     PR_UnloadLibrary(sATKLib);
-    //     sATKLib = nullptr;
-    // }
+  if (sAtkBridge.lib) {
+    // Do not shutdown/unload atk-bridge,
+    // an exit function registered will take care of it
+    // if (sAtkBridge.shutdown)
+    //     (*sAtkBridge.shutdown)();
+    // PR_UnloadLibrary(sAtkBridge.lib);
+    sAtkBridge.lib = nullptr;
+    sAtkBridge.init = nullptr;
+    sAtkBridge.shutdown = nullptr;
+  }
+  // if (sATKLib) {
+  //     PR_UnloadLibrary(sATKLib);
+  //     sATKLib = nullptr;
+  // }
 }
 
-  static const char sAccEnv [] = "GNOME_ACCESSIBILITY";
+static const char sAccEnv[] = "GNOME_ACCESSIBILITY";
 #ifdef MOZ_ENABLE_DBUS
-static DBusPendingCall *sPendingCall = nullptr;
+static DBusPendingCall* sPendingCall = nullptr;
 #endif
 
-void
-a11y::PreInit()
-{
+void a11y::PreInit() {
 #ifdef MOZ_ENABLE_DBUS
   static bool sChecked = FALSE;
-  if (sChecked)
-    return;
+  if (sChecked) return;
 
   sChecked = TRUE;
 
   // dbus is only checked if GNOME_ACCESSIBILITY is unset
   // also make sure that a session bus address is available to prevent dbus from
   // starting a new one.  Dbus confuses the test harness when it creates a new
   // process (see bug 693343)
-  if (PR_GetEnv(sAccEnv) || !PR_GetEnv("DBUS_SESSION_BUS_ADDRESS"))
-    return;
+  if (PR_GetEnv(sAccEnv) || !PR_GetEnv("DBUS_SESSION_BUS_ADDRESS")) return;
 
   DBusConnection* bus = dbus_bus_get(DBUS_BUS_SESSION, nullptr);
-  if (!bus)
-    return;
+  if (!bus) return;
 
   dbus_connection_set_exit_on_disconnect(bus, FALSE);
 
   static const char* iface = "org.a11y.Status";
   static const char* member = "IsEnabled";
-  DBusMessage *message;
-  message = dbus_message_new_method_call("org.a11y.Bus", "/org/a11y/bus",
-                                         "org.freedesktop.DBus.Properties",
-                                         "Get");
-  if (!message)
-    goto dbus_done;
+  DBusMessage* message;
+  message =
+      dbus_message_new_method_call("org.a11y.Bus", "/org/a11y/bus",
+                                   "org.freedesktop.DBus.Properties", "Get");
+  if (!message) goto dbus_done;
 
-  dbus_message_append_args(message, DBUS_TYPE_STRING, &iface,
-                           DBUS_TYPE_STRING, &member, DBUS_TYPE_INVALID);
+  dbus_message_append_args(message, DBUS_TYPE_STRING, &iface, DBUS_TYPE_STRING,
+                           &member, DBUS_TYPE_INVALID);
   dbus_connection_send_with_reply(bus, message, &sPendingCall, 1000);
   dbus_message_unref(message);
 
 dbus_done:
   dbus_connection_unref(bus);
 #endif
 }
 
-bool
-a11y::ShouldA11yBeEnabled()
-{
+bool a11y::ShouldA11yBeEnabled() {
   static bool sChecked = false, sShouldEnable = false;
-  if (sChecked)
-    return sShouldEnable;
+  if (sChecked) return sShouldEnable;
 
   sChecked = true;
 
   EPlatformDisabledState disabledState = PlatformDisabledState();
-  if (disabledState == ePlatformIsDisabled)
-    return sShouldEnable = false;
+  if (disabledState == ePlatformIsDisabled) return sShouldEnable = false;
 
   // check if accessibility enabled/disabled by environment variable
   const char* envValue = PR_GetEnv(sAccEnv);
-  if (envValue)
-    return sShouldEnable = !!atoi(envValue);
+  if (envValue) return sShouldEnable = !!atoi(envValue);
 
 #ifdef MOZ_ENABLE_DBUS
   PreInit();
   bool dbusSuccess = false;
-  DBusMessage *reply = nullptr;
-  if (!sPendingCall)
-    goto dbus_done;
+  DBusMessage* reply = nullptr;
+  if (!sPendingCall) goto dbus_done;
 
   dbus_pending_call_block(sPendingCall);
   reply = dbus_pending_call_steal_reply(sPendingCall);
   dbus_pending_call_unref(sPendingCall);
   sPendingCall = nullptr;
   if (!reply ||
       dbus_message_get_type(reply) != DBUS_MESSAGE_TYPE_METHOD_RETURN ||
-      strcmp(dbus_message_get_signature (reply), DBUS_TYPE_VARIANT_AS_STRING))
+      strcmp(dbus_message_get_signature(reply), DBUS_TYPE_VARIANT_AS_STRING))
     goto dbus_done;
 
   DBusMessageIter iter, iter_variant, iter_struct;
   dbus_bool_t dResult;
   dbus_message_iter_init(reply, &iter);
-  dbus_message_iter_recurse (&iter, &iter_variant);
+  dbus_message_iter_recurse(&iter, &iter_variant);
   switch (dbus_message_iter_get_arg_type(&iter_variant)) {
     case DBUS_TYPE_STRUCT:
       // at-spi2-core 2.2.0-2.2.1 had a bug where it returned a struct
       dbus_message_iter_recurse(&iter_variant, &iter_struct);
       if (dbus_message_iter_get_arg_type(&iter_struct) == DBUS_TYPE_BOOLEAN) {
         dbus_message_iter_get_basic(&iter_struct, &dResult);
         sShouldEnable = dResult;
         dbusSuccess = true;
@@ -324,25 +298,23 @@ a11y::ShouldA11yBeEnabled()
       sShouldEnable = dResult;
       dbusSuccess = true;
       break;
     default:
       break;
   }
 
 dbus_done:
-  if (reply)
-    dbus_message_unref(reply);
+  if (reply) dbus_message_unref(reply);
 
-  if (dbusSuccess)
-    return sShouldEnable;
+  if (dbusSuccess) return sShouldEnable;
 #endif
 
-  //check gconf-2 setting
+    // check gconf-2 setting
 #define GCONF_A11Y_KEY "/desktop/gnome/interface/accessibility"
   nsresult rv = NS_OK;
   nsCOMPtr<nsIGConfService> gconf =
-    do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
+      do_GetService(NS_GCONFSERVICE_CONTRACTID, &rv);
   if (NS_SUCCEEDED(rv) && gconf)
     gconf->GetBool(NS_LITERAL_CSTRING(GCONF_A11Y_KEY), &sShouldEnable);
 
   return sShouldEnable;
 }
--- a/accessible/atk/RootAccessibleWrap.cpp
+++ b/accessible/atk/RootAccessibleWrap.cpp
@@ -5,20 +5,18 @@
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "RootAccessibleWrap.h"
 
 #include "nsMai.h"
 
 using namespace mozilla::a11y;
 
-GtkWindowAccessible::GtkWindowAccessible(AtkObject* aAccessible) :
-  DummyAccessible()
-{
+GtkWindowAccessible::GtkWindowAccessible(AtkObject* aAccessible)
+    : DummyAccessible() {
   g_object_ref(aAccessible);
   mAtkObject = aAccessible;
 }
 
-GtkWindowAccessible::~GtkWindowAccessible()
-{
+GtkWindowAccessible::~GtkWindowAccessible() {
   g_object_unref(mAtkObject);
   mAtkObject = nullptr;
 }
--- a/accessible/atk/RootAccessibleWrap.h
+++ b/accessible/atk/RootAccessibleWrap.h
@@ -15,20 +15,18 @@ namespace a11y {
 
 typedef RootAccessible RootAccessibleWrap;
 
 /* GtkWindowAccessible is the accessible class for gtk+ native window.
  * The instance of GtkWindowAccessible is a child of MaiAppRoot instance.
  * It is added into root when the toplevel window is created, and removed
  * from root when the toplevel window is destroyed.
  */
-class GtkWindowAccessible final : public DummyAccessible
-{
-public:
+class GtkWindowAccessible final : public DummyAccessible {
+ public:
   explicit GtkWindowAccessible(AtkObject* aAccessible);
   virtual ~GtkWindowAccessible();
 };
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
-#endif   /* mozilla_a11y_Root_Accessible_Wrap_h__ */
-
+#endif /* mozilla_a11y_Root_Accessible_Wrap_h__ */
--- a/accessible/atk/TextLeafAccessibleWrap.h
+++ b/accessible/atk/TextLeafAccessibleWrap.h
@@ -9,12 +9,12 @@
 
 #include "TextLeafAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class TextLeafAccessible TextLeafAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/atk/UtilInterface.cpp
+++ b/accessible/atk/UtilInterface.cpp
@@ -19,245 +19,213 @@ using namespace mozilla::a11y;
 typedef AtkUtil MaiUtil;
 typedef AtkUtilClass MaiUtilClass;
 
 #define MAI_VERSION MOZILLA_VERSION
 #define MAI_NAME "Gecko"
 
 extern "C" {
 static guint (*gail_add_global_event_listener)(GSignalEmissionHook listener,
-                                               const gchar* event_type);
-static void (*gail_remove_global_event_listener) (guint remove_listener);
-static void (*gail_remove_key_event_listener) (guint remove_listener);
-static AtkObject*  (*gail_get_root)();
+                                               const gchar *event_type);
+static void (*gail_remove_global_event_listener)(guint remove_listener);
+static void (*gail_remove_key_event_listener)(guint remove_listener);
+static AtkObject *(*gail_get_root)();
 }
 
-struct MaiUtilListenerInfo
-{
+struct MaiUtilListenerInfo {
   gint key;
   guint signal_id;
   gulong hook_id;
   // For window create/destory/minimize/maximize/restore/activate/deactivate
   // events, we'll chain gail_util's add/remove_global_event_listener.
   // So we store the listenerid returned by gail's add_global_event_listener
   // in this structure to call gail's remove_global_event_listener later.
   guint gail_listenerid;
 };
 
-static GHashTable* sListener_list = nullptr;
+static GHashTable *sListener_list = nullptr;
 static gint sListener_idx = 1;
 
 extern "C" {
-static guint
-add_listener (GSignalEmissionHook listener,
-              const gchar *object_type,
-              const gchar *signal,
-              const gchar *hook_data,
-              guint gail_listenerid = 0)
-{
-    GType type;
-    guint signal_id;
-    gint rc = 0;
+static guint add_listener(GSignalEmissionHook listener,
+                          const gchar *object_type, const gchar *signal,
+                          const gchar *hook_data, guint gail_listenerid = 0) {
+  GType type;
+  guint signal_id;
+  gint rc = 0;
 
-    type = g_type_from_name(object_type);
-    if (type) {
-        signal_id = g_signal_lookup(signal, type);
-        if (signal_id > 0) {
-            MaiUtilListenerInfo *listener_info;
+  type = g_type_from_name(object_type);
+  if (type) {
+    signal_id = g_signal_lookup(signal, type);
+    if (signal_id > 0) {
+      MaiUtilListenerInfo *listener_info;
 
-            rc = sListener_idx;
+      rc = sListener_idx;
 
-            listener_info =  (MaiUtilListenerInfo *)
-                g_malloc(sizeof(MaiUtilListenerInfo));
-            listener_info->key = sListener_idx;
-            listener_info->hook_id =
-                g_signal_add_emission_hook(signal_id, 0, listener,
-                                           g_strdup(hook_data),
-                                           (GDestroyNotify)g_free);
-            listener_info->signal_id = signal_id;
-            listener_info->gail_listenerid = gail_listenerid;
+      listener_info =
+          (MaiUtilListenerInfo *)g_malloc(sizeof(MaiUtilListenerInfo));
+      listener_info->key = sListener_idx;
+      listener_info->hook_id = g_signal_add_emission_hook(
+          signal_id, 0, listener, g_strdup(hook_data), (GDestroyNotify)g_free);
+      listener_info->signal_id = signal_id;
+      listener_info->gail_listenerid = gail_listenerid;
 
-            g_hash_table_insert(sListener_list, &(listener_info->key),
-                                listener_info);
-            sListener_idx++;
-        }
-        else {
-            g_warning("Invalid signal type %s\n", signal);
-        }
+      g_hash_table_insert(sListener_list, &(listener_info->key), listener_info);
+      sListener_idx++;
+    } else {
+      g_warning("Invalid signal type %s\n", signal);
     }
-    else {
-        g_warning("Invalid object type %s\n", object_type);
-    }
-    return rc;
+  } else {
+    g_warning("Invalid object type %s\n", object_type);
+  }
+  return rc;
 }
 
-static guint
-mai_util_add_global_event_listener(GSignalEmissionHook listener,
-                                   const gchar *event_type)
-{
-    guint rc = 0;
-    gchar **split_string;
+static guint mai_util_add_global_event_listener(GSignalEmissionHook listener,
+                                                const gchar *event_type) {
+  guint rc = 0;
+  gchar **split_string;
 
-    split_string = g_strsplit (event_type, ":", 3);
+  split_string = g_strsplit(event_type, ":", 3);
 
-    if (split_string) {
-        if (!strcmp ("window", split_string[0])) {
-            guint gail_listenerid = 0;
-            if (gail_add_global_event_listener) {
-                // call gail's function to track gtk native window events
-                gail_listenerid =
-                    gail_add_global_event_listener(listener, event_type);
-            }
+  if (split_string) {
+    if (!strcmp("window", split_string[0])) {
+      guint gail_listenerid = 0;
+      if (gail_add_global_event_listener) {
+        // call gail's function to track gtk native window events
+        gail_listenerid = gail_add_global_event_listener(listener, event_type);
+      }
 
-            rc = add_listener (listener, "MaiAtkObject", split_string[1],
-                               event_type, gail_listenerid);
-        }
-        else {
-            rc = add_listener (listener, split_string[1], split_string[2],
-                               event_type);
-        }
-        g_strfreev(split_string);
+      rc = add_listener(listener, "MaiAtkObject", split_string[1], event_type,
+                        gail_listenerid);
+    } else {
+      rc = add_listener(listener, split_string[1], split_string[2], event_type);
     }
-    return rc;
+    g_strfreev(split_string);
+  }
+  return rc;
 }
 
-static void
-mai_util_remove_global_event_listener(guint remove_listener)
-{
-    if (remove_listener > 0) {
-        MaiUtilListenerInfo *listener_info;
-        gint tmp_idx = remove_listener;
+static void mai_util_remove_global_event_listener(guint remove_listener) {
+  if (remove_listener > 0) {
+    MaiUtilListenerInfo *listener_info;
+    gint tmp_idx = remove_listener;
 
-        listener_info = (MaiUtilListenerInfo *)
-            g_hash_table_lookup(sListener_list, &tmp_idx);
+    listener_info =
+        (MaiUtilListenerInfo *)g_hash_table_lookup(sListener_list, &tmp_idx);
 
-        if (listener_info != nullptr) {
-            if (gail_remove_global_event_listener &&
-                listener_info->gail_listenerid) {
-              gail_remove_global_event_listener(listener_info->gail_listenerid);
-            }
+    if (listener_info != nullptr) {
+      if (gail_remove_global_event_listener && listener_info->gail_listenerid) {
+        gail_remove_global_event_listener(listener_info->gail_listenerid);
+      }
 
-            /* Hook id of 0 and signal id of 0 are invalid */
-            if (listener_info->hook_id != 0 && listener_info->signal_id != 0) {
-                /* Remove the emission hook */
-                g_signal_remove_emission_hook(listener_info->signal_id,
-                                              listener_info->hook_id);
+      /* Hook id of 0 and signal id of 0 are invalid */
+      if (listener_info->hook_id != 0 && listener_info->signal_id != 0) {
+        /* Remove the emission hook */
+        g_signal_remove_emission_hook(listener_info->signal_id,
+                                      listener_info->hook_id);
 
-                /* Remove the element from the hash */
-                g_hash_table_remove(sListener_list, &tmp_idx);
-            }
-            else {
-                g_warning("Invalid listener hook_id %ld or signal_id %d\n",
-                          listener_info->hook_id, listener_info->signal_id);
-            }
-        }
-        else {
-            // atk-bridge is initialized with gail (e.g. yelp)
-            // try gail_remove_global_event_listener
-            if (gail_remove_global_event_listener) {
-                return gail_remove_global_event_listener(remove_listener);
-            }
+        /* Remove the element from the hash */
+        g_hash_table_remove(sListener_list, &tmp_idx);
+      } else {
+        g_warning("Invalid listener hook_id %ld or signal_id %d\n",
+                  listener_info->hook_id, listener_info->signal_id);
+      }
+    } else {
+      // atk-bridge is initialized with gail (e.g. yelp)
+      // try gail_remove_global_event_listener
+      if (gail_remove_global_event_listener) {
+        return gail_remove_global_event_listener(remove_listener);
+      }
 
-            g_warning("No listener with the specified listener id %d",
-                      remove_listener);
-        }
+      g_warning("No listener with the specified listener id %d",
+                remove_listener);
     }
-    else {
-        g_warning("Invalid listener_id %d", remove_listener);
-    }
+  } else {
+    g_warning("Invalid listener_id %d", remove_listener);
+  }
 }
 
-static AtkKeyEventStruct *
-atk_key_event_from_gdk_event_key (GdkEventKey *key)
-{
-    AtkKeyEventStruct *event = g_new0(AtkKeyEventStruct, 1);
-    switch (key->type) {
+static AtkKeyEventStruct *atk_key_event_from_gdk_event_key(GdkEventKey *key) {
+  AtkKeyEventStruct *event = g_new0(AtkKeyEventStruct, 1);
+  switch (key->type) {
     case GDK_KEY_PRESS:
-        event->type = ATK_KEY_EVENT_PRESS;
-        break;
+      event->type = ATK_KEY_EVENT_PRESS;
+      break;
     case GDK_KEY_RELEASE:
-        event->type = ATK_KEY_EVENT_RELEASE;
-        break;
+      event->type = ATK_KEY_EVENT_RELEASE;
+      break;
     default:
-        g_assert_not_reached ();
-        return nullptr;
-    }
-    event->state = key->state;
-    event->keyval = key->keyval;
-    event->length = key->length;
-    if (key->string && key->string [0] &&
-        (key->state & GDK_CONTROL_MASK ||
-         g_unichar_isgraph (g_utf8_get_char (key->string)))) {
-        event->string = key->string;
-    }
-    else if (key->type == GDK_KEY_PRESS ||
-             key->type == GDK_KEY_RELEASE) {
-        event->string = gdk_keyval_name (key->keyval);
-    }
-    event->keycode = key->hardware_keycode;
-    event->timestamp = key->time;
+      g_assert_not_reached();
+      return nullptr;
+  }
+  event->state = key->state;
+  event->keyval = key->keyval;
+  event->length = key->length;
+  if (key->string && key->string[0] &&
+      (key->state & GDK_CONTROL_MASK ||
+       g_unichar_isgraph(g_utf8_get_char(key->string)))) {
+    event->string = key->string;
+  } else if (key->type == GDK_KEY_PRESS || key->type == GDK_KEY_RELEASE) {
+    event->string = gdk_keyval_name(key->keyval);
+  }
+  event->keycode = key->hardware_keycode;
+  event->timestamp = key->time;
 
-    return event;
+  return event;
 }
 
-struct MaiKeyEventInfo
-{
-    AtkKeyEventStruct *key_event;
-    gpointer func_data;
+struct MaiKeyEventInfo {
+  AtkKeyEventStruct *key_event;
+  gpointer func_data;
 };
 
-union AtkKeySnoopFuncPointer
-{
-    AtkKeySnoopFunc func_ptr;
-    gpointer data;
+union AtkKeySnoopFuncPointer {
+  AtkKeySnoopFunc func_ptr;
+  gpointer data;
 };
 
-static gboolean
-notify_hf(gpointer key, gpointer value, gpointer data)
-{
-    MaiKeyEventInfo *info = (MaiKeyEventInfo *)data;
-    AtkKeySnoopFuncPointer atkKeySnoop;
-    atkKeySnoop.data = value;
-    return (atkKeySnoop.func_ptr)(info->key_event, info->func_data) ? TRUE : FALSE;
+static gboolean notify_hf(gpointer key, gpointer value, gpointer data) {
+  MaiKeyEventInfo *info = (MaiKeyEventInfo *)data;
+  AtkKeySnoopFuncPointer atkKeySnoop;
+  atkKeySnoop.data = value;
+  return (atkKeySnoop.func_ptr)(info->key_event, info->func_data) ? TRUE
+                                                                  : FALSE;
+}
+
+static void insert_hf(gpointer key, gpointer value, gpointer data) {
+  GHashTable *new_table = (GHashTable *)data;
+  g_hash_table_insert(new_table, key, value);
 }
 
-static void
-insert_hf(gpointer key, gpointer value, gpointer data)
-{
-    GHashTable *new_table = (GHashTable *) data;
-    g_hash_table_insert (new_table, key, value);
-}
+static GHashTable *sKey_listener_list = nullptr;
 
-static GHashTable* sKey_listener_list = nullptr;
-
-static gint
-mai_key_snooper(GtkWidget *the_widget, GdkEventKey *event, gpointer func_data)
-{
-    /* notify each AtkKeySnoopFunc in turn... */
+static gint mai_key_snooper(GtkWidget *the_widget, GdkEventKey *event,
+                            gpointer func_data) {
+  /* notify each AtkKeySnoopFunc in turn... */
 
-    MaiKeyEventInfo *info = g_new0(MaiKeyEventInfo, 1);
-    gint consumed = 0;
-    if (sKey_listener_list) {
-        GHashTable *new_hash = g_hash_table_new(nullptr, nullptr);
-        g_hash_table_foreach (sKey_listener_list, insert_hf, new_hash);
-        info->key_event = atk_key_event_from_gdk_event_key (event);
-        info->func_data = func_data;
-        consumed = g_hash_table_foreach_steal (new_hash, notify_hf, info);
-        g_hash_table_destroy (new_hash);
-        g_free(info->key_event);
-    }
-    g_free(info);
-    return (consumed ? 1 : 0);
+  MaiKeyEventInfo *info = g_new0(MaiKeyEventInfo, 1);
+  gint consumed = 0;
+  if (sKey_listener_list) {
+    GHashTable *new_hash = g_hash_table_new(nullptr, nullptr);
+    g_hash_table_foreach(sKey_listener_list, insert_hf, new_hash);
+    info->key_event = atk_key_event_from_gdk_event_key(event);
+    info->func_data = func_data;
+    consumed = g_hash_table_foreach_steal(new_hash, notify_hf, info);
+    g_hash_table_destroy(new_hash);
+    g_free(info->key_event);
+  }
+  g_free(info);
+  return (consumed ? 1 : 0);
 }
 
 static guint sKey_snooper_id = 0;
 
-static guint
-mai_util_add_key_event_listener(AtkKeySnoopFunc listener, gpointer data)
-{
+static guint mai_util_add_key_event_listener(AtkKeySnoopFunc listener,
+                                             gpointer data) {
   if (MOZ_UNLIKELY(!listener)) {
     return 0;
   }
 
   static guint key = 0;
 
   if (!sKey_listener_list) {
     sKey_listener_list = g_hash_table_new(nullptr, nullptr);
@@ -272,140 +240,108 @@ mai_util_add_key_event_listener(AtkKeySn
   AtkKeySnoopFuncPointer atkKeySnoop;
   atkKeySnoop.func_ptr = listener;
   key++;
   g_hash_table_insert(sKey_listener_list, GUINT_TO_POINTER(key),
                       atkKeySnoop.data);
   return key;
 }
 
-static void
-mai_util_remove_key_event_listener (guint remove_listener)
-{
-    if (!sKey_listener_list) {
-        // atk-bridge is initialized with gail (e.g. yelp)
-        // try gail_remove_key_event_listener
-        return gail_remove_key_event_listener(remove_listener);
-    }
+static void mai_util_remove_key_event_listener(guint remove_listener) {
+  if (!sKey_listener_list) {
+    // atk-bridge is initialized with gail (e.g. yelp)
+    // try gail_remove_key_event_listener
+    return gail_remove_key_event_listener(remove_listener);
+  }
 
-    g_hash_table_remove(sKey_listener_list, GUINT_TO_POINTER (remove_listener));
-    if (g_hash_table_size(sKey_listener_list) == 0) {
-        gtk_key_snooper_remove(sKey_snooper_id);
-    }
+  g_hash_table_remove(sKey_listener_list, GUINT_TO_POINTER(remove_listener));
+  if (g_hash_table_size(sKey_listener_list) == 0) {
+    gtk_key_snooper_remove(sKey_snooper_id);
+  }
 }
 
-static AtkObject*
-mai_util_get_root()
-{
-  ApplicationAccessible* app = ApplicationAcc();
-  if (app)
-    return app->GetAtkObject();
+static AtkObject *mai_util_get_root() {
+  ApplicationAccessible *app = ApplicationAcc();
+  if (app) return app->GetAtkObject();
 
   // We've shutdown, try to use gail instead
   // (to avoid assert in spi_atk_tidy_windows())
   // XXX tbsaunde then why didn't we replace the gail atk_util impl?
-  if (gail_get_root)
-    return gail_get_root();
+  if (gail_get_root) return gail_get_root();
 
   return nullptr;
 }
 
-static const gchar*
-mai_util_get_toolkit_name()
-{
-    return MAI_NAME;
-}
+static const gchar *mai_util_get_toolkit_name() { return MAI_NAME; }
+
+static const gchar *mai_util_get_toolkit_version() { return MAI_VERSION; }
+
+static void _listener_info_destroy(gpointer data) { g_free(data); }
 
-static const gchar*
-mai_util_get_toolkit_version()
-{
-    return MAI_VERSION;
+static void window_added(AtkObject *atk_obj, guint index, AtkObject *child) {
+  if (!IS_MAI_OBJECT(child)) return;
+
+  static guint id = g_signal_lookup("create", MAI_TYPE_ATK_OBJECT);
+  g_signal_emit(child, id, 0);
 }
 
-static void
-_listener_info_destroy(gpointer data)
-{
-    g_free(data);
-}
+static void window_removed(AtkObject *atk_obj, guint index, AtkObject *child) {
+  if (!IS_MAI_OBJECT(child)) return;
 
-static void
-window_added (AtkObject *atk_obj,
-              guint     index,
-              AtkObject *child)
-{
-  if (!IS_MAI_OBJECT(child))
-      return;
-
-  static guint id =  g_signal_lookup ("create", MAI_TYPE_ATK_OBJECT);
-  g_signal_emit (child, id, 0);
+  static guint id = g_signal_lookup("destroy", MAI_TYPE_ATK_OBJECT);
+  g_signal_emit(child, id, 0);
 }
 
-static void
-window_removed (AtkObject *atk_obj,
-                guint     index,
-                AtkObject *child)
-{
-  if (!IS_MAI_OBJECT(child))
-      return;
+static void UtilInterfaceInit(MaiUtilClass *klass) {
+  AtkUtilClass *atk_class;
+  gpointer data;
 
-  static guint id =  g_signal_lookup ("destroy", MAI_TYPE_ATK_OBJECT);
-  g_signal_emit (child, id, 0);
-}
+  data = g_type_class_peek(ATK_TYPE_UTIL);
+  atk_class = ATK_UTIL_CLASS(data);
 
-  static void
-UtilInterfaceInit(MaiUtilClass* klass)
-{
-    AtkUtilClass *atk_class;
-    gpointer data;
-
-    data = g_type_class_peek(ATK_TYPE_UTIL);
-    atk_class = ATK_UTIL_CLASS(data);
+  // save gail function pointer
+  gail_add_global_event_listener = atk_class->add_global_event_listener;
+  gail_remove_global_event_listener = atk_class->remove_global_event_listener;
+  gail_remove_key_event_listener = atk_class->remove_key_event_listener;
+  gail_get_root = atk_class->get_root;
 
-    // save gail function pointer
-    gail_add_global_event_listener = atk_class->add_global_event_listener;
-    gail_remove_global_event_listener = atk_class->remove_global_event_listener;
-    gail_remove_key_event_listener = atk_class->remove_key_event_listener;
-    gail_get_root = atk_class->get_root;
+  atk_class->add_global_event_listener = mai_util_add_global_event_listener;
+  atk_class->remove_global_event_listener =
+      mai_util_remove_global_event_listener;
+  atk_class->add_key_event_listener = mai_util_add_key_event_listener;
+  atk_class->remove_key_event_listener = mai_util_remove_key_event_listener;
+  atk_class->get_root = mai_util_get_root;
+  atk_class->get_toolkit_name = mai_util_get_toolkit_name;
+  atk_class->get_toolkit_version = mai_util_get_toolkit_version;
 
-    atk_class->add_global_event_listener =
-        mai_util_add_global_event_listener;
-    atk_class->remove_global_event_listener =
-        mai_util_remove_global_event_listener;
-    atk_class->add_key_event_listener = mai_util_add_key_event_listener;
-    atk_class->remove_key_event_listener = mai_util_remove_key_event_listener;
-    atk_class->get_root = mai_util_get_root;
-    atk_class->get_toolkit_name = mai_util_get_toolkit_name;
-    atk_class->get_toolkit_version = mai_util_get_toolkit_version;
-
-    sListener_list = g_hash_table_new_full(g_int_hash, g_int_equal, nullptr,
-                                           _listener_info_destroy);
-    // Keep track of added/removed windows.
-    AtkObject *root = atk_get_root ();
-    g_signal_connect (root, "children-changed::add", (GCallback) window_added, nullptr);
-    g_signal_connect (root, "children-changed::remove", (GCallback) window_removed, nullptr);
+  sListener_list = g_hash_table_new_full(g_int_hash, g_int_equal, nullptr,
+                                         _listener_info_destroy);
+  // Keep track of added/removed windows.
+  AtkObject *root = atk_get_root();
+  g_signal_connect(root, "children-changed::add", (GCallback)window_added,
+                   nullptr);
+  g_signal_connect(root, "children-changed::remove", (GCallback)window_removed,
+                   nullptr);
 }
 }
 
-GType
-mai_util_get_type()
-{
-    static GType type = 0;
+GType mai_util_get_type() {
+  static GType type = 0;
 
-    if (!type) {
-        static const GTypeInfo tinfo = {
-            sizeof(MaiUtilClass),
-            (GBaseInitFunc) nullptr, /* base init */
-            (GBaseFinalizeFunc) nullptr, /* base finalize */
-            (GClassInitFunc) UtilInterfaceInit, /* class init */
-            (GClassFinalizeFunc) nullptr, /* class finalize */
-            nullptr, /* class data */
-            sizeof(MaiUtil), /* instance size */
-            0, /* nb preallocs */
-            (GInstanceInitFunc) nullptr, /* instance init */
-            nullptr /* value table */
-        };
+  if (!type) {
+    static const GTypeInfo tinfo = {
+        sizeof(MaiUtilClass),
+        (GBaseInitFunc) nullptr,           /* base init */
+        (GBaseFinalizeFunc) nullptr,       /* base finalize */
+        (GClassInitFunc)UtilInterfaceInit, /* class init */
+        (GClassFinalizeFunc) nullptr,      /* class finalize */
+        nullptr,                           /* class data */
+        sizeof(MaiUtil),                   /* instance size */
+        0,                                 /* nb preallocs */
+        (GInstanceInitFunc) nullptr,       /* instance init */
+        nullptr                            /* value table */
+    };
 
-        type = g_type_register_static(ATK_TYPE_UTIL,
-                                      "MaiUtil", &tinfo, GTypeFlags(0));
-    }
-    return type;
+    type =
+        g_type_register_static(ATK_TYPE_UTIL, "MaiUtil", &tinfo, GTypeFlags(0));
+  }
+  return type;
 }
-
--- a/accessible/atk/XULListboxAccessibleWrap.h
+++ b/accessible/atk/XULListboxAccessibleWrap.h
@@ -9,12 +9,12 @@
 
 #include "XULListboxAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class XULListboxAccessible XULListboxAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/atk/XULMenuAccessibleWrap.h
+++ b/accessible/atk/XULMenuAccessibleWrap.h
@@ -9,12 +9,12 @@
 
 #include "XULMenuAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class XULMenuitemAccessible XULMenuitemAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
--- a/accessible/atk/XULTreeGridAccessibleWrap.h
+++ b/accessible/atk/XULTreeGridAccessibleWrap.h
@@ -10,13 +10,12 @@
 #include "XULTreeGridAccessible.h"
 
 namespace mozilla {
 namespace a11y {
 
 typedef class XULTreeGridAccessible XULTreeGridAccessibleWrap;
 typedef class XULTreeGridCellAccessible XULTreeGridCellAccessibleWrap;
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif
-
--- a/accessible/atk/nsMai.h
+++ b/accessible/atk/nsMai.h
@@ -13,60 +13,54 @@
 
 #include "AccessibleOrProxy.h"
 #include "AccessibleWrap.h"
 
 namespace mozilla {
 namespace a11y {
 class ProxyAccessible;
 }
-}
+}  // namespace mozilla
 
-#define MAI_TYPE_ATK_OBJECT             (mai_atk_object_get_type ())
-#define MAI_ATK_OBJECT(obj)             (G_TYPE_CHECK_INSTANCE_CAST ((obj), \
-                                         MAI_TYPE_ATK_OBJECT, MaiAtkObject))
-#define MAI_ATK_OBJECT_CLASS(klass)     (G_TYPE_CHECK_CLASS_CAST ((klass), \
-                                         MAI_TYPE_ATK_OBJECT, \
-                                         MaiAtkObjectClass))
-#define IS_MAI_OBJECT(obj)              (G_TYPE_CHECK_INSTANCE_TYPE ((obj), \
-                                         MAI_TYPE_ATK_OBJECT))
-#define IS_MAI_OBJECT_CLASS(klass)      (G_TYPE_CHECK_CLASS_TYPE ((klass), \
-                                         MAI_TYPE_ATK_OBJECT))
-#define MAI_ATK_OBJECT_GET_CLASS(obj)   (G_TYPE_INSTANCE_GET_CLASS ((obj), \
-                                         MAI_TYPE_ATK_OBJECT, \
-                                         MaiAtkObjectClass))
+#define MAI_TYPE_ATK_OBJECT (mai_atk_object_get_type())
+#define MAI_ATK_OBJECT(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), MAI_TYPE_ATK_OBJECT, MaiAtkObject))
+#define MAI_ATK_OBJECT_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass), MAI_TYPE_ATK_OBJECT, MaiAtkObjectClass))
+#define IS_MAI_OBJECT(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), MAI_TYPE_ATK_OBJECT))
+#define IS_MAI_OBJECT_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), MAI_TYPE_ATK_OBJECT))
+#define MAI_ATK_OBJECT_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS((obj), MAI_TYPE_ATK_OBJECT, MaiAtkObjectClass))
 GType mai_atk_object_get_type(void);
 GType mai_util_get_type();
 extern "C" GType mai_atk_socket_get_type(void);
 
 /* MaiAtkSocket */
 
-#define MAI_TYPE_ATK_SOCKET              (mai_atk_socket_get_type ())
-#define MAI_ATK_SOCKET(obj)              (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
-                                          MAI_TYPE_ATK_SOCKET, MaiAtkSocket))
-#define MAI_IS_ATK_SOCKET(obj)           (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
-                                          MAI_TYPE_ATK_SOCKET))
-#define MAI_ATK_SOCKET_CLASS(klass)      (G_TYPE_CHECK_CLASS_CAST ((klass),\
-                                          MAI_TYPE_ATK_SOCKET,\
-                                          MaiAtkSocketClass))
-#define MAI_IS_ATK_SOCKET_CLASS(klass)   (G_TYPE_CHECK_CLASS_TYPE ((klass),\
-                                          MAI_TYPE_ATK_SOCKET))
-#define MAI_ATK_SOCKET_GET_CLASS(obj)    (G_TYPE_INSTANCE_GET_CLASS ((obj),\
-                                          MAI_TYPE_ATK_SOCKET,\
-                                          MaiAtkSocketClass))
+#define MAI_TYPE_ATK_SOCKET (mai_atk_socket_get_type())
+#define MAI_ATK_SOCKET(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), MAI_TYPE_ATK_SOCKET, MaiAtkSocket))
+#define MAI_IS_ATK_SOCKET(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), MAI_TYPE_ATK_SOCKET))
+#define MAI_ATK_SOCKET_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_CAST((klass), MAI_TYPE_ATK_SOCKET, MaiAtkSocketClass))
+#define MAI_IS_ATK_SOCKET_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), MAI_TYPE_ATK_SOCKET))
+#define MAI_ATK_SOCKET_GET_CLASS(obj) \
+  (G_TYPE_INSTANCE_GET_CLASS((obj), MAI_TYPE_ATK_SOCKET, MaiAtkSocketClass))
 
-typedef struct _MaiAtkSocket
-{
+typedef struct _MaiAtkSocket {
   AtkSocket parent;
 
   mozilla::a11y::AccessibleWrap* accWrap;
 } MaiAtkSocket;
 
-typedef struct _MaiAtkSocketClass
-{
+typedef struct _MaiAtkSocketClass {
   AtkSocketClass parent_class;
 } MaiAtkSocketClass;
 
 // This is a pointer to the atk_table_cell_get_type function if we are using
 // a version of atk that defines that.
 extern "C" GType (*gAtkTableCellGetTypeFunc)();
 
 mozilla::a11y::AccessibleWrap* GetAccessibleWrap(AtkObject* aAtkObj);
@@ -76,34 +70,31 @@ AtkObject* GetWrapperFor(mozilla::a11y::
 AtkObject* GetWrapperFor(mozilla::a11y::AccessibleOrProxy aObj);
 
 extern int atkMajorVersion, atkMinorVersion, atkMicroVersion;
 
 /**
  * Return true if the loaded version of libatk-1.0.so is at least
  * aMajor.aMinor.aMicro.
  */
-static inline bool
-IsAtkVersionAtLeast(int aMajor, int aMinor, int aMicro=0)
-{
+static inline bool IsAtkVersionAtLeast(int aMajor, int aMinor, int aMicro = 0) {
   return aMajor < atkMajorVersion ||
          (aMajor == atkMajorVersion &&
           (aMinor < atkMinorVersion ||
            (aMinor == atkMinorVersion && aMicro <= atkMicroVersion)));
 }
 
 // This is or'd with the pointer in MaiAtkObject::accWrap if the wrap-ee is a
 // proxy.
 static const uintptr_t IS_PROXY = 1;
 
 /**
  * This MaiAtkObject is a thin wrapper, in the MAI namespace, for AtkObject
  */
-struct MaiAtkObject
-{
+struct MaiAtkObject {
   AtkObject parent;
   /*
    * The AccessibleWrap whose properties and features are exported
    * via this object instance.
    */
   mozilla::a11y::AccessibleOrProxy accWrap;
 
   /*
@@ -128,17 +119,17 @@ struct MaiAtkObject
                            bool aIsInsert, bool aIsFromUser);
 
   /**
    * Notify ATK of a shown or hidden subtree rooted at aObject whose parent is
    * aParent
    */
   void FireAtkShowHideEvent(AtkObject* aParent, bool aIsAdded, bool aFromUser);
 
-private:
+ private:
   /*
    * do we have text-remove and text-insert signals if not we need to use
    * text-changed see AccessibleWrap::FireAtkTextChangedEvent() and
    * bug 619002
    */
   enum EAvailableAtkSignals {
     eUnknown,
     eHaveNewAtkTextSignals,
--- a/accessible/atk/nsMaiHyperlink.cpp
+++ b/accessible/atk/nsMaiHyperlink.cpp
@@ -7,47 +7,47 @@
 #include "nsIURI.h"
 #include "nsMaiHyperlink.h"
 #include "mozilla/a11y/ProxyAccessible.h"
 
 using namespace mozilla::a11y;
 
 /* MaiAtkHyperlink */
 
-#define MAI_TYPE_ATK_HYPERLINK      (mai_atk_hyperlink_get_type ())
-#define MAI_ATK_HYPERLINK(obj)      (G_TYPE_CHECK_INSTANCE_CAST ((obj),\
-                                     MAI_TYPE_ATK_HYPERLINK, MaiAtkHyperlink))
-#define MAI_ATK_HYPERLINK_CLASS(klass)  (G_TYPE_CHECK_CLASS_CAST ((klass),\
-                                 MAI_TYPE_ATK_HYPERLINK, MaiAtkHyperlinkClass))
-#define MAI_IS_ATK_HYPERLINK(obj)      (G_TYPE_CHECK_INSTANCE_TYPE ((obj),\
-                                        MAI_TYPE_ATK_HYPERLINK))
-#define MAI_IS_ATK_HYPERLINK_CLASS(klass) (G_TYPE_CHECK_CLASS_TYPE ((klass),\
-                                        MAI_TYPE_ATK_HYPERLINK))
-#define MAI_ATK_HYPERLINK_GET_CLASS(obj) (G_TYPE_INSTANCE_GET_CLASS ((obj),\
-                                 MAI_TYPE_ATK_HYPERLINK, MaiAtkHyperlinkClass))
+#define MAI_TYPE_ATK_HYPERLINK (mai_atk_hyperlink_get_type())
+#define MAI_ATK_HYPERLINK(obj) \
+  (G_TYPE_CHECK_INSTANCE_CAST((obj), MAI_TYPE_ATK_HYPERLINK, MaiAtkHyperlink))
+#define MAI_ATK_HYPERLINK_CLASS(klass)                      \
+  (G_TYPE_CHECK_CLASS_CAST((klass), MAI_TYPE_ATK_HYPERLINK, \
+                           MaiAtkHyperlinkClass))
+#define MAI_IS_ATK_HYPERLINK(obj) \
+  (G_TYPE_CHECK_INSTANCE_TYPE((obj), MAI_TYPE_ATK_HYPERLINK))
+#define MAI_IS_ATK_HYPERLINK_CLASS(klass) \
+  (G_TYPE_CHECK_CLASS_TYPE((klass), MAI_TYPE_ATK_HYPERLINK))
+#define MAI_ATK_HYPERLINK_GET_CLASS(obj)                    \
+  (G_TYPE_INSTANCE_GET_CLASS((obj), MAI_TYPE_ATK_HYPERLINK, \
+                             MaiAtkHyperlinkClass))
 
 /**
  * This MaiAtkHyperlink is a thin wrapper, in the MAI namespace,
  * for AtkHyperlink
  */
 
-struct MaiAtkHyperlink
-{
-    AtkHyperlink parent;
+struct MaiAtkHyperlink {
+  AtkHyperlink parent;
 
-    /*
-     * The MaiHyperlink whose properties and features are exported via this
-     * hyperlink instance.
-     */
-    MaiHyperlink *maiHyperlink;
+  /*
+   * The MaiHyperlink whose properties and features are exported via this
+   * hyperlink instance.
+   */
+  MaiHyperlink *maiHyperlink;
 };
 
-struct MaiAtkHyperlinkClass
-{
-    AtkHyperlinkClass parent_class;
+struct MaiAtkHyperlinkClass {
+  AtkHyperlinkClass parent_class;
 };
 
 GType mai_atk_hyperlink_get_type(void);
 
 G_BEGIN_DECLS
 /* callbacks for AtkHyperlink */
 static void classInitCB(AtkHyperlinkClass *aClass);
 static void finalizeCB(GObject *aObj);
@@ -58,205 +58,169 @@ static AtkObject *getObjectCB(AtkHyperli
 static gint getEndIndexCB(AtkHyperlink *aLink);
 static gint getStartIndexCB(AtkHyperlink *aLink);
 static gboolean isValidCB(AtkHyperlink *aLink);
 static gint getAnchorCountCB(AtkHyperlink *aLink);
 G_END_DECLS
 
 static gpointer parent_class = nullptr;
 
-static MaiHyperlink*
-GetMaiHyperlink(AtkHyperlink *aHyperlink)
-{
-    NS_ENSURE_TRUE(MAI_IS_ATK_HYPERLINK(aHyperlink), nullptr);
-    MaiHyperlink * maiHyperlink =
-        MAI_ATK_HYPERLINK(aHyperlink)->maiHyperlink;
-    NS_ENSURE_TRUE(maiHyperlink != nullptr, nullptr);
-    NS_ENSURE_TRUE(maiHyperlink->GetAtkHyperlink() == aHyperlink, nullptr);
-    return maiHyperlink;
+static MaiHyperlink *GetMaiHyperlink(AtkHyperlink *aHyperlink) {
+  NS_ENSURE_TRUE(MAI_IS_ATK_HYPERLINK(aHyperlink), nullptr);
+  MaiHyperlink *maiHyperlink = MAI_ATK_HYPERLINK(aHyperlink)->maiHyperlink;
+  NS_ENSURE_TRUE(maiHyperlink != nullptr, nullptr);
+  NS_ENSURE_TRUE(maiHyperlink->GetAtkHyperlink() == aHyperlink, nullptr);
+  return maiHyperlink;
 }
 
-GType
-mai_atk_hyperlink_get_type(void)
-{
-    static GType type = 0;
+GType mai_atk_hyperlink_get_type(void) {
+  static GType type = 0;
 
-    if (!type) {
-        static const GTypeInfo tinfo = {
-            sizeof(MaiAtkHyperlinkClass),
-            (GBaseInitFunc)nullptr,
-            (GBaseFinalizeFunc)nullptr,
-            (GClassInitFunc)classInitCB,
-            (GClassFinalizeFunc)nullptr,
-            nullptr, /* class data */
-            sizeof(MaiAtkHyperlink), /* instance size */
-            0, /* nb preallocs */
-            (GInstanceInitFunc)nullptr,
-            nullptr /* value table */
-        };
+  if (!type) {
+    static const GTypeInfo tinfo = {
+        sizeof(MaiAtkHyperlinkClass),
+        (GBaseInitFunc) nullptr,
+        (GBaseFinalizeFunc) nullptr,
+        (GClassInitFunc)classInitCB,
+        (GClassFinalizeFunc) nullptr,
+        nullptr,                 /* class data */
+        sizeof(MaiAtkHyperlink), /* instance size */
+        0,                       /* nb preallocs */
+        (GInstanceInitFunc) nullptr,
+        nullptr /* value table */
+    };
 
-        type = g_type_register_static(ATK_TYPE_HYPERLINK,
-                                      "MaiAtkHyperlink",
-                                      &tinfo, GTypeFlags(0));
-    }
-    return type;
+    type = g_type_register_static(ATK_TYPE_HYPERLINK, "MaiAtkHyperlink", &tinfo,
+                                  GTypeFlags(0));
+  }
+  return type;
 }
 
-MaiHyperlink::MaiHyperlink(AccessibleOrProxy aHyperLink) :
-    mHyperlink(aHyperLink),
-    mMaiAtkHyperlink(nullptr)
-{
-    mMaiAtkHyperlink =
-        reinterpret_cast<AtkHyperlink *>
-                        (g_object_new(mai_atk_hyperlink_get_type(), nullptr));
-    NS_ASSERTION(mMaiAtkHyperlink, "OUT OF MEMORY");
-    if (!mMaiAtkHyperlink)
-      return;
+MaiHyperlink::MaiHyperlink(AccessibleOrProxy aHyperLink)
+    : mHyperlink(aHyperLink), mMaiAtkHyperlink(nullptr) {
+  mMaiAtkHyperlink = reinterpret_cast<AtkHyperlink *>(
+      g_object_new(mai_atk_hyperlink_get_type(), nullptr));
+  NS_ASSERTION(mMaiAtkHyperlink, "OUT OF MEMORY");
+  if (!mMaiAtkHyperlink) return;
 
-    MAI_ATK_HYPERLINK(mMaiAtkHyperlink)->maiHyperlink = this;
+  MAI_ATK_HYPERLINK(mMaiAtkHyperlink)->maiHyperlink = this;
 }
 
-MaiHyperlink::~MaiHyperlink()
-{
+MaiHyperlink::~MaiHyperlink() {
   if (mMaiAtkHyperlink) {
     MAI_ATK_HYPERLINK(mMaiAtkHyperlink)->maiHyperlink = nullptr;
     g_object_unref(mMaiAtkHyperlink);
   }
 }
 
-
 /* static functions for ATK callbacks */
 
-void
-classInitCB(AtkHyperlinkClass *aClass)
-{
-    GObjectClass *gobject_class = G_OBJECT_CLASS(aClass);
+void classInitCB(AtkHyperlinkClass *aClass) {
+  GObjectClass *gobject_class = G_OBJECT_CLASS(aClass);
 
-    parent_class = g_type_class_peek_parent(aClass);
+  parent_class = g_type_class_peek_parent(aClass);
 
-    aClass->get_uri = getUriCB;
-    aClass->get_object = getObjectCB;
-    aClass->get_end_index = getEndIndexCB;
-    aClass->get_start_index = getStartIndexCB;
-    aClass->is_valid = isValidCB;
-    aClass->get_n_anchors = getAnchorCountCB;
+  aClass->get_uri = getUriCB;
+  aClass->get_object = getObjectCB;
+  aClass->get_end_index = getEndIndexCB;
+  aClass->get_start_index = getStartIndexCB;
+  aClass->is_valid = isValidCB;
+  aClass->get_n_anchors = getAnchorCountCB;
 
-    gobject_class->finalize = finalizeCB;
+  gobject_class->finalize = finalizeCB;
 }
 
-void
-finalizeCB(GObject *aObj)
-{
-    NS_ASSERTION(MAI_IS_ATK_HYPERLINK(aObj), "Invalid MaiAtkHyperlink");
-    if (!MAI_IS_ATK_HYPERLINK(aObj))
-        return;
+void finalizeCB(GObject *aObj) {
+  NS_ASSERTION(MAI_IS_ATK_HYPERLINK(aObj), "Invalid MaiAtkHyperlink");
+  if (!MAI_IS_ATK_HYPERLINK(aObj)) return;
 
-    MaiAtkHyperlink *maiAtkHyperlink = MAI_ATK_HYPERLINK(aObj);
-    maiAtkHyperlink->maiHyperlink = nullptr;
+  MaiAtkHyperlink *maiAtkHyperlink = MAI_ATK_HYPERLINK(aObj);
+  maiAtkHyperlink->maiHyperlink = nullptr;
 
-    /* call parent finalize function */
-    if (G_OBJECT_CLASS (parent_class)->finalize)
-        G_OBJECT_CLASS (parent_class)->finalize(aObj);
+  /* call parent finalize function */
+  if (G_OBJECT_CLASS(parent_class)->finalize)
+    G_OBJECT_CLASS(parent_class)->finalize(aObj);
 }
 
-gchar *
-getUriCB(AtkHyperlink *aLink, gint aLinkIndex)
-{
-  MaiHyperlink* maiLink = GetMaiHyperlink(aLink);
-  if (!maiLink)
-    return nullptr;
+gchar *getUriCB(AtkHyperlink *aLink, gint aLinkIndex) {
+  MaiHyperlink *maiLink = GetMaiHyperlink(aLink);
+  if (!maiLink) return nullptr;
 
   nsAutoCString cautoStr;
-  if (Accessible* hyperlink = maiLink->GetAccHyperlink()) {
+  if (Accessible *hyperlink = maiLink->GetAccHyperlink()) {
     nsCOMPtr<nsIURI> uri = hyperlink->AnchorURIAt(aLinkIndex);
-    if (!uri)
-      return nullptr;
+    if (!uri) return nullptr;
 
     nsresult rv = uri->GetSpec(cautoStr);
     NS_ENSURE_SUCCESS(rv, nullptr);
 
     return g_strdup(cautoStr.get());
   }
 
   bool valid;
   maiLink->Proxy()->AnchorURIAt(aLinkIndex, cautoStr, &valid);
-  if (!valid)
-    return nullptr;
+  if (!valid) return nullptr;
 
   return g_strdup(cautoStr.get());
 }
 
-AtkObject *
-getObjectCB(AtkHyperlink *aLink, gint aLinkIndex)
-{
-  MaiHyperlink* maiLink = GetMaiHyperlink(aLink);
+AtkObject *getObjectCB(AtkHyperlink *aLink, gint aLinkIndex) {
+  MaiHyperlink *maiLink = GetMaiHyperlink(aLink);
   if (!maiLink) {
     return nullptr;
   }
 
-  if (Accessible* hyperlink = maiLink->GetAccHyperlink()) {
-    Accessible* anchor = hyperlink->AnchorAt(aLinkIndex);
+  if (Accessible *hyperlink = maiLink->GetAccHyperlink()) {
+    Accessible *anchor = hyperlink->AnchorAt(aLinkIndex);
     NS_ENSURE_TRUE(anchor, nullptr);
 
     return AccessibleWrap::GetAtkObject(anchor);
   }
 
-  ProxyAccessible* anchor = maiLink->Proxy()->AnchorAt(aLinkIndex);
+  ProxyAccessible *anchor = maiLink->Proxy()->AnchorAt(aLinkIndex);
   return anchor ? GetWrapperFor(anchor) : nullptr;
 }
 
-gint
-getEndIndexCB(AtkHyperlink *aLink)
-{
-  MaiHyperlink* maiLink = GetMaiHyperlink(aLink);
-  if (!maiLink)
-    return false;
+gint getEndIndexCB(AtkHyperlink *aLink) {
+  MaiHyperlink *maiLink = GetMaiHyperlink(aLink);
+  if (!maiLink) return false;
 
-  if (Accessible* hyperlink = maiLink->GetAccHyperlink())
+  if (Accessible *hyperlink = maiLink->GetAccHyperlink())
     return static_cast<gint>(hyperlink->EndOffset());
 
   bool valid = false;
   uint32_t endIdx = maiLink->Proxy()->EndOffset(&valid);
   return valid ? static_cast<gint>(endIdx) : -1;
 }
 
-gint
-getStartIndexCB(AtkHyperlink *aLink)
-{
-  MaiHyperlink* maiLink = GetMaiHyperlink(aLink);
-  if (!maiLink)
-    return -1;
+gint getStartIndexCB(AtkHyperlink *aLink) {
+  MaiHyperlink *maiLink = GetMaiHyperlink(aLink);
+  if (!maiLink) return -1;
 
-  if (Accessible* hyperlink = maiLink->GetAccHyperlink())
+  if (Accessible *hyperlink = maiLink->GetAccHyperlink())
     return static_cast<gint>(hyperlink->StartOffset());
 
   bool valid = false;
   uint32_t startIdx = maiLink->Proxy()->StartOffset(&valid);
   return valid ? static_cast<gint>(startIdx) : -1;
 }
 
-gboolean
-isValidCB(AtkHyperlink *aLink)
-{
-  MaiHyperlink* maiLink = GetMaiHyperlink(aLink);
-  if (!maiLink)
-    return false;
+gboolean isValidCB(AtkHyperlink *aLink) {
+  MaiHyperlink *maiLink = GetMaiHyperlink(aLink);
+  if (!maiLink) return false;
 
-  if (Accessible* hyperlink = maiLink->GetAccHyperlink())
+  if (Accessible *hyperlink = maiLink->GetAccHyperlink())
     return static_cast<gboolean>(hyperlink->IsLinkValid());
 
   return static_cast<gboolean>(maiLink->Proxy()->IsLinkValid());
 }
 
-gint
-getAnchorCountCB(AtkHyperlink *aLink)
-{
-  MaiHyperlink* maiLink = GetMaiHyperlink(aLink);
-  if (!maiLink)
-    return -1;
+gint getAnchorCountCB(AtkHyperlink *aLink) {
+  MaiHyperlink *maiLink = GetMaiHyperlink(aLink);
+  if (!maiLink) return -1;
 
-  if (Accessible* hyperlink = maiLink->GetAccHyperlink())
+  if (Accessible *hyperlink = maiLink->GetAccHyperlink())
     return static_cast<gint>(hyperlink->AnchorCount());
 
   bool valid = false;
   uint32_t anchorCount = maiLink->Proxy()->AnchorCount(&valid);
   return valid ? static_cast<gint>(anchorCount) : -1;
 }
--- a/accessible/atk/nsMaiHyperlink.h
+++ b/accessible/atk/nsMaiHyperlink.h
@@ -6,50 +6,47 @@
 
 #ifndef __MAI_HYPERLINK_H__
 #define __MAI_HYPERLINK_H__
 
 #include "nsMai.h"
 #include "Accessible.h"
 
 struct _AtkHyperlink;
-typedef struct _AtkHyperlink                      AtkHyperlink;
+typedef struct _AtkHyperlink AtkHyperlink;
 
 namespace mozilla {
 namespace a11y {
 
 /*
  * MaiHyperlink is a auxiliary class for MaiInterfaceHyperText.
  */
 
-class MaiHyperlink
-{
-public:
+class MaiHyperlink {
+ public:
   explicit MaiHyperlink(AccessibleOrProxy aHyperLink);
   ~MaiHyperlink();
 
-public:
+ public:
   AtkHyperlink* GetAtkHyperlink() const { return mMaiAtkHyperlink; }
-  Accessible* GetAccHyperlink()
-    {
-      if (!mHyperlink.IsAccessible())
-        return nullptr;
+  Accessible* GetAccHyperlink() {
+    if (!mHyperlink.IsAccessible()) return nullptr;
 
-      Accessible* link = mHyperlink.AsAccessible();
-      if (!link) {
-        return nullptr;
-      }
+    Accessible* link = mHyperlink.AsAccessible();
+    if (!link) {
+      return nullptr;
+    }
 
-      NS_ASSERTION(link->IsLink(), "Why isn't it a link!");
-      return link;
-    }
+    NS_ASSERTION(link->IsLink(), "Why isn't it a link!");
+    return link;
+  }
 
   ProxyAccessible* Proxy() const { return mHyperlink.AsProxy(); }
 
-protected:
+ protected:
   AccessibleOrProxy mHyperlink;
   AtkHyperlink* mMaiAtkHyperlink;
 };
 
-} // namespace a11y
-} // namespace mozilla
+}  // namespace a11y
+}  // namespace mozilla
 
 #endif /* __MAI_HYPERLINK_H__ */
--- a/accessible/atk/nsMaiInterfaceAction.cpp
+++ b/accessible/atk/nsMaiInterfaceAction.cpp
@@ -12,94 +12,82 @@
 #include "mozilla/Likely.h"
 #include "ProxyAccessible.h"
 #include "nsString.h"
 
 using namespace mozilla::a11y;
 
 extern "C" {
 
-static gboolean
-doActionCB(AtkAction *aAction, gint aActionIndex)
-{
+static gboolean doActionCB(AtkAction* aAction, gint aActionIndex) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
   if (accWrap) {
     return accWrap->DoAction(aActionIndex);
   }
 
   ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction));
   return proxy && proxy->DoAction(aActionIndex);
 }
 
-static gint
-getActionCountCB(AtkAction *aAction)
-{
+static gint getActionCountCB(AtkAction* aAction) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
   if (accWrap) {
     return accWrap->ActionCount();
   }
 
   ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction));
   return proxy ? proxy->ActionCount() : 0;
 }
 
-static const gchar*
-getActionDescriptionCB(AtkAction *aAction, gint aActionIndex)
-{
+static const gchar* getActionDescriptionCB(AtkAction* aAction,
+                                           gint aActionIndex) {
   nsAutoString description;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
   if (accWrap) {
     accWrap->ActionDescriptionAt(aActionIndex, description);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction))) {
     proxy->ActionDescriptionAt(aActionIndex, description);
   } else {
     return nullptr;
   }
 
   return AccessibleWrap::ReturnString(description);
 }
 
-static const gchar*
-getActionNameCB(AtkAction *aAction, gint aActionIndex)
-{
+static const gchar* getActionNameCB(AtkAction* aAction, gint aActionIndex) {
   nsAutoString autoStr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aAction));
   if (accWrap) {
     accWrap->ActionNameAt(aActionIndex, autoStr);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction))) {
     proxy->ActionNameAt(aActionIndex, autoStr);
   } else {
     return nullptr;
   }
 
   return AccessibleWrap::ReturnString(autoStr);
 }
 
-static const gchar*
-getKeyBindingCB(AtkAction *aAction, gint aActionIndex)
-{
+static const gchar* getKeyBindingCB(AtkAction* aAction, gint aActionIndex) {
   nsAutoString keyBindingsStr;
   AccessibleWrap* acc = GetAccessibleWrap(ATK_OBJECT(aAction));
   if (acc) {
     AccessibleWrap::GetKeyBinding(acc, keyBindingsStr);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aAction))) {
     proxy->AtkKeyBinding(keyBindingsStr);
   } else {
     return nullptr;
   }
 
   return AccessibleWrap::ReturnString(keyBindingsStr);
 }
 }
 
-void
-actionInterfaceInitCB(AtkActionIface* aIface)
-{
+void actionInterfaceInitCB(AtkActionIface* aIface) {
   NS_ASSERTION(aIface, "Invalid aIface");
-  if (MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   aIface->do_action = doActionCB;
   aIface->get_n_actions = getActionCountCB;
   aIface->get_description = getActionDescriptionCB;
   aIface->get_keybinding = getKeyBindingCB;
   aIface->get_name = getActionNameCB;
 }
--- a/accessible/atk/nsMaiInterfaceComponent.cpp
+++ b/accessible/atk/nsMaiInterfaceComponent.cpp
@@ -13,35 +13,28 @@
 #include "nsMai.h"
 #include "mozilla/Likely.h"
 #include "mozilla/a11y/ProxyAccessible.h"
 
 using namespace mozilla::a11y;
 
 extern "C" {
 
-static AtkObject*
-refAccessibleAtPointCB(AtkComponent* aComponent, gint aAccX, gint aAccY,
-                       AtkCoordType aCoordType)
-{
-  return refAccessibleAtPointHelper(ATK_OBJECT(aComponent),
-                                    aAccX, aAccY, aCoordType);
+static AtkObject* refAccessibleAtPointCB(AtkComponent* aComponent, gint aAccX,
+                                         gint aAccY, AtkCoordType aCoordType) {
+  return refAccessibleAtPointHelper(ATK_OBJECT(aComponent), aAccX, aAccY,
+                                    aCoordType);
 }
 
-static void
-getExtentsCB(AtkComponent* aComponent, gint* aX, gint* aY,
-             gint* aWidth, gint* aHeight, AtkCoordType aCoordType)
-{
-  getExtentsHelper(ATK_OBJECT(aComponent),
-                   aX, aY, aWidth, aHeight, aCoordType);
+static void getExtentsCB(AtkComponent* aComponent, gint* aX, gint* aY,
+                         gint* aWidth, gint* aHeight, AtkCoordType aCoordType) {
+  getExtentsHelper(ATK_OBJECT(aComponent), aX, aY, aWidth, aHeight, aCoordType);
 }
 
-static gboolean
-grabFocusCB(AtkComponent* aComponent)
-{
+static gboolean grabFocusCB(AtkComponent* aComponent) {
   AtkObject* atkObject = ATK_OBJECT(aComponent);
   AccessibleWrap* accWrap = GetAccessibleWrap(atkObject);
   if (accWrap) {
     accWrap->TakeFocus();
     return TRUE;
   }
 
   ProxyAccessible* proxy = GetProxy(atkObject);
@@ -49,19 +42,17 @@ grabFocusCB(AtkComponent* aComponent)
     proxy->TakeFocus();
     return TRUE;
   }
 
   return FALSE;
 }
 
 // ScrollType is compatible
-static gboolean
-scrollToCB(AtkComponent* aComponent, AtkScrollType type)
-{
+static gboolean scrollToCB(AtkComponent* aComponent, AtkScrollType type) {
   AtkObject* atkObject = ATK_OBJECT(aComponent);
   AccessibleWrap* accWrap = GetAccessibleWrap(atkObject);
   if (accWrap) {
     accWrap->ScrollTo(type);
     return TRUE;
   }
 
   ProxyAccessible* proxy = GetProxy(atkObject);
@@ -69,19 +60,18 @@ scrollToCB(AtkComponent* aComponent, Atk
     proxy->ScrollTo(type);
     return TRUE;
   }
 
   return FALSE;
 }
 
 // CoordType is compatible
-static gboolean
-scrollToPointCB(AtkComponent* aComponent, AtkCoordType coords, gint x, gint y)
-{
+static gboolean scrollToPointCB(AtkComponent* aComponent, AtkCoordType coords,
+                                gint x, gint y) {
   AtkObject* atkObject = ATK_OBJECT(aComponent);
   AccessibleWrap* accWrap = GetAccessibleWrap(atkObject);
   if (accWrap) {
     accWrap->ScrollToPoint(coords, x, y);
     return TRUE;
   }
 
   ProxyAccessible* proxy = GetProxy(atkObject);
@@ -89,103 +79,94 @@ scrollToPointCB(AtkComponent* aComponent
     proxy->ScrollToPoint(coords, x, y);
     return TRUE;
   }
 
   return FALSE;
 }
 }
 
-AtkObject*
-refAccessibleAtPointHelper(AtkObject* aAtkObj, gint aX, gint aY,
-                           AtkCoordType aCoordType)
-{
+AtkObject* refAccessibleAtPointHelper(AtkObject* aAtkObj, gint aX, gint aY,
+                                      AtkCoordType aCoordType) {
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
   if (accWrap) {
     if (accWrap->IsDefunct() || nsAccUtils::MustPrune(accWrap)) {
       return nullptr;
     }
 
     // Accessible::ChildAtPoint(x,y) is in screen pixels.
     if (aCoordType == ATK_XY_WINDOW) {
       nsIntPoint winCoords =
-        nsCoreUtils::GetScreenCoordsForWindow(accWrap->GetNode());
+          nsCoreUtils::GetScreenCoordsForWindow(accWrap->GetNode());
       aX += winCoords.x;
       aY += winCoords.y;
     }
 
-    Accessible* accAtPoint = accWrap->ChildAtPoint(aX, aY,
-                                                   Accessible::eDirectChild);
+    Accessible* accAtPoint =
+        accWrap->ChildAtPoint(aX, aY, Accessible::eDirectChild);
     if (!accAtPoint) {
       return nullptr;
     }
 
     AtkObject* atkObj = AccessibleWrap::GetAtkObject(accAtPoint);
     if (atkObj) {
       g_object_ref(atkObj);
     }
 
     return atkObj;
   }
 
   if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
     ProxyAccessible* result =
-      proxy->AccessibleAtPoint(aX, aY, aCoordType == ATK_XY_WINDOW);
+        proxy->AccessibleAtPoint(aX, aY, aCoordType == ATK_XY_WINDOW);
     AtkObject* atkObj = result ? GetWrapperFor(result) : nullptr;
     if (atkObj) {
       g_object_ref(atkObj);
     }
     return atkObj;
   }
 
   return nullptr;
 }
 
-void
-getExtentsHelper(AtkObject* aAtkObj,
-                 gint* aX, gint* aY, gint* aWidth, gint* aHeight,
-                 AtkCoordType aCoordType)
-{
+void getExtentsHelper(AtkObject* aAtkObj, gint* aX, gint* aY, gint* aWidth,
+                      gint* aHeight, AtkCoordType aCoordType) {
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
   *aX = *aY = *aWidth = *aHeight = 0;
 
   if (accWrap) {
     if (accWrap->IsDefunct()) {
       return;
     }
 
     nsIntRect screenRect = accWrap->Bounds();
-    if (screenRect.IsEmpty())
-      return;
+    if (screenRect.IsEmpty()) return;
 
     if (aCoordType == ATK_XY_WINDOW) {
       nsIntPoint winCoords =
-        nsCoreUtils::GetScreenCoordsForWindow(accWrap->GetNode());
+          nsCoreUtils::GetScreenCoordsForWindow(accWrap->GetNode());
       screenRect.x -= winCoords.x;
       screenRect.y -= winCoords.y;
     }
 
     *aX = screenRect.x;
     *aY = screenRect.y;
     *aWidth = screenRect.width;
     *aHeight = screenRect.height;
     return;
   }
 
   if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
     proxy->Extents(aCoordType == ATK_XY_WINDOW, aX, aY, aWidth, aHeight);
   }
 }
 
-void
-componentInterfaceInitCB(AtkComponentIface* aIface)
-{
+void componentInterfaceInitCB(AtkComponentIface* aIface) {
   NS_ASSERTION(aIface, "Invalid Interface");
-  if(MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   /*
    * Use default implementation in atk for contains, get_position,
    * and get_size
    */
   aIface->ref_accessible_at_point = refAccessibleAtPointCB;
   aIface->get_extents = getExtentsCB;
   aIface->grab_focus = grabFocusCB;
--- a/accessible/atk/nsMaiInterfaceDocument.cpp
+++ b/accessible/atk/nsMaiInterfaceDocument.cpp
@@ -22,64 +22,56 @@ static const char* const kMimeTypeName =
 // below functions are vfuncs on an ATK  interface so they need to be C call
 extern "C" {
 
 static const gchar* getDocumentLocaleCB(AtkDocument* aDocument);
 static AtkAttributeSet* getDocumentAttributesCB(AtkDocument* aDocument);
 static const gchar* getDocumentAttributeValueCB(AtkDocument* aDocument,
                                                 const gchar* aAttrName);
 
-void
-documentInterfaceInitCB(AtkDocumentIface *aIface)
-{
-    NS_ASSERTION(aIface, "Invalid Interface");
-    if(MOZ_UNLIKELY(!aIface))
-        return;
+void documentInterfaceInitCB(AtkDocumentIface* aIface) {
+  NS_ASSERTION(aIface, "Invalid Interface");
+  if (MOZ_UNLIKELY(!aIface)) return;
 
-    /*
-     * We don't support get_document or set_attribute right now.
-     * get_document_type is deprecated, we return DocType in
-     * get_document_attribute_value and get_document_attributes instead.
-     */
-    aIface->get_document_attributes = getDocumentAttributesCB;
-    aIface->get_document_attribute_value = getDocumentAttributeValueCB;
-    aIface->get_document_locale = getDocumentLocaleCB;
+  /*
+   * We don't support get_document or set_attribute right now.
+   * get_document_type is deprecated, we return DocType in
+   * get_document_attribute_value and get_document_attributes instead.
+   */
+  aIface->get_document_attributes = getDocumentAttributesCB;
+  aIface->get_document_attribute_value = getDocumentAttributeValueCB;
+  aIface->get_document_locale = getDocumentLocaleCB;
 }
 
-const gchar *
-getDocumentLocaleCB(AtkDocument *aDocument)
-{
+const gchar* getDocumentLocaleCB(AtkDocument* aDocument) {
   nsAutoString locale;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
   if (accWrap) {
     accWrap->Language(locale);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aDocument))) {
     proxy->Language(locale);
   }
 
   return locale.IsEmpty() ? nullptr : AccessibleWrap::ReturnString(locale);
 }
 
-static inline GSList *
-prependToList(GSList *aList, const char *const aName, const nsAutoString &aValue)
-{
+static inline GSList* prependToList(GSList* aList, const char* const aName,
+                                    const nsAutoString& aValue) {
   if (aValue.IsEmpty()) {
     return aList;
   }
 
   // libspi will free these
-  AtkAttribute *atkAttr = (AtkAttribute *)g_malloc(sizeof(AtkAttribute));
+  AtkAttribute* atkAttr = (AtkAttribute*)g_malloc(sizeof(AtkAttribute));
   atkAttr->name = g_strdup(aName);
   atkAttr->value = g_strdup(NS_ConvertUTF16toUTF8(aValue).get());
   return g_slist_prepend(aList, atkAttr);
 }
 
-AtkAttributeSet *
-getDocumentAttributesCB(AtkDocument *aDocument)
-{
+AtkAttributeSet* getDocumentAttributesCB(AtkDocument* aDocument) {
   nsAutoString url;
   nsAutoString w3cDocType;
   nsAutoString mimeType;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
   if (accWrap) {
     if (!accWrap->IsDoc()) {
       return nullptr;
     }
@@ -98,20 +90,18 @@ getDocumentAttributesCB(AtkDocument *aDo
   GSList* attributes = nullptr;
   attributes = prependToList(attributes, kDocUrlName, url);
   attributes = prependToList(attributes, kDocTypeName, w3cDocType);
   attributes = prependToList(attributes, kMimeTypeName, mimeType);
 
   return attributes;
 }
 
-const gchar *
-getDocumentAttributeValueCB(AtkDocument *aDocument,
-                            const gchar *aAttrName)
-{
+const gchar* getDocumentAttributeValueCB(AtkDocument* aDocument,
+                                         const gchar* aAttrName) {
   ProxyAccessible* proxy = nullptr;
   DocAccessible* document = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aDocument));
   if (accWrap) {
     if (!accWrap->IsDoc()) {
       return nullptr;
     }
 
@@ -141,11 +131,12 @@ getDocumentAttributeValueCB(AtkDocument 
       document->MimeType(attrValue);
     } else {
       proxy->MimeType(attrValue);
     }
   } else {
     return nullptr;
   }
 
-  return attrValue.IsEmpty() ? nullptr : AccessibleWrap::ReturnString(attrValue);
+  return attrValue.IsEmpty() ? nullptr
+                             : AccessibleWrap::ReturnString(attrValue);
 }
 }
--- a/accessible/atk/nsMaiInterfaceEditableText.cpp
+++ b/accessible/atk/nsMaiInterfaceEditableText.cpp
@@ -11,124 +11,109 @@
 #include "nsMai.h"
 #include "ProxyAccessible.h"
 #include "nsString.h"
 #include "mozilla/Likely.h"
 
 using namespace mozilla::a11y;
 
 extern "C" {
-static void
-setTextContentsCB(AtkEditableText *aText, const gchar *aString)
-{
+static void setTextContentsCB(AtkEditableText* aText, const gchar* aString) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return;
     }
 
     NS_ConvertUTF8toUTF16 strContent(aString);
     text->ReplaceText(strContent);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     NS_ConvertUTF8toUTF16 strContent(aString);
     proxy->ReplaceText(strContent);
   }
 }
 
-static void
-insertTextCB(AtkEditableText *aText,
-             const gchar *aString, gint aLength, gint *aPosition)
-{
+static void insertTextCB(AtkEditableText* aText, const gchar* aString,
+                         gint aLength, gint* aPosition) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return;
     }
 
     NS_ConvertUTF8toUTF16 strContent(aString);
     text->InsertText(strContent, *aPosition);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     NS_ConvertUTF8toUTF16 strContent(aString);
     proxy->InsertText(strContent, *aPosition);
   }
 }
 
-static void
-copyTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos)
-{
+static void copyTextCB(AtkEditableText* aText, gint aStartPos, gint aEndPos) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return;
     }
 
     text->CopyText(aStartPos, aEndPos);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     proxy->CopyText(aStartPos, aEndPos);
   }
 }
 
-static void
-cutTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos)
-{
+static void cutTextCB(AtkEditableText* aText, gint aStartPos, gint aEndPos) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return;
     }
 
     text->CutText(aStartPos, aEndPos);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     proxy->CutText(aStartPos, aEndPos);
   }
 }
 
-static void
-deleteTextCB(AtkEditableText *aText, gint aStartPos, gint aEndPos)
-{
+static void deleteTextCB(AtkEditableText* aText, gint aStartPos, gint aEndPos) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return;
     }
 
     text->DeleteText(aStartPos, aEndPos);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     proxy->DeleteText(aStartPos, aEndPos);
   }
 }
 
-static void
-pasteTextCB(AtkEditableText *aText, gint aPosition)
-{
+static void pasteTextCB(AtkEditableText* aText, gint aPosition) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return;
     }
 
     text->PasteText(aPosition);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     proxy->PasteText(aPosition);
   }
 }
 }
 
-void
-editableTextInterfaceInitCB(AtkEditableTextIface* aIface)
-{
+void editableTextInterfaceInitCB(AtkEditableTextIface* aIface) {
   NS_ASSERTION(aIface, "Invalid aIface");
-  if (MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   aIface->set_text_contents = setTextContentsCB;
   aIface->insert_text = insertTextCB;
   aIface->copy_text = copyTextCB;
   aIface->cut_text = cutTextCB;
   aIface->delete_text = deleteTextCB;
   aIface->paste_text = pasteTextCB;
 }
--- a/accessible/atk/nsMaiInterfaceHyperlinkImpl.cpp
+++ b/accessible/atk/nsMaiInterfaceHyperlinkImpl.cpp
@@ -7,31 +7,24 @@
 #include "InterfaceInitFuncs.h"
 
 #include "nsMaiHyperlink.h"
 #include "mozilla/Likely.h"
 
 using namespace mozilla::a11y;
 
 extern "C" {
-static AtkHyperlink*
-getHyperlinkCB(AtkHyperlinkImpl* aImpl)
-{
+static AtkHyperlink* getHyperlinkCB(AtkHyperlinkImpl* aImpl) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImpl));
-  if (!accWrap && !GetProxy(ATK_OBJECT(aImpl)))
-    return nullptr;
+  if (!accWrap && !GetProxy(ATK_OBJECT(aImpl))) return nullptr;
 
-  if (accWrap)
-    NS_ASSERTION(accWrap->IsLink(), "why isn't it a link!");
+  if (accWrap) NS_ASSERTION(accWrap->IsLink(), "why isn't it a link!");
 
   return MAI_ATK_OBJECT(aImpl)->GetAtkHyperlink();
 }
 }
 
-void
-hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface *aIface)
-{
+void hyperlinkImplInterfaceInitCB(AtkHyperlinkImplIface* aIface) {
   NS_ASSERTION(aIface, "no interface!");
-  if (MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   aIface->get_hyperlink = getHyperlinkCB;
 }
--- a/accessible/atk/nsMaiInterfaceHypertext.cpp
+++ b/accessible/atk/nsMaiInterfaceHypertext.cpp
@@ -8,87 +8,76 @@
 
 #include "Accessible-inl.h"
 #include "HyperTextAccessible.h"
 #include "nsMai.h"
 #include "nsMaiHyperlink.h"
 #include "ProxyAccessible.h"
 #include "mozilla/Likely.h"
 
-
 using namespace mozilla::a11y;
 
 extern "C" {
 
-static AtkHyperlink*
-getLinkCB(AtkHypertext *aText, gint aLinkIndex)
-{
+static AtkHyperlink* getLinkCB(AtkHypertext* aText, gint aLinkIndex) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   AtkObject* atkHyperLink = nullptr;
   if (accWrap) {
     HyperTextAccessible* hyperText = accWrap->AsHyperText();
     NS_ENSURE_TRUE(hyperText, nullptr);
 
     Accessible* hyperLink = hyperText->LinkAt(aLinkIndex);
     if (!hyperLink || !hyperLink->IsLink()) {
       return nullptr;
     }
 
     atkHyperLink = AccessibleWrap::GetAtkObject(hyperLink);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     ProxyAccessible* proxyLink = proxy->LinkAt(aLinkIndex);
-    if (!proxyLink)
-      return nullptr;
+    if (!proxyLink) return nullptr;
 
     atkHyperLink = GetWrapperFor(proxyLink);
   }
 
-    NS_ENSURE_TRUE(IS_MAI_OBJECT(atkHyperLink), nullptr);
-    return MAI_ATK_OBJECT(atkHyperLink)->GetAtkHyperlink();
+  NS_ENSURE_TRUE(IS_MAI_OBJECT(atkHyperLink), nullptr);
+  return MAI_ATK_OBJECT(atkHyperLink)->GetAtkHyperlink();
 }
 
-static gint
-getLinkCountCB(AtkHypertext *aText)
-{
+static gint getLinkCountCB(AtkHypertext* aText) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* hyperText = accWrap->AsHyperText();
     NS_ENSURE_TRUE(hyperText, -1);
     return hyperText->LinkCount();
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     return proxy->LinkCount();
   }
 
   return -1;
 }
 
-static gint
-getLinkIndexCB(AtkHypertext *aText, gint aCharIndex)
-{
+static gint getLinkIndexCB(AtkHypertext* aText, gint aCharIndex) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* hyperText = accWrap->AsHyperText();
     NS_ENSURE_TRUE(hyperText, -1);
 
     return hyperText->LinkIndexAtOffset(aCharIndex);
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     return proxy->LinkIndexAtOffset(aCharIndex);
   }
 
   return -1;
 }
 }
 
-void
-hypertextInterfaceInitCB(AtkHypertextIface* aIface)
-{
+void hypertextInterfaceInitCB(AtkHypertextIface* aIface) {
   NS_ASSERTION(aIface, "no interface!");
-  if (MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   aIface->get_link = getLinkCB;
   aIface->get_n_links = getLinkCountCB;
   aIface->get_link_index = getLinkIndexCB;
 }
--- a/accessible/atk/nsMaiInterfaceImage.cpp
+++ b/accessible/atk/nsMaiInterfaceImage.cpp
@@ -15,63 +15,56 @@
 #include "ProxyAccessible.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 extern "C" {
 const gchar* getDescriptionCB(AtkObject* aAtkObj);
 
-static void
-getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY,
-                   AtkCoordType aCoordType)
-{
+static void getImagePositionCB(AtkImage* aImage, gint* aAccX, gint* aAccY,
+                               AtkCoordType aCoordType) {
   nsIntPoint pos;
-  uint32_t geckoCoordType = (aCoordType == ATK_XY_WINDOW) ?
-    nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE :
-    nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
+  uint32_t geckoCoordType =
+      (aCoordType == ATK_XY_WINDOW)
+          ? nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE
+          : nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
 
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
   if (accWrap && accWrap->IsImage()) {
     ImageAccessible* image = accWrap->AsImage();
     pos = image->Position(geckoCoordType);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aImage))) {
     pos = proxy->ImagePosition(geckoCoordType);
   }
 
   *aAccX = pos.x;
   *aAccY = pos.y;
 }
 
-static const gchar*
-getImageDescriptionCB(AtkImage* aImage)
-{
+static const gchar* getImageDescriptionCB(AtkImage* aImage) {
   return getDescriptionCB(ATK_OBJECT(aImage));
 }
 
-static void
-getImageSizeCB(AtkImage* aImage, gint* aAccWidth, gint* aAccHeight)
-{
+static void getImageSizeCB(AtkImage* aImage, gint* aAccWidth,
+                           gint* aAccHeight) {
   nsIntSize size;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aImage));
   if (accWrap && accWrap->IsImage()) {
     size = accWrap->AsImage()->Size();
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aImage))) {
     size = proxy->ImageSize();
   }
 
   *aAccWidth = size.width;
   *aAccHeight = size.height;
 }
 
-} // extern "C"
+}  // extern "C"
 
-void
-imageInterfaceInitCB(AtkImageIface* aIface)
-{
+void imageInterfaceInitCB(AtkImageIface* aIface) {
   NS_ASSERTION(aIface, "no interface!");
-  if (MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   aIface->get_image_position = getImagePositionCB;
   aIface->get_image_description = getImageDescriptionCB;
   aIface->get_image_size = getImageSizeCB;
 }
--- a/accessible/atk/nsMaiInterfaceSelection.cpp
+++ b/accessible/atk/nsMaiInterfaceSelection.cpp
@@ -13,49 +13,43 @@
 #include "mozilla/Likely.h"
 
 #include <atk/atk.h>
 
 using namespace mozilla::a11y;
 
 extern "C" {
 
-static gboolean
-addSelectionCB(AtkSelection *aSelection, gint i)
-{
+static gboolean addSelectionCB(AtkSelection* aSelection, gint i) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
   if (accWrap && accWrap->IsSelect()) {
     return accWrap->AddItemToSelection(i);
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
     return proxy->AddItemToSelection(i);
   }
 
   return FALSE;
 }
 
-static gboolean
-clearSelectionCB(AtkSelection *aSelection)
-{
+static gboolean clearSelectionCB(AtkSelection* aSelection) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
   if (accWrap && accWrap->IsSelect()) {
     return accWrap->UnselectAll();
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
     return proxy->UnselectAll();
   }
 
   return FALSE;
 }
 
-static AtkObject*
-refSelectionCB(AtkSelection *aSelection, gint i)
-{
+static AtkObject* refSelectionCB(AtkSelection* aSelection, gint i) {
   AtkObject* atkObj = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
   if (accWrap && accWrap->IsSelect()) {
     Accessible* selectedItem = accWrap->GetSelectedItem(i);
     if (!selectedItem) {
       return nullptr;
     }
 
@@ -69,83 +63,72 @@ refSelectionCB(AtkSelection *aSelection,
 
   if (atkObj) {
     g_object_ref(atkObj);
   }
 
   return atkObj;
 }
 
-static gint
-getSelectionCountCB(AtkSelection *aSelection)
-{
+static gint getSelectionCountCB(AtkSelection* aSelection) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
   if (accWrap && accWrap->IsSelect()) {
     return accWrap->SelectedItemCount();
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
     return proxy->SelectedItemCount();
   }
 
   return -1;
 }
 
-static gboolean
-isChildSelectedCB(AtkSelection *aSelection, gint i)
-{
+static gboolean isChildSelectedCB(AtkSelection* aSelection, gint i) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
   if (accWrap && accWrap->IsSelect()) {
     return accWrap->IsItemSelected(i);
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
     return proxy->IsItemSelected(i);
   }
 
   return FALSE;
 }
 
-static gboolean
-removeSelectionCB(AtkSelection *aSelection, gint i)
-{
+static gboolean removeSelectionCB(AtkSelection* aSelection, gint i) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
   if (accWrap && accWrap->IsSelect()) {
     return accWrap->RemoveItemFromSelection(i);
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
     return proxy->RemoveItemFromSelection(i);
   }
 
   return FALSE;
 }
 
-static gboolean
-selectAllSelectionCB(AtkSelection *aSelection)
-{
+static gboolean selectAllSelectionCB(AtkSelection* aSelection) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aSelection));
   if (accWrap && accWrap->IsSelect()) {
     return accWrap->SelectAll();
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aSelection))) {
     return proxy->SelectAll();
   }
 
   return FALSE;
 }
 }
 
-void
-selectionInterfaceInitCB(AtkSelectionIface* aIface)
-{
+void selectionInterfaceInitCB(AtkSelectionIface* aIface) {
   NS_ASSERTION(aIface, "Invalid aIface");
-  if (MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   aIface->add_selection = addSelectionCB;
   aIface->clear_selection = clearSelectionCB;
   aIface->ref_selection = refSelectionCB;
   aIface->get_selection_count = getSelectionCountCB;
   aIface->is_child_selected = isChildSelectedCB;
   aIface->remove_selection = removeSelectionCB;
   aIface->select_all_selection = selectAllSelectionCB;
--- a/accessible/atk/nsMaiInterfaceTable.cpp
+++ b/accessible/atk/nsMaiInterfaceTable.cpp
@@ -15,19 +15,17 @@
 #include "ProxyAccessible.h"
 #include "nsArrayUtils.h"
 
 #include "mozilla/Likely.h"
 
 using namespace mozilla::a11y;
 
 extern "C" {
-static AtkObject*
-refAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx)
-{
+static AtkObject* refAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx) {
   if (aRowIdx < 0 || aColIdx < 0) {
     return nullptr;
   }
 
   AtkObject* cellAtkObj = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     Accessible* cell = accWrap->AsTable()->CellAt(aRowIdx, aColIdx);
@@ -47,264 +45,233 @@ refAtCB(AtkTable* aTable, gint aRowIdx, 
 
   if (cellAtkObj) {
     g_object_ref(cellAtkObj);
   }
 
   return cellAtkObj;
 }
 
-static gint
-getIndexAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx)
-{
+static gint getIndexAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx) {
   if (aRowIdx < 0 || aColIdx < 0) {
     return -1;
   }
 
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     return static_cast<gint>(accWrap->AsTable()->CellIndexAt(aRowIdx, aColIdx));
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     return static_cast<gint>(proxy->TableCellIndexAt(aRowIdx, aColIdx));
   }
 
   return -1;
 }
 
-static gint
-getColumnAtIndexCB(AtkTable *aTable, gint aIdx)
-{
+static gint getColumnAtIndexCB(AtkTable* aTable, gint aIdx) {
   if (aIdx < 0) {
     return -1;
   }
 
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     return static_cast<gint>(accWrap->AsTable()->ColIndexAt(aIdx));
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     return static_cast<gint>(proxy->TableColumnIndexAt(aIdx));
   }
 
   return -1;
 }
 
-static gint
-getRowAtIndexCB(AtkTable *aTable, gint aIdx)
-{
+static gint getRowAtIndexCB(AtkTable* aTable, gint aIdx) {
   if (aIdx < 0) {
     return -1;
   }
 
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     return static_cast<gint>(accWrap->AsTable()->RowIndexAt(aIdx));
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     return static_cast<gint>(proxy->TableRowIndexAt(aIdx));
   }
 
   return -1;
 }
 
-static gint
-getColumnCountCB(AtkTable *aTable)
-{
+static gint getColumnCountCB(AtkTable* aTable) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     return static_cast<gint>(accWrap->AsTable()->ColCount());
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     return static_cast<gint>(proxy->TableColumnCount());
   }
 
   return -1;
 }
 
-static gint
-getRowCountCB(AtkTable *aTable)
-{
+static gint getRowCountCB(AtkTable* aTable) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     return static_cast<gint>(accWrap->AsTable()->RowCount());
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     return static_cast<gint>(proxy->TableRowCount());
   }
 
   return -1;
 }
 
-static gint
-getColumnExtentAtCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
-{
+static gint getColumnExtentAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx) {
   if (aRowIdx < 0 || aColIdx < 0) {
     return -1;
   }
 
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     return static_cast<gint>(accWrap->AsTable()->ColExtentAt(aRowIdx, aColIdx));
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     return static_cast<gint>(proxy->TableColumnExtentAt(aRowIdx, aColIdx));
   }
 
   return -1;
 }
 
-static gint
-getRowExtentAtCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
-{
+static gint getRowExtentAtCB(AtkTable* aTable, gint aRowIdx, gint aColIdx) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     return static_cast<gint>(accWrap->AsTable()->RowExtentAt(aRowIdx, aColIdx));
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     return static_cast<gint>(proxy->TableRowExtentAt(aRowIdx, aColIdx));
   }
 
   return -1;
 }
 
-static AtkObject*
-getCaptionCB(AtkTable* aTable)
-{
+static AtkObject* getCaptionCB(AtkTable* aTable) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     Accessible* caption = accWrap->AsTable()->Caption();
     return caption ? AccessibleWrap::GetAtkObject(caption) : nullptr;
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     ProxyAccessible* caption = proxy->TableCaption();
     return caption ? GetWrapperFor(caption) : nullptr;
   }
 
   return nullptr;
 }
 
-static const gchar*
-getColumnDescriptionCB(AtkTable *aTable, gint aColumn)
-{
+static const gchar* getColumnDescriptionCB(AtkTable* aTable, gint aColumn) {
   nsAutoString autoStr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     accWrap->AsTable()->ColDescription(aColumn, autoStr);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     proxy->TableColumnDescription(aColumn, autoStr);
   } else {
     return nullptr;
   }
 
   return AccessibleWrap::ReturnString(autoStr);
 }
 
-static AtkObject*
-getColumnHeaderCB(AtkTable *aTable, gint aColIdx)
-{
+static AtkObject* getColumnHeaderCB(AtkTable* aTable, gint aColIdx) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     Accessible* header =
-      AccessibleWrap::GetColumnHeader(accWrap->AsTable(), aColIdx);
+        AccessibleWrap::GetColumnHeader(accWrap->AsTable(), aColIdx);
     return header ? AccessibleWrap::GetAtkObject(header) : nullptr;
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     ProxyAccessible* header = proxy->AtkTableColumnHeader(aColIdx);
     return header ? GetWrapperFor(header) : nullptr;
   }
 
   return nullptr;
 }
 
-static const gchar*
-getRowDescriptionCB(AtkTable *aTable, gint aRow)
-{
+static const gchar* getRowDescriptionCB(AtkTable* aTable, gint aRow) {
   nsAutoString autoStr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     accWrap->AsTable()->RowDescription(aRow, autoStr);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     proxy->TableRowDescription(aRow, autoStr);
   } else {
     return nullptr;
   }
 
   return AccessibleWrap::ReturnString(autoStr);
 }
 
-static AtkObject*
-getRowHeaderCB(AtkTable *aTable, gint aRowIdx)
-{
+static AtkObject* getRowHeaderCB(AtkTable* aTable, gint aRowIdx) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     Accessible* header =
-      AccessibleWrap::GetRowHeader(accWrap->AsTable(), aRowIdx);
+        AccessibleWrap::GetRowHeader(accWrap->AsTable(), aRowIdx);
     return header ? AccessibleWrap::GetAtkObject(header) : nullptr;
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     ProxyAccessible* header = proxy->AtkTableRowHeader(aRowIdx);
     return header ? GetWrapperFor(header) : nullptr;
   }
 
   return nullptr;
 }
 
-static AtkObject*
-getSummaryCB(AtkTable *aTable)
-{
+static AtkObject* getSummaryCB(AtkTable* aTable) {
   // Neither html:table nor xul:tree nor ARIA grid/tree have an ability to
   // link an accessible object to specify a summary. There is closes method
   // in TableAccessible::summary to get a summary as a string which is not
   // mapped directly to ATK.
   return nullptr;
 }
 
-static gint
-getSelectedColumnsCB(AtkTable *aTable, gint** aSelected)
-{
+static gint getSelectedColumnsCB(AtkTable* aTable, gint** aSelected) {
   *aSelected = nullptr;
 
   AutoTArray<uint32_t, 10> cols;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     accWrap->AsTable()->SelectedColIndices(&cols);
-   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
+  } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     proxy->TableSelectedColumnIndices(&cols);
   } else {
     return 0;
   }
 
-  if (cols.IsEmpty())
-    return 0;
+  if (cols.IsEmpty()) return 0;
 
   gint* atkColumns = g_new(gint, cols.Length());
   if (!atkColumns) {
     NS_WARNING("OUT OF MEMORY");
     return 0;
   }
 
   memcpy(atkColumns, cols.Elements(), cols.Length() * sizeof(uint32_t));
   *aSelected = atkColumns;
   return cols.Length();
 }
 
-static gint
-getSelectedRowsCB(AtkTable *aTable, gint **aSelected)
-{
+static gint getSelectedRowsCB(AtkTable* aTable, gint** aSelected) {
   AutoTArray<uint32_t, 10> rows;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     accWrap->AsTable()->SelectedRowIndices(&rows);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     proxy->TableSelectedRowIndices(&rows);
   } else {
     return 0;
@@ -316,66 +283,57 @@ getSelectedRowsCB(AtkTable *aTable, gint
     return 0;
   }
 
   memcpy(atkRows, rows.Elements(), rows.Length() * sizeof(uint32_t));
   *aSelected = atkRows;
   return rows.Length();
 }
 
-static gboolean
-isColumnSelectedCB(AtkTable *aTable, gint aColIdx)
-{
+static gboolean isColumnSelectedCB(AtkTable* aTable, gint aColIdx) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     return static_cast<gboolean>(accWrap->AsTable()->IsColSelected(aColIdx));
   }
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     return static_cast<gboolean>(proxy->TableColumnSelected(aColIdx));
   }
 
   return FALSE;
 }
 
-static gboolean
-isRowSelectedCB(AtkTable *aTable, gint aRowIdx)
-{
+static gboolean isRowSelectedCB(AtkTable* aTable, gint aRowIdx) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
     return static_cast<gboolean>(accWrap->AsTable()->IsRowSelected(aRowIdx));
   }
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     return static_cast<gboolean>(proxy->TableRowSelected(aRowIdx));
   }
 
   return FALSE;
 }
 
-static gboolean
-isCellSelectedCB(AtkTable *aTable, gint aRowIdx, gint aColIdx)
-{
+static gboolean isCellSelectedCB(AtkTable* aTable, gint aRowIdx, gint aColIdx) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTable));
   if (accWrap) {
-    return static_cast<gboolean>(accWrap->AsTable()->
-      IsCellSelected(aRowIdx, aColIdx));
+    return static_cast<gboolean>(
+        accWrap->AsTable()->IsCellSelected(aRowIdx, aColIdx));
   }
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTable))) {
     return static_cast<gboolean>(proxy->TableCellSelected(aRowIdx, aColIdx));
   }
 
   return FALSE;
 }
 }
 
-void
-tableInterfaceInitCB(AtkTableIface* aIface)
-{
+void tableInterfaceInitCB(AtkTableIface* aIface) {
   NS_ASSERTION(aIface, "no interface!");
-  if (MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   aIface->ref_at = refAtCB;
   aIface->get_index_at = getIndexAtCB;
   aIface->get_column_at_index = getColumnAtIndexCB;
   aIface->get_row_at_index = getRowAtIndexCB;
   aIface->get_n_columns = getColumnCountCB;
   aIface->get_n_rows = getRowCountCB;
   aIface->get_column_extent_at = getColumnExtentAtCB;
--- a/accessible/atk/nsMaiInterfaceTableCell.cpp
+++ b/accessible/atk/nsMaiInterfaceTableCell.cpp
@@ -15,49 +15,43 @@
 #include "ProxyAccessible.h"
 #include "nsArrayUtils.h"
 
 #include "mozilla/Likely.h"
 
 using namespace mozilla::a11y;
 
 extern "C" {
-static gint
-GetColumnSpanCB(AtkTableCell* aCell)
-{
+static gint GetColumnSpanCB(AtkTableCell* aCell) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aCell));
   if (accWrap) {
     return accWrap->AsTableCell()->ColExtent();
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aCell))) {
     return proxy->ColExtent();
   }
 
   return 0;
 }
 
-static gboolean
-GetRowSpanCB(AtkTableCell* aCell)
-{
+static gboolean GetRowSpanCB(AtkTableCell* aCell) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aCell));
   if (accWrap) {
     return accWrap->AsTableCell()->RowExtent();
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aCell))) {
     return proxy->RowExtent();
   }
 
   return 0;
 }
 
-static gboolean
-GetPositionCB(AtkTableCell* aCell, gint* aRow, gint* aCol)
-{
+static gboolean GetPositionCB(AtkTableCell* aCell, gint* aRow, gint* aCol) {
   if (AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aCell))) {
     TableCellAccessible* cell = accWrap->AsTableCell();
     if (!cell) {
       return false;
     }
     *aRow = cell->RowIdx();
     *aCol = cell->ColIdx();
     return true;
@@ -69,19 +63,18 @@ GetPositionCB(AtkTableCell* aCell, gint*
     *aCol = colIdx;
     *aRow = rowIdx;
     return true;
   }
 
   return false;
 }
 
-static gboolean
-GetColumnRowSpanCB(AtkTableCell* aCell, gint* aCol, gint* aRow,
-                   gint* aColExtent, gint* aRowExtent) {
+static gboolean GetColumnRowSpanCB(AtkTableCell* aCell, gint* aCol, gint* aRow,
+                                   gint* aColExtent, gint* aRowExtent) {
   if (AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aCell))) {
     TableCellAccessible* cellAcc = accWrap->AsTableCell();
     if (!cellAcc) {
       return false;
     }
     *aCol = cellAcc->ColIdx();
     *aRow = cellAcc->RowIdx();
     *aColExtent = cellAcc->ColExtent();
@@ -91,25 +84,23 @@ GetColumnRowSpanCB(AtkTableCell* aCell, 
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aCell))) {
     uint32_t colIdx = 0, rowIdx = 0, colExtent = 0, rowExtent = 0;
     proxy->GetColRowExtents(&colIdx, &rowIdx, &colExtent, &rowExtent);
     *aCol = colIdx;
     *aRow = rowIdx;
     *aColExtent = colExtent;
     *aRowExtent = rowExtent;
-  return true;
+    return true;
   }
 
   return false;
 }
 
-static AtkObject*
-GetTableCB(AtkTableCell* aTableCell)
-{
+static AtkObject* GetTableCB(AtkTableCell* aTableCell) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aTableCell));
   if (accWrap) {
     TableAccessible* table = accWrap->AsTableCell()->Table();
     if (!table) {
       return nullptr;
     }
 
     Accessible* tableAcc = table->AsAccessible();
@@ -119,103 +110,96 @@ GetTableCB(AtkTableCell* aTableCell)
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aTableCell))) {
     ProxyAccessible* table = proxy->TableOfACell();
     return table ? GetWrapperFor(table) : nullptr;
   }
 
   return nullptr;
 }
 
-static GPtrArray*
-GetColumnHeaderCellsCB(AtkTableCell* aCell)
-{
+static GPtrArray* GetColumnHeaderCellsCB(AtkTableCell* aCell) {
   if (AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aCell))) {
     AutoTArray<Accessible*, 10> headers;
     accWrap->AsTableCell()->ColHeaderCells(&headers);
     if (headers.IsEmpty()) {
       return nullptr;
     }
 
     GPtrArray* atkHeaders = g_ptr_array_sized_new(headers.Length());
-    for (Accessible* header: headers) {
+    for (Accessible* header : headers) {
       AtkObject* atkHeader = AccessibleWrap::GetAtkObject(header);
       g_object_ref(atkHeader);
       g_ptr_array_add(atkHeaders, atkHeader);
     }
 
     return atkHeaders;
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aCell))) {
     AutoTArray<ProxyAccessible*, 10> headers;
     proxy->ColHeaderCells(&headers);
     if (headers.IsEmpty()) {
       return nullptr;
     }
 
     GPtrArray* atkHeaders = g_ptr_array_sized_new(headers.Length());
-    for (ProxyAccessible* header: headers) {
+    for (ProxyAccessible* header : headers) {
       AtkObject* atkHeader = GetWrapperFor(header);
       g_object_ref(atkHeader);
       g_ptr_array_add(atkHeaders, atkHeader);
     }
 
     return atkHeaders;
   }
 
   return nullptr;
 }
 
-static GPtrArray*
-GetRowHeaderCellsCB(AtkTableCell* aCell)
-{
+static GPtrArray* GetRowHeaderCellsCB(AtkTableCell* aCell) {
   if (AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aCell))) {
     AutoTArray<Accessible*, 10> headers;
     accWrap->AsTableCell()->RowHeaderCells(&headers);
     if (headers.IsEmpty()) {
       return nullptr;
     }
 
     GPtrArray* atkHeaders = g_ptr_array_sized_new(headers.Length());
-    for (Accessible* header: headers) {
+    for (Accessible* header : headers) {
       AtkObject* atkHeader = AccessibleWrap::GetAtkObject(header);
       g_object_ref(atkHeader);
       g_ptr_array_add(atkHeaders, atkHeader);
     }
 
     return atkHeaders;
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aCell))) {
     AutoTArray<ProxyAccessible*, 10> headers;
     proxy->RowHeaderCells(&headers);
     if (headers.IsEmpty()) {
       return nullptr;
     }
 
     GPtrArray* atkHeaders = g_ptr_array_sized_new(headers.Length());
-    for (ProxyAccessible* header: headers) {
+    for (ProxyAccessible* header : headers) {
       AtkObject* atkHeader = GetWrapperFor(header);
       g_object_ref(atkHeader);
       g_ptr_array_add(atkHeaders, atkHeader);
     }
 
     return atkHeaders;
   }
 
   return nullptr;
 }
 }
 
-void
-tableCellInterfaceInitCB(AtkTableCellIface* aIface)
-{
+void tableCellInterfaceInitCB(AtkTableCellIface* aIface) {
   NS_ASSERTION(aIface, "no interface!");
-  if (MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   aIface->get_column_span = GetColumnSpanCB;
   aIface->get_column_header_cells = GetColumnHeaderCellsCB;
   aIface->get_position = GetPositionCB;
   aIface->get_row_span = GetRowSpanCB;
   aIface->get_row_header_cells = GetRowHeaderCellsCB;
   aIface->get_row_column_span = GetColumnRowSpanCB;
   aIface->get_table = GetTableCB;
--- a/accessible/atk/nsMaiInterfaceText.cpp
+++ b/accessible/atk/nsMaiInterfaceText.cpp
@@ -20,21 +20,19 @@
 
 #include "DOMtoATK.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 static const char* sAtkTextAttrNames[ATK_TEXT_ATTR_LAST_DEFINED];
 
-void
-ConvertTextAttributeToAtkAttribute(const nsACString& aName,
-                                   const nsAString& aValue,
-                                   AtkAttributeSet** aAttributeSet)
-{
+void ConvertTextAttributeToAtkAttribute(const nsACString& aName,
+                                        const nsAString& aValue,
+                                        AtkAttributeSet** aAttributeSet) {
   // Handle attributes where atk has its own name.
   const char* atkName = nullptr;
   nsAutoString atkValue;
   if (aName.EqualsLiteral("color")) {
     // The format of the atk attribute is r,g,b and the gecko one is
     // rgb(r, g, b).
     atkValue = Substring(aValue, 4, aValue.Length() - 5);
     atkValue.StripWhitespace();
@@ -57,45 +55,41 @@ ConvertTextAttributeToAtkAttribute(const
     atkName = sAtkTextAttrNames[ATK_TEXT_ATTR_WEIGHT];
   } else if (aName.EqualsLiteral("invalid")) {
     atkValue = aValue;
     atkName = sAtkTextAttrNames[ATK_TEXT_ATTR_INVALID];
   }
 
   if (atkName) {
     AtkAttribute* objAttr =
-      static_cast<AtkAttribute*>(g_malloc(sizeof(AtkAttribute)));
+        static_cast<AtkAttribute*>(g_malloc(sizeof(AtkAttribute)));
     objAttr->name = g_strdup(atkName);
     objAttr->value = g_strdup(NS_ConvertUTF16toUTF8(atkValue).get());
     *aAttributeSet = g_slist_prepend(*aAttributeSet, objAttr);
   }
 }
 
-static AtkAttributeSet*
-ConvertToAtkTextAttributeSet(nsTArray<Attribute>& aAttributes)
-{
+static AtkAttributeSet* ConvertToAtkTextAttributeSet(
+    nsTArray<Attribute>& aAttributes) {
   AtkAttributeSet* objAttributeSet = nullptr;
   for (size_t i = 0; i < aAttributes.Length(); ++i) {
-    AtkAttribute* objAttr = (AtkAttribute *)g_malloc(sizeof(AtkAttribute));
+    AtkAttribute* objAttr = (AtkAttribute*)g_malloc(sizeof(AtkAttribute));
     objAttr->name = g_strdup(aAttributes[i].Name().get());
     objAttr->value =
-      g_strdup(NS_ConvertUTF16toUTF8(aAttributes[i].Value()).get());
+        g_strdup(NS_ConvertUTF16toUTF8(aAttributes[i].Value()).get());
     objAttributeSet = g_slist_prepend(objAttributeSet, objAttr);
-    ConvertTextAttributeToAtkAttribute(aAttributes[i].Name(),
-                                       aAttributes[i].Value(),
-                                       &objAttributeSet);
+    ConvertTextAttributeToAtkAttribute(
+        aAttributes[i].Name(), aAttributes[i].Value(), &objAttributeSet);
   }
   return objAttributeSet;
 }
 
-static AtkAttributeSet*
-ConvertToAtkTextAttributeSet(nsIPersistentProperties* aAttributes)
-{
-  if (!aAttributes)
-    return nullptr;
+static AtkAttributeSet* ConvertToAtkTextAttributeSet(
+    nsIPersistentProperties* aAttributes) {
+  if (!aAttributes) return nullptr;
 
   AtkAttributeSet* objAttributeSet = nullptr;
   nsCOMPtr<nsISimpleEnumerator> propEnum;
   nsresult rv = aAttributes->Enumerate(getter_AddRefs(propEnum));
   NS_ENSURE_SUCCESS(rv, nullptr);
 
   bool hasMore = false;
   while (NS_SUCCEEDED(propEnum->HasMoreElements(&hasMore)) && hasMore) {
@@ -121,58 +115,53 @@ ConvertToAtkTextAttributeSet(nsIPersiste
 
     ConvertTextAttributeToAtkAttribute(name, value, &objAttributeSet);
   }
 
   // libatk-adaptor will free it
   return objAttributeSet;
 }
 
-static void
-ConvertTexttoAsterisks(AccessibleWrap* accWrap, nsAString& aString)
-{
+static void ConvertTexttoAsterisks(AccessibleWrap* accWrap,
+                                   nsAString& aString) {
   // convert each char to "*" when it's "password text"
   if (accWrap->IsPassword()) {
     DOMtoATK::ConvertTexttoAsterisks(aString);
   }
 }
 
 extern "C" {
 
-static gchar*
-getTextCB(AtkText *aText, gint aStartOffset, gint aEndOffset)
-{
+static gchar* getTextCB(AtkText* aText, gint aStartOffset, gint aEndOffset) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   nsAutoString autoStr;
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
-    if (!text || !text->IsTextRole() || text->IsDefunct())
-      return nullptr;
+    if (!text || !text->IsTextRole() || text->IsDefunct()) return nullptr;
 
-    return DOMtoATK::NewATKString(text, aStartOffset, aEndOffset,
-         accWrap->IsPassword() ?
-           DOMtoATK::AtkStringConvertFlags::ConvertTextToAsterisks :
-           DOMtoATK::AtkStringConvertFlags::None);
+    return DOMtoATK::NewATKString(
+        text, aStartOffset, aEndOffset,
+        accWrap->IsPassword()
+            ? DOMtoATK::AtkStringConvertFlags::ConvertTextToAsterisks
+            : DOMtoATK::AtkStringConvertFlags::None);
 
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     return DOMtoATK::NewATKString(proxy, aStartOffset, aEndOffset,
-         DOMtoATK::AtkStringConvertFlags::None);
+                                  DOMtoATK::AtkStringConvertFlags::None);
   }
 
   return nullptr;
 }
 
 static gint getCharacterCountCB(AtkText* aText);
 
 // Note: this does not support magic offsets, which is fine for its callers
 // which do not implement any.
-static gchar*
-getCharTextAtOffset(AtkText* aText, gint aOffset,
-                    gint* aStartOffset, gint* aEndOffset)
-{
+static gchar* getCharTextAtOffset(AtkText* aText, gint aOffset,
+                                  gint* aStartOffset, gint* aEndOffset) {
   gint end = aOffset + 1;
   gint count = getCharacterCountCB(aText);
 
   if (aOffset > count) {
     aOffset = count;
   }
   if (end > count) {
     end = count;
@@ -184,132 +173,121 @@ getCharTextAtOffset(AtkText* aText, gint
     end = 0;
   }
   *aStartOffset = aOffset;
   *aEndOffset = end;
 
   return getTextCB(aText, aOffset, end);
 }
 
-static gchar*
-getTextAfterOffsetCB(AtkText *aText, gint aOffset,
-                     AtkTextBoundary aBoundaryType,
-                     gint *aStartOffset, gint *aEndOffset)
-{
+static gchar* getTextAfterOffsetCB(AtkText* aText, gint aOffset,
+                                   AtkTextBoundary aBoundaryType,
+                                   gint* aStartOffset, gint* aEndOffset) {
   if (aBoundaryType == ATK_TEXT_BOUNDARY_CHAR) {
     return getCharTextAtOffset(aText, aOffset + 1, aStartOffset, aEndOffset);
   }
 
-    nsAutoString autoStr;
+  nsAutoString autoStr;
   int32_t startOffset = 0, endOffset = 0;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
-    if (!text || !text->IsTextRole())
-      return nullptr;
+    if (!text || !text->IsTextRole()) return nullptr;
 
-    text->TextAfterOffset(aOffset, aBoundaryType, &startOffset, &endOffset, autoStr);
+    text->TextAfterOffset(aOffset, aBoundaryType, &startOffset, &endOffset,
+                          autoStr);
     ConvertTexttoAsterisks(accWrap, autoStr);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     proxy->GetTextAfterOffset(aOffset, aBoundaryType, autoStr, &startOffset,
                               &endOffset);
   }
 
   *aStartOffset = startOffset;
   *aEndOffset = endOffset;
 
   // libspi will free it.
   return DOMtoATK::Convert(autoStr);
 }
 
-static gchar*
-getTextAtOffsetCB(AtkText *aText, gint aOffset,
-                  AtkTextBoundary aBoundaryType,
-                  gint *aStartOffset, gint *aEndOffset)
-{
+static gchar* getTextAtOffsetCB(AtkText* aText, gint aOffset,
+                                AtkTextBoundary aBoundaryType,
+                                gint* aStartOffset, gint* aEndOffset) {
   if (aBoundaryType == ATK_TEXT_BOUNDARY_CHAR) {
     return getCharTextAtOffset(aText, aOffset, aStartOffset, aEndOffset);
   }
 
   nsAutoString autoStr;
   int32_t startOffset = 0, endOffset = 0;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
-    if (!text || !text->IsTextRole())
-      return nullptr;
+    if (!text || !text->IsTextRole()) return nullptr;
 
-    text->TextAtOffset(aOffset, aBoundaryType, &startOffset, &endOffset, autoStr);
+    text->TextAtOffset(aOffset, aBoundaryType, &startOffset, &endOffset,
+                       autoStr);
     ConvertTexttoAsterisks(accWrap, autoStr);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     proxy->GetTextAtOffset(aOffset, aBoundaryType, autoStr, &startOffset,
                            &endOffset);
   }
 
   *aStartOffset = startOffset;
   *aEndOffset = endOffset;
 
   // libspi will free it.
   return DOMtoATK::Convert(autoStr);
 }
 
-static gunichar
-getCharacterAtOffsetCB(AtkText* aText, gint aOffset)
-{
+static gunichar getCharacterAtOffsetCB(AtkText* aText, gint aOffset) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return 0;
     }
     return DOMtoATK::ATKCharacter(text, aOffset);
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     return DOMtoATK::ATKCharacter(proxy, aOffset);
   }
 
   return 0;
 }
 
-static gchar*
-getTextBeforeOffsetCB(AtkText *aText, gint aOffset,
-                      AtkTextBoundary aBoundaryType,
-                      gint *aStartOffset, gint *aEndOffset)
-{
+static gchar* getTextBeforeOffsetCB(AtkText* aText, gint aOffset,
+                                    AtkTextBoundary aBoundaryType,
+                                    gint* aStartOffset, gint* aEndOffset) {
   if (aBoundaryType == ATK_TEXT_BOUNDARY_CHAR) {
     return getCharTextAtOffset(aText, aOffset - 1, aStartOffset, aEndOffset);
   }
 
   nsAutoString autoStr;
   int32_t startOffset = 0, endOffset = 0;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
-    if (!text || !text->IsTextRole())
-      return nullptr;
+    if (!text || !text->IsTextRole()) return nullptr;
 
-    text->TextBeforeOffset(aOffset, aBoundaryType,
-                           &startOffset, &endOffset, autoStr);
+    text->TextBeforeOffset(aOffset, aBoundaryType, &startOffset, &endOffset,
+                           autoStr);
     ConvertTexttoAsterisks(accWrap, autoStr);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     proxy->GetTextBeforeOffset(aOffset, aBoundaryType, autoStr, &startOffset,
                                &endOffset);
   }
 
   *aStartOffset = startOffset;
   *aEndOffset = endOffset;
 
   // libspi will free it.
   return DOMtoATK::Convert(autoStr);
 }
 
-static gint
-getCaretOffsetCB(AtkText *aText)
-{
+static gint getCaretOffsetCB(AtkText* aText) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return 0;
     }
 
     return static_cast<gint>(text->CaretOffset());
@@ -317,34 +295,32 @@ getCaretOffsetCB(AtkText *aText)
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     return static_cast<gint>(proxy->CaretOffset());
   }
 
   return 0;
 }
 
-static AtkAttributeSet*
-getRunAttributesCB(AtkText *aText, gint aOffset,
-                   gint *aStartOffset,
-                   gint *aEndOffset)
-{
+static AtkAttributeSet* getRunAttributesCB(AtkText* aText, gint aOffset,
+                                           gint* aStartOffset,
+                                           gint* aEndOffset) {
   *aStartOffset = -1;
   *aEndOffset = -1;
   int32_t startOffset = 0, endOffset = 0;
 
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return nullptr;
     }
 
     nsCOMPtr<nsIPersistentProperties> attributes =
-      text->TextAttributes(false, aOffset, &startOffset, &endOffset);
+        text->TextAttributes(false, aOffset, &startOffset, &endOffset);
 
     *aStartOffset = startOffset;
     *aEndOffset = endOffset;
 
     return ConvertToAtkTextAttributeSet(attributes);
   }
 
   ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText));
@@ -354,47 +330,43 @@ getRunAttributesCB(AtkText *aText, gint 
 
   AutoTArray<Attribute, 10> attrs;
   proxy->TextAttributes(false, aOffset, &attrs, &startOffset, &endOffset);
   *aStartOffset = startOffset;
   *aEndOffset = endOffset;
   return ConvertToAtkTextAttributeSet(attrs);
 }
 
-static AtkAttributeSet*
-getDefaultAttributesCB(AtkText *aText)
-{
+static AtkAttributeSet* getDefaultAttributesCB(AtkText* aText) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return nullptr;
     }
 
-    nsCOMPtr<nsIPersistentProperties> attributes = text->DefaultTextAttributes();
+    nsCOMPtr<nsIPersistentProperties> attributes =
+        text->DefaultTextAttributes();
     return ConvertToAtkTextAttributeSet(attributes);
   }
 
   ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText));
   if (!proxy) {
     return nullptr;
   }
 
   AutoTArray<Attribute, 10> attrs;
   proxy->DefaultTextAttributes(&attrs);
   return ConvertToAtkTextAttributeSet(attrs);
 }
 
-static void
-getCharacterExtentsCB(AtkText *aText, gint aOffset,
-                      gint *aX, gint *aY,
-                      gint *aWidth, gint *aHeight,
-                      AtkCoordType aCoords)
-{
-  if(!aX || !aY || !aWidth || !aHeight) {
+static void getCharacterExtentsCB(AtkText* aText, gint aOffset, gint* aX,
+                                  gint* aY, gint* aWidth, gint* aHeight,
+                                  AtkCoordType aCoords) {
+  if (!aX || !aY || !aWidth || !aHeight) {
     return;
   }
 
   nsIntRect rect;
   uint32_t geckoCoordType;
   if (aCoords == ATK_XY_SCREEN) {
     geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
   } else {
@@ -416,34 +388,33 @@ getCharacterExtentsCB(AtkText *aText, gi
   }
 
   *aX = rect.x;
   *aY = rect.y;
   *aWidth = rect.width;
   *aHeight = rect.height;
 }
 
-static void
-getRangeExtentsCB(AtkText *aText, gint aStartOffset, gint aEndOffset,
-                  AtkCoordType aCoords, AtkTextRectangle *aRect)
-{
+static void getRangeExtentsCB(AtkText* aText, gint aStartOffset,
+                              gint aEndOffset, AtkCoordType aCoords,
+                              AtkTextRectangle* aRect) {
   if (!aRect) {
     return;
   }
 
   nsIntRect rect;
   uint32_t geckoCoordType;
   if (aCoords == ATK_XY_SCREEN) {
     geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE;
   } else {
     geckoCoordType = nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE;
   }
 
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
-  if(accWrap) {
+  if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return;
     }
 
     rect = text->TextBounds(aStartOffset, aEndOffset, geckoCoordType);
   } else if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     rect = proxy->TextBounds(aStartOffset, aEndOffset, geckoCoordType);
@@ -452,66 +423,60 @@ getRangeExtentsCB(AtkText *aText, gint a
   }
 
   aRect->x = rect.x;
   aRect->y = rect.y;
   aRect->width = rect.width;
   aRect->height = rect.height;
 }
 
-static gint
-getCharacterCountCB(AtkText *aText)
-{
+static gint getCharacterCountCB(AtkText* aText) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* textAcc = accWrap->AsHyperText();
-    return !textAcc || textAcc->IsDefunct() ?
-        0 : static_cast<gint>(textAcc->CharacterCount());
+    return !textAcc || textAcc->IsDefunct()
+               ? 0
+               : static_cast<gint>(textAcc->CharacterCount());
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     return proxy->CharacterCount();
   }
 
   return 0;
 }
 
-static gint
-getOffsetAtPointCB(AtkText *aText,
-                   gint aX, gint aY,
-                   AtkCoordType aCoords)
-{
+static gint getOffsetAtPointCB(AtkText* aText, gint aX, gint aY,
+                               AtkCoordType aCoords) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return -1;
     }
 
-    return static_cast<gint>(
-      text->OffsetAtPoint(aX, aY,
-                          (aCoords == ATK_XY_SCREEN ?
-                           nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
-                           nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE)));
+    return static_cast<gint>(text->OffsetAtPoint(
+        aX, aY,
+        (aCoords == ATK_XY_SCREEN
+             ? nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE
+             : nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE)));
   }
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
-    return static_cast<gint>(
-      proxy->OffsetAtPoint(aX, aY,
-                           (aCoords == ATK_XY_SCREEN ?
-                            nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE :
-                            nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE)));
+    return static_cast<gint>(proxy->OffsetAtPoint(
+        aX, aY,
+        (aCoords == ATK_XY_SCREEN
+             ? nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE
+             : nsIAccessibleCoordinateType::COORDTYPE_WINDOW_RELATIVE)));
   }
 
   return -1;
 }
 
-static gint
-getTextSelectionCountCB(AtkText *aText)
-{
+static gint getTextSelectionCountCB(AtkText* aText) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return 0;
     }
 
     return text->SelectionCount();
@@ -519,20 +484,18 @@ getTextSelectionCountCB(AtkText *aText)
 
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     return proxy->SelectionCount();
   }
 
   return 0;
 }
 
-static gchar*
-getTextSelectionCB(AtkText *aText, gint aSelectionNum,
-                   gint *aStartOffset, gint *aEndOffset)
-{
+static gchar* getTextSelectionCB(AtkText* aText, gint aSelectionNum,
+                                 gint* aStartOffset, gint* aEndOffset) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   int32_t startOffset = 0, endOffset = 0;
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return nullptr;
     }
 
@@ -550,80 +513,70 @@ getTextSelectionCB(AtkText *aText, gint 
 
     NS_ConvertUTF16toUTF8 dataAsUTF8(data);
     return (dataAsUTF8.get()) ? g_strdup(dataAsUTF8.get()) : nullptr;
   }
   return nullptr;
 }
 
 // set methods
-static gboolean
-addTextSelectionCB(AtkText *aText,
-                   gint aStartOffset,
-                   gint aEndOffset)
-{
+static gboolean addTextSelectionCB(AtkText* aText, gint aStartOffset,
+                                   gint aEndOffset) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return FALSE;
     }
 
     return text->AddToSelection(aStartOffset, aEndOffset);
   }
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     return proxy->AddToSelection(aStartOffset, aEndOffset);
   }
 
   return FALSE;
 }
 
-static gboolean
-removeTextSelectionCB(AtkText *aText,
-                      gint aSelectionNum)
-{
+static gboolean removeTextSelectionCB(AtkText* aText, gint aSelectionNum) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return FALSE;
     }
 
     return text->RemoveFromSelection(aSelectionNum);
   }
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     return proxy->RemoveFromSelection(aSelectionNum);
   }
 
   return FALSE;
 }
 
-static gboolean
-setTextSelectionCB(AtkText *aText, gint aSelectionNum,
-                   gint aStartOffset, gint aEndOffset)
-{
+static gboolean setTextSelectionCB(AtkText* aText, gint aSelectionNum,
+                                   gint aStartOffset, gint aEndOffset) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole()) {
       return FALSE;
     }
 
     return text->SetSelectionBoundsAt(aSelectionNum, aStartOffset, aEndOffset);
   }
   if (ProxyAccessible* proxy = GetProxy(ATK_OBJECT(aText))) {
     return proxy->SetSelectionBoundsAt(aSelectionNum, aStartOffset, aEndOffset);
   }
 
   return FALSE;
 }
 
-static gboolean
-setCaretOffsetCB(AtkText *aText, gint aOffset)
-{
+static gboolean setCaretOffsetCB(AtkText* aText, gint aOffset) {
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(aText));
   if (accWrap) {
     HyperTextAccessible* text = accWrap->AsHyperText();
     if (!text || !text->IsTextRole() || !text->IsValidOffset(aOffset)) {
       return FALSE;
     }
 
     text->SetCaretOffset(aOffset);
@@ -634,41 +587,38 @@ setCaretOffsetCB(AtkText *aText, gint aO
     proxy->SetCaretOffset(aOffset);
     return TRUE;
   }
 
   return FALSE;
 }
 }
 
-void
-textInterfaceInitCB(AtkTextIface* aIface)
-{
+void textInterfaceInitCB(AtkTextIface* aIface) {
   NS_ASSERTION(aIface, "Invalid aIface");
-  if (MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   aIface->get_text = getTextCB;
   aIface->get_text_after_offset = getTextAfterOffsetCB;
   aIface->get_text_at_offset = getTextAtOffsetCB;
   aIface->get_character_at_offset = getCharacterAtOffsetCB;
   aIface->get_text_before_offset = getTextBeforeOffsetCB;
   aIface->get_caret_offset = getCaretOffsetCB;
   aIface->get_run_attributes = getRunAttributesCB;
   aIface->get_default_attributes = getDefaultAttributesCB;
   aIface->get_character_extents = getCharacterExtentsCB;
   aIface->get_range_extents = getRangeExtentsCB;
   aIface->get_character_count = getCharacterCountCB;
   aIface->get_offset_at_point = getOffsetAtPointCB;
   aIface->get_n_selections = getTextSelectionCountCB;
   aIface->get_selection = getTextSelectionCB;
 
-    // set methods
+  // set methods
   aIface->add_selection = addTextSelectionCB;
   aIface->remove_selection = removeTextSelectionCB;
   aIface->set_selection = setTextSelectionCB;
   aIface->set_caret_offset = setCaretOffsetCB;
 
   // Cache the string values of the atk text attribute names.
   for (uint32_t i = 0; i < ArrayLength(sAtkTextAttrNames); i++)
     sAtkTextAttrNames[i] =
-      atk_text_attribute_get_name(static_cast<AtkTextAttribute>(i));
+        atk_text_attribute_get_name(static_cast<AtkTextAttribute>(i));
 }
--- a/accessible/atk/nsMaiInterfaceValue.cpp
+++ b/accessible/atk/nsMaiInterfaceValue.cpp
@@ -12,122 +12,107 @@
 #include "mozilla/FloatingPoint.h"
 #include "mozilla/Likely.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
 extern "C" {
 
-static void
-getCurrentValueCB(AtkValue *obj, GValue *value)
-{
+static void getCurrentValueCB(AtkValue* obj, GValue* value) {
   ProxyAccessible* proxy = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
   if (!accWrap) {
     proxy = GetProxy(ATK_OBJECT(obj));
     if (!proxy) {
       return;
     }
   }
 
-  memset (value,  0, sizeof (GValue));
+  memset(value, 0, sizeof(GValue));
   double accValue = accWrap ? accWrap->CurValue() : proxy->CurValue();
-  if (IsNaN(accValue))
-    return;
+  if (IsNaN(accValue)) return;
 
-  g_value_init (value, G_TYPE_DOUBLE);
-  g_value_set_double (value, accValue);
+  g_value_init(value, G_TYPE_DOUBLE);
+  g_value_set_double(value, accValue);
 }
 
-static void
-getMaximumValueCB(AtkValue *obj, GValue *value)
-{
+static void getMaximumValueCB(AtkValue* obj, GValue* value) {
   ProxyAccessible* proxy = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
   if (!accWrap) {
     proxy = GetProxy(ATK_OBJECT(obj));
     if (!proxy) {
       return;
     }
   }
 
-  memset(value,  0, sizeof (GValue));
+  memset(value, 0, sizeof(GValue));
   double accValue = accWrap ? accWrap->MaxValue() : proxy->MaxValue();
-  if (IsNaN(accValue))
-    return;
+  if (IsNaN(accValue)) return;
 
   g_value_init(value, G_TYPE_DOUBLE);
   g_value_set_double(value, accValue);
 }
 
-static void
-getMinimumValueCB(AtkValue *obj, GValue *value)
-{
+static void getMinimumValueCB(AtkValue* obj, GValue* value) {
   ProxyAccessible* proxy = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
   if (!accWrap) {
     proxy = GetProxy(ATK_OBJECT(obj));
     if (!proxy) {
       return;
     }
   }
 
-  memset(value,  0, sizeof (GValue));
+  memset(value, 0, sizeof(GValue));
   double accValue = accWrap ? accWrap->MinValue() : proxy->MinValue();
-  if (IsNaN(accValue))
-    return;
+  if (IsNaN(accValue)) return;
 
   g_value_init(value, G_TYPE_DOUBLE);
   g_value_set_double(value, accValue);
 }
 
-static void
-getMinimumIncrementCB(AtkValue *obj, GValue *minimumIncrement)
-{
+static void getMinimumIncrementCB(AtkValue* obj, GValue* minimumIncrement) {
   ProxyAccessible* proxy = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
   if (!accWrap) {
     proxy = GetProxy(ATK_OBJECT(obj));
     if (!proxy) {
       return;
     }
   }
 
-  memset(minimumIncrement,  0, sizeof (GValue));
+  memset(minimumIncrement, 0, sizeof(GValue));
   double accValue = accWrap ? accWrap->Step() : proxy->Step();
   if (IsNaN(accValue))
-    accValue = 0; // zero if the minimum increment is undefined
+    accValue = 0;  // zero if the minimum increment is undefined
 
   g_value_init(minimumIncrement, G_TYPE_DOUBLE);
   g_value_set_double(minimumIncrement, accValue);
 }
 
-static gboolean
-setCurrentValueCB(AtkValue *obj, const GValue *value)
-{
+static gboolean setCurrentValueCB(AtkValue* obj, const GValue* value) {
   ProxyAccessible* proxy = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
   if (!accWrap) {
     proxy = GetProxy(ATK_OBJECT(obj));
     if (!proxy) {
       return FALSE;
     }
   }
 
-  double accValue =g_value_get_double(value);
-  return accWrap ? accWrap->SetCurValue(accValue) : proxy->SetCurValue(accValue);
+  double accValue = g_value_get_double(value);
+  return accWrap ? accWrap->SetCurValue(accValue)
+                 : proxy->SetCurValue(accValue);
 }
 }
 
-void
-valueInterfaceInitCB(AtkValueIface* aIface)
-{
+void valueInterfaceInitCB(AtkValueIface* aIface) {
   NS_ASSERTION(aIface, "Invalid aIface");
-  if (MOZ_UNLIKELY(!aIface))
-    return;
+  if (MOZ_UNLIKELY(!aIface)) return;
 
   aIface->get_current_value = getCurrentValueCB;
   aIface->get_maximum_value = getMaximumValueCB;
   aIface->get_minimum_value = getMinimumValueCB;
   aIface->get_minimum_increment = getMinimumIncrementCB;
   aIface->set_current_value = setCurrentValueCB;
 }
--- a/accessible/atk/nsStateMap.h
+++ b/accessible/atk/nsStateMap.h
@@ -36,31 +36,33 @@ The following ATK states are not support
   ATK_STATE_ICONIFIED:   Mozilla does not have elements which are collapsable into icons
   ATK_STATE_TRUNCATED:   No clear use case. Indicates that an object's onscreen content is truncated,
                          e.g. a text value in a spreadsheet cell. No IA2 state.
 ******************************************************************************/
 // clang-format on
 
 enum EStateMapEntryType {
   kMapDirectly,
-  kMapOpposite,   // For example, UNAVAILABLE is the opposite of ENABLED
-  kNoStateChange, // Don't fire state change event
+  kMapOpposite,    // For example, UNAVAILABLE is the opposite of ENABLED
+  kNoStateChange,  // Don't fire state change event
 };
 
 const AtkStateType kNone = ATK_STATE_INVALID;
 
 struct AtkStateMap {
   AtkStateType atkState;
   EStateMapEntryType stateMapEntryType;
 };
 
-
 // Map array from cross platform states to ATK states
-static const AtkStateMap gAtkStateMap[] = {                     // Cross Platform States
-  // clang-format off
+static const AtkStateMap
+    gAtkStateMap[] =
+        {
+            // Cross Platform States
+            // clang-format off
   { kNone,                                    kMapOpposite },   // states::UNAVAILABLE             = 1 << 0
   { ATK_STATE_SELECTED,                       kMapDirectly },   // states::SELECTED                = 1 << 1
   { ATK_STATE_FOCUSED,                        kMapDirectly },   // states::FOCUSED                 = 1 << 2
   { ATK_STATE_PRESSED,                        kMapDirectly },   // states::PRESSED                 = 1 << 3
   { ATK_STATE_CHECKED,                        kMapDirectly },   // states::CHECKED                 = 1 << 4
   { ATK_STATE_INDETERMINATE,                  kMapDirectly },   // states::MIXED                   = 1 << 5
   { kNone,                                    kMapDirectly },   // states::READONLY                = 1 << 6
   { kNone,                                    kMapDirectly },   // states::HOTTRACKED              = 1 << 7
@@ -100,15 +102,16 @@ static const AtkStateMap gAtkStateMap[] 
   { ATK_STATE_TRANSIENT,                      kMapDirectly },   // states::TRANSIENT               = 1 << 41
   { ATK_STATE_VERTICAL,                       kMapDirectly },   // states::VERTICAL                = 1 << 42
   { ATK_STATE_STALE,                          kMapDirectly },   // states::STALE                   = 1 << 43
   { ATK_STATE_ENABLED,                        kMapDirectly },   // states::ENABLED                 = 1 << 44
   { ATK_STATE_SENSITIVE,                      kMapDirectly },   // states::SENSITIVE               = 1 << 45
   { ATK_STATE_EXPANDABLE,                     kMapDirectly },   // states::EXPANDABLE              = 1 << 46
   { kNone,                                    kMapDirectly },   // states::PINNED                  = 1 << 47
   { ATK_STATE_ACTIVE,                         kMapDirectly }    // states::CURRENT                 = 1 << 48
-  // clang-format on
+                                              // clang-format on
 };
 
 static const auto gAtkStateMapLen = std::extent<decltype(gAtkStateMap)>::value;
 
-static_assert(((uint64_t) 0x1) << (gAtkStateMapLen - 1) == mozilla::a11y::states::LAST_ENTRY,
+static_assert(((uint64_t)0x1) << (gAtkStateMapLen - 1) ==
+                  mozilla::a11y::states::LAST_ENTRY,
               "ATK states map is out of sync with internal states");
--- a/accessible/base/ARIAMap.cpp
+++ b/accessible/base/ARIAMap.cpp
@@ -21,28 +21,27 @@
 using namespace mozilla;
 using namespace mozilla::a11y;
 using namespace mozilla::a11y::aria;
 
 static const uint32_t kGenericAccType = 0;
 
 /**
  *  This list of WAI-defined roles are currently hardcoded.
- *  Eventually we will most likely be loading an RDF resource that contains th