Bug 1693607 - [Linux] Add braces around statements. r=morgan
authorEitan Isaacson <eitan@monotonous.org>
Fri, 19 Feb 2021 23:14:32 +0000
changeset 568147 9070544a3a945d2608389d7771f8ae9ac69f6a4d
parent 568146 2871d20800e1523d09e4db6b157bfcf7c00ec3fe
child 568148 0df6a015e7c44653ff9cb114d25644c0515b0cc9
push id38221
push usercbrindusan@mozilla.com
push dateSat, 20 Feb 2021 09:33:16 +0000
treeherdermozilla-central@398870af9cb5 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmorgan
bugs1693607
milestone87.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
Bug 1693607 - [Linux] Add braces around statements. r=morgan This is a collaboration between clang-tidy and clang-format. clang-tidy uses compiled code paths, so this patch is linux specific. Differential Revision: https://phabricator.services.mozilla.com/D105669
accessible/atk/AccessibleWrap.cpp
accessible/atk/ApplicationAccessibleWrap.cpp
accessible/atk/AtkSocketAccessible.cpp
accessible/atk/DOMtoATK.h
accessible/atk/Platform.cpp
accessible/atk/nsMaiHyperlink.cpp
accessible/atk/nsMaiInterfaceText.cpp
accessible/atk/nsMaiInterfaceValue.cpp
accessible/base/ARIAMap.cpp
accessible/base/ARIAStateMap.cpp
accessible/base/AccEvent.cpp
accessible/base/AccGroupInfo.cpp
accessible/base/AccGroupInfo.h
accessible/base/AccIterator.cpp
accessible/base/DocManager.cpp
accessible/base/EmbeddedObjCollector.cpp
accessible/base/EventQueue.cpp
accessible/base/Filters.cpp
accessible/base/FocusManager.cpp
accessible/base/Logging.cpp
accessible/base/NotificationController.cpp
accessible/base/NotificationController.h
accessible/base/Relation.h
accessible/base/SelectionManager.cpp
accessible/base/TextAttrs.cpp
accessible/base/TextAttrs.h
accessible/base/TextRange.cpp
accessible/base/TextUpdater.cpp
accessible/base/TreeWalker.cpp
accessible/base/nsAccUtils.cpp
accessible/base/nsAccessibilityService.cpp
accessible/base/nsAccessiblePivot.cpp
accessible/base/nsCoreUtils.cpp
accessible/base/nsTextEquivUtils.cpp
accessible/generic/ARIAGridAccessible.cpp
accessible/generic/Accessible-inl.h
accessible/generic/Accessible.cpp
accessible/generic/Accessible.h
accessible/generic/DocAccessible-inl.h
accessible/generic/DocAccessible.cpp
accessible/generic/HyperTextAccessible-inl.h
accessible/generic/HyperTextAccessible.cpp
accessible/generic/ImageAccessible.cpp
accessible/generic/RootAccessible.cpp
accessible/generic/TableCellAccessible.cpp
accessible/html/HTMLElementAccessibles.cpp
accessible/html/HTMLFormControlAccessible.cpp
accessible/html/HTMLImageMapAccessible.cpp
accessible/html/HTMLLinkAccessible.cpp
accessible/html/HTMLSelectAccessible.cpp
accessible/html/HTMLTableAccessible.cpp
accessible/ipc/DocAccessibleChildBase.cpp
accessible/ipc/DocAccessibleParent.cpp
accessible/ipc/other/DocAccessibleChild.cpp
accessible/ipc/other/ProxyAccessible.cpp
accessible/xpcom/nsAccessibleRelation.cpp
accessible/xpcom/xpcAccessibilityService.cpp
accessible/xpcom/xpcAccessible.cpp
accessible/xpcom/xpcAccessibleDocument.cpp
accessible/xpcom/xpcAccessibleHyperLink.cpp
accessible/xpcom/xpcAccessibleHyperText.cpp
accessible/xpcom/xpcAccessibleHyperText.h
accessible/xpcom/xpcAccessibleSelectable.cpp
accessible/xpcom/xpcAccessibleTable.cpp
accessible/xpcom/xpcAccessibleTextRange.cpp
accessible/xpcom/xpcAccessibleValue.cpp
accessible/xul/XULComboboxAccessible.cpp
accessible/xul/XULFormControlAccessible.cpp
accessible/xul/XULListboxAccessible.cpp
accessible/xul/XULMenuAccessible.cpp
accessible/xul/XULTabAccessible.cpp
accessible/xul/XULTreeAccessible.cpp
accessible/xul/XULTreeGridAccessible.cpp
--- a/accessible/atk/AccessibleWrap.cpp
+++ b/accessible/atk/AccessibleWrap.cpp
@@ -316,18 +316,19 @@ uint16_t AccessibleWrap::CreateMaiInterf
   // Add Action interface if the action count is more than zero.
   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))
+    if (!nsAccUtils::MustPrune(this)) {
       interfacesBits |= 1 << MAI_INTERFACE_HYPERTEXT;
+    }
   }
 
   // Value interface.
   if (HasNumericValue()) interfacesBits |= 1 << MAI_INTERFACE_VALUE;
 
   // Document interface.
   if (IsDoc()) interfacesBits |= 1 << MAI_INTERFACE_DOCUMENT;
 
@@ -488,42 +489,45 @@ void initializeCB(AtkObject* aAtkObj, gp
   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
    */
 
-  if (ATK_OBJECT_CLASS(parent_class)->initialize)
+  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");
 
   // call parent finalize function
   // finalize of GObjectClass will unref the accessible parent if has
-  if (G_OBJECT_CLASS(parent_class)->finalize)
+  if (G_OBJECT_CLASS(parent_class)->finalize) {
     G_OBJECT_CLASS(parent_class)->finalize(aObj);
+  }
 }
 
 const gchar* getNameCB(AtkObject* aAtkObj) {
   nsAutoString name;
   AccessibleWrap* accWrap = GetAccessibleWrap(aAtkObj);
-  if (accWrap)
+  if (accWrap) {
     accWrap->Name(name);
-  else if (ProxyAccessible* proxy = GetProxy(aAtkObj))
+  } else if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
     proxy->Name(name);
-  else
+  } 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) {
@@ -557,18 +561,19 @@ const gchar* getDescriptionCB(AtkObject*
     accWrap->Description(uniDesc);
   } else if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
     proxy->Description(uniDesc);
   } else {
     return nullptr;
   }
 
   NS_ConvertUTF8toUTF16 objDesc(aAtkObj->description);
-  if (!uniDesc.Equals(objDesc))
+  if (!uniDesc.Equals(objDesc)) {
     atk_object_set_description(aAtkObj, NS_ConvertUTF16toUTF8(uniDesc).get());
+  }
 
   return aAtkObj->description;
 }
 
 AtkRole getRoleCB(AtkObject* aAtkObj) {
   if (aAtkObj->role != ATK_ROLE_INVALID) return aAtkObj->role;
 
   AccessibleOrProxy acc = GetInternalObj(aAtkObj);
@@ -592,35 +597,38 @@ AtkRole getRoleCB(AtkObject* aAtkObj) {
   switch (acc.Role()) {
 #include "RoleMap.h"
     default:
       MOZ_CRASH("Unknown role.");
   }
 
 #undef ROLE
 
-  if (aAtkObj->role == ATK_ROLE_LIST_BOX && !IsAtkVersionAtLeast(2, 1))
+  if (aAtkObj->role == ATK_ROLE_LIST_BOX && !IsAtkVersionAtLeast(2, 1)) {
     aAtkObj->role = ATK_ROLE_LIST;
-  else if (aAtkObj->role == ATK_ROLE_TABLE_ROW && !IsAtkVersionAtLeast(2, 1))
+  } else if (aAtkObj->role == ATK_ROLE_TABLE_ROW &&
+             !IsAtkVersionAtLeast(2, 1)) {
     aAtkObj->role = ATK_ROLE_LIST_ITEM;
-  else if (aAtkObj->role == ATK_ROLE_MATH && !IsAtkVersionAtLeast(2, 12))
+  } else if (aAtkObj->role == ATK_ROLE_MATH && !IsAtkVersionAtLeast(2, 12)) {
     aAtkObj->role = ATK_ROLE_SECTION;
-  else if (aAtkObj->role == ATK_ROLE_COMMENT && !IsAtkVersionAtLeast(2, 12))
-    aAtkObj->role = ATK_ROLE_SECTION;
-  else if (aAtkObj->role == ATK_ROLE_LANDMARK && !IsAtkVersionAtLeast(2, 12))
+  } else if (aAtkObj->role == ATK_ROLE_COMMENT && !IsAtkVersionAtLeast(2, 12)) {
     aAtkObj->role = ATK_ROLE_SECTION;
-  else if (aAtkObj->role == ATK_ROLE_FOOTNOTE && !IsAtkVersionAtLeast(2, 25, 2))
+  } else if (aAtkObj->role == ATK_ROLE_LANDMARK &&
+             !IsAtkVersionAtLeast(2, 12)) {
     aAtkObj->role = ATK_ROLE_SECTION;
-  else if (aAtkObj->role == ATK_ROLE_STATIC && !IsAtkVersionAtLeast(2, 16))
+  } 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))
+  } else if ((aAtkObj->role == ATK_ROLE_MATH_FRACTION ||
+              aAtkObj->role == ATK_ROLE_MATH_ROOT) &&
+             !IsAtkVersionAtLeast(2, 16)) {
     aAtkObj->role = ATK_ROLE_SECTION;
-  else if (aAtkObj->role == ATK_ROLE_MARK && !IsAtkVersionAtLeast(2, 36)) {
+  } else if (aAtkObj->role == ATK_ROLE_MARK && !IsAtkVersionAtLeast(2, 36)) {
     aAtkObj->role = ATK_ROLE_TEXT;
   } else if (aAtkObj->role == ATK_ROLE_SUGGESTION &&
              !IsAtkVersionAtLeast(2, 36)) {
     aAtkObj->role = ATK_ROLE_SECTION;
   } else if (aAtkObj->role == ATK_ROLE_COMMENT && !IsAtkVersionAtLeast(2, 36)) {
     aAtkObj->role = ATK_ROLE_SECTION;
   }
 
@@ -784,18 +792,19 @@ AtkObject* refChildCB(AtkObject* aAtkObj
     return nullptr;
   }
 
   NS_ASSERTION(childAtkObj, "Fail to get AtkObj");
   if (!childAtkObj) return nullptr;
 
   g_object_ref(childAtkObj);
 
-  if (aAtkObj != childAtkObj->accessible_parent)
+  if (aAtkObj != childAtkObj->accessible_parent) {
     atk_object_set_parent(childAtkObj, aAtkObj);
+  }
 
   return childAtkObj;
 }
 
 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)) {
@@ -870,18 +879,19 @@ static void UpdateAtkRelation(RelationTy
 
   AtkRelation* 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()))
+  while ((tempAcc = rel.Next())) {
     targets.AppendElement(AccessibleWrap::GetAtkObject(tempAcc));
+  }
 
   if (aType == RelationType::EMBEDS && aAcc->IsRoot()) {
     if (ProxyAccessible* proxyDoc =
             aAcc->AsRoot()->GetPrimaryRemoteTopLevelContentDoc()) {
       targets.AppendElement(GetWrapperFor(proxyDoc));
     }
   }
 
@@ -905,23 +915,25 @@ AtkRelationSet* refRelationSetCB(AtkObje
 
   if (ProxyAccessible* proxy = GetProxy(aAtkObj)) {
     nsTArray<RelationType> types;
     nsTArray<nsTArray<ProxyAccessible*>> targetSets;
     proxy->Relations(&types, &targetSets);
 
     size_t relationCount = types.Length();
     for (size_t i = 0; i < relationCount; i++) {
-      if (typeMap[static_cast<uint32_t>(types[i])] == ATK_RELATION_NULL)
+      if (typeMap[static_cast<uint32_t>(types[i])] == ATK_RELATION_NULL) {
         continue;
+      }
 
       size_t targetCount = targetSets[i].Length();
       AutoTArray<AtkObject*, 5> wrappers;
-      for (size_t j = 0; j < targetCount; j++)
+      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);
 
       atkRelation =
           atk_relation_new(wrappers.Elements(), wrappers.Length(), atkType);
@@ -988,34 +1000,38 @@ AtkObject* GetWrapperFor(AccessibleOrPro
   }
 
   return AccessibleWrap::GetAtkObject(aObj.AsAccessible());
 }
 
 static uint16_t GetInterfacesForProxy(ProxyAccessible* aProxy,
                                       uint32_t aInterfaces) {
   uint16_t interfaces = 1 << MAI_INTERFACE_COMPONENT;
-  if (aInterfaces & Interfaces::HYPERTEXT)
+  if (aInterfaces & Interfaces::HYPERTEXT) {
     interfaces |= (1 << MAI_INTERFACE_HYPERTEXT) | (1 << MAI_INTERFACE_TEXT) |
                   (1 << MAI_INTERFACE_EDITABLE_TEXT);
+  }
 
-  if (aInterfaces & Interfaces::HYPERLINK)
+  if (aInterfaces & Interfaces::HYPERLINK) {
     interfaces |= 1 << MAI_INTERFACE_HYPERLINK_IMPL;
+  }
 
   if (aInterfaces & Interfaces::VALUE) interfaces |= 1 << MAI_INTERFACE_VALUE;
 
   if (aInterfaces & Interfaces::TABLE) interfaces |= 1 << MAI_INTERFACE_TABLE;
 
-  if (aInterfaces & Interfaces::TABLECELL)
+  if (aInterfaces & Interfaces::TABLECELL) {
     interfaces |= 1 << MAI_INTERFACE_TABLE_CELL;
+  }
 
   if (aInterfaces & Interfaces::IMAGE) interfaces |= 1 << MAI_INTERFACE_IMAGE;
 
-  if (aInterfaces & Interfaces::DOCUMENT)
+  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;
   }
@@ -1428,20 +1444,21 @@ static const char* oldTextChangeStrings[
 #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}};
 
 void MaiAtkObject::FireTextChangeEvent(const nsString& aStr, int32_t aStart,
                                        uint32_t aLen, bool aIsInsert,
                                        bool aFromUser) {
-  if (gAvailableAtkSignals == eUnknown)
+  if (gAvailableAtkSignals == eUnknown) {
     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];
     g_signal_emit_by_name(this, signal_name, aStart, aLen);
   } else {
--- a/accessible/atk/ApplicationAccessibleWrap.cpp
+++ b/accessible/atk/ApplicationAccessibleWrap.cpp
@@ -25,18 +25,19 @@ ApplicationAccessibleWrap::~ApplicationA
   AccessibleWrap::ShutdownAtkObject();
 }
 
 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)
+  if (!sQuark_gecko_acc_obj) {
     sQuark_gecko_acc_obj = g_quark_from_static_string("GeckoAccObj");
+  }
 
   if (nsAccessibilityService::IsShutdown()) 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));
--- a/accessible/atk/AtkSocketAccessible.cpp
+++ b/accessible/atk/AtkSocketAccessible.cpp
@@ -91,15 +91,16 @@ AtkSocketAccessible::AtkSocketAccessible
 }
 
 void AtkSocketAccessible::GetNativeInterface(void** aOutAccessible) {
   *aOutAccessible = mAtkObject;
 }
 
 void AtkSocketAccessible::Shutdown() {
   if (mAtkObject) {
-    if (MAI_IS_ATK_SOCKET(mAtkObject))
+    if (MAI_IS_ATK_SOCKET(mAtkObject)) {
       MAI_ATK_SOCKET(mAtkObject)->accWrap = nullptr;
+    }
     g_object_unref(mAtkObject);
     mAtkObject = nullptr;
   }
   AccessibleWrap::Shutdown();
 }
--- a/accessible/atk/DOMtoATK.h
+++ b/accessible/atk/DOMtoATK.h
@@ -123,18 +123,19 @@ gchar* NewATKString(AccessibleOrProxy* a
   nsAutoString str;
   aAccessible->TextSubstring(startOffset, endOffset, str);
 
   if (str.Length() == 0) {
     // Bogus offsets, or empty string, either way we do not need conversion.
     return g_strdup("");
   }
 
-  if (aFlags & AtkStringConvertFlags::ConvertTextToAsterisks)
+  if (aFlags & AtkStringConvertFlags::ConvertTextToAsterisks) {
     ConvertTexttoAsterisks(str);
+  }
   return converter.ConvertAdjusted(str);
 }
 
 /**
  * Get a character from aAccessible, fetching more data as appropriate to
  * properly get non-BMP characters or a BOM as appropriate.
  */
 template <class AccessibleCharAt>
--- a/accessible/atk/Platform.cpp
+++ b/accessible/atk/Platform.cpp
@@ -81,20 +81,21 @@ static nsresult LoadGtkModule(GnomeAcces
     libPath.AppendLiteral(":/usr/lib");
 #endif
     PR_FreeLibraryName(curLibPath);
 
     int16_t loc1 = 0, loc2 = 0;
     int16_t subLen = 0;
     while (loc2 >= 0) {
       loc2 = libPath.FindChar(':', loc1);
-      if (loc2 < 0)
+      if (loc2 < 0) {
         subLen = libPath.Length() - loc1;
-      else
+      } 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;
     }
@@ -117,18 +118,19 @@ void a11y::PlatformInit() {
   if (!ShouldA11yBeEnabled()) return;
 
   sATKLib = PR_LoadLibrary(sATKLibName);
   if (!sATKLib) return;
 
   AtkGetTypeType pfn_atk_hyperlink_impl_get_type =
       (AtkGetTypeType)PR_FindFunctionSymbol(sATKLib,
                                             sATKHyperlinkImplGetTypeSymbol);
-  if (pfn_atk_hyperlink_impl_get_type)
+  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);
   if (pfn_atk_socket_get_type) {
     AtkSocketAccessible::g_atk_socket_type = pfn_atk_socket_get_type();
     AtkSocketAccessible::g_atk_socket_embed =
         (AtkSocketEmbedType)PR_FindFunctionSymbol(
@@ -145,18 +147,19 @@ void a11y::PlatformInit() {
       (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)
+        if (atkMinorVersion != 0L) {
           atkMicroVersion = strtol(endPtr + 1, &endPtr, 10);
+        }
       }
     }
   }
 
   // Initialize the MAI Utility class, it will overwrite gail_util.
   g_type_class_unref(g_type_class_ref(mai_util_get_type()));
 
   // Init atk-bridge now
@@ -270,18 +273,19 @@ bool a11y::ShouldA11yBeEnabled() {
   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);
   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
--- a/accessible/atk/nsMaiHyperlink.cpp
+++ b/accessible/atk/nsMaiHyperlink.cpp
@@ -131,18 +131,19 @@ void classInitCB(AtkHyperlinkClass* aCla
 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;
 
   /* call parent finalize function */
-  if (G_OBJECT_CLASS(parent_class)->finalize)
+  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;
 
   nsAutoCString cautoStr;
   if (Accessible* hyperlink = maiLink->GetAccHyperlink()) {
@@ -178,49 +179,53 @@ AtkObject* getObjectCB(AtkHyperlink* aLi
   ProxyAccessible* anchor = maiLink->Proxy()->AnchorAt(aLinkIndex);
   return anchor ? GetWrapperFor(anchor) : nullptr;
 }
 
 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;
 
-  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;
 
-  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;
 
-  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/nsMaiInterfaceText.cpp
+++ b/accessible/atk/nsMaiInterfaceText.cpp
@@ -667,12 +667,13 @@ void textInterfaceInitCB(AtkTextIface* a
   aIface->set_caret_offset = setCaretOffsetCB;
 
   if (IsAtkVersionAtLeast(2, 32)) {
     aIface->scroll_substring_to = scrollSubstringToCB;
     aIface->scroll_substring_to_point = scrollSubstringToPointCB;
   }
 
   // Cache the string values of the atk text attribute names.
-  for (uint32_t i = 0; i < ArrayLength(sAtkTextAttrNames); i++)
+  for (uint32_t i = 0; i < ArrayLength(sAtkTextAttrNames); i++) {
     sAtkTextAttrNames[i] =
         atk_text_attribute_get_name(static_cast<AtkTextAttribute>(i));
+  }
 }
--- a/accessible/atk/nsMaiInterfaceValue.cpp
+++ b/accessible/atk/nsMaiInterfaceValue.cpp
@@ -78,18 +78,19 @@ static void getMinimumIncrementCB(AtkVal
     proxy = GetProxy(ATK_OBJECT(obj));
     if (!proxy) {
       return;
     }
   }
 
   memset(minimumIncrement, 0, sizeof(GValue));
   double accValue = accWrap ? accWrap->Step() : proxy->Step();
-  if (IsNaN(accValue))
+  if (IsNaN(accValue)) {
     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) {
   ProxyAccessible* proxy = nullptr;
   AccessibleWrap* accWrap = GetAccessibleWrap(ATK_OBJECT(obj));
--- a/accessible/base/ARIAMap.cpp
+++ b/accessible/base/ARIAMap.cpp
@@ -1444,19 +1444,21 @@ uint64_t aria::UniversalStatesFor(mozill
   uint64_t state = 0;
   uint32_t index = 0;
   while (MapToState(sWAIUnivStateMap[index], aElement, &state)) index++;
 
   return state;
 }
 
 uint8_t aria::AttrCharacteristicsFor(nsAtom* aAtom) {
-  for (uint32_t i = 0; i < ArrayLength(gWAIUnivAttrMap); i++)
-    if (gWAIUnivAttrMap[i].attributeName == aAtom)
+  for (uint32_t i = 0; i < ArrayLength(gWAIUnivAttrMap); i++) {
+    if (gWAIUnivAttrMap[i].attributeName == aAtom) {
       return gWAIUnivAttrMap[i].characteristics;
+    }
+  }
 
   return 0;
 }
 
 bool aria::HasDefinedARIAHidden(nsIContent* aContent) {
   return aContent && aContent->IsElement() &&
          aContent->AsElement()->AttrValueIs(kNameSpaceID_None,
                                             nsGkAtoms::aria_hidden,
@@ -1476,22 +1478,24 @@ bool AttrIterator::Next(nsAString& aAttr
     const nsAttrName* attr = mElement->GetAttrNameAt(mAttrIdx);
     mAttrIdx++;
     if (attr->NamespaceEquals(kNameSpaceID_None)) {
       nsAtom* attrAtom = attr->Atom();
       nsDependentAtomString attrStr(attrAtom);
       if (!StringBeginsWith(attrStr, u"aria-"_ns)) continue;  // Not ARIA
 
       uint8_t attrFlags = aria::AttrCharacteristicsFor(attrAtom);
-      if (attrFlags & ATTR_BYPASSOBJ)
+      if (attrFlags & ATTR_BYPASSOBJ) {
         continue;  // No need to handle exposing as obj attribute here
+      }
 
       if ((attrFlags & ATTR_VALTOKEN) &&
-          !nsAccUtils::HasDefinedARIAToken(mElement, attrAtom))
+          !nsAccUtils::HasDefinedARIAToken(mElement, attrAtom)) {
         continue;  // only expose token based attributes if they are defined
+      }
 
       if ((attrFlags & ATTR_BYPASSOBJ_IF_FALSE) &&
           mElement->AttrValueIs(kNameSpaceID_None, attrAtom, nsGkAtoms::_false,
                                 eCaseMatters)) {
         continue;  // only expose token based attribute if value is not 'false'.
       }
 
       nsAutoString value;
--- a/accessible/base/ARIAStateMap.cpp
+++ b/accessible/base/ARIAStateMap.cpp
@@ -261,28 +261,30 @@ bool aria::MapToState(EStateRule aRule, 
     case eReadonlyUntilEditable: {
       if (!(*aState & states::EDITABLE)) *aState |= states::READONLY;
 
       return true;
     }
 
     case eIndeterminateIfNoValue: {
       if (!aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_valuenow) &&
-          !aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_valuetext))
+          !aElement->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_valuetext)) {
         *aState |= states::MIXED;
+      }
 
       return true;
     }
 
     case eFocusableUntilDisabled: {
       if (!nsAccUtils::HasDefinedARIAToken(aElement,
                                            nsGkAtoms::aria_disabled) ||
           aElement->AttrValueIs(kNameSpaceID_None, nsGkAtoms::aria_disabled,
-                                nsGkAtoms::_false, eCaseMatters))
+                                nsGkAtoms::_false, eCaseMatters)) {
         *aState |= states::FOCUSABLE;
+      }
 
       return true;
     }
 
     default:
       return false;
   }
 }
@@ -303,28 +305,30 @@ static void MapEnumType(dom::Element* aE
   }
 }
 
 static void MapTokenType(dom::Element* aElement, uint64_t* aState,
                          const TokenTypeData& aData) {
   if (nsAccUtils::HasDefinedARIAToken(aElement, aData.mAttrName)) {
     if (aElement->AttrValueIs(kNameSpaceID_None, aData.mAttrName,
                               nsGkAtoms::mixed, eCaseMatters)) {
-      if (aData.mType & eMixedType)
+      if (aData.mType & eMixedType) {
         *aState |= aData.mPermanentState | states::MIXED;
-      else  // unsupported use of 'mixed' is an authoring error
+      } else {  // unsupported use of 'mixed' is an authoring error
         *aState |= aData.mPermanentState | aData.mFalseState;
+      }
       return;
     }
 
     if (aElement->AttrValueIs(kNameSpaceID_None, aData.mAttrName,
                               nsGkAtoms::_false, eCaseMatters)) {
       *aState |= aData.mPermanentState | aData.mFalseState;
       return;
     }
 
     *aState |= aData.mPermanentState | aData.mTrueState;
     return;
   }
 
-  if (aData.mType & eDefinedIfAbsent)
+  if (aData.mType & eDefinedIfAbsent) {
     *aState |= aData.mPermanentState | aData.mFalseState;
+  }
 }
--- a/accessible/base/AccEvent.cpp
+++ b/accessible/base/AccEvent.cpp
@@ -32,20 +32,21 @@ static_assert(static_cast<bool>(eNoUserI
 ////////////////////////////////////////////////////////////////////////////////
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccEvent constructors
 
 AccEvent::AccEvent(uint32_t aEventType, Accessible* aAccessible,
                    EIsFromUserInput aIsFromUserInput, EEventRule aEventRule)
     : mEventType(aEventType), mEventRule(aEventRule), mAccessible(aAccessible) {
-  if (aIsFromUserInput == eAutoDetect)
+  if (aIsFromUserInput == eAutoDetect) {
     mIsFromUserInput = dom::UserActivation::IsHandlingUserInput();
-  else
+  } else {
     mIsFromUserInput = aIsFromUserInput == eFromUserInput ? true : false;
+  }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccEvent cycle collection
 
 NS_IMPL_CYCLE_COLLECTION_CLASS(AccEvent)
 
 NS_IMPL_CYCLE_COLLECTION_UNLINK_BEGIN(AccEvent)
@@ -152,20 +153,21 @@ AccSelChangeEvent::AccSelChangeEvent(Acc
                                      SelChangeType aSelChangeType)
     : AccEvent(0, aItem, eAutoDetect, eCoalesceSelectionChange),
       mWidget(aWidget),
       mItem(aItem),
       mSelChangeType(aSelChangeType),
       mPreceedingCount(0),
       mPackedEvent(nullptr) {
   if (aSelChangeType == eSelectionAdd) {
-    if (mWidget->GetSelectedItem(1))
+    if (mWidget->GetSelectedItem(1)) {
       mEventType = nsIAccessibleEvent::EVENT_SELECTION_ADD;
-    else
+    } else {
       mEventType = nsIAccessibleEvent::EVENT_SELECTION;
+    }
   } else {
     mEventType = nsIAccessibleEvent::EVENT_SELECTION_REMOVE;
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // AccTableChangeEvent
 ////////////////////////////////////////////////////////////////////////////////
--- a/accessible/base/AccGroupInfo.cpp
+++ b/accessible/base/AccGroupInfo.cpp
@@ -148,39 +148,43 @@ void AccGroupInfo::Update() {
 }
 
 Accessible* AccGroupInfo::FirstItemOf(const Accessible* aContainer) {
   // ARIA tree can be arranged by ARIA groups case #1 (previous sibling of a
   // group is a parent) or by aria-level.
   a11y::role containerRole = aContainer->Role();
   Accessible* item = aContainer->LocalNextSibling();
   if (item) {
-    if (containerRole == roles::OUTLINEITEM && item->Role() == roles::GROUPING)
+    if (containerRole == roles::OUTLINEITEM &&
+        item->Role() == roles::GROUPING) {
       item = item->LocalFirstChild();
+    }
 
     if (item) {
       AccGroupInfo* itemGroupInfo = item->GetGroupInfo();
-      if (itemGroupInfo && itemGroupInfo->ConceptualParent() == aContainer)
+      if (itemGroupInfo && itemGroupInfo->ConceptualParent() == aContainer) {
         return item;
+      }
     }
   }
 
   // ARIA list and tree can be arranged by ARIA groups case #2 (group is
   // a child of an item).
   item = aContainer->LocalLastChild();
   if (!item) return nullptr;
 
   if (item->Role() == roles::GROUPING &&
       (containerRole == roles::LISTITEM ||
        containerRole == roles::OUTLINEITEM)) {
     item = item->LocalFirstChild();
     if (item) {
       AccGroupInfo* itemGroupInfo = item->GetGroupInfo();
-      if (itemGroupInfo && itemGroupInfo->ConceptualParent() == aContainer)
+      if (itemGroupInfo && itemGroupInfo->ConceptualParent() == aContainer) {
         return item;
+      }
     }
   }
 
   // Otherwise, it can be a direct child if the container is a list or tree.
   item = aContainer->LocalFirstChild();
   if (ShouldReportRelations(item->Role(), containerRole)) return item;
 
   return nullptr;
--- a/accessible/base/AccGroupInfo.h
+++ b/accessible/base/AccGroupInfo.h
@@ -51,18 +51,19 @@ class AccGroupInfo {
         role != mozilla::a11y::roles::COMBOBOX_OPTION &&
         role != mozilla::a11y::roles::RICH_OPTION &&
         role != mozilla::a11y::roles::CHECK_RICH_OPTION &&
         role != mozilla::a11y::roles::PARENT_MENUITEM &&
         role != mozilla::a11y::roles::CHECK_MENU_ITEM &&
         role != mozilla::a11y::roles::RADIO_MENU_ITEM &&
         role != mozilla::a11y::roles::RADIOBUTTON &&
         role != mozilla::a11y::roles::PAGETAB &&
-        role != mozilla::a11y::roles::COMMENT)
+        role != mozilla::a11y::roles::COMMENT) {
       return nullptr;
+    }
 
     AccGroupInfo* info = new AccGroupInfo(aAccessible, BaseRole(role));
     return info;
   }
 
   /**
    * Return a first item for the given container.
    */
@@ -85,21 +86,23 @@ class AccGroupInfo {
  private:
   AccGroupInfo() = delete;
   AccGroupInfo(const AccGroupInfo&) = delete;
   AccGroupInfo& operator=(const AccGroupInfo&) = delete;
 
   static mozilla::a11y::role BaseRole(mozilla::a11y::role aRole) {
     if (aRole == mozilla::a11y::roles::CHECK_MENU_ITEM ||
         aRole == mozilla::a11y::roles::PARENT_MENUITEM ||
-        aRole == mozilla::a11y::roles::RADIO_MENU_ITEM)
+        aRole == mozilla::a11y::roles::RADIO_MENU_ITEM) {
       return mozilla::a11y::roles::MENUITEM;
+    }
 
-    if (aRole == mozilla::a11y::roles::CHECK_RICH_OPTION)
+    if (aRole == mozilla::a11y::roles::CHECK_RICH_OPTION) {
       return mozilla::a11y::roles::RICH_OPTION;
+    }
 
     return aRole;
   }
 
   /**
    * Return true if the given parent and child roles should have their node
    * relations reported.
    */
--- a/accessible/base/AccIterator.cpp
+++ b/accessible/base/AccIterator.cpp
@@ -318,18 +318,19 @@ XULTreeItemIterator::XULTreeItemIterator
   if (aRowIdx != -1) mTreeView->GetLevel(aRowIdx, &mContainerLevel);
 }
 
 Accessible* XULTreeItemIterator::Next() {
   while (mCurrRowIdx < mRowCount) {
     int32_t level = 0;
     mTreeView->GetLevel(mCurrRowIdx, &level);
 
-    if (level == mContainerLevel + 1)
+    if (level == mContainerLevel + 1) {
       return mXULTree->GetTreeItemAccessible(mCurrRowIdx++);
+    }
 
     if (level <= mContainerLevel) {  // got level up
       mCurrRowIdx = mRowCount;
       break;
     }
 
     mCurrRowIdx++;
   }
--- a/accessible/base/DocManager.cpp
+++ b/accessible/base/DocManager.cpp
@@ -197,19 +197,20 @@ bool DocManager::Init() {
                                 nsIWebProgress::NOTIFY_STATE_DOCUMENT);
 
   return true;
 }
 
 void DocManager::Shutdown() {
   nsCOMPtr<nsIWebProgress> progress = components::DocLoader::Service();
 
-  if (progress)
+  if (progress) {
     progress->RemoveProgressListener(
         static_cast<nsIWebProgressListener*>(this));
+  }
 
   ClearDocCache();
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsISupports
 
 NS_IMPL_ISUPPORTS(DocManager, nsIWebProgressListener, nsIDOMEventListener,
@@ -219,63 +220,67 @@ NS_IMPL_ISUPPORTS(DocManager, nsIWebProg
 // nsIWebProgressListener
 
 NS_IMETHODIMP
 DocManager::OnStateChange(nsIWebProgress* aWebProgress, nsIRequest* aRequest,
                           uint32_t aStateFlags, nsresult aStatus) {
   NS_ASSERTION(aStateFlags & STATE_IS_DOCUMENT, "Other notifications excluded");
 
   if (nsAccessibilityService::IsShutdown() || !aWebProgress ||
-      (aStateFlags & (STATE_START | STATE_STOP)) == 0)
+      (aStateFlags & (STATE_START | STATE_STOP)) == 0) {
     return NS_OK;
+  }
 
   nsCOMPtr<mozIDOMWindowProxy> DOMWindow;
   aWebProgress->GetDOMWindow(getter_AddRefs(DOMWindow));
   NS_ENSURE_STATE(DOMWindow);
 
   nsPIDOMWindowOuter* piWindow = nsPIDOMWindowOuter::From(DOMWindow);
   MOZ_ASSERT(piWindow);
 
   nsCOMPtr<Document> document = piWindow->GetDoc();
   NS_ENSURE_STATE(document);
 
   // Document was loaded.
   if (aStateFlags & STATE_STOP) {
 #ifdef A11Y_LOG
-    if (logging::IsEnabled(logging::eDocLoad))
+    if (logging::IsEnabled(logging::eDocLoad)) {
       logging::DocLoad("document loaded", aWebProgress, aRequest, aStateFlags);
+    }
 #endif
 
     // Figure out an event type to notify the document has been loaded.
     uint32_t eventType = nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED;
 
     // Some XUL documents get start state and then stop state with failure
     // status when everything is ok. Fire document load complete event in this
     // case.
-    if (NS_SUCCEEDED(aStatus) || !nsCoreUtils::IsContentDocument(document))
+    if (NS_SUCCEEDED(aStatus) || !nsCoreUtils::IsContentDocument(document)) {
       eventType = nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE;
+    }
 
     // If end consumer has been retargeted for loaded content then do not fire
     // any event because it means no new document has been loaded, for example,
     // it happens when user clicks on file link.
     if (aRequest) {
       uint32_t loadFlags = 0;
       aRequest->GetLoadFlags(&loadFlags);
       if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI) eventType = 0;
     }
 
     HandleDOMDocumentLoad(document, eventType);
     return NS_OK;
   }
 
   // Document loading was started.
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eDocLoad))
+  if (logging::IsEnabled(logging::eDocLoad)) {
     logging::DocLoad("start document loading", aWebProgress, aRequest,
                      aStateFlags);
+  }
 #endif
 
   DocAccessible* docAcc = GetExistingDocAccessible(document);
   if (!docAcc) return NS_OK;
 
   nsCOMPtr<nsIWebNavigation> webNav(do_GetInterface(DOMWindow));
   nsCOMPtr<nsIDocShell> docShell(do_QueryInterface(webNav));
   NS_ENSURE_STATE(docShell);
@@ -345,18 +350,19 @@ DocManager::HandleEvent(Event* aEvent) {
 
   if (type.EqualsLiteral("pagehide")) {
     // 'pagehide' event is registered on every DOM document we create an
     // accessible for, process the event for the target. This document
     // accessible and all its sub document accessible are shutdown as result of
     // processing.
 
 #ifdef A11Y_LOG
-    if (logging::IsEnabled(logging::eDocDestroy))
+    if (logging::IsEnabled(logging::eDocDestroy)) {
       logging::DocDestroy("received 'pagehide' event", document);
+    }
 #endif
 
     // Shutdown this one and sub document accessibles.
 
     // We're allowed to not remove listeners when accessible document is
     // shutdown since we don't keep strong reference on chrome event target and
     // listeners are removed automatically when chrome event target goes away.
     DocAccessible* docAccessible = GetExistingDocAccessible(document);
@@ -365,18 +371,19 @@ DocManager::HandleEvent(Event* aEvent) {
     return NS_OK;
   }
 
   // XXX: handle error pages loading separately since they get neither
   // webprogress notifications nor 'pageshow' event.
   if (type.EqualsLiteral("DOMContentLoaded") &&
       nsCoreUtils::IsErrorPage(document)) {
 #ifdef A11Y_LOG
-    if (logging::IsEnabled(logging::eDocLoad))
+    if (logging::IsEnabled(logging::eDocLoad)) {
       logging::DocLoad("handled 'DOMContentLoaded' event", document);
+    }
 #endif
 
     HandleDOMDocumentLoad(document,
                           nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE);
   }
 
   return NS_OK;
 }
@@ -400,26 +407,28 @@ void DocManager::HandleDOMDocumentLoad(D
 void DocManager::AddListeners(Document* aDocument,
                               bool aAddDOMContentLoadedListener) {
   nsPIDOMWindowOuter* window = aDocument->GetWindow();
   EventTarget* target = window->GetChromeEventHandler();
   EventListenerManager* elm = target->GetOrCreateListenerManager();
   elm->AddEventListenerByType(this, u"pagehide"_ns, TrustedEventsAtCapture());
 
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eDocCreate))
+  if (logging::IsEnabled(logging::eDocCreate)) {
     logging::Text("added 'pagehide' listener");
+  }
 #endif
 
   if (aAddDOMContentLoadedListener) {
     elm->AddEventListenerByType(this, u"DOMContentLoaded"_ns,
                                 TrustedEventsAtCapture());
 #ifdef A11Y_LOG
-    if (logging::IsEnabled(logging::eDocCreate))
+    if (logging::IsEnabled(logging::eDocCreate)) {
       logging::Text("added 'DOMContentLoaded' listener");
+    }
 #endif
   }
 }
 
 void DocManager::RemoveListeners(Document* aDocument) {
   nsPIDOMWindowOuter* window = aDocument->GetWindow();
   if (!window) return;
 
--- a/accessible/base/EmbeddedObjCollector.cpp
+++ b/accessible/base/EmbeddedObjCollector.cpp
@@ -45,18 +45,19 @@ int32_t EmbeddedObjCollector::EnsureNGet
 
   return -1;
 }
 
 int32_t EmbeddedObjCollector::GetIndexAt(Accessible* aAccessible) {
   if (aAccessible->mParent != mRoot) return -1;
 
   MOZ_ASSERT(!aAccessible->IsProxy());
-  if (aAccessible->mInt.mIndexOfEmbeddedChild != -1)
+  if (aAccessible->mInt.mIndexOfEmbeddedChild != -1) {
     return aAccessible->mInt.mIndexOfEmbeddedChild;
+  }
 
   return !aAccessible->IsText() ? EnsureNGetIndex(aAccessible) : -1;
 }
 
 void EmbeddedObjCollector::AppendObject(Accessible* aAccessible) {
   MOZ_ASSERT(!aAccessible->IsProxy());
   aAccessible->mInt.mIndexOfEmbeddedChild = mObjects.Length();
   mObjects.AppendElement(aAccessible);
--- a/accessible/base/EventQueue.cpp
+++ b/accessible/base/EventQueue.cpp
@@ -162,18 +162,19 @@ void EventQueue::CoalesceEvents() {
         AccEvent* thisEvent = mEvents[index];
         if (thisEvent->mEventRule != AccEvent::eDoNotEmit &&
             thisEvent->mEventType == tailEvent->mEventType &&
             thisEvent->mAccessible == tailEvent->mAccessible) {
           AccStateChangeEvent* thisSCEvent = downcast_accEvent(thisEvent);
           AccStateChangeEvent* tailSCEvent = downcast_accEvent(tailEvent);
           if (thisSCEvent->mState == tailSCEvent->mState) {
             thisEvent->mEventRule = AccEvent::eDoNotEmit;
-            if (thisSCEvent->mIsEnabled != tailSCEvent->mIsEnabled)
+            if (thisSCEvent->mIsEnabled != tailSCEvent->mIsEnabled) {
               tailEvent->mEventRule = AccEvent::eDoNotEmit;
+            }
           }
         }
       }
       break;  // eCoalesceStateChange
     }
 
     case AccEvent::eCoalesceTextSelChange: {
       // Coalesce older event by newer event for the same selection or target.
@@ -182,18 +183,19 @@ void EventQueue::CoalesceEvents() {
       // bug 927159).
       for (uint32_t index = tail - 1; index < tail; index--) {
         AccEvent* thisEvent = mEvents[index];
         if (thisEvent->mEventRule != AccEvent::eDoNotEmit &&
             thisEvent->mEventType == tailEvent->mEventType) {
           AccTextSelChangeEvent* thisTSCEvent = downcast_accEvent(thisEvent);
           AccTextSelChangeEvent* tailTSCEvent = downcast_accEvent(tailEvent);
           if (thisTSCEvent->mSel == tailTSCEvent->mSel ||
-              thisEvent->mAccessible == tailEvent->mAccessible)
+              thisEvent->mAccessible == tailEvent->mAccessible) {
             thisEvent->mEventRule = AccEvent::eDoNotEmit;
+          }
         }
       }
       break;  // eCoalesceTextSelChange
     }
 
     case AccEvent::eRemoveDupes: {
       // Check for repeat events, coalesce newly appended event by more older
       // event.
@@ -228,18 +230,19 @@ void EventQueue::CoalesceSelChangeEvents
 
     // Do not emit any preceding selection events for same widget if they
     // weren't coalesced yet.
     if (aThisEvent->mEventType != nsIAccessibleEvent::EVENT_SELECTION_WITHIN) {
       for (uint32_t jdx = aThisIndex - 1; jdx < aThisIndex; jdx--) {
         AccEvent* prevEvent = mEvents[jdx];
         if (prevEvent->mEventRule == aTailEvent->mEventRule) {
           AccSelChangeEvent* prevSelChangeEvent = downcast_accEvent(prevEvent);
-          if (prevSelChangeEvent->mWidget == aTailEvent->mWidget)
+          if (prevSelChangeEvent->mWidget == aTailEvent->mWidget) {
             prevSelChangeEvent->mEventRule = AccEvent::eDoNotEmit;
+          }
         }
       }
     }
     return;
   }
 
   // Pack sequential selection remove and selection add events into
   // single selection change event.
@@ -282,18 +285,19 @@ void EventQueue::CoalesceSelChangeEvents
             ? nsIAccessibleEvent::EVENT_SELECTION_ADD
             : nsIAccessibleEvent::EVENT_SELECTION_REMOVE;
 
     return;
   }
 
   // Convert into selection add since control has single selection but other
   // selection events for this control are queued.
-  if (aTailEvent->mEventType == nsIAccessibleEvent::EVENT_SELECTION)
+  if (aTailEvent->mEventType == nsIAccessibleEvent::EVENT_SELECTION) {
     aTailEvent->mEventType = nsIAccessibleEvent::EVENT_SELECTION_ADD;
+  }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // EventQueue: event queue
 
 void EventQueue::ProcessEventQueue() {
   // Process only currently queued events.
   const nsTArray<RefPtr<AccEvent> > events = std::move(mEvents);
--- a/accessible/base/Filters.cpp
+++ b/accessible/base/Filters.cpp
@@ -14,18 +14,19 @@ using namespace mozilla::a11y::filters;
 
 uint32_t filters::GetSelected(Accessible* aAccessible) {
   if (aAccessible->State() & states::SELECTED) return eMatch | eSkipSubtree;
 
   return eSkip;
 }
 
 uint32_t filters::GetSelectable(Accessible* aAccessible) {
-  if (aAccessible->InteractiveState() & states::SELECTABLE)
+  if (aAccessible->InteractiveState() & states::SELECTABLE) {
     return eMatch | eSkipSubtree;
+  }
 
   return eSkip;
 }
 
 uint32_t filters::GetRow(Accessible* aAccessible) {
   if (aAccessible->IsTableRow()) return eMatch | eSkipSubtree;
 
   // Look for rows inside rowgroup or wrapping text containers.
--- a/accessible/base/FocusManager.cpp
+++ b/accessible/base/FocusManager.cpp
@@ -101,80 +101,86 @@ FocusManager::FocusDisposition FocusMana
 }
 
 bool FocusManager::WasLastFocused(const Accessible* aAccessible) const {
   return mLastFocus == aAccessible;
 }
 
 void FocusManager::NotifyOfDOMFocus(nsISupports* aTarget) {
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eFocus))
+  if (logging::IsEnabled(logging::eFocus)) {
     logging::FocusNotificationTarget("DOM focus", "Target", aTarget);
+  }
 #endif
 
   mActiveItem = nullptr;
 
   nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTarget));
   if (targetNode) {
     DocAccessible* document =
         GetAccService()->GetDocAccessible(targetNode->OwnerDoc());
     if (document) {
       // Set selection listener for focused element.
-      if (targetNode->IsElement())
+      if (targetNode->IsElement()) {
         SelectionMgr()->SetControlSelectionListener(targetNode->AsElement());
+      }
 
       document->HandleNotification<FocusManager, nsINode>(
           this, &FocusManager::ProcessDOMFocus, targetNode);
     }
   }
 }
 
 void FocusManager::NotifyOfDOMBlur(nsISupports* aTarget) {
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eFocus))
+  if (logging::IsEnabled(logging::eFocus)) {
     logging::FocusNotificationTarget("DOM blur", "Target", aTarget);
+  }
 #endif
 
   mActiveItem = nullptr;
 
   // If DOM document stays focused then fire accessible focus event to process
   // the case when no element within this DOM document will be focused.
   nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTarget));
   if (targetNode && targetNode->OwnerDoc() == FocusedDOMDocument()) {
     dom::Document* DOMDoc = targetNode->OwnerDoc();
     DocAccessible* document = GetAccService()->GetDocAccessible(DOMDoc);
     if (document) {
       // Clear selection listener for previously focused element.
-      if (targetNode->IsElement())
+      if (targetNode->IsElement()) {
         SelectionMgr()->ClearControlSelectionListener();
+      }
 
       document->HandleNotification<FocusManager, nsINode>(
           this, &FocusManager::ProcessDOMFocus, DOMDoc);
     }
   }
 }
 
 void FocusManager::ActiveItemChanged(Accessible* aItem, bool aCheckIfActive) {
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eFocus))
+  if (logging::IsEnabled(logging::eFocus)) {
     logging::FocusNotificationTarget("active item changed", "Item", aItem);
+  }
 #endif
 
   // Nothing changed, happens for XUL trees and HTML selects.
   if (aItem && aItem == mActiveItem) return;
 
   mActiveItem = nullptr;
 
   if (aItem && aCheckIfActive) {
     Accessible* widget = aItem->ContainerWidget();
 #ifdef A11Y_LOG
     if (logging::IsEnabled(logging::eFocus)) logging::ActiveWidget(widget);
 #endif
-    if (!widget || !widget->IsActiveWidget() || !widget->AreItemsOperable())
+    if (!widget || !widget->IsActiveWidget() || !widget->AreItemsOperable()) {
       return;
+    }
   }
   mActiveItem = aItem;
 
   // If mActiveItem is null we may need to shift a11y focus back to a remote
   // document. For example, when combobox popup is closed, then
   // the focus should be moved back to the combobox.
   if (!mActiveItem && XRE_IsParentProcess()) {
     dom::BrowserParent* browser = dom::BrowserParent::GetFocused();
@@ -220,18 +226,19 @@ void FocusManager::DispatchFocusEvent(Do
 #ifdef A11Y_LOG
     if (logging::IsEnabled(logging::eFocus)) logging::FocusDispatched(aTarget);
 #endif
   }
 }
 
 void FocusManager::ProcessDOMFocus(nsINode* aTarget) {
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eFocus))
+  if (logging::IsEnabled(logging::eFocus)) {
     logging::FocusNotificationTarget("process DOM focus", "Target", aTarget);
+  }
 #endif
 
   DocAccessible* document =
       GetAccService()->GetDocAccessible(aTarget->OwnerDoc());
   if (!document) return;
 
   Accessible* target =
       document->GetAccessibleEvenIfNotInMapOrContainer(aTarget);
@@ -325,18 +332,19 @@ void FocusManager::ProcessFocusEvent(Acc
         new AccEvent(nsIAccessibleEvent::EVENT_MENU_END, mActiveARIAMenubar,
                      aEvent->FromUserInput());
     nsEventShell::FireEvent(menuEndEvent);
 
     mActiveARIAMenubar = nullptr;
   }
 
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eFocus))
+  if (logging::IsEnabled(logging::eFocus)) {
     logging::FocusNotificationTarget("fire focus event", "Target", target);
+  }
 #endif
 
   // Reset cached caret value. The cache will be updated upon processing the
   // next caret move event. This ensures that we will return the correct caret
   // offset before the caret move event is handled.
   SelectionMgr()->ResetCaretOffset();
 
   RefPtr<AccEvent> focusEvent = new AccEvent(nsIAccessibleEvent::EVENT_FOCUS,
--- a/accessible/base/Logging.cpp
+++ b/accessible/base/Logging.cpp
@@ -304,60 +304,65 @@ static void LogRequest(nsIRequest* aRequ
   if (aRequest) {
     nsAutoCString name;
     aRequest->GetName(name);
     printf("    request spec: %s\n", name.get());
     uint32_t loadFlags = 0;
     aRequest->GetLoadFlags(&loadFlags);
     printf("    request load flags: %x; ", loadFlags);
     if (loadFlags & nsIChannel::LOAD_DOCUMENT_URI) printf("document uri; ");
-    if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI)
+    if (loadFlags & nsIChannel::LOAD_RETARGETED_DOCUMENT_URI) {
       printf("retargeted document uri; ");
+    }
     if (loadFlags & nsIChannel::LOAD_REPLACE) printf("replace; ");
-    if (loadFlags & nsIChannel::LOAD_INITIAL_DOCUMENT_URI)
+    if (loadFlags & nsIChannel::LOAD_INITIAL_DOCUMENT_URI) {
       printf("initial document uri; ");
+    }
     if (loadFlags & nsIChannel::LOAD_TARGETED) printf("targeted; ");
-    if (loadFlags & nsIChannel::LOAD_CALL_CONTENT_SNIFFERS)
+    if (loadFlags & nsIChannel::LOAD_CALL_CONTENT_SNIFFERS) {
       printf("call content sniffers; ");
+    }
     if (loadFlags & nsIChannel::LOAD_BYPASS_URL_CLASSIFIER) {
       printf("bypass classify uri; ");
     }
   } else {
     printf("    no request");
   }
 }
 
 static void LogDocAccState(DocAccessible* aDocument) {
   printf("document acc state: ");
-  if (aDocument->HasLoadState(DocAccessible::eCompletelyLoaded))
+  if (aDocument->HasLoadState(DocAccessible::eCompletelyLoaded)) {
     printf("completely loaded;");
-  else if (aDocument->HasLoadState(DocAccessible::eReady))
+  } else if (aDocument->HasLoadState(DocAccessible::eReady)) {
     printf("ready;");
-  else if (aDocument->HasLoadState(DocAccessible::eDOMLoaded))
+  } else if (aDocument->HasLoadState(DocAccessible::eDOMLoaded)) {
     printf("DOM loaded;");
-  else if (aDocument->HasLoadState(DocAccessible::eTreeConstructed))
+  } else if (aDocument->HasLoadState(DocAccessible::eTreeConstructed)) {
     printf("tree constructed;");
+  }
 }
 
 static void GetDocLoadEventType(AccEvent* aEvent, nsACString& aEventType) {
   uint32_t type = aEvent->GetEventType();
   if (type == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_STOPPED) {
     aEventType.AssignLiteral("load stopped");
   } else if (type == nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE) {
     aEventType.AssignLiteral("load complete");
   } else if (type == nsIAccessibleEvent::EVENT_DOCUMENT_RELOAD) {
     aEventType.AssignLiteral("reload");
   } else if (type == nsIAccessibleEvent::EVENT_STATE_CHANGE) {
     AccStateChangeEvent* event = downcast_accEvent(aEvent);
     if (event->GetState() == states::BUSY) {
       aEventType.AssignLiteral("busy ");
-      if (event->IsStateEnabled())
+      if (event->IsStateEnabled()) {
         aEventType.AppendLiteral("true");
-      else
+      } else {
         aEventType.AppendLiteral("false");
+      }
     }
   }
 }
 
 static void DescribeNode(nsINode* aNode, nsAString& aOutDescription) {
   if (!aNode) {
     aOutDescription.AppendLiteral("null");
     return;
@@ -555,21 +560,22 @@ void logging::FocusNotificationTarget(co
 
 void logging::FocusNotificationTarget(const char* aMsg,
                                       const char* aTargetDescr,
                                       nsISupports* aTargetThing) {
   MsgBegin(sFocusTitle, "%s", aMsg);
 
   if (aTargetThing) {
     nsCOMPtr<nsINode> targetNode(do_QueryInterface(aTargetThing));
-    if (targetNode)
+    if (targetNode) {
       AccessibleNNode(aTargetDescr, targetNode);
-    else
+    } else {
       printf("    %s: %p, window\n", aTargetDescr,
              static_cast<void*>(aTargetThing));
+    }
   }
 
   MsgEnd();
 }
 
 void logging::ActiveItemChangeCausedBy(const char* aCause,
                                        Accessible* aTarget) {
   SubMsgBegin();
@@ -595,22 +601,23 @@ void logging::FocusDispatched(Accessible
   SubMsgEnd();
 }
 
 void logging::SelChange(dom::Selection* aSelection, DocAccessible* aDocument,
                         int16_t aReason) {
   SelectionType type = aSelection->GetType();
 
   const char* strType = 0;
-  if (type == SelectionType::eNormal)
+  if (type == SelectionType::eNormal) {
     strType = "normal";
-  else if (type == SelectionType::eSpellCheck)
+  } else if (type == SelectionType::eSpellCheck) {
     strType = "spellcheck";
-  else
+  } else {
     strType = "unknown";
+  }
 
   bool isIgnored = !aDocument || !aDocument->IsContentLoaded();
   printf(
       "\nSelection changed, selection type: %s, notification %s, reason: %d\n",
       strType, (isIgnored ? "ignored" : "pending"), aReason);
 
   Stack();
 }
@@ -906,18 +913,19 @@ void logging::Stack() {
 bool logging::IsEnabled(uint32_t aModules) { return sModules & aModules; }
 
 bool logging::IsEnabledAll(uint32_t aModules) {
   return (sModules & aModules) == aModules;
 }
 
 bool logging::IsEnabled(const nsAString& aModuleStr) {
   for (unsigned int idx = 0; idx < ArrayLength(sModuleMap); idx++) {
-    if (aModuleStr.EqualsASCII(sModuleMap[idx].mStr))
+    if (aModuleStr.EqualsASCII(sModuleMap[idx].mStr)) {
       return sModules & sModuleMap[idx].mModule;
+    }
   }
 
   return false;
 }
 
 void logging::Enable(const nsCString& aModules) {
   EnableLogging(aModules.get());
 }
--- a/accessible/base/NotificationController.cpp
+++ b/accessible/base/NotificationController.cpp
@@ -81,18 +81,19 @@ void NotificationController::Shutdown() 
   if (mObservingState != eNotObservingRefresh &&
       mPresShell->RemoveRefreshObserver(this, FlushType::Display)) {
     mObservingState = eNotObservingRefresh;
   }
 
   // Shutdown handling child documents.
   int32_t childDocCount = mHangingChildDocuments.Length();
   for (int32_t idx = childDocCount - 1; idx >= 0; idx--) {
-    if (!mHangingChildDocuments[idx]->IsDefunct())
+    if (!mHangingChildDocuments[idx]->IsDefunct()) {
       mHangingChildDocuments[idx]->Shutdown();
+    }
   }
 
   mHangingChildDocuments.Clear();
 
   mDocument = nullptr;
   mPresShell = nullptr;
 
   mTextHash.Clear();
@@ -432,18 +433,19 @@ void NotificationController::ScheduleCon
   }
 }
 
 void NotificationController::ScheduleProcessing() {
   // If notification flush isn't planed yet start notification flush
   // asynchronously (after style and layout).
   if (mObservingState == eNotObservingRefresh) {
     if (mPresShell->AddRefreshObserver(this, FlushType::Display,
-                                       "Accessibility notifications"))
+                                       "Accessibility notifications")) {
       mObservingState = eRefreshObserving;
+    }
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // NotificationCollector: protected
 
 bool NotificationController::IsUpdatePending() {
   return mPresShell->IsLayoutFlushObserver() ||
--- a/accessible/base/NotificationController.h
+++ b/accessible/base/NotificationController.h
@@ -212,18 +212,19 @@ class NotificationController final : pub
   template <class Class, class... Args>
   inline void HandleNotification(
       Class* aInstance,
       typename TNotification<Class, Args...>::Callback aMethod,
       Args*... aArgs) {
     if (!IsUpdatePending()) {
 #ifdef A11Y_LOG
       if (mozilla::a11y::logging::IsEnabled(
-              mozilla::a11y::logging::eNotifications))
+              mozilla::a11y::logging::eNotifications)) {
         mozilla::a11y::logging::Text("sync notification processing");
+      }
 #endif
       (aInstance->*aMethod)(aArgs...);
       return;
     }
 
     RefPtr<Notification> notification =
         new TNotification<Class, Args...>(aInstance, aMethod, aArgs...);
     if (notification) {
--- a/accessible/base/Relation.h
+++ b/accessible/base/Relation.h
@@ -42,20 +42,21 @@ class Relation {
   Relation& operator=(Relation&& aRH) {
     mFirstIter = std::move(aRH.mFirstIter);
     mLastIter = aRH.mLastIter;
     aRH.mLastIter = nullptr;
     return *this;
   }
 
   inline void AppendIter(AccIterable* aIter) {
-    if (mLastIter)
+    if (mLastIter) {
       mLastIter->mNextIter.reset(aIter);
-    else
+    } else {
       mFirstIter.reset(aIter);
+    }
 
     mLastIter = aIter;
   }
 
   /**
    * Append the given accessible to the set of related accessibles.
    */
   inline void AppendTarget(Accessible* aAcc) {
@@ -71,18 +72,19 @@ class Relation {
   }
 
   /**
    * compute and return the next related accessible.
    */
   inline Accessible* Next() {
     Accessible* target = nullptr;
 
-    while (mFirstIter && !(target = mFirstIter->Next()))
+    while (mFirstIter && !(target = mFirstIter->Next())) {
       mFirstIter = std::move(mFirstIter->mNextIter);
+    }
 
     if (!mFirstIter) mLastIter = nullptr;
 
     return target;
   }
 
  private:
   Relation& operator=(const Relation&) = delete;
--- a/accessible/base/SelectionManager.cpp
+++ b/accessible/base/SelectionManager.cpp
@@ -143,18 +143,19 @@ SelectionManager::NotifySelectionChanged
                                          int16_t aReason) {
   if (NS_WARN_IF(!aDocument) || NS_WARN_IF(!aSelection)) {
     return NS_ERROR_INVALID_ARG;
   }
 
   DocAccessible* document = GetAccService()->GetDocAccessible(aDocument);
 
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eSelection))
+  if (logging::IsEnabled(logging::eSelection)) {
     logging::SelChange(aSelection, document, aReason);
+  }
 #endif
 
   if (document) {
     // Selection manager has longer lifetime than any document accessible,
     // so that we are guaranteed that the notification is processed before
     // the selection manager is destroyed.
     RefPtr<SelData> selData = new SelData(aSelection, aReason);
     document->HandleNotification<SelectionManager, SelData>(
--- a/accessible/base/TextAttrs.cpp
+++ b/accessible/base/TextAttrs.cpp
@@ -60,18 +60,19 @@ void TextAttrsMgr::GetAttributes(nsIPers
     }
 
     return;
   }
 
   // Get the content and frame of the accessible. In the case of document
   // accessible it's role content and root frame.
   nsIContent* hyperTextElm = mHyperTextAcc->GetContent();
-  if (!hyperTextElm)
+  if (!hyperTextElm) {
     return;  // XXX: we don't support text attrs on document with no body
+  }
 
   nsIFrame* rootFrame = mHyperTextAcc->GetFrame();
   MOZ_ASSERT(rootFrame, "No frame for accessible!");
   if (!rootFrame) return;
 
   nsIContent *offsetNode = nullptr, *offsetElm = nullptr;
   nsIFrame* frame = nullptr;
   if (mOffsetAcc) {
@@ -119,23 +120,25 @@ void TextAttrsMgr::GetAttributes(nsIPers
   TextAttr* attrArray[] = {
       &langTextAttr,      &invalidTextAttr,    &bgColorTextAttr,
       &colorTextAttr,     &fontFamilyTextAttr, &fontSizeTextAttr,
       &fontStyleTextAttr, &fontWeightTextAttr, &autoGenTextAttr,
       &textDecorTextAttr, &textPosTextAttr};
 
   // Expose text attributes if applicable.
   if (aAttributes) {
-    for (uint32_t idx = 0; idx < ArrayLength(attrArray); idx++)
+    for (uint32_t idx = 0; idx < ArrayLength(attrArray); idx++) {
       attrArray[idx]->Expose(aAttributes, mIncludeDefAttrs);
+    }
   }
 
   // Expose text attributes range where they are applied if applicable.
-  if (mOffsetAcc)
+  if (mOffsetAcc) {
     GetRange(attrArray, ArrayLength(attrArray), aStartOffset, aEndOffset);
+  }
 }
 
 void TextAttrsMgr::GetRange(TextAttr* aAttrArray[], uint32_t aAttrArrayLen,
                             uint32_t* aStartOffset, uint32_t* aEndOffset) {
   // Navigate backward from anchor accessible to find start offset.
   for (int32_t childIdx = mOffsetAccIdx - 1; childIdx >= 0; childIdx--) {
     Accessible* currAcc = mHyperTextAcc->LocalChildAt(childIdx);
 
@@ -571,20 +574,21 @@ FontWeight TextAttrsMgr::FontWeightTextA
 // AutoGeneratedTextAttr
 ////////////////////////////////////////////////////////////////////////////////
 TextAttrsMgr::AutoGeneratedTextAttr::AutoGeneratedTextAttr(
     HyperTextAccessible* aHyperTextAcc, Accessible* aAccessible)
     : TTextAttr<bool>(!aAccessible) {
   mRootNativeValue = false;
   mIsRootDefined = false;
 
-  if (aAccessible)
+  if (aAccessible) {
     mIsDefined = mNativeValue =
         ((aAccessible->NativeRole() == roles::STATICTEXT) ||
          (aAccessible->NativeRole() == roles::LISTITEM_MARKER));
+  }
 }
 
 bool TextAttrsMgr::AutoGeneratedTextAttr::GetValueFor(Accessible* aAccessible,
                                                       bool* aValue) {
   return *aValue = (aAccessible->NativeRole() == roles::STATICTEXT);
 }
 
 void TextAttrsMgr::AutoGeneratedTextAttr::ExposeValue(
--- a/accessible/base/TextAttrs.h
+++ b/accessible/base/TextAttrs.h
@@ -131,23 +131,25 @@ class TextAttrsMgr {
     virtual void Expose(nsIPersistentProperties* aAttributes,
                         bool aIncludeDefAttrValue) override {
       if (mGetRootValue) {
         if (mIsRootDefined) ExposeValue(aAttributes, mRootNativeValue);
         return;
       }
 
       if (mIsDefined) {
-        if (aIncludeDefAttrValue || mRootNativeValue != mNativeValue)
+        if (aIncludeDefAttrValue || mRootNativeValue != mNativeValue) {
           ExposeValue(aAttributes, mNativeValue);
+        }
         return;
       }
 
-      if (aIncludeDefAttrValue && mIsRootDefined)
+      if (aIncludeDefAttrValue && mIsRootDefined) {
         ExposeValue(aAttributes, mRootNativeValue);
+      }
     }
 
     virtual bool Equal(Accessible* aAccessible) override {
       T nativeValue;
       bool isDefined = GetValueFor(aAccessible, &nativeValue);
 
       if (!mIsDefined && !isDefined) return true;
 
--- a/accessible/base/TextRange.cpp
+++ b/accessible/base/TextRange.cpp
@@ -33,18 +33,19 @@ bool TextPoint::operator<(const TextPoin
     p2 = p2->LocalParent();
   } while (p2);
 
   // Find where the parent chain differs
   uint32_t pos1 = parents1.Length(), pos2 = parents2.Length();
   for (uint32_t len = std::min(pos1, pos2); len > 0; --len) {
     Accessible* child1 = parents1.ElementAt(--pos1);
     Accessible* child2 = parents2.ElementAt(--pos2);
-    if (child1 != child2)
+    if (child1 != child2) {
       return child1->IndexInParent() < child2->IndexInParent();
+    }
   }
 
   if (pos1 != 0) {
     // If parents1 is a superset of parents2 then mContainer is a
     // descendant of aPoint.mContainer. The next element down in parents1
     // is mContainer's ancestor that is the child of aPoint.mContainer.
     // We compare its end offset in aPoint.mContainer with aPoint.mOffset.
     Accessible* child = parents1.ElementAt(pos1 - 1);
--- a/accessible/base/TextUpdater.cpp
+++ b/accessible/base/TextUpdater.cpp
@@ -122,18 +122,19 @@ void TextUpdater::DoUpdate(const nsAStri
 
   // Compute events based on the difference.
   nsTArray<RefPtr<AccEvent> > events;
   ComputeTextChangeEvents(str1, str2, entries, events);
 
   delete[] entries;
 
   // Fire events.
-  for (int32_t idx = events.Length() - 1; idx >= 0; idx--)
+  for (int32_t idx = events.Length() - 1; idx >= 0; idx--) {
     mDocument->FireDelayedEvent(events[idx]);
+  }
 
   mDocument->MaybeNotifyOfValueChange(mHyperText);
 
   // Update the text.
   mTextLeaf->SetText(aNewText);
 }
 
 void TextUpdater::ComputeTextChangeEvents(
--- a/accessible/base/TreeWalker.cpp
+++ b/accessible/base/TreeWalker.cpp
@@ -121,18 +121,19 @@ bool TreeWalker::Seek(nsIContent* aChild
           !(mFlags & eScoped),
           "Walker should not be scoped when seeking into relocated children");
       if (child->LocalParent() != mContext) {
         return false;
       }
 
       Accessible* ownedChild = nullptr;
       while ((ownedChild = mDoc->ARIAOwnedAt(mContext, mARIAOwnsIdx++)) &&
-             ownedChild != child)
+             ownedChild != child) {
         ;
+      }
 
       MOZ_ASSERT(ownedChild, "A child has to be in ARIA owned elements");
       mPhase = eAtARIAOwns;
       return true;
     }
 
     // Look in DOM.
     dom::AllChildrenIterator* iter =
--- a/accessible/base/nsAccUtils.cpp
+++ b/accessible/base/nsAccUtils.cpp
@@ -126,18 +126,19 @@ void nsAccUtils::SetLiveContainerAttribu
   }
   dom::Element* topEl = doc->GetRootElement();
   nsIContent* ancestor = aStartContent;
   while (ancestor) {
     // container-relevant attribute
     if (relevant.IsEmpty() &&
         HasDefinedARIAToken(ancestor, nsGkAtoms::aria_relevant) &&
         ancestor->AsElement()->GetAttr(kNameSpaceID_None,
-                                       nsGkAtoms::aria_relevant, relevant))
+                                       nsGkAtoms::aria_relevant, relevant)) {
       SetAccAttr(aAttributes, nsGkAtoms::containerRelevant, relevant);
+    }
 
     // container-live, and container-live-role attributes
     if (live.IsEmpty()) {
       const nsRoleMapEntry* role = nullptr;
       if (ancestor->IsElement()) {
         role = aria::GetRoleMap(ancestor->AsElement());
       }
       if (HasDefinedARIAToken(ancestor, nsGkAtoms::aria_live)) {
@@ -164,18 +165,19 @@ void nsAccUtils::SetLiveContainerAttribu
                                      kNameSpaceID_None, nsGkAtoms::aria_atomic,
                                      nsGkAtoms::_true, eCaseMatters)) {
       SetAccAttr(aAttributes, nsGkAtoms::containerAtomic, u"true"_ns);
     }
 
     // container-busy attribute
     if (busy.IsEmpty() && HasDefinedARIAToken(ancestor, nsGkAtoms::aria_busy) &&
         ancestor->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::aria_busy,
-                                       busy))
+                                       busy)) {
       SetAccAttr(aAttributes, nsGkAtoms::containerBusy, busy);
+    }
 
     if (ancestor == topEl) {
       break;
     }
 
     ancestor = ancestor->GetParent();
     if (!ancestor) {
       ancestor = topEl;  // Use <body>/<frameset>
--- a/accessible/base/nsAccessibilityService.cpp
+++ b/accessible/base/nsAccessibilityService.cpp
@@ -990,29 +990,32 @@ Accessible* nsAccessibilityService::Crea
         frame->AccessibleType() == eHTMLTableType ||
         // We should always use OuterDocAccessible for OuterDocs, even for
         // ARIA table roles.
         frame->AccessibleType() == eOuterDocType) {
       // Prefer to use markup to decide if and what kind of accessible to
       // create,
       const HTMLMarkupMapInfo* markupMap =
           mHTMLMarkupMap.Get(content->NodeInfo()->NameAtom());
-      if (markupMap && markupMap->new_func)
+      if (markupMap && markupMap->new_func) {
         newAcc = markupMap->new_func(content->AsElement(), aContext);
+      }
 
-      if (!newAcc)  // try by frame accessible type.
+      if (!newAcc) {  // try by frame accessible type.
         newAcc = CreateAccessibleByFrameType(frame, content, aContext);
+      }
     }
 
     // In case of ARIA grid or table use table-specific classes if it's not
     // native table based.
     if (isARIATablePart && (!newAcc || newAcc->IsGenericHyperText())) {
       if ((roleMapEntry->accTypes & eTableCell)) {
-        if (aContext->IsTableRow())
+        if (aContext->IsTableRow()) {
           newAcc = new ARIAGridCellAccessibleWrap(content, document);
+        }
 
       } else if (roleMapEntry->IsOfType(eTableRow)) {
         if (aContext->IsTable() ||
             (aContext->LocalParent() && aContext->LocalParent()->IsTable())) {
           newAcc = new ARIARowAccessible(content, document);
         }
 
       } else if (roleMapEntry->IsOfType(eTable)) {
@@ -1020,29 +1023,31 @@ Accessible* nsAccessibilityService::Crea
       }
     }
 
     // If table has strong ARIA role then all table descendants shouldn't
     // expose their native roles.
     if (!roleMapEntry && newAcc && aContext->HasStrongARIARole()) {
       if (frame->AccessibleType() == eHTMLTableRowType) {
         const nsRoleMapEntry* contextRoleMap = aContext->ARIARoleMap();
-        if (!contextRoleMap->IsOfType(eTable))
+        if (!contextRoleMap->IsOfType(eTable)) {
           roleMapEntry = &aria::gEmptyRoleMap;
+        }
 
       } else if (frame->AccessibleType() == eHTMLTableCellType &&
                  aContext->ARIARoleMap() == &aria::gEmptyRoleMap) {
         roleMapEntry = &aria::gEmptyRoleMap;
 
       } else if (content->IsAnyOfHTMLElements(nsGkAtoms::dt, nsGkAtoms::li,
                                               nsGkAtoms::dd) ||
                  frame->AccessibleType() == eHTMLLiType) {
         const nsRoleMapEntry* contextRoleMap = aContext->ARIARoleMap();
-        if (!contextRoleMap->IsOfType(eList))
+        if (!contextRoleMap->IsOfType(eList)) {
           roleMapEntry = &aria::gEmptyRoleMap;
+        }
       }
     }
   }
 
   // XUL accessibles.
   if (!newAcc && content->IsXULElement()) {
     // No accessible for not selected deck panel and its children.
     if (!aContext->IsXULTabpanels()) {
@@ -1090,18 +1095,19 @@ Accessible* nsAccessibilityService::Crea
       } else if (content->IsSVGElement(nsGkAtoms::g) &&
                  MustSVGElementBeAccessible(content)) {
         newAcc = new EnumRoleAccessible<roles::GROUPING>(content, document);
       }
 
     } else if (content->IsMathMLElement()) {
       const HTMLMarkupMapInfo* markupMap =
           mHTMLMarkupMap.Get(content->NodeInfo()->NameAtom());
-      if (markupMap && markupMap->new_func)
+      if (markupMap && markupMap->new_func) {
         newAcc = markupMap->new_func(content->AsElement(), aContext);
+      }
 
       // Fall back to text when encountering Content MathML.
       if (!newAcc && !content->IsAnyOfMathMLElements(
                          nsGkAtoms::annotation_, nsGkAtoms::annotation_xml_,
                          nsGkAtoms::mpadded_, nsGkAtoms::mphantom_,
                          nsGkAtoms::maligngroup_, nsGkAtoms::malignmark_,
                          nsGkAtoms::mspace_, nsGkAtoms::semantics_)) {
         newAcc = new HyperTextAccessible(content, document);
@@ -1160,22 +1166,24 @@ bool nsAccessibilityService::Init() {
 
   // Subscribe to EventListenerService.
   nsCOMPtr<nsIEventListenerService> eventListenerService =
       do_GetService("@mozilla.org/eventlistenerservice;1");
   if (!eventListenerService) return false;
 
   eventListenerService->AddListenerChangeListener(this);
 
-  for (uint32_t i = 0; i < ArrayLength(sHTMLMarkupMapList); i++)
+  for (uint32_t i = 0; i < ArrayLength(sHTMLMarkupMapList); i++) {
     mHTMLMarkupMap.Put(sHTMLMarkupMapList[i].tag, &sHTMLMarkupMapList[i]);
+  }
 
 #ifdef MOZ_XUL
-  for (uint32_t i = 0; i < ArrayLength(sXULMarkupMapList); i++)
+  for (uint32_t i = 0; i < ArrayLength(sXULMarkupMapList); i++) {
     mXULMarkupMap.Put(sXULMarkupMapList[i].tag, &sXULMarkupMapList[i]);
+  }
 #endif
 
 #ifdef A11Y_LOG
   logging::CheckEnv();
 #endif
 
   gAccessibilityService = this;
   NS_ADDREF(gAccessibilityService);  // will release in Shutdown()
@@ -1321,31 +1329,33 @@ nsAccessibilityService::CreateAccessible
       break;
     case eHTMLRangeType:
       newAcc = new HTMLRangeAccessible(aContent, document);
       break;
     case eHTMLSpinnerType:
       newAcc = new HTMLSpinnerAccessible(aContent, document);
       break;
     case eHTMLTableType:
-      if (aContent->IsHTMLElement(nsGkAtoms::table))
+      if (aContent->IsHTMLElement(nsGkAtoms::table)) {
         newAcc = new HTMLTableAccessibleWrap(aContent, document);
-      else
+      } else {
         newAcc = new HyperTextAccessibleWrap(aContent, document);
+      }
       break;
     case eHTMLTableCellType:
       // Accessible HTML table cell should be a child of accessible HTML table
       // or its row (CSS HTML tables are polite to the used markup at
       // certain degree).
       // Otherwise create a generic text accessible to avoid text jamming
       // when reading by AT.
-      if (aContext->IsHTMLTableRow() || aContext->IsHTMLTable())
+      if (aContext->IsHTMLTableRow() || aContext->IsHTMLTable()) {
         newAcc = new HTMLTableCellAccessibleWrap(aContent, document);
-      else
+      } else {
         newAcc = new HyperTextAccessibleWrap(aContent, document);
+      }
       break;
 
     case eHTMLTableRowType: {
       // Accessible HTML table row may be a child of tbody/tfoot/thead of
       // accessible HTML table or a direct child of accessible of HTML table.
       Accessible* table = aContext->IsTable() ? aContext : nullptr;
       if (!table && aContext->LocalParent() &&
           aContext->LocalParent()->IsTable()) {
@@ -1430,18 +1440,19 @@ void nsAccessibilityService::MarkupAttri
 
       nsAutoString value;
 
       if (aContent->IsElement()) {
         aContent->AsElement()->GetAttr(kNameSpaceID_None, info->DOMAttrName,
                                        value);
       }
 
-      if (!value.IsEmpty())
+      if (!value.IsEmpty()) {
         nsAccUtils::SetAccAttr(aAttributes, info->name, value);
+      }
 
       continue;
     }
 
     nsAccUtils::SetAccAttr(aAttributes, info->name, info->value);
   }
 }
 
--- a/accessible/base/nsAccessiblePivot.cpp
+++ b/accessible/base/nsAccessiblePivot.cpp
@@ -84,18 +84,19 @@ nsAccessiblePivot::GetPosition(nsIAccess
 }
 
 NS_IMETHODIMP
 nsAccessiblePivot::SetPosition(nsIAccessible* aPosition) {
   RefPtr<Accessible> position = nullptr;
 
   if (aPosition) {
     position = aPosition->ToInternalAccessible();
-    if (!position || !IsDescendantOf(position, GetActiveRoot()))
+    if (!position || !IsDescendantOf(position, GetActiveRoot())) {
       return NS_ERROR_INVALID_ARG;
+    }
   }
 
   // Swap old position with new position, saves us an AddRef/Release.
   mPosition.swap(position);
   int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
   mStartOffset = mEndOffset = -1;
   NotifyOfPivotChange(position, oldStart, oldEnd,
                       nsIAccessiblePivot::REASON_NONE,
@@ -114,18 +115,19 @@ nsAccessiblePivot::GetModalRoot(nsIAcces
 }
 
 NS_IMETHODIMP
 nsAccessiblePivot::SetModalRoot(nsIAccessible* aModalRoot) {
   Accessible* modalRoot = nullptr;
 
   if (aModalRoot) {
     modalRoot = aModalRoot->ToInternalAccessible();
-    if (!modalRoot || !IsDescendantOf(modalRoot, mRoot))
+    if (!modalRoot || !IsDescendantOf(modalRoot, mRoot)) {
       return NS_ERROR_INVALID_ARG;
+    }
   }
 
   mModalRoot = modalRoot;
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsAccessiblePivot::GetStartOffset(int32_t* aStartOffset) {
@@ -160,22 +162,24 @@ nsAccessiblePivot::SetTextRange(nsIAcces
 
   nsCOMPtr<nsIAccessible> xpcAcc = do_QueryInterface(aTextAccessible);
   NS_ENSURE_ARG(xpcAcc);
 
   RefPtr<Accessible> acc = xpcAcc->ToInternalAccessible();
   NS_ENSURE_ARG(acc);
 
   HyperTextAccessible* position = acc->AsHyperText();
-  if (!position || !IsDescendantOf(position, GetActiveRoot()))
+  if (!position || !IsDescendantOf(position, GetActiveRoot())) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   // Make sure the given offsets don't exceed the character count.
-  if (aEndOffset > static_cast<int32_t>(position->CharacterCount()))
+  if (aEndOffset > static_cast<int32_t>(position->CharacterCount())) {
     return NS_ERROR_FAILURE;
+  }
 
   int32_t oldStart = mStartOffset, oldEnd = mEndOffset;
   mStartOffset = aStartOffset;
   mEndOffset = aEndOffset;
 
   mPosition.swap(acc);
   NotifyOfPivotChange(acc, oldStart, oldEnd, nsIAccessiblePivot::REASON_NONE,
                       nsIAccessiblePivot::NO_BOUNDARY,
@@ -194,18 +198,19 @@ nsAccessiblePivot::MoveNext(nsIAccessibl
   NS_ENSURE_ARG(aResult);
   NS_ENSURE_ARG(aRule);
   *aResult = false;
 
   Accessible* anchor = mPosition;
   if (aArgc > 0 && aAnchor) anchor = aAnchor->ToInternalAccessible();
 
   if (anchor &&
-      (anchor->IsDefunct() || !IsDescendantOf(anchor, GetActiveRoot())))
+      (anchor->IsDefunct() || !IsDescendantOf(anchor, GetActiveRoot()))) {
     return NS_ERROR_NOT_IN_TREE;
+  }
 
   Pivot pivot(GetActiveRoot());
   RuleCache rule(aRule);
   AccessibleOrProxy wrappedAnchor = AccessibleOrProxy(anchor);
   AccessibleOrProxy newPos =
       pivot.Next(wrappedAnchor, rule, (aArgc > 1) ? aIncludeStart : false);
   if (!newPos.IsNull() && newPos.IsAccessible()) {
     *aResult = MovePivotInternal(newPos.AsAccessible(),
@@ -228,18 +233,19 @@ nsAccessiblePivot::MovePrevious(nsIAcces
   NS_ENSURE_ARG(aResult);
   NS_ENSURE_ARG(aRule);
   *aResult = false;
 
   Accessible* anchor = mPosition;
   if (aArgc > 0 && aAnchor) anchor = aAnchor->ToInternalAccessible();
 
   if (anchor &&
-      (anchor->IsDefunct() || !IsDescendantOf(anchor, GetActiveRoot())))
+      (anchor->IsDefunct() || !IsDescendantOf(anchor, GetActiveRoot()))) {
     return NS_ERROR_NOT_IN_TREE;
+  }
 
   Pivot pivot(GetActiveRoot());
   RuleCache rule(aRule);
   AccessibleOrProxy wrappedAnchor = AccessibleOrProxy(anchor);
   AccessibleOrProxy newPos =
       pivot.Prev(wrappedAnchor, rule, (aArgc > 1) ? aIncludeStart : false);
   if (!newPos.IsNull() && newPos.IsAccessible()) {
     *aResult = MovePivotInternal(newPos.AsAccessible(),
@@ -437,18 +443,19 @@ bool nsAccessiblePivot::MovePivotInterna
 }
 
 bool nsAccessiblePivot::NotifyOfPivotChange(Accessible* aOldPosition,
                                             int32_t aOldStart, int32_t aOldEnd,
                                             int16_t aReason,
                                             int16_t aBoundaryType,
                                             bool aIsFromUserInput) {
   if (aOldPosition == mPosition && aOldStart == mStartOffset &&
-      aOldEnd == mEndOffset)
+      aOldEnd == mEndOffset) {
     return false;
+  }
 
   nsCOMPtr<nsIAccessible> xpcOldPos = ToXPC(aOldPosition);  // death grip
   for (nsIAccessiblePivotObserver* obs : mObservers.ForwardRange()) {
     obs->OnPivotChanged(this, xpcOldPos, aOldStart, aOldEnd, ToXPC(mPosition),
                         mStartOffset, mEndOffset, aReason, aBoundaryType,
                         aIsFromUserInput);
   }
 
@@ -475,26 +482,29 @@ uint16_t RuleCache::Match(const Accessib
     }
 
     if ((nsIAccessibleTraversalRule::PREFILTER_PLATFORM_PRUNED & mPreFilter) &&
         nsAccUtils::MustPrune(aAccOrProxy)) {
       result |= nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
     }
 
     if ((nsIAccessibleTraversalRule::PREFILTER_INVISIBLE & mPreFilter) &&
-        (state & states::INVISIBLE))
+        (state & states::INVISIBLE)) {
       return result;
+    }
 
     if ((nsIAccessibleTraversalRule::PREFILTER_OFFSCREEN & mPreFilter) &&
-        (state & states::OFFSCREEN))
+        (state & states::OFFSCREEN)) {
       return result;
+    }
 
     if ((nsIAccessibleTraversalRule::PREFILTER_NOT_FOCUSABLE & mPreFilter) &&
-        !(state & states::FOCUSABLE))
+        !(state & states::FOCUSABLE)) {
       return result;
+    }
 
     if (aAccOrProxy.IsAccessible() &&
         (nsIAccessibleTraversalRule::PREFILTER_TRANSPARENT & mPreFilter) &&
         !(state & states::OPAQUE1)) {
       nsIFrame* frame = aAccOrProxy.AsAccessible()->GetFrame();
       if (frame->StyleEffects()->mOpacity == 0.0f) {
         return result | nsIAccessibleTraversalRule::FILTER_IGNORE_SUBTREE;
       }
--- a/accessible/base/nsCoreUtils.cpp
+++ b/accessible/base/nsCoreUtils.cpp
@@ -160,19 +160,20 @@ void nsCoreUtils::DispatchTouchEvent(Eve
   nsEventStatus status = nsEventStatus_eIgnore;
   aPresShell->HandleEventWithTarget(&event, aFrame, aContent, &status);
 }
 
 uint32_t nsCoreUtils::GetAccessKeyFor(nsIContent* aContent) {
   // Accesskeys are registered by @accesskey attribute only. At first check
   // whether it is presented on the given element to avoid the slow
   // EventStateManager::GetRegisteredAccessKey() method.
-  if (!aContent->IsElement() ||
-      !aContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::accesskey))
+  if (!aContent->IsElement() || !aContent->AsElement()->HasAttr(
+                                    kNameSpaceID_None, nsGkAtoms::accesskey)) {
     return 0;
+  }
 
   nsPresContext* presContext = aContent->OwnerDoc()->GetPresContext();
   if (!presContext) return 0;
 
   EventStateManager* esm = presContext->EventStateManager();
   if (!esm) return 0;
 
   return esm->GetRegisteredAccessKey(aContent->AsElement());
@@ -324,18 +325,19 @@ nsIntPoint nsCoreUtils::GetScreenCoordsF
   nsCOMPtr<nsIDocShellTreeItem> treeItem(GetDocShellFor(aNode));
   if (!treeItem) return coords;
 
   nsCOMPtr<nsIDocShellTreeOwner> treeOwner;
   treeItem->GetTreeOwner(getter_AddRefs(treeOwner));
   if (!treeOwner) return coords;
 
   nsCOMPtr<nsIBaseWindow> baseWindow = do_QueryInterface(treeOwner);
-  if (baseWindow)
+  if (baseWindow) {
     baseWindow->GetPosition(&coords.x, &coords.y);  // in device pixels
+  }
 
   return coords;
 }
 
 already_AddRefed<nsIDocShell> nsCoreUtils::GetDocShellFor(nsINode* aNode) {
   if (!aNode) return nullptr;
 
   nsCOMPtr<nsIDocShell> docShell = aNode->OwnerDoc()->GetDocShell();
@@ -414,18 +416,19 @@ bool nsCoreUtils::GetUIntAttr(nsIContent
 void nsCoreUtils::GetLanguageFor(nsIContent* aContent, nsIContent* aRootContent,
                                  nsAString& aLanguage) {
   aLanguage.Truncate();
 
   nsIContent* walkUp = aContent;
   while (walkUp && walkUp != aRootContent &&
          (!walkUp->IsElement() ||
           !walkUp->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::lang,
-                                        aLanguage)))
+                                        aLanguage))) {
     walkUp = walkUp->GetParent();
+  }
 }
 
 XULTreeElement* nsCoreUtils::GetTree(nsIContent* aContent) {
   // Find DOMNode's parents recursively until reach the <tree> tag
   nsIContent* currentContent = aContent;
   while (currentContent) {
     if (currentContent->NodeInfo()->Equals(nsGkAtoms::tree, kNameSpaceID_XUL)) {
       return XULTreeElement::FromNode(currentContent);
--- a/accessible/base/nsTextEquivUtils.cpp
+++ b/accessible/base/nsTextEquivUtils.cpp
@@ -186,18 +186,19 @@ nsresult nsTextEquivUtils::AppendFromAcc
     if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED) return rv;
   }
 
   bool isEmptyTextEquiv = true;
 
   // If the name is from tooltip then append it to result string in the end
   // (see h. step of name computation guide).
   nsAutoString text;
-  if (aAccessible->Name(text) != eNameFromTooltip)
+  if (aAccessible->Name(text) != eNameFromTooltip) {
     isEmptyTextEquiv = !AppendString(aString, text);
+  }
 
   // Implementation of f. step.
   nsresult rv = AppendFromValue(aAccessible, aString);
   NS_ENSURE_SUCCESS(rv, rv);
 
   if (rv != NS_OK_NO_NAME_CLAUSE_HANDLED) isEmptyTextEquiv = false;
 
   // Implementation of g) step of text equivalent computation guide. Go down
@@ -218,18 +219,19 @@ nsresult nsTextEquivUtils::AppendFromAcc
     return NS_OK;
   }
 
   return rv;
 }
 
 nsresult nsTextEquivUtils::AppendFromValue(Accessible* aAccessible,
                                            nsAString* aString) {
-  if (GetRoleRule(aAccessible->Role()) != eNameFromValueRule)
+  if (GetRoleRule(aAccessible->Role()) != eNameFromValueRule) {
     return NS_OK_NO_NAME_CLAUSE_HANDLED;
+  }
 
   // Implementation of step f. of text equivalent computation. If the given
   // accessible is not root accessible (the accessible the text equivalent is
   // computed for in the end) then append accessible value. Otherwise append
   // value if and only if the given accessible is in the middle of its parent.
 
   nsAutoString text;
   if (aAccessible != sInitiatorAcc) {
@@ -293,23 +295,25 @@ nsresult nsTextEquivUtils::AppendFromDOM
   return AppendFromDOMChildren(aContent, aString);
 }
 
 bool nsTextEquivUtils::AppendString(nsAString* aString,
                                     const nsAString& aTextEquivalent) {
   if (aTextEquivalent.IsEmpty()) return false;
 
   // Insert spaces to insure that words from controls aren't jammed together.
-  if (!aString->IsEmpty() && !nsCoreUtils::IsWhitespace(aString->Last()))
+  if (!aString->IsEmpty() && !nsCoreUtils::IsWhitespace(aString->Last())) {
     aString->Append(char16_t(' '));
+  }
 
   aString->Append(aTextEquivalent);
 
-  if (!nsCoreUtils::IsWhitespace(aString->Last()))
+  if (!nsCoreUtils::IsWhitespace(aString->Last())) {
     aString->Append(char16_t(' '));
+  }
 
   return true;
 }
 
 uint32_t nsTextEquivUtils::GetRoleRule(role aRole) {
 #define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
              ia2Role, androidClass, nameRule)                               \
   case roles::geckoRole:                                                    \
--- a/accessible/generic/ARIAGridAccessible.cpp
+++ b/accessible/generic/ARIAGridAccessible.cpp
@@ -174,21 +174,22 @@ uint32_t ARIAGridAccessible::SelectedCol
 
   uint32_t selColCount = colCount;
   do {
     if (nsAccUtils::IsARIASelected(row)) continue;
 
     AccIterator cellIter(row, filters::GetCell);
     Accessible* cell = nullptr;
     for (uint32_t colIdx = 0; (cell = cellIter.Next()) && colIdx < colCount;
-         colIdx++)
+         colIdx++) {
       if (isColSelArray[colIdx] && !nsAccUtils::IsARIASelected(cell)) {
         isColSelArray[colIdx] = false;
         selColCount--;
       }
+    }
   } while ((row = rowIter.Next()));
 
   return selColCount;
 }
 
 uint32_t ARIAGridAccessible::SelectedRowCount() {
   if (IsARIARole(nsGkAtoms::table)) return 0;
 
@@ -247,27 +248,29 @@ void ARIAGridAccessible::SelectedCellInd
   if (IsARIARole(nsGkAtoms::table)) return;
 
   uint32_t colCount = ColCount();
 
   AccIterator rowIter(this, filters::GetRow);
   Accessible* row = nullptr;
   for (uint32_t rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
     if (nsAccUtils::IsARIASelected(row)) {
-      for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
+      for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
         aCells->AppendElement(rowIdx * colCount + colIdx);
+      }
 
       continue;
     }
 
     AccIterator cellIter(row, filters::GetCell);
     Accessible* cell = nullptr;
     for (uint32_t colIdx = 0; (cell = cellIter.Next()); colIdx++) {
-      if (nsAccUtils::IsARIASelected(cell))
+      if (nsAccUtils::IsARIASelected(cell)) {
         aCells->AppendElement(rowIdx * colCount + colIdx);
+      }
     }
   }
 }
 
 void ARIAGridAccessible::SelectedColIndices(nsTArray<uint32_t>* aCols) {
   if (IsARIARole(nsGkAtoms::table)) return;
 
   uint32_t colCount = ColCount();
@@ -282,24 +285,26 @@ void ARIAGridAccessible::SelectedColIndi
   memset(isColSelArray.Elements(), true, colCount * sizeof(bool));
 
   do {
     if (nsAccUtils::IsARIASelected(row)) continue;
 
     AccIterator cellIter(row, filters::GetCell);
     Accessible* cell = nullptr;
     for (uint32_t colIdx = 0; (cell = cellIter.Next()) && colIdx < colCount;
-         colIdx++)
+         colIdx++) {
       if (isColSelArray[colIdx] && !nsAccUtils::IsARIASelected(cell)) {
         isColSelArray[colIdx] = false;
       }
+    }
   } while ((row = rowIter.Next()));
 
-  for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
+  for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
     if (isColSelArray[colIdx]) aCols->AppendElement(colIdx);
+  }
 }
 
 void ARIAGridAccessible::SelectedRowIndices(nsTArray<uint32_t>* aRows) {
   if (IsARIARole(nsGkAtoms::table)) return;
 
   AccIterator rowIter(this, filters::GetRow);
   Accessible* row = nullptr;
   for (uint32_t rowIdx = 0; (row = rowIter.Next()); rowIdx++) {
@@ -379,22 +384,23 @@ nsresult ARIAGridAccessible::SetARIASele
                                              bool aIsSelected, bool aNotify) {
   if (IsARIARole(nsGkAtoms::table)) return NS_OK;
 
   nsIContent* content = aAccessible->GetContent();
   NS_ENSURE_STATE(content);
 
   nsresult rv = NS_OK;
   if (content->IsElement()) {
-    if (aIsSelected)
+    if (aIsSelected) {
       rv = content->AsElement()->SetAttr(
           kNameSpaceID_None, nsGkAtoms::aria_selected, u"true"_ns, aNotify);
-    else
+    } else {
       rv = content->AsElement()->SetAttr(
           kNameSpaceID_None, nsGkAtoms::aria_selected, u"false"_ns, aNotify);
+    }
   }
 
   NS_ENSURE_SUCCESS(rv, rv);
 
   // No "smart" select/unselect for internal call.
   if (!aNotify) return NS_OK;
 
   // If row or cell accessible was selected then we're able to not bother about
@@ -565,18 +571,19 @@ void ARIAGridCellAccessible::ApplyARIASt
   // Check aria-selected="true" on the row.
   Accessible* row = LocalParent();
   if (!row || row->Role() != roles::ROW) return;
 
   nsIContent* rowContent = row->GetContent();
   if (nsAccUtils::HasDefinedARIAToken(rowContent, nsGkAtoms::aria_selected) &&
       !rowContent->AsElement()->AttrValueIs(kNameSpaceID_None,
                                             nsGkAtoms::aria_selected,
-                                            nsGkAtoms::_false, eCaseMatters))
+                                            nsGkAtoms::_false, eCaseMatters)) {
     *aState |= states::SELECTABLE | states::SELECTED;
+  }
 }
 
 already_AddRefed<nsIPersistentProperties>
 ARIAGridCellAccessible::NativeAttributes() {
   nsCOMPtr<nsIPersistentProperties> attributes =
       HyperTextAccessibleWrap::NativeAttributes();
 
   // Expose "table-cell-index" attribute.
@@ -591,18 +598,19 @@ ARIAGridCellAccessible::NativeAttributes
   int32_t colIdx = 0, colCount = 0;
   uint32_t childCount = thisRow->ChildCount();
   for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* child = thisRow->LocalChildAt(childIdx);
     if (child == this) colIdx = colCount;
 
     roles::Role role = child->Role();
     if (role == roles::CELL || role == roles::GRID_CELL ||
-        role == roles::ROWHEADER || role == roles::COLUMNHEADER)
+        role == roles::ROWHEADER || role == roles::COLUMNHEADER) {
       colCount++;
+    }
   }
 
   nsAutoString stringIdx;
   stringIdx.AppendInt(rowIdx * colCount + colIdx);
   nsAccUtils::SetAccAttr(attributes, nsGkAtoms::tableCellIndex, stringIdx);
 
 #ifdef DEBUG
   nsAutoString unused;
--- a/accessible/generic/Accessible-inl.h
+++ b/accessible/generic/Accessible-inl.h
@@ -17,18 +17,19 @@
 #  include "Logging.h"
 #endif
 
 namespace mozilla {
 namespace a11y {
 
 inline mozilla::a11y::role Accessible::Role() const {
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
-  if (!roleMapEntry || roleMapEntry->roleRule != kUseMapRole)
+  if (!roleMapEntry || roleMapEntry->roleRule != kUseMapRole) {
     return ARIATransformRole(NativeRole());
+  }
 
   return ARIATransformRole(roleMapEntry->role);
 }
 
 inline bool Accessible::HasARIARole() const {
   return mRoleMapEntryIndex != aria::NO_ROLE_MAP_ENTRY_INDEX;
 }
 
@@ -43,18 +44,19 @@ inline bool Accessible::HasStrongARIARol
 }
 
 inline const nsRoleMapEntry* Accessible::ARIARoleMap() const {
   return aria::GetRoleMapFromIndex(mRoleMapEntryIndex);
 }
 
 inline mozilla::a11y::role Accessible::ARIARole() {
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
-  if (!roleMapEntry || roleMapEntry->roleRule != kUseMapRole)
+  if (!roleMapEntry || roleMapEntry->roleRule != kUseMapRole) {
     return mozilla::a11y::roles::NOTHING;
+  }
 
   return ARIATransformRole(roleMapEntry->role);
 }
 
 inline void Accessible::SetRoleMapEntry(const nsRoleMapEntry* aRoleMapEntry) {
   mRoleMapEntryIndex = aria::GetIndexFromRoleMap(aRoleMapEntry);
 }
 
@@ -75,18 +77,19 @@ inline bool Accessible::HasGenericType(A
 inline bool Accessible::NativeHasNumericValue() const {
   return mStateFlags & eHasNumericValue;
 }
 
 inline bool Accessible::ARIAHasNumericValue() const {
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
   if (!roleMapEntry || roleMapEntry->valueRule == eNoValue) return false;
 
-  if (roleMapEntry->valueRule == eHasValueMinMaxIfFocusable)
+  if (roleMapEntry->valueRule == eHasValueMinMaxIfFocusable) {
     return InteractiveState() & states::FOCUSABLE;
+  }
 
   return true;
 }
 
 inline bool Accessible::HasNumericValue() const {
   return NativeHasNumericValue() || ARIAHasNumericValue();
 }
 
--- a/accessible/generic/Accessible.cpp
+++ b/accessible/generic/Accessible.cpp
@@ -315,28 +315,30 @@ uint64_t Accessible::VisibilityState() c
   // Offscreen state if the document's visibility state is not visible.
   if (Document()->IsHidden()) return states::OFFSCREEN;
 
   // Walk the parent frame chain to see if the frame is in background tab or
   // scrolled out.
   nsIFrame* curFrame = frame;
   do {
     nsView* view = curFrame->GetView();
-    if (view && view->GetVisibility() == nsViewVisibility_kHide)
+    if (view && view->GetVisibility() == nsViewVisibility_kHide) {
       return states::INVISIBLE;
+    }
 
     if (nsLayoutUtils::IsPopup(curFrame)) return 0;
 
     // Offscreen state for background tab content and invisible for not selected
     // deck panel.
     nsIFrame* parentFrame = curFrame->GetParent();
     nsDeckFrame* deckFrame = do_QueryFrame(parentFrame);
     if (deckFrame && deckFrame->GetSelectedBox() != curFrame) {
-      if (deckFrame->GetContent()->IsXULElement(nsGkAtoms::tabpanels))
+      if (deckFrame->GetContent()->IsXULElement(nsGkAtoms::tabpanels)) {
         return states::OFFSCREEN;
+      }
 
       MOZ_ASSERT_UNREACHABLE(
           "Children of not selected deck panel are not accessible.");
       return states::INVISIBLE;
     }
 
     // If contained by scrollable frame then check that at least 12 pixels
     // around the object is visible, otherwise the object is offscreen.
@@ -390,18 +392,19 @@ uint64_t Accessible::NativeState() const
 
   if (!IsInDocument()) state |= states::STALE;
 
   if (HasOwnContent() && mContent->IsElement()) {
     EventStates elementState = mContent->AsElement()->State();
 
     if (elementState.HasState(NS_EVENT_STATE_INVALID)) state |= states::INVALID;
 
-    if (elementState.HasState(NS_EVENT_STATE_REQUIRED))
+    if (elementState.HasState(NS_EVENT_STATE_REQUIRED)) {
       state |= states::REQUIRED;
+    }
 
     state |= NativeInteractiveState();
     if (FocusMgr()->IsFocused(this)) state |= states::FOCUSED;
   }
 
   // Gather states::INVISIBLE and states::OFFSCREEN flags for this object.
   state |= VisibilityState();
 
@@ -410,34 +413,37 @@ uint64_t Accessible::NativeState() const
     if (frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) state |= states::FLOATING;
 
     // XXX we should look at layout for non XUL box frames, but need to decide
     // how that interacts with ARIA.
     if (HasOwnContent() && mContent->IsXULElement() && frame->IsXULBoxFrame()) {
       const nsStyleXUL* xulStyle = frame->StyleXUL();
       if (xulStyle && frame->IsXULBoxFrame()) {
         // In XUL all boxes are either vertical or horizontal
-        if (xulStyle->mBoxOrient == StyleBoxOrient::Vertical)
+        if (xulStyle->mBoxOrient == StyleBoxOrient::Vertical) {
           state |= states::VERTICAL;
-        else
+        } else {
           state |= states::HORIZONTAL;
+        }
       }
     }
   }
 
   // Check if a XUL element has the popup attribute (an attached popup menu).
   if (HasOwnContent() && mContent->IsXULElement() &&
-      mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::popup))
+      mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::popup)) {
     state |= states::HASPOPUP;
+  }
 
   // Bypass the link states specialization for non links.
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
   if (!roleMapEntry || roleMapEntry->roleRule == kUseNativeRole ||
-      roleMapEntry->role == roles::LINK)
+      roleMapEntry->role == roles::LINK) {
     state |= NativeLinkState();
+  }
 
   return state;
 }
 
 uint64_t Accessible::NativeInteractiveState() const {
   if (!mContent->IsElement()) return 0;
 
   if (NativelyUnavailable()) return states::UNAVAILABLE;
@@ -470,18 +476,19 @@ Accessible* Accessible::FocusedChild() {
 Accessible* Accessible::ChildAtPoint(int32_t aX, int32_t aY,
                                      EWhichChildAtPoint aWhichChild) {
   // If we can't find the point in a child, we will return the fallback answer:
   // we return |this| if the point is within it, otherwise nullptr.
   Accessible* fallbackAnswer = nullptr;
   nsIntRect rect = Bounds();
   if (rect.Contains(aX, aY)) fallbackAnswer = this;
 
-  if (nsAccUtils::MustPrune(this))  // Do not dig any further
+  if (nsAccUtils::MustPrune(this)) {  // Do not dig any further
     return fallbackAnswer;
+  }
 
   // Search an accessible at the given point starting from accessible document
   // because containing block (see CSS2) for out of flow element (for example,
   // absolutely positioned element) may be different from its DOM parent and
   // therefore accessible for containing block may be different from accessible
   // for DOM parent but GetFrameForPoint() should be called for containing block
   // to get an out of flow element.
   DocAccessible* accDocument = Document();
@@ -508,33 +515,35 @@ Accessible* Accessible::ChildAtPoint(int
   if (popupFrame) {
     // If 'this' accessible is not inside the popup then ignore the popup when
     // searching an accessible at point.
     DocAccessible* popupDoc =
         GetAccService()->GetDocAccessible(popupFrame->GetContent()->OwnerDoc());
     Accessible* popupAcc =
         popupDoc->GetAccessibleOrContainer(popupFrame->GetContent());
     Accessible* popupChild = this;
-    while (popupChild && !popupChild->IsDoc() && popupChild != popupAcc)
+    while (popupChild && !popupChild->IsDoc() && popupChild != popupAcc) {
       popupChild = popupChild->LocalParent();
+    }
 
     if (popupChild == popupAcc) startFrame = popupFrame;
   }
 
   nsPresContext* presContext = startFrame->PresContext();
   nsRect screenRect = startFrame->GetScreenRectInAppUnits();
   nsPoint offset(presContext->DevPixelsToAppUnits(aX) - screenRect.X(),
                  presContext->DevPixelsToAppUnits(aY) - screenRect.Y());
 
   nsIFrame* foundFrame = nsLayoutUtils::GetFrameForPoint(
       RelativeTo{startFrame, ViewportType::Visual}, offset);
 
   nsIContent* content = nullptr;
-  if (!foundFrame || !(content = foundFrame->GetContent()))
+  if (!foundFrame || !(content = foundFrame->GetContent())) {
     return fallbackAnswer;
+  }
 
   // Get accessible for the node with the point or the first accessible in
   // the DOM parent chain.
   DocAccessible* contentDocAcc =
       GetAccService()->GetDocAccessible(content->OwnerDoc());
 
   // contentDocAcc in some circumstances can be nullptr. See bug 729861
   NS_ASSERTION(contentDocAcc, "could not get the document accessible");
@@ -569,18 +578,19 @@ Accessible* Accessible::ChildAtPoint(int
   // OuterDocAccessibles).
   uint32_t childCount = accessible->ChildCount();
   for (uint32_t childIdx = 0; childIdx < childCount; childIdx++) {
     Accessible* child = accessible->LocalChildAt(childIdx);
 
     nsIntRect childRect = child->Bounds();
     if (childRect.Contains(aX, aY) &&
         (child->State() & states::INVISIBLE) == 0) {
-      if (aWhichChild == eDeepestChild)
+      if (aWhichChild == eDeepestChild) {
         return child->ChildAtPoint(aX, aY, eDeepestChild);
+      }
 
       return child;
     }
   }
 
   return accessible;
 }
 
@@ -797,18 +807,19 @@ nsresult Accessible::HandleAccEvent(AccE
 
         case nsIAccessibleEvent::EVENT_HIDE:
           ipcDoc->SendHideEvent(id, aEvent->IsFromUserInput());
           break;
 
         case nsIAccessibleEvent::EVENT_REORDER:
           // reorder events on the application acc aren't necessary to tell the
           // parent about new top level documents.
-          if (!aEvent->GetAccessible()->IsApplication())
+          if (!aEvent->GetAccessible()->IsApplication()) {
             ipcDoc->SendEvent(id, aEvent->GetEventType());
+          }
           break;
         case nsIAccessibleEvent::EVENT_STATE_CHANGE: {
           AccStateChangeEvent* event = downcast_accEvent(aEvent);
           ipcDoc->SendStateChangeEvent(id, event->GetState(),
                                        event->IsStateEnabled());
           break;
         }
         case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED: {
@@ -935,33 +946,35 @@ already_AddRefed<nsIPersistentProperties
     // 'xml-roles' attribute for landmark.
     nsAccUtils::SetAccAttr(attributes, nsGkAtoms::xmlroles, landmark);
   }
 
   // Expose object attributes from ARIA attributes.
   nsAutoString unused;
   aria::AttrIterator attribIter(mContent);
   nsAutoString name, value;
-  while (attribIter.Next(name, value))
+  while (attribIter.Next(name, value)) {
     attributes->SetStringProperty(NS_ConvertUTF16toUTF8(name), value, unused);
+  }
 
   // If there is no aria-live attribute then expose default value of 'live'
   // object attribute used for ARIA role of this accessible.
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
   if (roleMapEntry) {
     if (roleMapEntry->Is(nsGkAtoms::searchbox)) {
       nsAccUtils::SetAccAttr(attributes, nsGkAtoms::textInputType,
                              u"search"_ns);
     }
 
     nsAutoString live;
     nsAccUtils::GetAccAttr(attributes, nsGkAtoms::live, live);
     if (live.IsEmpty()) {
-      if (nsAccUtils::GetLiveAttrValue(roleMapEntry->liveAttRule, live))
+      if (nsAccUtils::GetLiveAttrValue(roleMapEntry->liveAttRule, live)) {
         nsAccUtils::SetAccAttr(attributes, nsGkAtoms::live, live);
+      }
     }
   }
 
   return attributes.forget();
 }
 
 already_AddRefed<nsIPersistentProperties> Accessible::NativeAttributes() {
   RefPtr<nsPersistentProperties> attributes = new nsPersistentProperties();
@@ -1016,24 +1029,26 @@ already_AddRefed<nsIPersistentProperties
   // container with the live region attribute. Inner nodes override outer nodes
   // within the same document. The inner nodes can be used to override live
   // region behavior on more general outer nodes.
   nsAccUtils::SetLiveContainerAttributes(attributes, mContent);
 
   if (!mContent->IsElement()) return attributes.forget();
 
   nsAutoString id;
-  if (nsCoreUtils::GetID(mContent, id))
+  if (nsCoreUtils::GetID(mContent, id)) {
     attributes->SetStringProperty("id"_ns, id, unused);
+  }
 
   // Expose class because it may have useful microformat information.
   nsAutoString _class;
   if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::_class,
-                                     _class))
+                                     _class)) {
     nsAccUtils::SetAccAttr(attributes, nsGkAtoms::_class, _class);
+  }
 
   // Expose tag.
   nsAutoString tagName;
   mContent->NodeInfo()->GetName(tagName);
   nsAccUtils::SetAccAttr(attributes, nsGkAtoms::tag, tagName);
 
   // Expose draggable object attribute.
   if (auto htmlElement = nsGenericHTMLElement::FromNode(mContent)) {
@@ -1154,18 +1169,19 @@ uint64_t Accessible::State() {
       if (state & states::FOCUSED) {
         state |= states::SELECTED;
       } else {
         // If focus is in a child of the tab panel surely the tab is selected!
         Relation rel = RelationByType(RelationType::LABEL_FOR);
         Accessible* relTarget = nullptr;
         while ((relTarget = rel.Next())) {
           if (relTarget->Role() == roles::PROPERTYPAGE &&
-              FocusMgr()->IsFocusWithin(relTarget))
+              FocusMgr()->IsFocusWithin(relTarget)) {
             state |= states::SELECTED;
+          }
         }
       }
     } else if (state & states::FOCUSED) {
       Accessible* container = nsAccUtils::GetSelectableContainer(this, state);
       if (container &&
           !nsAccUtils::HasDefinedARIAToken(container->GetContent(),
                                            nsGkAtoms::aria_multiselectable)) {
         state |= states::SELECTED;
@@ -1189,18 +1205,19 @@ uint64_t Accessible::State() {
     // If the object is a current item of container widget then mark it as
     // ACTIVE. This allows screen reader virtual buffer modes to know which
     // descendant is the current one that would get focus if the user navigates
     // to the container widget.
     Accessible* widget = ContainerWidget();
     if (widget && widget->CurrentItem() == this) state |= states::ACTIVE;
   }
 
-  if ((state & states::COLLAPSED) || (state & states::EXPANDED))
+  if ((state & states::COLLAPSED) || (state & states::EXPANDED)) {
     state |= states::EXPANDABLE;
+  }
 
   // For some reasons DOM node may have not a frame. We tract such accessibles
   // as invisible.
   nsIFrame* frame = GetFrame();
   if (!frame) return state;
 
   if (frame->StyleEffects()->mOpacity == 1.0f && !(state & states::INVISIBLE)) {
     state |= states::OPAQUE1;
@@ -1262,27 +1279,29 @@ void Accessible::ApplyARIAState(uint64_t
     if (FocusMgr()->IsActiveItem(this)) {
       *aState |= states::FOCUSABLE;
     }
   }
 
   // special case: A native button element whose role got transformed by ARIA to
   // a toggle button Also applies to togglable button menus, like in the Dev
   // Tools Web Console.
-  if (IsButton() || IsMenuButton())
+  if (IsButton() || IsMenuButton()) {
     aria::MapToState(aria::eARIAPressed, element, aState);
+  }
 
   if (!roleMapEntry) return;
 
   *aState |= roleMapEntry->state;
 
   if (aria::MapToState(roleMapEntry->attributeMap1, element, aState) &&
       aria::MapToState(roleMapEntry->attributeMap2, element, aState) &&
-      aria::MapToState(roleMapEntry->attributeMap3, element, aState))
+      aria::MapToState(roleMapEntry->attributeMap3, element, aState)) {
     aria::MapToState(roleMapEntry->attributeMap4, element, aState);
+  }
 
   // ARIA gridcell inherits readonly state from the grid until it's overridden.
   if ((roleMapEntry->Is(nsGkAtoms::gridcell) ||
        roleMapEntry->Is(nsGkAtoms::columnheader) ||
        roleMapEntry->Is(nsGkAtoms::rowheader)) &&
       !nsAccUtils::HasDefinedARIAToken(mContent, nsGkAtoms::aria_readonly)) {
     const TableCellAccessible* cell = AsTableCell();
     if (cell) {
@@ -1431,23 +1450,25 @@ role Accessible::ARIATransformRole(role 
     // A listbox inside of a combobox needs a special role because of ATK
     // mapping to menu.
     if (mParent && mParent->IsCombobox()) {
       return roles::COMBOBOX_LIST;
     } else {
       // Listbox is owned by a combobox
       Relation rel = RelationByType(RelationType::NODE_CHILD_OF);
       Accessible* targetAcc = nullptr;
-      while ((targetAcc = rel.Next()))
+      while ((targetAcc = rel.Next())) {
         if (targetAcc->IsCombobox()) return roles::COMBOBOX_LIST;
+      }
     }
 
   } else if (aRole == roles::OPTION) {
-    if (mParent && mParent->Role() == roles::COMBOBOX_LIST)
+    if (mParent && mParent->Role() == roles::COMBOBOX_LIST) {
       return roles::COMBOBOX_OPTION;
+    }
 
   } else if (aRole == roles::MENUITEM) {
     // Menuitem has a submenu.
     if (mContent->IsElement() &&
         mContent->AsElement()->AttrValueIs(kNameSpaceID_None,
                                            nsGkAtoms::aria_haspopup,
                                            nsGkAtoms::_true, eCaseMatters)) {
       return roles::PARENT_MENUITEM;
@@ -1499,53 +1520,56 @@ void Accessible::ActionNameAt(uint8_t aI
       return;
 
     case ePressAction:
       aName.AssignLiteral("press");
       return;
 
     case eCheckUncheckAction: {
       uint64_t state = State();
-      if (state & states::CHECKED)
+      if (state & states::CHECKED) {
         aName.AssignLiteral("uncheck");
-      else if (state & states::MIXED)
+      } else if (state & states::MIXED) {
         aName.AssignLiteral("cycle");
-      else
+      } else {
         aName.AssignLiteral("check");
+      }
       return;
     }
 
     case eJumpAction:
       aName.AssignLiteral("jump");
       return;
 
     case eOpenCloseAction:
-      if (State() & states::COLLAPSED)
+      if (State() & states::COLLAPSED) {
         aName.AssignLiteral("open");
-      else
+      } else {
         aName.AssignLiteral("close");
+      }
       return;
 
     case eSelectAction:
       aName.AssignLiteral("select");
       return;
 
     case eSwitchAction:
       aName.AssignLiteral("switch");
       return;
 
     case eSortAction:
       aName.AssignLiteral("sort");
       return;
 
     case eExpandAction:
-      if (State() & states::COLLAPSED)
+      if (State() & states::COLLAPSED) {
         aName.AssignLiteral("expand");
-      else
+      } else {
         aName.AssignLiteral("collapse");
+      }
       return;
   }
 }
 
 bool Accessible::DoAction(uint8_t aIndex) const {
   if (aIndex != 0) return false;
 
   if (GetActionRule() != eNoAction) {
@@ -1557,18 +1581,19 @@ bool Accessible::DoAction(uint8_t aIndex
 }
 
 nsIContent* Accessible::GetAtomicRegion() const {
   nsIContent* loopContent = mContent;
   nsAutoString atomic;
   while (loopContent &&
          (!loopContent->IsElement() ||
           !loopContent->AsElement()->GetAttr(kNameSpaceID_None,
-                                             nsGkAtoms::aria_atomic, atomic)))
+                                             nsGkAtoms::aria_atomic, atomic))) {
     loopContent = loopContent->GetParent();
+  }
 
   return atomic.EqualsLiteral("true") ? loopContent : nullptr;
 }
 
 Relation Accessible::RelationByType(RelationType aType) const {
   if (!HasOwnContent()) return Relation();
 
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
@@ -1585,40 +1610,43 @@ Relation Accessible::RelationByType(Rela
       rel.AppendIter(new XULLabelIterator(Document(), mContent));
 
       return rel;
     }
 
     case RelationType::LABEL_FOR: {
       Relation rel(new RelatedAccIterator(Document(), mContent,
                                           nsGkAtoms::aria_labelledby));
-      if (mContent->IsXULElement(nsGkAtoms::label))
+      if (mContent->IsXULElement(nsGkAtoms::label)) {
         rel.AppendIter(new IDRefsIterator(mDoc, mContent, nsGkAtoms::control));
+      }
 
       return rel;
     }
 
     case RelationType::DESCRIBED_BY: {
       Relation rel(
           new IDRefsIterator(mDoc, mContent, nsGkAtoms::aria_describedby));
-      if (mContent->IsXULElement())
+      if (mContent->IsXULElement()) {
         rel.AppendIter(new XULDescriptionIterator(Document(), mContent));
+      }
 
       return rel;
     }
 
     case RelationType::DESCRIPTION_FOR: {
       Relation rel(new RelatedAccIterator(Document(), mContent,
                                           nsGkAtoms::aria_describedby));
 
       // This affectively adds an optional control attribute to xul:description,
       // which only affects accessibility, by allowing the description to be
       // tied to a control.
-      if (mContent->IsXULElement(nsGkAtoms::description))
+      if (mContent->IsXULElement(nsGkAtoms::description)) {
         rel.AppendIter(new IDRefsIterator(mDoc, mContent, nsGkAtoms::control));
+      }
 
       return rel;
     }
 
     case RelationType::NODE_CHILD_OF: {
       Relation rel;
       // This is an ARIA tree or treegrid that doesn't use owns, so we need to
       // get the parent the hard way.
@@ -1648,18 +1676,19 @@ Relation Accessible::RelationByType(Rela
       // ROLE_WINDOW accessible which will prevent us from going up further
       // (because it is system generated and has no idea about the hierarchy
       // above it).
       nsIFrame* frame = GetFrame();
       if (frame) {
         nsView* view = frame->GetView();
         if (view) {
           nsIScrollableFrame* scrollFrame = do_QueryFrame(frame);
-          if (scrollFrame || view->GetWidget() || !frame->GetParent())
+          if (scrollFrame || view->GetWidget() || !frame->GetParent()) {
             rel.AppendTarget(LocalParent());
+          }
         }
       }
 
       return rel;
     }
 
     case RelationType::NODE_PARENT_OF: {
       // ARIA tree or treegrid can do the hierarchy by @aria-level, ARIA trees
@@ -1899,18 +1928,19 @@ void Accessible::ScrollToPoint(uint32_t 
                                int32_t aY) {
   nsIFrame* frame = GetFrame();
   if (!frame) return;
 
   nsIntPoint coords =
       nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordinateType, this);
 
   nsIFrame* parentFrame = frame;
-  while ((parentFrame = parentFrame->GetParent()))
+  while ((parentFrame = parentFrame->GetParent())) {
     nsCoreUtils::ScrollFrameToPoint(parentFrame, frame, coords);
+  }
 }
 
 void Accessible::AppendTextTo(nsAString& aText, uint32_t aStartOffset,
                               uint32_t aLength) {
   // Return text representation of non-text accessible within hypertext
   // accessible. Text accessible overrides this method to return enclosed text.
   if (aStartOffset != 0 || aLength == 0) return;
 
@@ -1950,18 +1980,19 @@ void Accessible::Shutdown() {
   mChildren.Clear();
 
   mEmbeddedObjCollector = nullptr;
 
   if (mParent) mParent->RemoveChild(this);
 
   mContent = nullptr;
   mDoc = nullptr;
-  if (SelectionMgr() && SelectionMgr()->AccessibleWithCaret(nullptr) == this)
+  if (SelectionMgr() && SelectionMgr()->AccessibleWithCaret(nullptr) == this) {
     SelectionMgr()->ResetCaretOffset();
+  }
 }
 
 // Accessible protected
 void Accessible::ARIAName(nsString& aName) const {
   // aria-labelledby now takes precedence over aria-label
   nsresult rv = nsTextEquivUtils::GetTextEquivFromIDRefs(
       this, nsGkAtoms::aria_labelledby, aName);
   if (NS_SUCCEEDED(rv)) {
@@ -2274,40 +2305,43 @@ Accessible* Accessible::LocalChildAt(uin
 }
 
 uint32_t Accessible::ChildCount() const { return mChildren.Length(); }
 
 int32_t Accessible::IndexInParent() const { return mIndexInParent; }
 
 uint32_t Accessible::EmbeddedChildCount() {
   if (mStateFlags & eHasTextKids) {
-    if (!mEmbeddedObjCollector)
+    if (!mEmbeddedObjCollector) {
       mEmbeddedObjCollector.reset(new EmbeddedObjCollector(this));
+    }
     return mEmbeddedObjCollector->Count();
   }
 
   return ChildCount();
 }
 
 Accessible* Accessible::GetEmbeddedChildAt(uint32_t aIndex) {
   if (mStateFlags & eHasTextKids) {
-    if (!mEmbeddedObjCollector)
+    if (!mEmbeddedObjCollector) {
       mEmbeddedObjCollector.reset(new EmbeddedObjCollector(this));
+    }
     return mEmbeddedObjCollector.get()
                ? mEmbeddedObjCollector->GetAccessibleAt(aIndex)
                : nullptr;
   }
 
   return LocalChildAt(aIndex);
 }
 
 int32_t Accessible::GetIndexOfEmbeddedChild(Accessible* aChild) {
   if (mStateFlags & eHasTextKids) {
-    if (!mEmbeddedObjCollector)
+    if (!mEmbeddedObjCollector) {
       mEmbeddedObjCollector.reset(new EmbeddedObjCollector(this));
+    }
     return mEmbeddedObjCollector.get()
                ? mEmbeddedObjCollector->GetIndexAt(aChild)
                : -1;
   }
 
   return GetIndexOf(aChild);
 }
 
@@ -2465,18 +2499,19 @@ bool Accessible::IsActiveWidget() const 
 
   // If text entry of combobox widget has a focus then the combobox widget is
   // active.
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
   if (roleMapEntry && roleMapEntry->Is(nsGkAtoms::combobox)) {
     uint32_t childCount = ChildCount();
     for (uint32_t idx = 0; idx < childCount; idx++) {
       Accessible* child = mChildren.ElementAt(idx);
-      if (child->Role() == roles::ENTRY)
+      if (child->Role() == roles::ENTRY) {
         return FocusMgr()->HasDOMFocus(child->GetContent());
+      }
     }
   }
 
   return false;
 }
 
 bool Accessible::AreItemsOperable() const {
   return HasOwnContent() && mContent->IsElement() &&
@@ -2572,51 +2607,58 @@ Accessible* Accessible::GetSiblingAtOffs
   Accessible* child = mParent->LocalChildAt(mIndexInParent + aOffset);
   if (aError && !child) *aError = NS_ERROR_UNEXPECTED;
 
   return child;
 }
 
 double Accessible::AttrNumericValue(nsAtom* aAttr) const {
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
-  if (!roleMapEntry || roleMapEntry->valueRule == eNoValue)
+  if (!roleMapEntry || roleMapEntry->valueRule == eNoValue) {
     return UnspecifiedNaN<double>();
+  }
 
   nsAutoString attrValue;
   if (!mContent->IsElement() ||
-      !mContent->AsElement()->GetAttr(kNameSpaceID_None, aAttr, attrValue))
+      !mContent->AsElement()->GetAttr(kNameSpaceID_None, aAttr, attrValue)) {
     return UnspecifiedNaN<double>();
+  }
 
   nsresult error = NS_OK;
   double value = attrValue.ToDouble(&error);
   return NS_FAILED(error) ? UnspecifiedNaN<double>() : value;
 }
 
 uint32_t Accessible::GetActionRule() const {
-  if (!HasOwnContent() || (InteractiveState() & states::UNAVAILABLE))
+  if (!HasOwnContent() || (InteractiveState() & states::UNAVAILABLE)) {
     return eNoAction;
+  }
 
   // Return "click" action on elements that have an attached popup menu.
-  if (mContent->IsXULElement())
-    if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::popup))
+  if (mContent->IsXULElement()) {
+    if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::popup)) {
       return eClickAction;
+    }
+  }
 
   // Has registered 'click' event handler.
   bool isOnclick = nsCoreUtils::HasClickListener(mContent);
 
   if (isOnclick) return eClickAction;
 
   // Get an action based on ARIA role.
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
-  if (roleMapEntry && roleMapEntry->actionRule != eNoAction)
+  if (roleMapEntry && roleMapEntry->actionRule != eNoAction) {
     return roleMapEntry->actionRule;
+  }
 
   // Get an action based on ARIA attribute.
-  if (nsAccUtils::HasDefinedARIAToken(mContent, nsGkAtoms::aria_expanded))
+  if (nsAccUtils::HasDefinedARIAToken(mContent, nsGkAtoms::aria_expanded)) {
     return eExpandAction;
+  }
 
   return eNoAction;
 }
 
 AccGroupInfo* Accessible::GetGroupInfo() const {
   if (IsProxy()) MOZ_CRASH("This should never be called on proxy wrappers");
 
   if (mBits.groupInfo) {
@@ -2679,35 +2721,38 @@ int32_t Accessible::GetLevelInternal() {
     //   by group that is a last child of the parent listitem).
 
     // Calculate 'level' attribute based on number of parent listitems.
     level = 0;
     Accessible* parent = this;
     while ((parent = parent->LocalParent())) {
       roles::Role parentRole = parent->Role();
 
-      if (parentRole == roles::LISTITEM)
+      if (parentRole == roles::LISTITEM) {
         ++level;
-      else if (parentRole != roles::LIST && parentRole != roles::GROUPING)
+      } else if (parentRole != roles::LIST && parentRole != roles::GROUPING) {
         break;
+      }
     }
 
     if (level == 0) {
       // If this listitem is on top of nested lists then expose 'level'
       // attribute.
       parent = LocalParent();
       uint32_t siblingCount = parent->ChildCount();
       for (uint32_t siblingIdx = 0; siblingIdx < siblingCount; siblingIdx++) {
         Accessible* sibling = parent->LocalChildAt(siblingIdx);
 
         Accessible* siblingChild = sibling->LocalLastChild();
         if (siblingChild) {
           roles::Role lastChildRole = siblingChild->Role();
-          if (lastChildRole == roles::LIST || lastChildRole == roles::GROUPING)
+          if (lastChildRole == roles::LIST ||
+              lastChildRole == roles::GROUPING) {
             return 1;
+          }
         }
       }
     } else {
       ++level;  // level is 1-index based
     }
   } else if (role == roles::COMMENT) {
     // For comments, count the ancestor elements with the same role to get the
     // level.
@@ -2756,20 +2801,21 @@ uint32_t KeyBinding::AccelModifier() {
       return 0;
   }
 }
 
 void KeyBinding::ToPlatformFormat(nsAString& aValue) const {
   nsCOMPtr<nsIStringBundle> keyStringBundle;
   nsCOMPtr<nsIStringBundleService> stringBundleService =
       mozilla::components::StringBundle::Service();
-  if (stringBundleService)
+  if (stringBundleService) {
     stringBundleService->CreateBundle(
         "chrome://global-platform/locale/platformKeys.properties",
         getter_AddRefs(keyStringBundle));
+  }
 
   if (!keyStringBundle) return;
 
   nsAutoString separator;
   keyStringBundle->GetStringFromName("MODIFIER_SEPARATOR", separator);
 
   nsAutoString modifierName;
   if (mModifierMask & kControl) {
--- a/accessible/generic/Accessible.h
+++ b/accessible/generic/Accessible.h
@@ -914,20 +914,21 @@ class Accessible : public nsISupports {
   bool NeedsDOMUIEvent() const { return !(mStateFlags & eIgnoreDOMUIEvent); }
 
   /**
    * Get/set repositioned bit indicating that the accessible was moved in
    * the accessible tree, i.e. the accessible tree structure differs from DOM.
    */
   bool IsRelocated() const { return mStateFlags & eRelocated; }
   void SetRelocated(bool aRelocated) {
-    if (aRelocated)
+    if (aRelocated) {
       mStateFlags |= eRelocated;
-    else
+    } else {
       mStateFlags &= ~eRelocated;
+    }
   }
 
   /**
    * Return true if the accessible allows accessible children from subtree of
    * a DOM element of this accessible.
    */
   bool KidsFromDOM() const { return !(mStateFlags & eNoKidsFromDOM); }
 
@@ -1250,20 +1251,21 @@ class KeyBinding {
   inline void ToString(nsAString& aValue,
                        Format aFormat = ePlatformFormat) const {
     aValue.Truncate();
     AppendToString(aValue, aFormat);
   }
   inline void AppendToString(nsAString& aValue,
                              Format aFormat = ePlatformFormat) const {
     if (mKey) {
-      if (aFormat == ePlatformFormat)
+      if (aFormat == ePlatformFormat) {
         ToPlatformFormat(aValue);
-      else
+      } else {
         ToAtkFormat(aValue);
+      }
     }
   }
 
  private:
   void ToPlatformFormat(nsAString& aValue) const;
   void ToAtkFormat(nsAString& aValue) const;
 
   uint32_t mKey;
--- a/accessible/generic/DocAccessible-inl.h
+++ b/accessible/generic/DocAccessible-inl.h
@@ -78,18 +78,19 @@ inline void DocAccessible::HandleNotific
         aInstance, aMethod, aArgs...);
   }
 }
 
 inline void DocAccessible::UpdateText(nsIContent* aTextNode) {
   NS_ASSERTION(mNotificationController, "The document was shut down!");
 
   // Ignore the notification if initial tree construction hasn't been done yet.
-  if (mNotificationController && HasLoadState(eTreeConstructed))
+  if (mNotificationController && HasLoadState(eTreeConstructed)) {
     mNotificationController->ScheduleTextUpdate(aTextNode);
+  }
 }
 
 inline void DocAccessible::NotifyOfLoad(uint32_t aLoadEventType) {
   mLoadState |= eDOMLoaded;
   mLoadEventType = aLoadEventType;
 
   // If the document is loaded completely then network activity was presumingly
   // caused by file loading. Fire busy state change event.
--- a/accessible/generic/DocAccessible.cpp
+++ b/accessible/generic/DocAccessible.cpp
@@ -191,18 +191,19 @@ ENameValueFlag DocAccessible::Name(nsStr
 role DocAccessible::NativeRole() const {
   nsCOMPtr<nsIDocShell> docShell = nsCoreUtils::GetDocShellFor(mDocumentNode);
   if (docShell) {
     nsCOMPtr<nsIDocShellTreeItem> sameTypeRoot;
     docShell->GetInProcessSameTypeRootTreeItem(getter_AddRefs(sameTypeRoot));
     int32_t itemType = docShell->ItemType();
     if (sameTypeRoot == docShell) {
       // Root of content or chrome tree
-      if (itemType == nsIDocShellTreeItem::typeChrome)
+      if (itemType == nsIDocShellTreeItem::typeChrome) {
         return roles::CHROME_WINDOW;
+      }
 
       if (itemType == nsIDocShellTreeItem::typeContent) {
         return roles::DOCUMENT;
       }
     } else if (itemType == nsIDocShellTreeItem::typeContent) {
       return roles::DOCUMENT;
     }
   }
@@ -268,18 +269,19 @@ already_AddRefed<nsIPersistentProperties
 
   // No attributes if document is not attached to the tree or if it's a root
   // document.
   if (!mParent || IsRoot()) return attributes.forget();
 
   // Override ARIA object attributes from outerdoc.
   aria::AttrIterator attribIter(mParent->GetContent());
   nsAutoString name, value, unused;
-  while (attribIter.Next(name, value))
+  while (attribIter.Next(name, value)) {
     attributes->SetStringProperty(NS_ConvertUTF16toUTF8(name), value, unused);
+  }
 
   return attributes.forget();
 }
 
 Accessible* DocAccessible::FocusedChild() {
   // Return an accessible for the current global focus, which does not have to
   // be contained within the current document.
   return FocusMgr()->FocusedAccessible();
@@ -294,18 +296,19 @@ void DocAccessible::TakeFocus() const {
                 nsFocusManager::MOVEFOCUS_ROOT, 0, getter_AddRefs(newFocus));
 }
 
 // HyperTextAccessible method
 already_AddRefed<TextEditor> DocAccessible::GetEditor() const {
   // Check if document is editable (designMode="on" case). Otherwise check if
   // the html:body (for HTML document case) or document element is editable.
   if (!mDocumentNode->HasFlag(NODE_IS_EDITABLE) &&
-      (!mContent || !mContent->HasFlag(NODE_IS_EDITABLE)))
+      (!mContent || !mContent->HasFlag(NODE_IS_EDITABLE))) {
     return nullptr;
+  }
 
   nsCOMPtr<nsIDocShell> docShell = mDocumentNode->GetDocShell();
   if (!docShell) {
     return nullptr;
   }
 
   nsCOMPtr<nsIEditingSession> editingSession;
   docShell->GetEditingSession(getter_AddRefs(editingSession));
@@ -353,40 +356,44 @@ void DocAccessible::DocType(nsAString& a
   if (docType) docType->GetPublicId(aType);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible
 
 void DocAccessible::Init() {
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eDocCreate))
+  if (logging::IsEnabled(logging::eDocCreate)) {
     logging::DocCreate("document initialize", mDocumentNode, this);
+  }
 #endif
 
   // Initialize notification controller.
   mNotificationController = new NotificationController(this, mPresShell);
 
   // Mark the document accessible as loaded if its DOM document was loaded at
   // this point (this can happen because a11y is started late or DOM document
   // having no container was loaded.
-  if (mDocumentNode->GetReadyStateEnum() == dom::Document::READYSTATE_COMPLETE)
+  if (mDocumentNode->GetReadyStateEnum() ==
+      dom::Document::READYSTATE_COMPLETE) {
     mLoadState |= eDOMLoaded;
+  }
 
   AddEventListeners();
 }
 
 void DocAccessible::Shutdown() {
   if (!mPresShell) {  // already shutdown
     return;
   }
 
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eDocDestroy))
+  if (logging::IsEnabled(logging::eDocDestroy)) {
     logging::DocDestroy("document shutdown", mDocumentNode, this);
+  }
 #endif
 
   // Mark the document as shutdown before AT is notified about the document
   // removal from its container (valid for root documents on ATK and due to
   // some reason for MSAA, refer to bug 757392 for details).
   mStateFlags |= eIsDefunct;
 
   if (mNotificationController) {
@@ -408,18 +415,19 @@ void DocAccessible::Shutdown() {
   }
 
   mPresShell->SetDocAccessible(nullptr);
   mPresShell = nullptr;  // Avoid reentrancy
 
   // Walk the array backwards because child documents remove themselves from the
   // array as they are shutdown.
   int32_t childDocCount = mChildDocuments.Length();
-  for (int32_t idx = childDocCount - 1; idx >= 0; idx--)
+  for (int32_t idx = childDocCount - 1; idx >= 0; idx--) {
     mChildDocuments[idx]->Shutdown();
+  }
 
   mChildDocuments.Clear();
 
   // XXX thinking about ordering?
   if (mIPCDoc) {
     MOZ_ASSERT(IPCAccessibilityActive());
     mIPCDoc->Shutdown();
     MOZ_ASSERT(!mIPCDoc);
@@ -514,18 +522,19 @@ nsRect DocAccessible::RelativeBounds(nsI
 // DocAccessible protected member
 nsresult DocAccessible::AddEventListeners() {
   nsCOMPtr<nsIDocShell> docShell(mDocumentNode->GetDocShell());
 
   // We want to add a command observer only if the document is content and has
   // an editor.
   if (docShell->ItemType() == nsIDocShellTreeItem::typeContent) {
     RefPtr<nsCommandManager> commandManager = docShell->GetCommandManager();
-    if (commandManager)
+    if (commandManager) {
       commandManager->AddCommandObserver(this, "obs_documentCreated");
+    }
   }
 
   SelectionMgr()->AddDocSelectionListener(mPresShell);
 
   // Add document observer.
   mDocumentNode->AddObserver(this);
   return NS_OK;
 }
@@ -667,18 +676,19 @@ void DocAccessible::AttributeWillChange(
     if (aElement != mContent) return;
 
     accessible = this;
   }
 
   // Update dependent IDs cache. Take care of elements that are accessible
   // because dependent IDs cache doesn't contain IDs from non accessible
   // elements.
-  if (aModType != dom::MutationEvent_Binding::ADDITION)
+  if (aModType != dom::MutationEvent_Binding::ADDITION) {
     RemoveDependentIDsFor(accessible, aAttribute);
+  }
 
   if (aAttribute == nsGkAtoms::id) {
     RelocateARIAOwnedIfNeeded(aElement);
   }
 
   // Store the ARIA attribute old value so that it can be used after
   // attribute change. Note, we assume there's no nested ARIA attribute
   // changes. If this happens then we should end up with keeping a stack of
@@ -918,19 +928,20 @@ void DocAccessible::AttributeChangedImpl
   if (aAttribute == nsGkAtoms::title) {
     if (!elm->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_label) &&
         !elm->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_labelledby) &&
         !elm->HasAttr(kNameSpaceID_None, nsGkAtoms::alt)) {
       FireDelayedEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, aAccessible);
       return;
     }
 
-    if (!elm->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_describedby))
+    if (!elm->HasAttr(kNameSpaceID_None, nsGkAtoms::aria_describedby)) {
       FireDelayedEvent(nsIAccessibleEvent::EVENT_DESCRIPTION_CHANGE,
                        aAccessible);
+    }
 
     return;
   }
 
   // These attributes can change whether or not a table is a layout table.
   // We currently cache that information on Mac, so we fire a
   // EVENT_OBJECT_ATTRIBUTE_CHANGED, which Mac listens for, to invalidate.
   if (aAccessible->IsTable() || aAccessible->IsTableRow() ||
@@ -994,18 +1005,19 @@ void DocAccessible::AttributeChangedImpl
     // It may be the same if contenteditable is set on a node that doesn't
     // support it. Like an <input>.
     aAccessible->MaybeFireFocusableStateChange(
         (mPrevStateBits & states::FOCUSABLE));
     return;
   }
 
   if (aAttribute == nsGkAtoms::value) {
-    if (aAccessible->IsProgress())
+    if (aAccessible->IsProgress()) {
       FireDelayedEvent(nsIAccessibleEvent::EVENT_VALUE_CHANGE, aAccessible);
+    }
     return;
   }
 
   if (aModType == dom::MutationEvent_Binding::REMOVAL ||
       aModType == dom::MutationEvent_Binding::ADDITION) {
     if (aAttribute == nsGkAtoms::href) {
       if (aAccessible->IsHTMLLink() &&
           !nsCoreUtils::HasClickListener(aAccessible->GetContent())) {
@@ -1141,19 +1153,20 @@ void DocAccessible::ARIAActiveDescendant
     if (elm->AsElement()->GetAttr(kNameSpaceID_None,
                                   nsGkAtoms::aria_activedescendant, id)) {
       dom::Element* activeDescendantElm = IDRefsIterator::GetElem(elm, id);
       if (activeDescendantElm) {
         Accessible* activeDescendant = GetAccessible(activeDescendantElm);
         if (activeDescendant) {
           FocusMgr()->ActiveItemChanged(activeDescendant, false);
 #ifdef A11Y_LOG
-          if (logging::IsEnabled(logging::eFocus))
+          if (logging::IsEnabled(logging::eFocus)) {
             logging::ActiveItemChangeCausedBy("ARIA activedescedant changed",
                                               activeDescendant);
+          }
 #endif
           return;
         }
       }
     }
 
     // aria-activedescendant was cleared or changed to a non-existent node.
     // Move focus back to the element itself.
@@ -1239,18 +1252,19 @@ void DocAccessible::ContentRemoved(nsICo
 
 void DocAccessible::ParentChainChanged(nsIContent* aContent) {}
 
 ////////////////////////////////////////////////////////////////////////////////
 // Accessible
 
 #ifdef A11Y_LOG
 nsresult DocAccessible::HandleAccEvent(AccEvent* aEvent) {
-  if (logging::IsEnabled(logging::eDocLoad))
+  if (logging::IsEnabled(logging::eDocLoad)) {
     logging::DocLoadEventHandled(aEvent);
+  }
 
   return HyperTextAccessible::HandleAccEvent(aEvent);
 }
 #endif
 
 ////////////////////////////////////////////////////////////////////////////////
 // Public members
 
@@ -1372,18 +1386,19 @@ Accessible* DocAccessible::GetAccessible
   }
 
   return nullptr;
 }
 
 void DocAccessible::BindToDocument(Accessible* aAccessible,
                                    const nsRoleMapEntry* aRoleMapEntry) {
   // Put into DOM node cache.
-  if (aAccessible->IsNodeMapEntry())
+  if (aAccessible->IsNodeMapEntry()) {
     mNodeToAccessibleMap.Put(aAccessible->GetNode(), aAccessible);
+  }
 
   // Put into unique ID cache.
   mAccessibleCache.Put(aAccessible->UniqueID(), RefPtr{aAccessible});
 
   aAccessible->SetRoleMapEntry(aRoleMapEntry);
 
   if (aAccessible->HasOwnContent()) {
     AddDependentIDsFor(aAccessible);
@@ -1400,25 +1415,27 @@ void DocAccessible::UnbindFromDocument(A
   NS_ASSERTION(mAccessibleCache.GetWeak(aAccessible->UniqueID()),
                "Unbinding the unbound accessible!");
 
   // Fire focus event on accessible having DOM focus if last focus was removed
   // from the tree.
   if (FocusMgr()->WasLastFocused(aAccessible)) {
     FocusMgr()->ActiveItemChanged(nullptr);
 #ifdef A11Y_LOG
-    if (logging::IsEnabled(logging::eFocus))
+    if (logging::IsEnabled(logging::eFocus)) {
       logging::ActiveItemChangeCausedBy("tree shutdown", aAccessible);
+    }
 #endif
   }
 
   // Remove an accessible from node-to-accessible map if it exists there.
   if (aAccessible->IsNodeMapEntry() &&
-      mNodeToAccessibleMap.Get(aAccessible->GetNode()) == aAccessible)
+      mNodeToAccessibleMap.Get(aAccessible->GetNode()) == aAccessible) {
     mNodeToAccessibleMap.Remove(aAccessible->GetNode());
+  }
 
   aAccessible->mStateFlags |= eIsNotInDocument;
 
   // Update XPCOM part.
   xpcAccessibleDocument* xpcDoc = GetAccService()->GetCachedXPCDocument(this);
   if (xpcDoc) xpcDoc->NotifyOfShutdown(aAccessible);
 
   void* uniqueID = aAccessible->UniqueID();
@@ -1647,18 +1664,19 @@ void DocAccessible::ProcessInvalidationL
     }
   }
 
   mInvalidationList.Clear();
 }
 
 Accessible* DocAccessible::GetAccessibleEvenIfNotInMap(nsINode* aNode) const {
   if (!aNode->IsContent() ||
-      !aNode->AsContent()->IsHTMLElement(nsGkAtoms::area))
+      !aNode->AsContent()->IsHTMLElement(nsGkAtoms::area)) {
     return GetAccessible(aNode);
+  }
 
   // XXX Bug 135040, incorrect when multiple images use the same map.
   nsIFrame* frame = aNode->AsContent()->GetPrimaryFrame();
   nsImageFrame* imageFrame = do_QueryFrame(frame);
   if (imageFrame) {
     Accessible* parent = GetAccessible(imageFrame->GetContent());
     if (parent) {
       Accessible* area = parent->AsImageMap()->GetChildAccessibleFor(aNode);
@@ -1776,18 +1794,19 @@ void DocAccessible::DoInitialUpdate() {
     }
   }
 }
 
 void DocAccessible::ProcessLoad() {
   mLoadState |= eCompletelyLoaded;
 
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eDocLoad))
+  if (logging::IsEnabled(logging::eDocLoad)) {
     logging::DocCompleteLoad(this, IsLoadEventTarget());
+  }
 #endif
 
   // Do not fire document complete/stop events for root chrome document
   // accessibles and for frame/iframe documents because
   // a) screen readers start working on focus event in the case of root chrome
   // documents
   // b) document load event on sub documents causes screen readers to act is if
   // entire page is reloaded.
@@ -1813,35 +1832,38 @@ void DocAccessible::AddDependentIDsFor(A
   if (!relProviderEl) return;
 
   for (uint32_t idx = 0; idx < kRelationAttrsLen; idx++) {
     nsStaticAtom* relAttr = kRelationAttrs[idx];
     if (aRelAttr && aRelAttr != relAttr) continue;
 
     if (relAttr == nsGkAtoms::_for) {
       if (!relProviderEl->IsAnyOfHTMLElements(nsGkAtoms::label,
-                                              nsGkAtoms::output))
+                                              nsGkAtoms::output)) {
         continue;
+      }
 
     } else if (relAttr == nsGkAtoms::control) {
       if (!relProviderEl->IsAnyOfXULElements(nsGkAtoms::label,
-                                             nsGkAtoms::description))
+                                             nsGkAtoms::description)) {
         continue;
+      }
     }
 
     IDRefsIterator iter(this, relProviderEl, relAttr);
     while (true) {
       const nsDependentSubstring id = iter.NextID();
       if (id.IsEmpty()) break;
 
       nsIContent* dependentContent = iter.GetElem(id);
       if (!dependentContent ||
           (relAttr == nsGkAtoms::aria_owns &&
-           !aRelProvider->IsAcceptableChild(dependentContent)))
+           !aRelProvider->IsAcceptableChild(dependentContent))) {
         continue;
+      }
 
       AttrRelProviders* providers =
           GetOrCreateRelProviders(dependentContent->AsElement(), id);
       if (providers) {
         AttrRelProvider* provider = new AttrRelProvider(relAttr, relProviderEl);
         if (provider) {
           providers->AppendElement(provider);
 
@@ -2549,18 +2571,19 @@ bool DocAccessible::MoveChild(Accessible
   return true;
 }
 
 void DocAccessible::CacheChildrenInSubtree(Accessible* aRoot,
                                            Accessible** aFocusedAcc) {
   // If the accessible is focused then report a focus event after all related
   // mutation events.
   if (aFocusedAcc && !*aFocusedAcc &&
-      FocusMgr()->HasDOMFocus(aRoot->GetContent()))
+      FocusMgr()->HasDOMFocus(aRoot->GetContent())) {
     *aFocusedAcc = aRoot;
+  }
 
   Accessible* root = aRoot->IsHTMLCombobox() ? aRoot->LocalFirstChild() : aRoot;
   if (root->KidsFromDOM()) {
     TreeMutation mt(root, TreeMutation::kNoEvents);
     TreeWalker walker(root);
     while (Accessible* child = walker.Next()) {
       if (child->IsBoundToParent()) {
         MoveChild(child, root, root->mChildren.Length());
@@ -2610,18 +2633,19 @@ void DocAccessible::UncacheChildrenInSub
     // Removing this accessible from the document doesn't mean anything about
     // accessibles for subdocuments, so skip removing those from the tree.
     if (!child->IsDoc()) {
       UncacheChildrenInSubtree(child);
     }
   }
 
   if (aRoot->IsNodeMapEntry() &&
-      mNodeToAccessibleMap.Get(aRoot->GetNode()) == aRoot)
+      mNodeToAccessibleMap.Get(aRoot->GetNode()) == aRoot) {
     mNodeToAccessibleMap.Remove(aRoot->GetNode());
+  }
 }
 
 void DocAccessible::ShutdownChildrenInSubtree(Accessible* aAccessible) {
   // Traverse through children and shutdown them before this accessible. When
   // child gets shutdown then it removes itself from children array of its
   // parent. Use jdx index to process the cases if child is not attached to the
   // parent and as result doesn't remove itself from its children.
   uint32_t count = aAccessible->ContentChildCount();
--- a/accessible/generic/HyperTextAccessible-inl.h
+++ b/accessible/generic/HyperTextAccessible-inl.h
@@ -104,18 +104,19 @@ inline void HyperTextAccessible::PasteTe
   RefPtr<TextEditor> textEditor = GetEditor();
   if (textEditor) {
     SetSelectionRange(aPosition, aPosition);
     textEditor->PasteAsAction(nsIClipboard::kGlobalClipboard, true);
   }
 }
 
 inline index_t HyperTextAccessible::ConvertMagicOffset(int32_t aOffset) const {
-  if (aOffset == nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT)
+  if (aOffset == nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT) {
     return CharacterCount();
+  }
 
   if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET) return CaretOffset();
 
   return aOffset;
 }
 
 inline uint32_t HyperTextAccessible::AdjustCaretOffset(uint32_t aOffset) const {
   // It is the same character offset when the caret is visually at the very
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -462,18 +462,19 @@ DOMPoint HyperTextAccessible::OffsetToDO
   // A text leaf case.
   if (child->IsTextLeaf()) {
     // The point is inside the text node. This is always true for any text leaf
     // except a last child one. See assertion below.
     if (aOffset < GetChildOffset(childIdx + 1)) {
       nsIContent* content = child->GetContent();
       int32_t idx = 0;
       if (NS_FAILED(RenderedToContentOffset(content->GetPrimaryFrame(),
-                                            innerOffset, &idx)))
+                                            innerOffset, &idx))) {
         return DOMPoint();
+      }
 
       return DOMPoint(content, idx);
     }
 
     // Set the DOM point right after the text node.
     MOZ_ASSERT(static_cast<uint32_t>(aOffset) == CharacterCount());
     innerOffset = 1;
   }
@@ -715,18 +716,19 @@ uint32_t HyperTextAccessible::FindLineBo
     uint32_t aOffset, EWhichLineBoundary aWhichLineBoundary) {
   // Note: empty last line doesn't have own frame (a previous line contains '\n'
   // character instead) thus when it makes a difference we need to process this
   // case separately (otherwise operations are performed on previous line).
   switch (aWhichLineBoundary) {
     case ePrevLineBegin: {
       // Fetch a previous line and move to its start (as arrow up and home keys
       // were pressed).
-      if (IsEmptyLastLineOffset(aOffset))
+      if (IsEmptyLastLineOffset(aOffset)) {
         return FindOffset(aOffset, eDirPrevious, eSelectBeginLine);
+      }
 
       uint32_t tmpOffset = FindOffset(aOffset, eDirPrevious, eSelectLine);
       return FindOffset(tmpOffset, eDirPrevious, eSelectBeginLine);
     }
 
     case ePrevLineEnd: {
       if (IsEmptyLastLineOffset(aOffset)) return aOffset - 1;
 
@@ -973,23 +975,25 @@ void HyperTextAccessible::TextBeforeOffs
 
   index_t convertedOffset = ConvertMagicOffset(aOffset);
   if (!convertedOffset.IsValid() || convertedOffset > CharacterCount()) {
     NS_ERROR("Wrong in offset!");
     return;
   }
 
   uint32_t adjustedOffset = convertedOffset;
-  if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET)
+  if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET) {
     adjustedOffset = AdjustCaretOffset(adjustedOffset);
+  }
 
   switch (aBoundaryType) {
     case nsIAccessibleText::BOUNDARY_CHAR:
-      if (convertedOffset != 0)
+      if (convertedOffset != 0) {
         CharAt(convertedOffset - 1, aText, aStartOffset, aEndOffset);
+      }
       break;
 
     case nsIAccessibleText::BOUNDARY_WORD_START: {
       // If the offset is a word start (except text length offset) then move
       // backward to find a start offset (end offset is the given offset).
       // Otherwise move backward twice to find both start and end offsets.
       if (adjustedOffset == CharacterCount()) {
         *aEndOffset =
@@ -1049,52 +1053,56 @@ void HyperTextAccessible::TextAtOffset(i
     return;
   }
 
   switch (aBoundaryType) {
     case nsIAccessibleText::BOUNDARY_CHAR:
       // Return no char if caret is at the end of wrapped line (case of no line
       // end character). Returning a next line char is confusing for AT.
       if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET &&
-          IsCaretAtEndOfLine())
+          IsCaretAtEndOfLine()) {
         *aStartOffset = *aEndOffset = adjustedOffset;
-      else
+      } else {
         CharAt(adjustedOffset, aText, aStartOffset, aEndOffset);
+      }
       break;
 
     case nsIAccessibleText::BOUNDARY_WORD_START:
-      if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET)
+      if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET) {
         adjustedOffset = AdjustCaretOffset(adjustedOffset);
+      }
 
       *aEndOffset = FindWordBoundary(adjustedOffset, eDirNext, eStartWord);
       *aStartOffset = FindWordBoundary(*aEndOffset, eDirPrevious, eStartWord);
       TextSubstring(*aStartOffset, *aEndOffset, aText);
       break;
 
     case nsIAccessibleText::BOUNDARY_WORD_END:
       // Ignore the spec and follow what WebKitGtk does because Orca expects it,
       // i.e. return a next word at word end offset of the current word
       // (WebKitGtk behavior) instead the current word (AKT spec).
       *aEndOffset = FindWordBoundary(adjustedOffset, eDirNext, eEndWord);
       *aStartOffset = FindWordBoundary(*aEndOffset, eDirPrevious, eEndWord);
       TextSubstring(*aStartOffset, *aEndOffset, aText);
       break;
 
     case nsIAccessibleText::BOUNDARY_LINE_START:
-      if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET)
+      if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET) {
         adjustedOffset = AdjustCaretOffset(adjustedOffset);
+      }
 
       *aStartOffset = FindLineBoundary(adjustedOffset, eThisLineBegin);
       *aEndOffset = FindLineBoundary(adjustedOffset, eNextLineBegin);
       TextSubstring(*aStartOffset, *aEndOffset, aText);
       break;
 
     case nsIAccessibleText::BOUNDARY_LINE_END:
-      if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET)
+      if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET) {
         adjustedOffset = AdjustCaretOffset(adjustedOffset);
+      }
 
       // In contrast to word end boundary we follow the spec here.
       *aStartOffset = FindLineBoundary(adjustedOffset, ePrevLineEnd);
       *aEndOffset = FindLineBoundary(adjustedOffset, eThisLineEnd);
       TextSubstring(*aStartOffset, *aEndOffset, aText);
       break;
 
     case nsIAccessibleText::BOUNDARY_PARAGRAPH: {
@@ -1133,27 +1141,29 @@ void HyperTextAccessible::TextAfterOffse
 
   index_t convertedOffset = ConvertMagicOffset(aOffset);
   if (!convertedOffset.IsValid() || convertedOffset > CharacterCount()) {
     NS_ERROR("Wrong in offset!");
     return;
   }
 
   uint32_t adjustedOffset = convertedOffset;
-  if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET)
+  if (aOffset == nsIAccessibleText::TEXT_OFFSET_CARET) {
     adjustedOffset = AdjustCaretOffset(adjustedOffset);
+  }
 
   switch (aBoundaryType) {
     case nsIAccessibleText::BOUNDARY_CHAR:
       // If caret is at the end of wrapped line (case of no line end character)
       // then char after the offset is a first char at next line.
-      if (adjustedOffset >= CharacterCount())
+      if (adjustedOffset >= CharacterCount()) {
         *aStartOffset = *aEndOffset = CharacterCount();
-      else
+      } else {
         CharAt(adjustedOffset + 1, aText, aStartOffset, aEndOffset);
+      }
       break;
 
     case nsIAccessibleText::BOUNDARY_WORD_START:
       // Move word forward twice to find start and end offsets.
       *aStartOffset = FindWordBoundary(adjustedOffset, eDirNext, eStartWord);
       *aEndOffset = FindWordBoundary(*aStartOffset, eDirNext, eStartWord);
       TextSubstring(*aStartOffset, *aEndOffset, aText);
       break;
@@ -1456,18 +1466,19 @@ int32_t HyperTextAccessible::OffsetAtPoi
   nsIntPoint coords =
       nsAccUtils::ConvertToScreenCoords(aX, aY, aCoordType, this);
 
   nsPresContext* presContext = mDoc->PresContext();
   nsPoint coordsInAppUnits =
       ToAppUnits(coords, presContext->AppUnitsPerDevPixel());
 
   nsRect frameScreenRect = hyperFrame->GetScreenRectInAppUnits();
-  if (!frameScreenRect.Contains(coordsInAppUnits.x, coordsInAppUnits.y))
+  if (!frameScreenRect.Contains(coordsInAppUnits.x, coordsInAppUnits.y)) {
     return -1;  // Not found
+  }
 
   nsPoint pointInHyperText(coordsInAppUnits.x - frameScreenRect.X(),
                            coordsInAppUnits.y - frameScreenRect.Y());
 
   // Go through the frames to check if each one has the point.
   // When one does, add up the character offsets until we have a match
 
   // We have an point in an accessible child of this, now we need to add up the
@@ -1684,18 +1695,19 @@ int32_t HyperTextAccessible::CaretOffset
   HyperTextAccessible* text = SelectionMgr()->AccessibleWithCaret(&caretOffset);
 
   // Use cached value if it corresponds to this accessible.
   if (caretOffset != -1) {
     if (text == this) return caretOffset;
 
     nsINode* textNode = text->GetNode();
     // Ignore offset if cached accessible isn't a text leaf.
-    if (nsCoreUtils::IsAncestorOf(GetNode(), textNode))
+    if (nsCoreUtils::IsAncestorOf(GetNode(), textNode)) {
       return TransformOffset(text, textNode->IsText() ? caretOffset : 0, false);
+    }
   }
 
   // No caret if the focused node is not inside this DOM node and this DOM node
   // is not inside of focused node.
   FocusManager::FocusDisposition focusDisp =
       FocusMgr()->IsInOrContainsFocus(this);
   if (focusDisp == FocusManager::eNone) return -1;
 
@@ -1710,18 +1722,19 @@ int32_t HyperTextAccessible::CaretOffset
   // No caret if this DOM node is inside of focused node but the selection's
   // focus point is not inside of this DOM node.
   if (focusDisp == FocusManager::eContainedByFocus) {
     nsINode* resultNode =
         nsCoreUtils::GetDOMNodeFromDOMPoint(focusNode, focusOffset);
 
     nsINode* thisNode = GetNode();
     if (resultNode != thisNode &&
-        !nsCoreUtils::IsAncestorOf(thisNode, resultNode))
+        !nsCoreUtils::IsAncestorOf(thisNode, resultNode)) {
       return -1;
+    }
   }
 
   return DOMPointToOffset(focusNode, focusOffset);
 }
 
 int32_t HyperTextAccessible::CaretLineNumber() {
   // Provide the line number for the caret, relative to the
   // currently focused node. Use a 1-based index
@@ -1825,18 +1838,19 @@ LayoutDeviceIntRect HyperTextAccessible:
   return caretRect;
 }
 
 void HyperTextAccessible::GetSelectionDOMRanges(SelectionType aSelectionType,
                                                 nsTArray<nsRange*>* aRanges) {
   // Ignore selection if it is not visible.
   RefPtr<nsFrameSelection> frameSelection = FrameSelection();
   if (!frameSelection || frameSelection->GetDisplaySelection() <=
-                             nsISelectionController::SELECTION_HIDDEN)
+                             nsISelectionController::SELECTION_HIDDEN) {
     return;
+  }
 
   dom::Selection* domSel = frameSelection->GetSelection(aSelectionType);
   if (!domSel) return;
 
   nsINode* startNode = GetNode();
 
   RefPtr<TextEditor> textEditor = GetEditor();
   if (textEditor) {
@@ -1865,18 +1879,19 @@ bool HyperTextAccessible::SelectionBound
                                             int32_t* aStartOffset,
                                             int32_t* aEndOffset) {
   *aStartOffset = *aEndOffset = 0;
 
   nsTArray<nsRange*> ranges;
   GetSelectionDOMRanges(SelectionType::eNormal, &ranges);
 
   uint32_t rangeCount = ranges.Length();
-  if (aSelectionNum < 0 || aSelectionNum >= static_cast<int32_t>(rangeCount))
+  if (aSelectionNum < 0 || aSelectionNum >= static_cast<int32_t>(rangeCount)) {
     return false;
+  }
 
   nsRange* range = ranges[aSelectionNum];
 
   // Get start and end points.
   nsINode* startNode = range->GetStartContainer();
   nsINode* endNode = range->GetEndContainer();
   int32_t startOffset = range->StartOffset(), endOffset = range->EndOffset();
 
@@ -1894,25 +1909,27 @@ bool HyperTextAccessible::SelectionBound
     nsINode* tempNode = startNode;
     startNode = endNode;
     endNode = tempNode;
     int32_t tempOffset = startOffset;
     startOffset = endOffset;
     endOffset = tempOffset;
   }
 
-  if (!startNode->IsInclusiveDescendantOf(mContent))
+  if (!startNode->IsInclusiveDescendantOf(mContent)) {
     *aStartOffset = 0;
-  else
+  } else {
     *aStartOffset = DOMPointToOffset(startNode, startOffset);
+  }
 
-  if (!endNode->IsInclusiveDescendantOf(mContent))
+  if (!endNode->IsInclusiveDescendantOf(mContent)) {
     *aEndOffset = CharacterCount();
-  else
+  } else {
     *aEndOffset = DOMPointToOffset(endNode, endOffset, true);
+  }
   return true;
 }
 
 bool HyperTextAccessible::SetSelectionBoundsAt(int32_t aSelectionNum,
                                                int32_t aStartOffset,
                                                int32_t aEndOffset) {
   index_t startOffset = ConvertMagicOffset(aStartOffset);
   index_t endOffset = ConvertMagicOffset(aEndOffset);
@@ -1926,18 +1943,19 @@ bool HyperTextAccessible::SetSelectionBo
   return range.SetSelectionAt(aSelectionNum);
 }
 
 bool HyperTextAccessible::RemoveFromSelection(int32_t aSelectionNum) {
   RefPtr<dom::Selection> domSel = DOMSelection();
   if (!domSel) return false;
 
   if (aSelectionNum < 0 ||
-      aSelectionNum >= static_cast<int32_t>(domSel->RangeCount()))
+      aSelectionNum >= static_cast<int32_t>(domSel->RangeCount())) {
     return false;
+  }
 
   const RefPtr<nsRange> range{domSel->GetRangeAt(aSelectionNum)};
   domSel->RemoveRangeAndUnselectFramesAndNotifyListeners(*range,
                                                          IgnoreErrors());
   return true;
 }
 
 void HyperTextAccessible::ScrollSubstringTo(int32_t aStartOffset,
@@ -2086,18 +2104,19 @@ ENameValueFlag HyperTextAccessible::Nati
 
   ENameValueFlag nameFlag = AccessibleWrap::NativeName(aName);
   if (!aName.IsEmpty()) return nameFlag;
 
   // Get name from title attribute for HTML abbr and acronym elements making it
   // a valid name from markup. Otherwise their name isn't picked up by recursive
   // name computation algorithm. See NS_OK_NAME_FROM_TOOLTIP.
   if (IsAbbreviation() && mContent->AsElement()->GetAttr(
-                              kNameSpaceID_None, nsGkAtoms::title, aName))
+                              kNameSpaceID_None, nsGkAtoms::title, aName)) {
     aName.CompressWhitespace();
+  }
 
   return hasImgAlt ? eNoNameOnPurpose : eNameOK;
 }
 
 void HyperTextAccessible::Shutdown() {
   mOffsets.Clear();
   AccessibleWrap::Shutdown();
 }
@@ -2386,18 +2405,19 @@ void HyperTextAccessible::GetSpellTextAt
       const nsRange* prevRange = domSel->GetRangeAt(idx - 1);
       startOffset = DOMPointToOffset(prevRange->GetEndContainer(),
                                      prevRange->EndOffset());
     }
 
     // The previous range might not be within this accessible. In that case,
     // DOMPointToOffset returns length as a fallback. We don't want to use
     // that offset if so, hence the startOffset < *aEndOffset check.
-    if (startOffset > *aStartOffset && startOffset < *aEndOffset)
+    if (startOffset > *aStartOffset && startOffset < *aEndOffset) {
       *aStartOffset = startOffset;
+    }
 
     if (endOffset < *aEndOffset) *aEndOffset = endOffset;
 
     return;
   }
 
   // We never found a range that ended after the point, therefore we know that
   // the point is not in a range, that we do not need to compute an end offset,
@@ -2405,23 +2425,25 @@ void HyperTextAccessible::GetSpellTextAt
   // start offset of the text attribute range.
   const nsRange* prevRange = domSel->GetRangeAt(rangeCount - 1);
   startOffset =
       DOMPointToOffset(prevRange->GetEndContainer(), prevRange->EndOffset());
 
   // The previous range might not be within this accessible. In that case,
   // DOMPointToOffset returns length as a fallback. We don't want to use
   // that offset if so, hence the startOffset < *aEndOffset check.
-  if (startOffset > *aStartOffset && startOffset < *aEndOffset)
+  if (startOffset > *aStartOffset && startOffset < *aEndOffset) {
     *aStartOffset = startOffset;
+  }
 }
 
 bool HyperTextAccessible::IsTextRole() {
   const nsRoleMapEntry* roleMapEntry = ARIARoleMap();
   if (roleMapEntry && (roleMapEntry->role == roles::GRAPHIC ||
                        roleMapEntry->role == roles::IMAGE_MAP ||
                        roleMapEntry->role == roles::SLIDER ||
                        roleMapEntry->role == roles::PROGRESSBAR ||
-                       roleMapEntry->role == roles::SEPARATOR))
+                       roleMapEntry->role == roles::SEPARATOR)) {
     return false;
+  }
 
   return true;
 }
--- a/accessible/generic/ImageAccessible.cpp
+++ b/accessible/generic/ImageAccessible.cpp
@@ -41,19 +41,20 @@ uint64_t ImageAccessible::NativeState() 
   // The state is a bitfield, get our inherited state, then logically OR it with
   // states::ANIMATED if this is an animated image.
 
   uint64_t state = LinkableAccessible::NativeState();
 
   nsCOMPtr<nsIImageLoadingContent> content(do_QueryInterface(mContent));
   nsCOMPtr<imgIRequest> imageRequest;
 
-  if (content)
+  if (content) {
     content->GetRequest(nsIImageLoadingContent::CURRENT_REQUEST,
                         getter_AddRefs(imageRequest));
+  }
 
   if (imageRequest) {
     nsCOMPtr<imgIContainer> imgContainer;
     imageRequest->GetImage(getter_AddRefs(imgContainer));
     if (imgContainer) {
       bool animated = false;
       imgContainer->GetAnimated(&animated);
       if (animated) {
@@ -101,20 +102,21 @@ role ImageAccessible::NativeRole() const
 
 uint8_t ImageAccessible::ActionCount() const {
   uint8_t actionCount = LinkableAccessible::ActionCount();
   return HasLongDesc() ? actionCount + 1 : actionCount;
 }
 
 void ImageAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName) {
   aName.Truncate();
-  if (IsLongDescIndex(aIndex) && HasLongDesc())
+  if (IsLongDescIndex(aIndex) && HasLongDesc()) {
     aName.AssignLiteral("showlongdesc");
-  else
+  } else {
     LinkableAccessible::ActionNameAt(aIndex, aName);
+  }
 }
 
 bool ImageAccessible::DoAction(uint8_t aIndex) const {
   // Get the long description uri and open in a new window.
   if (!IsLongDescIndex(aIndex)) return LinkableAccessible::DoAction(aIndex);
 
   nsCOMPtr<nsIURI> uri = GetLongDescURI();
   if (!uri) return false;
--- a/accessible/generic/RootAccessible.cpp
+++ b/accessible/generic/RootAccessible.cpp
@@ -103,29 +103,32 @@ uint32_t RootAccessible::GetChromeFlags(
 #endif
 
 uint64_t RootAccessible::NativeState() const {
   uint64_t state = DocAccessibleWrap::NativeState();
   if (state & states::DEFUNCT) return state;
 
 #ifdef MOZ_XUL
   uint32_t chromeFlags = GetChromeFlags();
-  if (chromeFlags & nsIWebBrowserChrome::CHROME_WINDOW_RESIZE)
+  if (chromeFlags & nsIWebBrowserChrome::CHROME_WINDOW_RESIZE) {
     state |= states::SIZEABLE;
+  }
   // If it has a titlebar it's movable
   // XXX unless it's minimized or maximized, but not sure
   //     how to detect that
-  if (chromeFlags & nsIWebBrowserChrome::CHROME_TITLEBAR)
+  if (chromeFlags & nsIWebBrowserChrome::CHROME_TITLEBAR) {
     state |= states::MOVEABLE;
+  }
   if (chromeFlags & nsIWebBrowserChrome::CHROME_MODAL) state |= states::MODAL;
 #endif
 
   nsFocusManager* fm = nsFocusManager::GetFocusManager();
-  if (fm && fm->GetActiveWindow() == mDocumentNode->GetWindow())
+  if (fm && fm->GetActiveWindow() == mDocumentNode->GetWindow()) {
     state |= states::ACTIVE;
+  }
 
   return state;
 }
 
 const char* const kEventTypes[] = {
 #ifdef DEBUG_DRAGDROPSTART
     // Capture mouse over events and fire fake DRAGDROPSTART event to simplify
     // debugging a11y objects with event viewers.
@@ -249,18 +252,19 @@ RootAccessible::HandleEvent(Event* aDOME
 void RootAccessible::ProcessDOMEvent(Event* aDOMEvent, nsINode* aTarget) {
   MOZ_ASSERT(aDOMEvent);
   MOZ_ASSERT(aTarget);
 
   nsAutoString eventType;
   aDOMEvent->GetType(eventType);
 
 #ifdef A11Y_LOG
-  if (logging::IsEnabled(logging::eDOMEvents))
+  if (logging::IsEnabled(logging::eDOMEvents)) {
     logging::DOMEvent("processed", aTarget, eventType);
+  }
 #endif
 
   if (eventType.EqualsLiteral("popuphiding")) {
     HandlePopupHidingEvent(aTarget);
     return;
   }
 
   DocAccessible* targetDocument =
@@ -303,18 +307,19 @@ void RootAccessible::ProcessDOMEvent(Eve
       RefPtr<AccEvent> accEvent =
           new AccStateChangeEvent(accessible, states::CHECKED, isEnabled);
       nsEventShell::FireEvent(accEvent);
     }
 
     if (isEnabled) {
       FocusMgr()->ActiveItemChanged(accessible);
 #ifdef A11Y_LOG
-      if (logging::IsEnabled(logging::eFocus))
+      if (logging::IsEnabled(logging::eFocus)) {
         logging::ActiveItemChangeCausedBy("RadioStateChange", accessible);
+      }
 #endif
     }
 
     return;
   }
 
   if (eventType.EqualsLiteral("CheckboxStateChange")) {
     if (accessible->NeedsDOMUIEvent()) {
@@ -389,31 +394,33 @@ void RootAccessible::ProcessDOMEvent(Eve
   } else if (eventType.EqualsLiteral("DOMMenuInactive")) {
     if (accessible->Role() == roles::MENUPOPUP) {
       nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_MENUPOPUP_END,
                               accessible);
     }
   } else if (eventType.EqualsLiteral("DOMMenuItemActive")) {
     FocusMgr()->ActiveItemChanged(accessible);
 #ifdef A11Y_LOG
-    if (logging::IsEnabled(logging::eFocus))
+    if (logging::IsEnabled(logging::eFocus)) {
       logging::ActiveItemChangeCausedBy("DOMMenuItemActive", accessible);
+    }
 #endif
   } else if (eventType.EqualsLiteral("DOMMenuItemInactive")) {
     // Process DOMMenuItemInactive event for autocomplete only because this is
     // unique widget that may acquire focus from autocomplete popup while popup
     // stays open and has no active item. In case of XUL tree autocomplete
     // popup this event is fired for tree accessible.
     Accessible* widget =
         accessible->IsWidget() ? accessible : accessible->ContainerWidget();
     if (widget && widget->IsAutoCompletePopup()) {
       FocusMgr()->ActiveItemChanged(nullptr);
 #ifdef A11Y_LOG
-      if (logging::IsEnabled(logging::eFocus))
+      if (logging::IsEnabled(logging::eFocus)) {
         logging::ActiveItemChangeCausedBy("DOMMenuItemInactive", accessible);
+      }
 #endif
     }
   } else if (eventType.EqualsLiteral(
                  "DOMMenuBarActive")) {  // Always from user input
     nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_MENU_START, accessible,
                             eFromUserInput);
 
     // Notify of active item change when menubar gets active and if it has
@@ -421,29 +428,31 @@ void RootAccessible::ProcessDOMEvent(Eve
     // mouse click (activate the menubar). If menubar doesn't have current item
     // (can be a case of menubar activation from keyboard) then ignore this
     // notification because later we'll receive DOMMenuItemActive event after
     // current menuitem is set.
     Accessible* activeItem = accessible->CurrentItem();
     if (activeItem) {
       FocusMgr()->ActiveItemChanged(activeItem);
 #ifdef A11Y_LOG
-      if (logging::IsEnabled(logging::eFocus))
+      if (logging::IsEnabled(logging::eFocus)) {
         logging::ActiveItemChangeCausedBy("DOMMenuBarActive", accessible);
+      }
 #endif
     }
   } else if (eventType.EqualsLiteral(
                  "DOMMenuBarInactive")) {  // Always from user input
     nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_MENU_END, accessible,
                             eFromUserInput);
 
     FocusMgr()->ActiveItemChanged(nullptr);
 #ifdef A11Y_LOG
-    if (logging::IsEnabled(logging::eFocus))
+    if (logging::IsEnabled(logging::eFocus)) {
       logging::ActiveItemChangeCausedBy("DOMMenuBarInactive", accessible);
+    }
 #endif
   } else if (accessible->NeedsDOMUIEvent() &&
              eventType.EqualsLiteral("ValueChange")) {
     uint32_t event = accessible->HasNumericValue()
                          ? nsIAccessibleEvent::EVENT_VALUE_CHANGE
                          : nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE;
     targetDocument->FireDelayedEvent(event, accessible);
   }
@@ -618,18 +627,19 @@ void RootAccessible::HandlePopupHidingEv
     // notifications.
     notifyOf = kNotifyOfFocus;
   }
 
   // Restore focus to where it was.
   if (notifyOf & kNotifyOfFocus) {
     FocusMgr()->ActiveItemChanged(nullptr);
 #ifdef A11Y_LOG
-    if (logging::IsEnabled(logging::eFocus))
+    if (logging::IsEnabled(logging::eFocus)) {
       logging::ActiveItemChangeCausedBy("popuphiding", popup);
+    }
 #endif
   }
 
   // Fire expanded state change event.
   if (notifyOf & kNotifyOfState) {
     RefPtr<AccEvent> event =
         new AccStateChangeEvent(widget, states::EXPANDED, false);
     document->FireDelayedEvent(event);
--- a/accessible/generic/TableCellAccessible.cpp
+++ b/accessible/generic/TableCellAccessible.cpp
@@ -24,18 +24,19 @@ void TableCellAccessible::RowHeaderCells
 
     // CellAt should always return a TableCellAccessible (XXX Bug 587529)
     TableCellAccessible* tableCell = cell->AsTableCell();
     NS_ASSERTION(tableCell, "cell should be a table cell!");
     if (!tableCell) continue;
 
     // Avoid addding cells multiple times, if this cell spans more columns
     // we'll get it later.
-    if (tableCell->ColIdx() == curColIdx && cell->Role() == roles::ROWHEADER)
+    if (tableCell->ColIdx() == curColIdx && cell->Role() == roles::ROWHEADER) {
       aCells->AppendElement(cell);
+    }
   }
 }
 
 Accessible* TableCellAccessible::PrevColHeader() {
   TableAccessible* table = Table();
   if (!table) {
     return nullptr;
   }
--- a/accessible/html/HTMLElementAccessibles.cpp
+++ b/accessible/html/HTMLElementAccessibles.cpp
@@ -74,18 +74,19 @@ bool HTMLLabelAccessible::DoAction(uint8
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // nsHTMLOuputAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 Relation HTMLOutputAccessible::RelationByType(RelationType aType) const {
   Relation rel = AccessibleWrap::RelationByType(aType);
-  if (aType == RelationType::CONTROLLED_BY)
+  if (aType == RelationType::CONTROLLED_BY) {
     rel.AppendIter(new IDRefsIterator(mDoc, mContent, nsGkAtoms::_for));
+  }
 
   return rel;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLSummaryAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
--- a/accessible/html/HTMLFormControlAccessible.cpp
+++ b/accessible/html/HTMLFormControlAccessible.cpp
@@ -186,21 +186,24 @@ ENameValueFlag HTMLButtonAccessible::Nat
   // then neither @alt nor @value attributes are used to generate a visual label
   // and thus we need to obtain the accessible name directly from attribute
   // value). Also the same algorithm works in case of default labels for
   // type="submit"/"reset"/"image" elements.
 
   ENameValueFlag nameFlag = Accessible::NativeName(aName);
   if (!aName.IsEmpty() || !mContent->IsHTMLElement(nsGkAtoms::input) ||
       !mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                                          nsGkAtoms::image, eCaseMatters))
+                                          nsGkAtoms::image, eCaseMatters)) {
     return nameFlag;
+  }
 
-  if (!mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName))
+  if (!mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::alt,
+                                      aName)) {
     mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::value, aName);
+  }
 
   aName.CompressWhitespace();
   return eNameOK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLButtonAccessible: Widgets
 
@@ -282,18 +285,19 @@ ENameValueFlag HTMLTextFieldAccessible::
   // text inputs and textareas might have useful placeholder text
   mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::placeholder,
                                  aName);
   return eNameOK;
 }
 
 void HTMLTextFieldAccessible::Value(nsString& aValue) const {
   aValue.Truncate();
-  if (NativeState() & states::PROTECTED)  // Don't return password text!
+  if (NativeState() & states::PROTECTED) {  // Don't return password text!
     return;
+  }
 
   HTMLTextAreaElement* textArea = HTMLTextAreaElement::FromNode(mContent);
   if (textArea) {
     textArea->GetValue(aValue);
     return;
   }
 
   HTMLInputElement* input = HTMLInputElement::FromNode(mContent);
@@ -306,18 +310,19 @@ void HTMLTextFieldAccessible::Value(nsSt
 
 void HTMLTextFieldAccessible::ApplyARIAState(uint64_t* aState) const {
   HyperTextAccessibleWrap::ApplyARIAState(aState);
   aria::MapToState(aria::eARIAAutoComplete, mContent->AsElement(), aState);
 
   // If part of compound of XUL widget then pick up ARIA stuff from XUL widget
   // element.
   nsIContent* widgetElm = BindingOrWidgetParent();
-  if (widgetElm)
+  if (widgetElm) {
     aria::MapToState(aria::eARIAAutoComplete, widgetElm->AsElement(), aState);
+  }
 }
 
 uint64_t HTMLTextFieldAccessible::NativeState() const {
   uint64_t state = HyperTextAccessibleWrap::NativeState();
 
   // Text fields are always editable, even if they are also read only or
   // disabled.
   state |= states::EDITABLE;
@@ -333,29 +338,31 @@ uint64_t HTMLTextFieldAccessible::Native
   }
 
   // Is it an <input> or a <textarea> ?
   HTMLInputElement* input = HTMLInputElement::FromNode(mContent);
   state |= input && input->IsSingleLineTextControl() ? states::SINGLE_LINE
                                                      : states::MULTI_LINE;
 
   if (state & (states::PROTECTED | states::MULTI_LINE | states::READONLY |
-               states::UNAVAILABLE))
+               states::UNAVAILABLE)) {
     return state;
+  }
 
   // Expose autocomplete states if this input is part of autocomplete widget.
   Accessible* widget = ContainerWidget();
   if (widget && widget - IsAutoComplete()) {
     state |= states::HASPOPUP | states::SUPPORTS_AUTOCOMPLETION;
     return state;
   }
 
   // Expose autocomplete state if it has associated autocomplete list.
-  if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::list_))
+  if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::list_)) {
     return state | states::SUPPORTS_AUTOCOMPLETION | states::HASPOPUP;
+  }
 
   // Ordinal XUL textboxes don't support autocomplete.
   if (!BindingOrWidgetParent() &&
       Preferences::GetBool("browser.formfill.enable")) {
     // Check to see if autocompletion is allowed on this input. We don't expose
     // it for password fields even though the entire password can be remembered
     // for a page if the user asks it to be. However, the kind of autocomplete
     // we're talking here is based on what the user types, where a popup of
@@ -366,18 +373,19 @@ uint64_t HTMLTextFieldAccessible::Native
 
     if (!autocomplete.LowerCaseEqualsLiteral("off")) {
       Element* formElement = input->GetFormElement();
       if (formElement) {
         formElement->GetAttr(kNameSpaceID_None, nsGkAtoms::autocomplete,
                              autocomplete);
       }
 
-      if (!formElement || !autocomplete.LowerCaseEqualsLiteral("off"))
+      if (!formElement || !autocomplete.LowerCaseEqualsLiteral("off")) {
         state |= states::SUPPORTS_AUTOCOMPLETION;
+      }
     }
   }
 
   return state;
 }
 
 uint8_t HTMLTextFieldAccessible::ActionCount() const { return 1; }
 
@@ -601,18 +609,19 @@ nsIContent* HTMLGroupboxAccessible::GetL
   return nullptr;
 }
 
 ENameValueFlag HTMLGroupboxAccessible::NativeName(nsString& aName) const {
   ENameValueFlag nameFlag = Accessible::NativeName(aName);
   if (!aName.IsEmpty()) return nameFlag;
 
   nsIContent* legendContent = GetLegend();
-  if (legendContent)
+  if (legendContent) {
     nsTextEquivUtils::AppendTextEquivFromContent(this, legendContent, &aName);
+  }
 
   aName.CompressWhitespace();
   return eNameOK;
 }
 
 Relation HTMLGroupboxAccessible::RelationByType(RelationType aType) const {
   Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
   // No override for label, so use <legend> for this <fieldset>
@@ -629,18 +638,19 @@ HTMLLegendAccessible::HTMLLegendAccessib
                                            DocAccessible* aDoc)
     : HyperTextAccessibleWrap(aContent, aDoc) {}
 
 Relation HTMLLegendAccessible::RelationByType(RelationType aType) const {
   Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
   if (aType != RelationType::LABEL_FOR) return rel;
 
   Accessible* groupbox = LocalParent();
-  if (groupbox && groupbox->Role() == roles::GROUPING)
+  if (groupbox && groupbox->Role() == roles::GROUPING) {
     rel.AppendTarget(groupbox);
+  }
 
   return rel;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLFigureAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
@@ -648,18 +658,19 @@ HTMLFigureAccessible::HTMLFigureAccessib
                                            DocAccessible* aDoc)
     : HyperTextAccessibleWrap(aContent, aDoc) {}
 
 ENameValueFlag HTMLFigureAccessible::NativeName(nsString& aName) const {
   ENameValueFlag nameFlag = HyperTextAccessibleWrap::NativeName(aName);
   if (!aName.IsEmpty()) return nameFlag;
 
   nsIContent* captionContent = Caption();
-  if (captionContent)
+  if (captionContent) {
     nsTextEquivUtils::AppendTextEquivFromContent(this, captionContent, &aName);
+  }
 
   aName.CompressWhitespace();
   return eNameOK;
 }
 
 Relation HTMLFigureAccessible::RelationByType(RelationType aType) const {
   Relation rel = HyperTextAccessibleWrap::RelationByType(aType);
   if (aType == RelationType::LABELLED_BY) rel.AppendTarget(mDoc, Caption());
--- a/accessible/html/HTMLImageMapAccessible.cpp
+++ b/accessible/html/HTMLImageMapAccessible.cpp
@@ -120,18 +120,20 @@ HTMLAreaAccessible::HTMLAreaAccessible(n
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLAreaAccessible: Accessible
 
 ENameValueFlag HTMLAreaAccessible::NativeName(nsString& aName) const {
   ENameValueFlag nameFlag = Accessible::NativeName(aName);
   if (!aName.IsEmpty()) return nameFlag;
 
-  if (!mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::alt, aName))
+  if (!mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::alt,
+                                      aName)) {
     Value(aName);
+  }
 
   return eNameOK;
 }
 
 void HTMLAreaAccessible::Description(nsString& aDescription) {
   aDescription.Truncate();
 
   // Still to do - follow IE's standard here
--- a/accessible/html/HTMLLinkAccessible.cpp
+++ b/accessible/html/HTMLLinkAccessible.cpp
@@ -35,43 +35,46 @@ role HTMLLinkAccessible::NativeRole() co
 uint64_t HTMLLinkAccessible::NativeState() const {
   return HyperTextAccessibleWrap::NativeState() & ~states::READONLY;
 }
 
 uint64_t HTMLLinkAccessible::NativeLinkState() const {
   EventStates eventState = mContent->AsElement()->State();
   if (eventState.HasState(NS_EVENT_STATE_UNVISITED)) return states::LINKED;
 
-  if (eventState.HasState(NS_EVENT_STATE_VISITED))
+  if (eventState.HasState(NS_EVENT_STATE_VISITED)) {
     return states::LINKED | states::TRAVERSED;
+  }
 
   // This is a either named anchor (a link with also a name attribute) or
   // it doesn't have any attributes. Check if 'click' event handler is
   // registered, otherwise bail out.
   return nsCoreUtils::HasClickListener(mContent) ? states::LINKED : 0;
 }
 
 uint64_t HTMLLinkAccessible::NativeInteractiveState() const {
   uint64_t state = HyperTextAccessibleWrap::NativeInteractiveState();
 
   // This is how we indicate it is a named anchor. In other words, this anchor
   // can be selected as a location :) There is no other better state to use to
   // indicate this.
-  if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::name))
+  if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::name)) {
     state |= states::SELECTABLE;
+  }
 
   return state;
 }
 
 void HTMLLinkAccessible::Value(nsString& aValue) const {
   aValue.Truncate();
 
   HyperTextAccessible::Value(aValue);
-  if (aValue.IsEmpty())
+  if (aValue.IsEmpty()) {
     nsContentUtils::GetLinkLocation(mContent->AsElement(), aValue);
+  }
 }
 
 uint8_t HTMLLinkAccessible::ActionCount() const {
   return IsLinked() ? 1 : HyperTextAccessible::ActionCount();
 }
 
 void HTMLLinkAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName) {
   aName.Truncate();
--- a/accessible/html/HTMLSelectAccessible.cpp
+++ b/accessible/html/HTMLSelectAccessible.cpp
@@ -34,18 +34,19 @@ HTMLSelectListAccessible::HTMLSelectList
   mGenericTypes |= eListControl | eSelect;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLSelectListAccessible: Accessible public
 
 uint64_t HTMLSelectListAccessible::NativeState() const {
   uint64_t state = AccessibleWrap::NativeState();
-  if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple))
+  if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::multiple)) {
     state |= states::MULTISELECTABLE | states::EXTSELECTABLE;
+  }
 
   return state;
 }
 
 role HTMLSelectListAccessible::NativeRole() const { return roles::LISTBOX; }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLSelectListAccessible: SelectAccessible
@@ -191,27 +192,29 @@ uint64_t HTMLSelectOptionAccessible::Nat
 }
 
 int32_t HTMLSelectOptionAccessible::GetLevelInternal() {
   nsIContent* parentContent = mContent->GetParent();
 
   int32_t level =
       parentContent->NodeInfo()->Equals(nsGkAtoms::optgroup) ? 2 : 1;
 
-  if (level == 1 && Role() != roles::HEADING)
+  if (level == 1 && Role() != roles::HEADING) {
     level = 0;  // In a single level list, the level is irrelevant
+  }
 
   return level;
 }
 
 nsRect HTMLSelectOptionAccessible::RelativeBounds(
     nsIFrame** aBoundingFrame) const {
   Accessible* combobox = GetCombobox();
-  if (combobox && (combobox->State() & states::COLLAPSED))
+  if (combobox && (combobox->State() & states::COLLAPSED)) {
     return combobox->RelativeBounds(aBoundingFrame);
+  }
 
   return HyperTextAccessibleWrap::RelativeBounds(aBoundingFrame);
 }
 
 void HTMLSelectOptionAccessible::ActionNameAt(uint8_t aIndex,
                                               nsAString& aName) {
   if (aIndex == eAction_Select) aName.AssignLiteral("select");
 }
@@ -317,20 +320,21 @@ void HTMLComboboxAccessible::Shutdown() 
 
 uint64_t HTMLComboboxAccessible::NativeState() const {
   // As a HTMLComboboxAccessible we can have the following states:
   // FOCUSED, FOCUSABLE, HASPOPUP, EXPANDED, COLLAPSED
   // Get focus status from base class
   uint64_t state = Accessible::NativeState();
 
   nsComboboxControlFrame* comboFrame = do_QueryFrame(GetFrame());
-  if (comboFrame && comboFrame->IsDroppedDown())
+  if (comboFrame && comboFrame->IsDroppedDown()) {
     state |= states::EXPANDED;
-  else
+  } else {
     state |= states::COLLAPSED;
+  }
 
   state |= states::HASPOPUP;
   return state;
 }
 
 void HTMLComboboxAccessible::Description(nsString& aDescription) {
   aDescription.Truncate();
   // First check to see if combo box itself has a description, perhaps through
@@ -359,20 +363,21 @@ bool HTMLComboboxAccessible::DoAction(ui
 }
 
 void HTMLComboboxAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName) {
   if (aIndex != HTMLComboboxAccessible::eAction_Click) return;
 
   nsComboboxControlFrame* comboFrame = do_QueryFrame(GetFrame());
   if (!comboFrame) return;
 
-  if (comboFrame->IsDroppedDown())
+  if (comboFrame->IsDroppedDown()) {
     aName.AssignLiteral("close");
-  else
+  } else {
     aName.AssignLiteral("open");
+  }
 }
 
 bool HTMLComboboxAccessible::IsAcceptableChild(nsIContent* aEl) const {
   return false;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // HTMLComboboxAccessible: Widgets
@@ -444,20 +449,21 @@ role HTMLComboboxListAccessible::NativeR
 
 uint64_t HTMLComboboxListAccessible::NativeState() const {
   // As a HTMLComboboxListAccessible we can have the following states:
   // FOCUSED, FOCUSABLE, FLOATING, INVISIBLE
   // Get focus status from base class
   uint64_t state = Accessible::NativeState();
 
   nsComboboxControlFrame* comboFrame = do_QueryFrame(mParent->GetFrame());
-  if (comboFrame && comboFrame->IsDroppedDown())
+  if (comboFrame && comboFrame->IsDroppedDown()) {
     state |= states::FLOATING;
-  else
+  } else {
     state |= states::INVISIBLE;
+  }
 
   return state;
 }
 
 nsRect HTMLComboboxListAccessible::RelativeBounds(
     nsIFrame** aBoundingFrame) const {
   *aBoundingFrame = nullptr;
 
--- a/accessible/html/HTMLTableAccessible.cpp
+++ b/accessible/html/HTMLTableAccessible.cpp
@@ -98,28 +98,31 @@ HTMLTableCellAccessible::NativeAttribute
     if (abbr->IsAbbreviation()) {
       nsIContent* firstChildNode = abbr->GetContent()->GetFirstChild();
       if (firstChildNode) {
         nsTextEquivUtils::AppendTextEquivFromTextContent(firstChildNode,
                                                          &abbrText);
       }
     }
   }
-  if (abbrText.IsEmpty())
+  if (abbrText.IsEmpty()) {
     mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::abbr,
                                    abbrText);
+  }
 
-  if (!abbrText.IsEmpty())
+  if (!abbrText.IsEmpty()) {
     nsAccUtils::SetAccAttr(attributes, nsGkAtoms::abbr, abbrText);
+  }
 
   // axis attribute
   nsAutoString axisText;
   mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::axis, axisText);
-  if (!axisText.IsEmpty())
+  if (!axisText.IsEmpty()) {
     nsAccUtils::SetAccAttr(attributes, nsGkAtoms::axis, axisText);
+  }
 
 #ifdef DEBUG
   nsAutoString unused;
   attributes->SetStringProperty("cppclass"_ns, u"HTMLTableCellAccessible"_ns,
                                 unused);
 #endif
 
   return attributes.forget();
@@ -189,36 +192,38 @@ void HTMLTableCellAccessible::ColHeaderC
   while (Accessible* cell = itr.Next()) {
     a11y::role cellRole = cell->Role();
     if (cellRole == roles::COLUMNHEADER) {
       aCells->AppendElement(cell);
     } else if (cellRole != roles::ROWHEADER) {
       // If referred table cell is at the same column then treat it as a column
       // header.
       TableCellAccessible* tableCell = cell->AsTableCell();
-      if (tableCell && tableCell->ColIdx() == ColIdx())
+      if (tableCell && tableCell->ColIdx() == ColIdx()) {
         aCells->AppendElement(cell);
+      }
     }
   }
 
   if (aCells->IsEmpty()) TableCellAccessible::ColHeaderCells(aCells);
 }
 
 void HTMLTableCellAccessible::RowHeaderCells(nsTArray<Accessible*>* aCells) {
   IDRefsIterator itr(mDoc, mContent, nsGkAtoms::headers);
   while (Accessible* cell = itr.Next()) {
     a11y::role cellRole = cell->Role();
     if (cellRole == roles::ROWHEADER) {
       aCells->AppendElement(cell);
     } else if (cellRole != roles::COLUMNHEADER) {
       // If referred table cell is at the same row then treat it as a column
       // header.
       TableCellAccessible* tableCell = cell->AsTableCell();
-      if (tableCell && tableCell->RowIdx() == RowIdx())
+      if (tableCell && tableCell->RowIdx() == RowIdx()) {
         aCells->AppendElement(cell);
+      }
     }
   }
 
   if (aCells->IsEmpty()) TableCellAccessible::RowHeaderCells(aCells);
 }
 
 bool HTMLTableCellAccessible::Selected() {
   int32_t rowIdx = -1, colIdx = -1;
@@ -279,25 +284,27 @@ role HTMLTableHeaderCellAccessible::Nati
 
   TableAccessible* table = Table();
   if (!table) return roles::NOTHING;
 
   // If the cell next to this one is not a header cell then assume this cell is
   // a row header for it.
   uint32_t rowIdx = RowIdx(), colIdx = ColIdx();
   Accessible* cell = table->CellAt(rowIdx, colIdx + ColExtent());
-  if (cell && !nsCoreUtils::IsHTMLTableHeader(cell->GetContent()))
+  if (cell && !nsCoreUtils::IsHTMLTableHeader(cell->GetContent())) {
     return roles::ROWHEADER;
+  }
 
   // If the cell below this one is not a header cell then assume this cell is
   // a column header for it.
   uint32_t rowExtent = RowExtent();
   cell = table->CellAt(rowIdx + rowExtent, colIdx);
-  if (cell && !nsCoreUtils::IsHTMLTableHeader(cell->GetContent()))
+  if (cell && !nsCoreUtils::IsHTMLTableHeader(cell->GetContent())) {
     return roles::COLUMNHEADER;
+  }
 
   // Otherwise if this cell is surrounded by header cells only then make a guess
   // based on its cell spanning. In other words if it is row spanned then assume
   // it's a row header, otherwise it's a column header.
   return rowExtent > 1 ? roles::ROWHEADER : roles::COLUMNHEADER;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -452,27 +459,29 @@ uint32_t HTMLTableAccessible::SelectedCe
   }
 
   return count;
 }
 
 uint32_t HTMLTableAccessible::SelectedColCount() {
   uint32_t count = 0, colCount = ColCount();
 
-  for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
+  for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
     if (IsColSelected(colIdx)) count++;
+  }
 
   return count;
 }
 
 uint32_t HTMLTableAccessible::SelectedRowCount() {
   uint32_t count = 0, rowCount = RowCount();
 
-  for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++)
+  for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     if (IsRowSelected(rowIdx)) count++;
+  }
 
   return count;
 }
 
 void HTMLTableAccessible::SelectedCells(nsTArray<Accessible*>* aCells) {
   nsTableWrapperFrame* tableFrame = GetTableWrapperFrame();
   if (!tableFrame) return;
 
@@ -499,32 +508,35 @@ void HTMLTableAccessible::SelectedCellIn
   uint32_t rowCount = RowCount(), colCount = ColCount();
   for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
       nsTableCellFrame* cellFrame = tableFrame->GetCellFrameAt(rowIdx, colIdx);
       if (!cellFrame || !cellFrame->IsSelected()) continue;
 
       uint32_t startCol = cellFrame->ColIndex();
       uint32_t startRow = cellFrame->RowIndex();
-      if (startRow == rowIdx && startCol == colIdx)
+      if (startRow == rowIdx && startCol == colIdx) {
         aCells->AppendElement(CellIndexAt(rowIdx, colIdx));
+      }
     }
   }
 }
 
 void HTMLTableAccessible::SelectedColIndices(nsTArray<uint32_t>* aCols) {
   uint32_t colCount = ColCount();
-  for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
+  for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
     if (IsColSelected(colIdx)) aCols->AppendElement(colIdx);
+  }
 }
 
 void HTMLTableAccessible::SelectedRowIndices(nsTArray<uint32_t>* aRows) {
   uint32_t rowCount = RowCount();
-  for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++)
+  for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     if (IsRowSelected(rowIdx)) aRows->AppendElement(rowIdx);
+  }
 }
 
 Accessible* HTMLTableAccessible::CellAt(uint32_t aRowIdx, uint32_t aColIdx) {
   nsTableWrapperFrame* tableFrame = GetTableWrapperFrame();
   if (!tableFrame) return nullptr;
 
   nsIContent* cellContent = tableFrame->GetCellAt(aRowIdx, aColIdx);
   Accessible* cell = mDoc->GetAccessible(cellContent);
@@ -698,20 +710,21 @@ void HTMLTableAccessible::UnselectCol(ui
 nsresult HTMLTableAccessible::AddRowOrColumnToSelection(
     int32_t aIndex, TableSelectionMode aTarget) {
   bool doSelectRow = (aTarget == TableSelectionMode::Row);
 
   nsTableWrapperFrame* tableFrame = GetTableWrapperFrame();
   if (!tableFrame) return NS_OK;
 
   uint32_t count = 0;
-  if (doSelectRow)
+  if (doSelectRow) {
     count = ColCount();
-  else
+  } else {
     count = RowCount();
+  }
 
   PresShell* presShell = mDoc->PresShellPtr();
   RefPtr<nsFrameSelection> tableSelection =
       const_cast<nsFrameSelection*>(presShell->ConstFrameSelection());
 
   for (uint32_t idx = 0; idx < count; idx++) {
     int32_t rowIdx = doSelectRow ? aIndex : idx;
     int32_t colIdx = doSelectRow ? idx : aIndex;
@@ -737,19 +750,20 @@ nsresult HTMLTableAccessible::RemoveRows
   bool doUnselectRow = (aTarget == TableSelectionMode::Row);
   uint32_t count = doUnselectRow ? ColCount() : RowCount();
 
   int32_t startRowIdx = doUnselectRow ? aIndex : 0;
   int32_t endRowIdx = doUnselectRow ? aIndex : count - 1;
   int32_t startColIdx = doUnselectRow ? 0 : aIndex;
   int32_t endColIdx = doUnselectRow ? count - 1 : aIndex;
 
-  if (aIsOuter)
+  if (aIsOuter) {
     return tableSelection->RestrictCellsToSelection(
         mContent, startRowIdx, startColIdx, endRowIdx, endColIdx);
+  }
 
   return tableSelection->RemoveCellsFromSelection(
       mContent, startRowIdx, startColIdx, endRowIdx, endColIdx);
 }
 
 void HTMLTableAccessible::Description(nsString& aDescription) {
   // Helpful for debugging layout vs. data tables
   aDescription.Truncate();
--- a/accessible/ipc/DocAccessibleChildBase.cpp
+++ b/accessible/ipc/DocAccessibleChildBase.cpp
@@ -10,18 +10,19 @@
 #include "Accessible-inl.h"
 
 namespace mozilla {
 namespace a11y {
 
 /* static */
 uint32_t DocAccessibleChildBase::InterfacesFor(Accessible* aAcc) {
   uint32_t interfaces = 0;
-  if (aAcc->IsHyperText() && aAcc->AsHyperText()->IsTextRole())
+  if (aAcc->IsHyperText() && aAcc->AsHyperText()->IsTextRole()) {
     interfaces |= Interfaces::HYPERTEXT;
+  }
 
   if (aAcc->IsLink()) interfaces |= Interfaces::HYPERLINK;
 
   if (aAcc->HasNumericValue()) interfaces |= Interfaces::VALUE;
 
   if (aAcc->IsImage()) interfaces |= Interfaces::IMAGE;
 
   if (aAcc->IsTable()) {
--- a/accessible/ipc/DocAccessibleParent.cpp
+++ b/accessible/ipc/DocAccessibleParent.cpp
@@ -767,20 +767,21 @@ void DocAccessibleParent::Destroy() {
 
   ProxyDestroyed(thisDoc);
   thisDoc = LiveDocs().Get(actorID);
   MOZ_ASSERT(thisDoc);
   if (!thisDoc) {
     return;
   }
 
-  if (DocAccessibleParent* parentDoc = thisDoc->ParentDoc())
+  if (DocAccessibleParent* parentDoc = thisDoc->ParentDoc()) {
     parentDoc->RemoveChildDoc(thisDoc);
-  else if (IsTopLevel())
+  } else if (IsTopLevel()) {
     GetAccService()->RemoteDocShutdown(this);
+  }
 }
 
 DocAccessibleParent* DocAccessibleParent::ParentDoc() const {
   if (mParentDoc == kNoParentDoc) {
     return nullptr;
   }
 
   return LiveDocs().Get(mParentDoc);
--- a/accessible/ipc/other/DocAccessibleChild.cpp
+++ b/accessible/ipc/other/DocAccessibleChild.cpp
@@ -156,28 +156,30 @@ mozilla::ipc::IPCResult DocAccessibleChi
 
 mozilla::ipc::IPCResult DocAccessibleChild::RecvRelationByType(
     const uint64_t& aID, const uint32_t& aType, nsTArray<uint64_t>* aTargets) {
   Accessible* acc = IdToAccessible(aID);
   if (!acc) return IPC_OK();
 
   auto type = static_cast<RelationType>(aType);
   Relation rel = acc->RelationByType(type);
-  while (Accessible* target = rel.Next())
+  while (Accessible* target = rel.Next()) {
     aTargets->AppendElement(reinterpret_cast<uint64_t>(target->UniqueID()));
+  }
 
   return IPC_OK();
 }
 
 static void AddRelation(Accessible* aAcc, RelationType aType,
                         nsTArray<RelationTargets>* aTargets) {
   Relation rel = aAcc->RelationByType(aType);
   nsTArray<uint64_t> targets;
-  while (Accessible* target = rel.Next())
+  while (Accessible* target = rel.Next()) {
     targets.AppendElement(reinterpret_cast<uint64_t>(target->UniqueID()));
+  }
 
   if (!targets.IsEmpty()) {
     RelationTargets* newRelation = aTargets->AppendElement(
         RelationTargets(static_cast<uint32_t>(aType), nsTArray<uint64_t>()));
     newRelation->Targets() = std::move(targets);
   }
 }
 
--- a/accessible/ipc/other/ProxyAccessible.cpp
+++ b/accessible/ipc/other/ProxyAccessible.cpp
@@ -55,19 +55,21 @@ void ProxyAccessible::Attributes(nsTArra
 nsTArray<ProxyAccessible*> ProxyAccessible::RelationByType(
     RelationType aType) const {
   nsTArray<uint64_t> targetIDs;
   Unused << mDoc->SendRelationByType(mID, static_cast<uint32_t>(aType),
                                      &targetIDs);
 
   size_t targetCount = targetIDs.Length();
   nsTArray<ProxyAccessible*> targets(targetCount);
-  for (size_t i = 0; i < targetCount; i++)
-    if (ProxyAccessible* proxy = mDoc->GetAccessible(targetIDs[i]))
+  for (size_t i = 0; i < targetCount; i++) {
+    if (ProxyAccessible* proxy = mDoc->GetAccessible(targetIDs[i])) {
       targets.AppendElement(proxy);
+    }
+  }
 
   return targets;
 }
 
 void ProxyAccessible::Relations(
     nsTArray<RelationType>* aTypes,
     nsTArray<nsTArray<ProxyAccessible*>>* aTargetSets) const {
   nsTArray<RelationTargets> ipcRelations;
@@ -77,20 +79,22 @@ void ProxyAccessible::Relations(
   aTypes->SetCapacity(relationCount);
   aTargetSets->SetCapacity(relationCount);
   for (size_t i = 0; i < relationCount; i++) {
     uint32_t type = ipcRelations[i].Type();
     if (type > static_cast<uint32_t>(RelationType::LAST)) continue;
 
     size_t targetCount = ipcRelations[i].Targets().Length();
     nsTArray<ProxyAccessible*> targets(targetCount);
-    for (size_t j = 0; j < targetCount; j++)
+    for (size_t j = 0; j < targetCount; j++) {
       if (ProxyAccessible* proxy =
-              mDoc->GetAccessible(ipcRelations[i].Targets()[j]))
+              mDoc->GetAccessible(ipcRelations[i].Targets()[j])) {
         targets.AppendElement(proxy);
+      }
+    }
 
     if (targets.IsEmpty()) continue;
 
     aTargetSets->AppendElement(std::move(targets));
     aTypes->AppendElement(static_cast<RelationType>(type));
   }
 }
 
--- a/accessible/xpcom/nsAccessibleRelation.cpp
+++ b/accessible/xpcom/nsAccessibleRelation.cpp
@@ -13,18 +13,19 @@
 #include "nsComponentManagerUtils.h"
 
 using namespace mozilla::a11y;
 
 nsAccessibleRelation::nsAccessibleRelation(uint32_t aType, Relation* aRel)
     : mType(aType) {
   mTargets = do_CreateInstance(NS_ARRAY_CONTRACTID);
   Accessible* targetAcc = nullptr;
-  while ((targetAcc = aRel->Next()))
+  while ((targetAcc = aRel->Next())) {
     mTargets->AppendElement(static_cast<nsIAccessible*>(ToXPC(targetAcc)));
+  }
 }
 
 nsAccessibleRelation::nsAccessibleRelation(
     uint32_t aType, const nsTArray<ProxyAccessible*>* aTargets)
     : mType(aType) {
   mTargets = do_CreateInstance(NS_ARRAY_CONTRACTID);
   for (uint32_t idx = 0; idx < aTargets->Length(); ++idx) {
     mTargets->AppendElement(
--- a/accessible/xpcom/xpcAccessibilityService.cpp
+++ b/accessible/xpcom/xpcAccessibilityService.cpp
@@ -35,18 +35,19 @@ void xpcAccessibilityService::ShutdownCa
     xpcAccService->mShutdownTimer = nullptr;
   }
 }
 
 NS_IMETHODIMP_(MozExternalRefCountType)
 xpcAccessibilityService::AddRef(void) {
   MOZ_ASSERT_TYPE_OK_FOR_REFCOUNTING(xpcAccessibilityService)
   MOZ_ASSERT(int32_t(mRefCnt) >= 0, "illegal refcnt");
-  if (!nsAutoRefCnt::isThreadSafe)
+  if (!nsAutoRefCnt::isThreadSafe) {
     NS_ASSERT_OWNINGTHREAD(xpcAccessibilityService);
+  }
   nsrefcnt count = ++mRefCnt;
   NS_LOG_ADDREF(this, count, "xpcAccessibilityService", sizeof(*this));
 
   // We want refcount to be > 1 because one reference is added in the XPCOM
   // accessibility service getter.
   if (mRefCnt > 1) {
     if (mShutdownTimer) {
       mShutdownTimer->Cancel();
--- a/accessible/xpcom/xpcAccessible.cpp
+++ b/accessible/xpcom/xpcAccessible.cpp
@@ -236,23 +236,24 @@ xpcAccessible::GetRole(uint32_t* aRole) 
   *aRole = IntlGeneric().Role();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetState(uint32_t* aState, uint32_t* aExtraState) {
   NS_ENSURE_ARG_POINTER(aState);
 
-  if (IntlGeneric().IsNull())
+  if (IntlGeneric().IsNull()) {
     nsAccUtils::To32States(states::DEFUNCT, aState, aExtraState);
-  else if (Intl())
+  } else if (Intl()) {
     nsAccUtils::To32States(Intl()->State(), aState, aExtraState);
-  else
+  } else {
     nsAccUtils::To32States(IntlGeneric().AsProxy()->State(), aState,
                            aExtraState);
+  }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessible::GetName(nsAString& aName) {
   aName.Truncate();
 
--- a/accessible/xpcom/xpcAccessibleDocument.cpp
+++ b/accessible/xpcom/xpcAccessibleDocument.cpp
@@ -155,26 +155,27 @@ xpcAccessibleGeneric* xpcAccessibleDocum
     return nullptr;
   }
 
   if (aAccessible->IsDoc()) return this;
 
   xpcAccessibleGeneric* xpcAcc = mCache.Get(aAccessible);
   if (xpcAcc) return xpcAcc;
 
-  if (aAccessible->IsImage())
+  if (aAccessible->IsImage()) {
     xpcAcc = new xpcAccessibleImage(aAccessible);
-  else if (aAccessible->IsTable())
+  } else if (aAccessible->IsTable()) {
     xpcAcc = new xpcAccessibleTable(aAccessible);
-  else if (aAccessible->IsTableCell())
+  } else if (aAccessible->IsTableCell()) {
     xpcAcc = new xpcAccessibleTableCell(aAccessible);
-  else if (aAccessible->IsHyperText())
+  } else if (aAccessible->IsHyperText()) {
     xpcAcc = new xpcAccessibleHyperText(aAccessible);
-  else
+  } else {
     xpcAcc = new xpcAccessibleGeneric(aAccessible);
+  }
 
   mCache.Put(aAccessible, xpcAcc);
   return xpcAcc;
 }
 
 xpcAccessibleGeneric* xpcAccessibleDocument::GetXPCAccessible(
     ProxyAccessible* aProxy) {
   MOZ_ASSERT(mRemote);
--- a/accessible/xpcom/xpcAccessibleHyperLink.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperLink.cpp
@@ -88,18 +88,19 @@ NS_IMETHODIMP
 xpcAccessibleHyperLink::GetURI(int32_t aIndex, nsIURI** aURI) {
   NS_ENSURE_ARG_POINTER(aURI);
 
   if (Intl().IsNull()) return NS_ERROR_FAILURE;
 
   if (aIndex < 0) return NS_ERROR_INVALID_ARG;
 
   if (Intl().IsAccessible()) {
-    if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount()))
+    if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount())) {
       return NS_ERROR_INVALID_ARG;
+    }
 
     RefPtr<nsIURI>(Intl().AsAccessible()->AnchorURIAt(aIndex)).forget(aURI);
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     nsCString spec;
     bool isURIValid = false;
@@ -122,18 +123,19 @@ xpcAccessibleHyperLink::GetAnchor(int32_
   NS_ENSURE_ARG_POINTER(aAccessible);
   *aAccessible = nullptr;
 
   if (Intl().IsNull()) return NS_ERROR_FAILURE;
 
   if (aIndex < 0) return NS_ERROR_INVALID_ARG;
 
   if (Intl().IsAccessible()) {
-    if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount()))
+    if (aIndex >= static_cast<int32_t>(Intl().AsAccessible()->AnchorCount())) {
       return NS_ERROR_INVALID_ARG;
+    }
 
     NS_IF_ADDREF(*aAccessible = ToXPC(Intl().AsAccessible()->AnchorAt(aIndex)));
   } else {
 #if defined(XP_WIN)
     return NS_ERROR_NOT_IMPLEMENTED;
 #else
     NS_IF_ADDREF(*aAccessible = ToXPC(Intl().AsProxy()->AnchorAt(aIndex)));
 #endif
--- a/accessible/xpcom/xpcAccessibleHyperText.cpp
+++ b/accessible/xpcom/xpcAccessibleHyperText.cpp
@@ -482,19 +482,20 @@ xpcAccessibleHyperText::GetSelectionRang
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> xpcRanges =
       do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   AutoTArray<TextRange, 1> ranges;
   Intl()->SelectionRanges(&ranges);
   uint32_t len = ranges.Length();
-  for (uint32_t idx = 0; idx < len; idx++)
+  for (uint32_t idx = 0; idx < len; idx++) {
     xpcRanges->AppendElement(
         new xpcAccessibleTextRange(std::move(ranges[idx])));
+  }
 
   xpcRanges.forget(aRanges);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetVisibleRanges(nsIArray** aRanges) {
   NS_ENSURE_ARG_POINTER(aRanges);
@@ -505,19 +506,20 @@ xpcAccessibleHyperText::GetVisibleRanges
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> xpcRanges =
       do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsTArray<TextRange> ranges;
   Intl()->VisibleRanges(&ranges);
   uint32_t len = ranges.Length();
-  for (uint32_t idx = 0; idx < len; idx++)
+  for (uint32_t idx = 0; idx < len; idx++) {
     xpcRanges->AppendElement(
         new xpcAccessibleTextRange(std::move(ranges[idx])));
+  }
 
   xpcRanges.forget(aRanges);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleHyperText::GetRangeByChild(nsIAccessible* aChild,
                                         nsIAccessibleTextRange** aRange) {
--- a/accessible/xpcom/xpcAccessibleHyperText.h
+++ b/accessible/xpcom/xpcAccessibleHyperText.h
@@ -19,18 +19,19 @@ namespace a11y {
 
 class xpcAccessibleHyperText : public xpcAccessibleGeneric,
                                public nsIAccessibleText,
                                public nsIAccessibleEditableText,
                                public nsIAccessibleHyperText {
  public:
   explicit xpcAccessibleHyperText(Accessible* aIntl)
       : xpcAccessibleGeneric(aIntl) {
-    if (aIntl->IsHyperText() && aIntl->AsHyperText()->IsTextRole())
+    if (aIntl->IsHyperText() && aIntl->AsHyperText()->IsTextRole()) {
       mSupportedIfaces |= eText;
+    }
   }
 
   xpcAccessibleHyperText(ProxyAccessible* aProxy, uint32_t aInterfaces)
       : xpcAccessibleGeneric(aProxy, aInterfaces) {
     mSupportedIfaces |= eText;
   }
 
   NS_DECL_ISUPPORTS_INHERITED
--- a/accessible/xpcom/xpcAccessibleSelectable.cpp
+++ b/accessible/xpcom/xpcAccessibleSelectable.cpp
@@ -28,18 +28,19 @@ xpcAccessibleSelectable::GetSelectedItem
   uint32_t itemCount = items.Length();
   if (itemCount == 0) return NS_OK;
 
   nsresult rv = NS_OK;
   nsCOMPtr<nsIMutableArray> xpcItems =
       do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
-  for (uint32_t idx = 0; idx < itemCount; idx++)
+  for (uint32_t idx = 0; idx < itemCount; idx++) {
     xpcItems->AppendElement(static_cast<nsIAccessible*>(ToXPC(items[idx])));
+  }
 
   NS_ADDREF(*aSelectedItems = xpcItems);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleSelectable::GetSelectedItemCount(uint32_t* aSelectionCount) {
   NS_ENSURE_ARG_POINTER(aSelectionCount);
--- a/accessible/xpcom/xpcAccessibleTable.cpp
+++ b/accessible/xpcom/xpcAccessibleTable.cpp
@@ -62,140 +62,149 @@ NS_IMETHODIMP
 xpcAccessibleTable::GetCellAt(int32_t aRowIdx, int32_t aColIdx,
                               nsIAccessible** aCell) {
   NS_ENSURE_ARG_POINTER(aCell);
   *aCell = nullptr;
 
   if (!Intl()) return NS_ERROR_FAILURE;
 
   if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->RowCount() ||
-      aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount())
+      aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   NS_IF_ADDREF(*aCell = ToXPC(Intl()->CellAt(aRowIdx, aColIdx)));
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::GetCellIndexAt(int32_t aRowIdx, int32_t aColIdx,
                                    int32_t* aCellIdx) {
   NS_ENSURE_ARG_POINTER(aCellIdx);
   *aCellIdx = -1;
 
   if (!Intl()) return NS_ERROR_FAILURE;
 
   if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->RowCount() ||
-      aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount())
+      aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   *aCellIdx = Intl()->CellIndexAt(aRowIdx, aColIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::GetColumnExtentAt(int32_t aRowIdx, int32_t aColIdx,
                                       int32_t* aColumnExtent) {
   NS_ENSURE_ARG_POINTER(aColumnExtent);
   *aColumnExtent = -1;
 
   if (!Intl()) return NS_ERROR_FAILURE;
 
   if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->RowCount() ||
-      aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount())
+      aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   *aColumnExtent = Intl()->ColExtentAt(aRowIdx, aColIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::GetRowExtentAt(int32_t aRowIdx, int32_t aColIdx,
                                    int32_t* aRowExtent) {
   NS_ENSURE_ARG_POINTER(aRowExtent);
   *aRowExtent = -1;
 
   if (!Intl()) return NS_ERROR_FAILURE;
 
   if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->RowCount() ||
-      aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount())
+      aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   *aRowExtent = Intl()->RowExtentAt(aRowIdx, aColIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::GetColumnDescription(int32_t aColIdx,
                                          nsAString& aDescription) {
   if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount())
+  if (aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   nsAutoString description;
   Intl()->ColDescription(aColIdx, description);
   aDescription.Assign(description);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::GetRowDescription(int32_t aRowIdx,
                                       nsAString& aDescription) {
   if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->ColCount())
+  if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   nsAutoString description;
   Intl()->RowDescription(aRowIdx, description);
   aDescription.Assign(description);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::IsColumnSelected(int32_t aColIdx, bool* aIsSelected) {
   NS_ENSURE_ARG_POINTER(aIsSelected);
   *aIsSelected = false;
 
   if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount())
+  if (aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   *aIsSelected = Intl()->IsColSelected(aColIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::IsRowSelected(int32_t aRowIdx, bool* aIsSelected) {
   NS_ENSURE_ARG_POINTER(aIsSelected);
   *aIsSelected = false;
 
   if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->RowCount())
+  if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->RowCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   *aIsSelected = Intl()->IsRowSelected(aRowIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::IsCellSelected(int32_t aRowIdx, int32_t aColIdx,
                                    bool* aIsSelected) {
   NS_ENSURE_ARG_POINTER(aIsSelected);
   *aIsSelected = false;
 
   if (!Intl()) return NS_ERROR_FAILURE;
 
   if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->RowCount() ||
-      aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount())
+      aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   *aIsSelected = Intl()->IsCellSelected(aRowIdx, aColIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::GetSelectedCellCount(uint32_t* aSelectedCellCount) {
   NS_ENSURE_ARG_POINTER(aSelectedCellCount);
@@ -284,51 +293,54 @@ xpcAccessibleTable::GetSelectedRowIndice
 NS_IMETHODIMP
 xpcAccessibleTable::GetColumnIndexAt(int32_t aCellIdx, int32_t* aColIdx) {
   NS_ENSURE_ARG_POINTER(aColIdx);
   *aColIdx = -1;
 
   if (!Intl()) return NS_ERROR_FAILURE;
 
   if (aCellIdx < 0 || static_cast<uint32_t>(aCellIdx) >=
-                          Intl()->RowCount() * Intl()->ColCount())
+                          Intl()->RowCount() * Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   *aColIdx = Intl()->ColIndexAt(aCellIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::GetRowIndexAt(int32_t aCellIdx, int32_t* aRowIdx) {
   NS_ENSURE_ARG_POINTER(aRowIdx);
   *aRowIdx = -1;
 
   if (!Intl()) return NS_ERROR_FAILURE;
 
   if (aCellIdx < 0 || static_cast<uint32_t>(aCellIdx) >=
-                          Intl()->RowCount() * Intl()->ColCount())
+                          Intl()->RowCount() * Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   *aRowIdx = Intl()->RowIndexAt(aCellIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::GetRowAndColumnIndicesAt(int32_t aCellIdx, int32_t* aRowIdx,
                                              int32_t* aColIdx) {
   NS_ENSURE_ARG_POINTER(aRowIdx);
   *aRowIdx = -1;
   NS_ENSURE_ARG_POINTER(aColIdx);
   *aColIdx = -1;
 
   if (!Intl()) return NS_ERROR_FAILURE;
 
   if (aCellIdx < 0 || static_cast<uint32_t>(aCellIdx) >=
-                          Intl()->RowCount() * Intl()->ColCount())
+                          Intl()->RowCount() * Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   Intl()->RowAndColIndicesAt(aCellIdx, aRowIdx, aColIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::GetSummary(nsAString& aSummary) {
   if (!Intl()) return NS_ERROR_FAILURE;
@@ -349,47 +361,51 @@ xpcAccessibleTable::IsProbablyForLayout(
   *aResult = Intl()->IsProbablyLayoutTable();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::SelectColumn(int32_t aColIdx) {
   if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount())
+  if (aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   Intl()->SelectCol(aColIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::SelectRow(int32_t aRowIdx) {
   if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->RowCount())
+  if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->RowCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   Intl()->SelectRow(aRowIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::UnselectColumn(int32_t aColIdx) {
   if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount())
+  if (aColIdx < 0 || static_cast<uint32_t>(aColIdx) >= Intl()->ColCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   Intl()->UnselectCol(aColIdx);
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTable::UnselectRow(int32_t aRowIdx) {
   if (!Intl()) return NS_ERROR_FAILURE;
 
-  if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->RowCount())
+  if (aRowIdx < 0 || static_cast<uint32_t>(aRowIdx) >= Intl()->RowCount()) {
     return NS_ERROR_INVALID_ARG;
+  }
 
   Intl()->UnselectRow(aRowIdx);
   return NS_OK;
 }
--- a/accessible/xpcom/xpcAccessibleTextRange.cpp
+++ b/accessible/xpcom/xpcAccessibleTextRange.cpp
@@ -73,18 +73,19 @@ xpcAccessibleTextRange::GetEmbeddedChild
   nsCOMPtr<nsIMutableArray> xpcList =
       do_CreateInstance(NS_ARRAY_CONTRACTID, &rv);
   NS_ENSURE_SUCCESS(rv, rv);
 
   nsTArray<Accessible*> objects;
   mRange.EmbeddedChildren(&objects);
 
   uint32_t len = objects.Length();
-  for (uint32_t idx = 0; idx < len; idx++)
+  for (uint32_t idx = 0; idx < len; idx++) {
     xpcList->AppendElement(static_cast<nsIAccessible*>(ToXPC(objects[idx])));
+  }
 
   xpcList.forget(aList);
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTextRange::Compare(nsIAccessibleTextRange* aOtherRange,
@@ -105,20 +106,21 @@ xpcAccessibleTextRange::CompareEndPoints
   if (!xpcRange || !aResult) return NS_ERROR_INVALID_ARG;
 
   TextPoint p =
       (aEndPoint == EndPoint_Start) ? mRange.StartPoint() : mRange.EndPoint();
   TextPoint otherPoint = (aOtherRangeEndPoint == EndPoint_Start)
                              ? xpcRange->mRange.StartPoint()
                              : xpcRange->mRange.EndPoint();
 
-  if (p == otherPoint)
+  if (p == otherPoint) {
     *aResult = 0;
-  else
+  } else {
     *aResult = p < otherPoint ? -1 : 1;
+  }
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleTextRange::GetText(nsAString& aText) {
   nsAutoString text;
   mRange.Text(text);
--- a/accessible/xpcom/xpcAccessibleValue.cpp
+++ b/accessible/xpcom/xpcAccessibleValue.cpp
@@ -12,18 +12,19 @@ using namespace mozilla::a11y;
 
 NS_IMETHODIMP
 xpcAccessibleValue::GetMaximumValue(double* aValue) {
   NS_ENSURE_ARG_POINTER(aValue);
   *aValue = 0;
 
   if (Intl().IsNull()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct())
+  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
     return NS_ERROR_FAILURE;
+  }
 
   double value;
   if (Intl().IsAccessible()) {
     value = Intl().AsAccessible()->MaxValue();
   } else {
     value = Intl().AsProxy()->MaxValue();
   }
 
@@ -34,18 +35,19 @@ xpcAccessibleValue::GetMaximumValue(doub
 
 NS_IMETHODIMP
 xpcAccessibleValue::GetMinimumValue(double* aValue) {
   NS_ENSURE_ARG_POINTER(aValue);
   *aValue = 0;
 
   if (Intl().IsNull()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct())
+  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
     return NS_ERROR_FAILURE;
+  }
 
   double value;
   if (Intl().IsAccessible()) {
     value = Intl().AsAccessible()->MinValue();
   } else {
     value = Intl().AsProxy()->MinValue();
   }
 
@@ -56,18 +58,19 @@ xpcAccessibleValue::GetMinimumValue(doub
 
 NS_IMETHODIMP
 xpcAccessibleValue::GetCurrentValue(double* aValue) {
   NS_ENSURE_ARG_POINTER(aValue);
   *aValue = 0;
 
   if (Intl().IsNull()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct())
+  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
     return NS_ERROR_FAILURE;
+  }
 
   double value;
   if (Intl().IsAccessible()) {
     value = Intl().AsAccessible()->CurValue();
   } else {
     value = Intl().AsProxy()->CurValue();
   }
 
@@ -75,18 +78,19 @@ xpcAccessibleValue::GetCurrentValue(doub
 
   return NS_OK;
 }
 
 NS_IMETHODIMP
 xpcAccessibleValue::SetCurrentValue(double aValue) {
   if (Intl().IsNull()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct())
+  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
     return NS_ERROR_FAILURE;
+  }
 
   if (Intl().IsAccessible()) {
     Intl().AsAccessible()->SetCurValue(aValue);
   } else {
     Intl().AsProxy()->SetCurValue(aValue);
   }
 
   return NS_OK;
@@ -94,18 +98,19 @@ xpcAccessibleValue::SetCurrentValue(doub
 
 NS_IMETHODIMP
 xpcAccessibleValue::GetMinimumIncrement(double* aValue) {
   NS_ENSURE_ARG_POINTER(aValue);
   *aValue = 0;
 
   if (Intl().IsNull()) return NS_ERROR_FAILURE;
 
-  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct())
+  if (Intl().IsAccessible() && Intl().AsAccessible()->IsDefunct()) {
     return NS_ERROR_FAILURE;
+  }
 
   double value;
   if (Intl().IsAccessible()) {
     value = Intl().AsAccessible()->Step();
   } else {
     value = Intl().AsProxy()->Step();
   }
 
--- a/accessible/xul/XULComboboxAccessible.cpp
+++ b/accessible/xul/XULComboboxAccessible.cpp
@@ -39,20 +39,21 @@ uint64_t XULComboboxAccessible::NativeSt
 
   // Get focus status from base class
   uint64_t state = Accessible::NativeState();
 
   nsCOMPtr<nsIDOMXULMenuListElement> menuList = Elm()->AsXULMenuList();
   if (menuList) {
     bool isOpen = false;
     menuList->GetOpen(&isOpen);
-    if (isOpen)
+    if (isOpen) {
       state |= states::EXPANDED;
-    else
+    } else {
       state |= states::COLLAPSED;
+    }
   }
 
   return state | states::HASPOPUP;
 }
 
 void XULComboboxAccessible::Description(nsString& aDescription) {
   aDescription.Truncate();
   // Use description of currently focused option
@@ -97,33 +98,35 @@ void XULComboboxAccessible::ActionNameAt
   aName.Truncate();
   if (aIndex != XULComboboxAccessible::eAction_Click) return;
 
   nsCOMPtr<nsIDOMXULMenuListElement> menuList = Elm()->AsXULMenuList();
   if (!menuList) return;
 
   bool isDroppedDown = false;
   menuList->GetOpen(&isDroppedDown);
-  if (isDroppedDown)
+  if (isDroppedDown) {
     aName.AssignLiteral("close");
-  else
+  } else {
     aName.AssignLiteral("open");
+  }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // Widgets
 
 bool XULComboboxAccessible::IsActiveWidget() const {
   if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::editable,
                                          nsGkAtoms::_true, eIgnoreCase)) {
     int32_t childCount = mChildren.Length();
     for (int32_t idx = 0; idx < childCount; idx++) {
       Accessible* child = mChildren[idx];
-      if (child->Role() == roles::ENTRY)
+      if (child->Role() == roles::ENTRY) {
         return FocusMgr()->HasDOMFocus(child->GetContent());
+      }
     }
     return false;
   }
 
   return FocusMgr()->HasDOMFocus(mContent);
 }
 
 bool XULComboboxAccessible::AreItemsOperable() const {
--- a/accessible/xul/XULFormControlAccessible.cpp
+++ b/accessible/xul/XULFormControlAccessible.cpp
@@ -87,18 +87,19 @@ uint64_t XULButtonAccessible::NativeStat
     xulButtonElement->GetChecked(&checked);
     if (checked) {
       state |= states::PRESSED;
     }
   }
 
   if (ContainsMenu()) state |= states::HASPOPUP;
 
-  if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::_default))
+  if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::_default)) {
     state |= states::DEFAULT;
+  }
 
   return state;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULButtonAccessible: Widgets
 
 bool XULButtonAccessible::IsWidget() const { return true; }
@@ -173,20 +174,21 @@ bool XULDropmarkerAccessible::Dropmarker
   }
 
   return isOpen;
 }
 
 void XULDropmarkerAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName) {
   aName.Truncate();
   if (aIndex == eAction_Click) {
-    if (DropmarkerOpen(false))
+    if (DropmarkerOpen(false)) {
       aName.AssignLiteral("close");
-    else
+    } else {
       aName.AssignLiteral("open");
+    }
   }
 }
 
 bool XULDropmarkerAccessible::DoAction(uint8_t index) const {
   if (index == eAction_Click) {
     DropmarkerOpen(true);  // Reverse the open attribute
     return true;
   }
@@ -413,18 +415,19 @@ bool XULToolbarButtonAccessible::IsAccep
 XULToolbarAccessible::XULToolbarAccessible(nsIContent* aContent,
                                            DocAccessible* aDoc)
     : AccessibleWrap(aContent, aDoc) {}
 
 role XULToolbarAccessible::NativeRole() const { return roles::TOOLBAR; }
 
 ENameValueFlag XULToolbarAccessible::NativeName(nsString& aName) const {
   if (mContent->AsElement()->GetAttr(kNameSpaceID_None, nsGkAtoms::toolbarname,
-                                     aName))
+                                     aName)) {
     aName.CompressWhitespace();
+  }
 
   return eNameOK;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULToolbarAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
--- a/accessible/xul/XULListboxAccessible.cpp
+++ b/accessible/xul/XULListboxAccessible.cpp
@@ -96,18 +96,19 @@ uint64_t XULListboxAccessible::NativeSta
 
   return states;
 }
 
 role XULListboxAccessible::NativeRole() const {
   // A richlistbox is used with the new autocomplete URL bar, and has a parent
   // popup <panel>.
   if (mContent->GetParent() &&
-      mContent->GetParent()->IsXULElement(nsGkAtoms::panel))
+      mContent->GetParent()->IsXULElement(nsGkAtoms::panel)) {
     return roles::COMBOBOX_LIST;
+  }
 
   return IsMulticolumn() ? roles::TABLE : roles::LISTBOX;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULListboxAccessible: Table
 
 uint32_t XULListboxAccessible::ColCount() const { return 0; }
@@ -262,29 +263,32 @@ void XULListboxAccessible::SelectedCellI
        selItemsIdx++) {
     nsIContent* itemContent = selectedItems->Item(selItemsIdx);
 
     nsCOMPtr<nsIDOMXULSelectControlItemElement> item =
         itemContent->AsElement()->AsXULSelectControlItem();
     if (item) {
       int32_t itemIdx = -1;
       control->GetIndexOfItem(item, &itemIdx);
-      if (itemIdx >= 0)
-        for (uint32_t colIdx = 0; colIdx < colCount; colIdx++, cellsIdx++)
+      if (itemIdx >= 0) {
+        for (uint32_t colIdx = 0; colIdx < colCount; colIdx++, cellsIdx++) {
           aCells->ElementAt(cellsIdx) = itemIdx * colCount + colIdx;
+        }
+      }
     }
   }
 }
 
 void XULListboxAccessible::SelectedColIndices(nsTArray<uint32_t>* aCols) {
   uint32_t selColCount = SelectedColCount();
   aCols->SetCapacity(selColCount);
 
-  for (uint32_t colIdx = 0; colIdx < selColCount; colIdx++)
+  for (uint32_t colIdx = 0; colIdx < selColCount; colIdx++) {
     aCols->AppendElement(colIdx);
+  }
 }
 
 void XULListboxAccessible::SelectedRowIndices(nsTArray<uint32_t>* aRows) {
   nsCOMPtr<nsIDOMXULMultiSelectControlElement> control =
       Elm()->AsXULMultiSelectControl();
   NS_ASSERTION(control,
                "Doesn't implement nsIDOMXULMultiSelectControlElement.");
 
@@ -454,18 +458,19 @@ role XULListitemAccessible::NativeRole()
     NS_ERROR("No list accessible for listitem accessible!");
     return roles::NOTHING;
   }
 
   if (list->Role() == roles::TABLE) return roles::ROW;
 
   if (mIsCheckbox) return roles::CHECK_RICH_OPTION;
 
-  if (mParent && mParent->Role() == roles::COMBOBOX_LIST)
+  if (mParent && mParent->Role() == roles::COMBOBOX_LIST) {
     return roles::COMBOBOX_OPTION;
+  }
 
   return roles::RICH_OPTION;
 }
 
 uint64_t XULListitemAccessible::NativeState() const {
   if (mIsCheckbox) return XULMenuitemAccessible::NativeState();
 
   uint64_t states = NativeInteractiveState();
@@ -487,20 +492,21 @@ uint64_t XULListitemAccessible::NativeIn
   return NativelyUnavailable() || (mParent && mParent->NativelyUnavailable())
              ? states::UNAVAILABLE
              : states::FOCUSABLE | states::SELECTABLE;
 }
 
 void XULListitemAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName) {
   if (aIndex == eAction_Click && mIsCheckbox) {
     uint64_t states = NativeState();
-    if (states & states::CHECKED)
+    if (states & states::CHECKED) {
       aName.AssignLiteral("uncheck");
-    else
+    } else {
       aName.AssignLiteral("check");
+    }
   }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULListitemAccessible: Widgets
 
 Accessible* XULListitemAccessible::ContainerWidget() const {
   return LocalParent();
--- a/accessible/xul/XULMenuAccessible.cpp
+++ b/accessible/xul/XULMenuAccessible.cpp
@@ -38,36 +38,38 @@ XULMenuitemAccessible::XULMenuitemAccess
     : AccessibleWrap(aContent, aDoc) {}
 
 uint64_t XULMenuitemAccessible::NativeState() const {
   uint64_t state = Accessible::NativeState();
 
   // Has Popup?
   if (mContent->NodeInfo()->Equals(nsGkAtoms::menu, kNameSpaceID_XUL)) {
     state |= states::HASPOPUP;
-    if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::open))
+    if (mContent->AsElement()->HasAttr(kNameSpaceID_None, nsGkAtoms::open)) {
       state |= states::EXPANDED;
-    else
+    } else {
       state |= states::COLLAPSED;
+    }
   }
 
   // Checkable/checked?
   static dom::Element::AttrValuesArray strings[] = {
       nsGkAtoms::radio, nsGkAtoms::checkbox, nullptr};
 
   if (mContent->AsElement()->FindAttrValueIn(kNameSpaceID_None, nsGkAtoms::type,
                                              strings, eCaseMatters) >= 0) {
     // Checkable?
     state |= states::CHECKABLE;
 
     // Checked?
     if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None,
                                            nsGkAtoms::checked, nsGkAtoms::_true,
-                                           eCaseMatters))
+                                           eCaseMatters)) {
       state |= states::CHECKED;
+    }
   }
 
   // Combo box listitem
   bool isComboboxOption = (Role() == roles::COMBOBOX_OPTION);
   if (isComboboxOption) {
     // Is selected?
     bool isSelected = false;
     nsCOMPtr<nsIDOMXULSelectControlItemElement> item =
@@ -220,22 +222,24 @@ role XULMenuitemAccessible::NativeRole()
   if (xulContainer) return roles::PARENT_MENUITEM;
 
   Accessible* widget = ContainerWidget();
   if (widget && widget->Role() == roles::COMBOBOX_LIST) {
     return roles::COMBOBOX_OPTION;
   }
 
   if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                                         nsGkAtoms::radio, eCaseMatters))
+                                         nsGkAtoms::radio, eCaseMatters)) {
     return roles::RADIO_MENU_ITEM;
+  }
 
   if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::type,
-                                         nsGkAtoms::checkbox, eCaseMatters))
+                                         nsGkAtoms::checkbox, eCaseMatters)) {
     return roles::CHECK_MENU_ITEM;
+  }
 
   return roles::MENUITEM;
 }
 
 int32_t XULMenuitemAccessible::GetLevelInternal() {
   return nsAccUtils::GetLevelForXULContainerItem(mContent);
 }
 
@@ -401,24 +405,26 @@ ENameValueFlag XULMenupopupAccessible::N
 
 role XULMenupopupAccessible::NativeRole() const {
   nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame());
   if (menuPopupFrame && menuPopupFrame->IsContextMenu()) {
     return roles::MENUPOPUP;
   }
 
   if (mParent) {
-    if (mParent->IsCombobox() || mParent->IsAutoComplete())
+    if (mParent->IsCombobox() || mParent->IsAutoComplete()) {
       return roles::COMBOBOX_LIST;
+    }
 
     if (mParent->Role() == roles::PUSHBUTTON) {
       // Some widgets like the search bar have several popups, owned by buttons.
       Accessible* grandParent = mParent->LocalParent();
-      if (grandParent && grandParent->IsAutoComplete())
+      if (grandParent && grandParent->IsAutoComplete()) {
         return roles::COMBOBOX_LIST;
+      }
     }
   }
 
   // If accessible is not bound to the tree (this happens while children are
   // cached) return general role.
   return roles::MENUPOPUP;
 }
 
@@ -440,26 +446,29 @@ bool XULMenupopupAccessible::AreItemsOpe
 
 Accessible* XULMenupopupAccessible::ContainerWidget() const {
   DocAccessible* document = Document();
 
   nsMenuPopupFrame* menuPopupFrame = do_QueryFrame(GetFrame());
   while (menuPopupFrame) {
     Accessible* menuPopup =
         document->GetAccessible(menuPopupFrame->GetContent());
-    if (!menuPopup)  // shouldn't be a real case
+    if (!menuPopup) {  // shouldn't be a real case
       return nullptr;
+    }
 
     nsMenuFrame* menuFrame = do_QueryFrame(menuPopupFrame->GetParent());
-    if (!menuFrame)  // context menu or popups
+    if (!menuFrame) {  // context menu or popups
       return nullptr;
+    }
 
     nsMenuParent* menuParent = menuFrame->GetMenuParent();
-    if (!menuParent)  // menulist or menubutton
+    if (!menuParent) {  // menulist or menubutton
       return menuPopup->LocalParent();
+    }
 
     if (menuParent->IsMenuBar()) {  // menubar menu
       nsMenuBarFrame* menuBarFrame = static_cast<nsMenuBarFrame*>(menuParent);
       return document->GetAccessible(menuBarFrame->GetContent());
     }
 
     // different kind of popups like panel or tooltip
     if (!menuParent->IsMenu()) return nullptr;
--- a/accessible/xul/XULTabAccessible.cpp
+++ b/accessible/xul/XULTabAccessible.cpp
@@ -60,22 +60,24 @@ uint64_t XULTabAccessible::NativeState()
   // get focus and disable status from base class
   uint64_t state = AccessibleWrap::NativeState();
 
   // Check whether the tab is selected and/or pinned
   nsCOMPtr<nsIDOMXULSelectControlItemElement> tab =
       Elm()->AsXULSelectControlItem();
   if (tab) {
     bool selected = false;
-    if (NS_SUCCEEDED(tab->GetSelected(&selected)) && selected)
+    if (NS_SUCCEEDED(tab->GetSelected(&selected)) && selected) {
       state |= states::SELECTED;
+    }
 
     if (mContent->AsElement()->AttrValueIs(kNameSpaceID_None, nsGkAtoms::pinned,
-                                           nsGkAtoms::_true, eCaseMatters))
+                                           nsGkAtoms::_true, eCaseMatters)) {
       state |= states::PINNED;
+    }
   }
 
   return state;
 }
 
 uint64_t XULTabAccessible::NativeInteractiveState() const {
   uint64_t state = Accessible::NativeInteractiveState();
   return (state & states::UNAVAILABLE) ? state : state | states::SELECTABLE;
--- a/accessible/xul/XULTreeAccessible.cpp
+++ b/accessible/xul/XULTreeAccessible.cpp
@@ -168,18 +168,19 @@ Accessible* XULTreeAccessible::ChildAtPo
   int32_t clientY = presContext->DevPixelsToIntCSSPixels(aY) - rootRect.Y();
 
   ErrorResult rv;
   dom::TreeCellInfo cellInfo;
   mTree->GetCellAt(clientX, clientY, cellInfo, rv);
 
   // If we failed to find tree cell for the given point then it might be
   // tree columns.
-  if (cellInfo.mRow == -1 || !cellInfo.mCol)
+  if (cellInfo.mRow == -1 || !cellInfo.mCol) {
     return AccessibleWrap::ChildAtPoint(aX, aY, aWhichChild);
+  }
 
   Accessible* child = GetTreeItemAccessible(cellInfo.mRow);
   if (aWhichChild == eDeepestChild && child) {
     // Look for accessible cell for the found item accessible.
     RefPtr<XULTreeItemAccessibleBase> treeitem = do_QueryObject(child);
 
     Accessible* cell = treeitem->GetCellAccessible(cellInfo.mCol);
     if (cell) child = cell;
@@ -358,18 +359,19 @@ uint32_t XULTreeAccessible::ChildCount()
   mTreeView->GetRowCount(&rowCount);
   childCount += rowCount;
 
   return childCount;
 }
 
 Relation XULTreeAccessible::RelationByType(RelationType aType) const {
   if (aType == RelationType::NODE_PARENT_OF) {
-    if (mTreeView)
+    if (mTreeView) {
       return Relation(new XULTreeItemIterator(this, mTreeView, -1));
+    }
 
     return Relation();
   }
 
   return Accessible::RelationByType(aType);
 }
 
 ////////////////////////////////////////////////////////////////////////////////
@@ -666,32 +668,35 @@ void XULTreeItemAccessibleBase::TakeFocu
   // focus event will be fired here
   Accessible::TakeFocus();
 }
 
 Relation XULTreeItemAccessibleBase::RelationByType(RelationType aType) const {
   switch (aType) {
     case RelationType::NODE_CHILD_OF: {
       int32_t parentIndex = -1;
-      if (!NS_SUCCEEDED(mTreeView->GetParentIndex(mRow, &parentIndex)))
+      if (!NS_SUCCEEDED(mTreeView->GetParentIndex(mRow, &parentIndex))) {
         return Relation();
+      }
 
       if (parentIndex == -1) return Relation(mParent);
 
       XULTreeAccessible* treeAcc = mParent->AsXULTree();
       return Relation(treeAcc->GetTreeItemAccessible(parentIndex));
     }
 
     case RelationType::NODE_PARENT_OF: {
       bool isTrue = false;
-      if (NS_FAILED(mTreeView->IsContainerEmpty(mRow, &isTrue)) || isTrue)
+      if (NS_FAILED(mTreeView->IsContainerEmpty(mRow, &isTrue)) || isTrue) {
         return Relation();
+      }
 
-      if (NS_FAILED(mTreeView->IsContainerOpen(mRow, &isTrue)) || !isTrue)
+      if (NS_FAILED(mTreeView->IsContainerOpen(mRow, &isTrue)) || !isTrue) {
         return Relation();
+      }
 
       XULTreeAccessible* tree = mParent->AsXULTree();
       return Relation(new XULTreeItemIterator(tree, mTreeView, mRow));
     }
 
     default:
       return Relation();
   }
@@ -707,26 +712,29 @@ void XULTreeItemAccessibleBase::ActionNa
   if (aIndex == eAction_Click) {
     aName.AssignLiteral("activate");
     return;
   }
 
   if (aIndex == eAction_Expand && IsExpandable()) {
     bool isContainerOpen = false;
     mTreeView->IsContainerOpen(mRow, &isContainerOpen);
-    if (isContainerOpen)
+    if (isContainerOpen) {
       aName.AssignLiteral("collapse");
-    else
+    } else {
       aName.AssignLiteral("expand");
+    }
   }
 }
 
 bool XULTreeItemAccessibleBase::DoAction(uint8_t aIndex) const {
-  if (aIndex != eAction_Click && (aIndex != eAction_Expand || !IsExpandable()))
+  if (aIndex != eAction_Click &&
+      (aIndex != eAction_Expand || !IsExpandable())) {
     return false;
+  }
 
   DoCommand(nullptr, aIndex);
   return true;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTreeItemAccessibleBase: Accessible implementation
 
@@ -798,18 +806,19 @@ uint64_t XULTreeItemAccessibleBase::Nati
   }
 
   // focused state
   if (FocusMgr()->IsFocused(this)) state |= states::FOCUSED;
 
   // invisible state
   int32_t firstVisibleRow = mTree->GetFirstVisibleRow();
   int32_t lastVisibleRow = mTree->GetLastVisibleRow();
-  if (mRow < firstVisibleRow || mRow > lastVisibleRow)
+  if (mRow < firstVisibleRow || mRow > lastVisibleRow) {
     state |= states::INVISIBLE;
+  }
 
   return state;
 }
 
 uint64_t XULTreeItemAccessibleBase::NativeInteractiveState() const {
   return states::FOCUSABLE | states::SELECTABLE;
 }
 
@@ -868,18 +877,19 @@ bool XULTreeItemAccessibleBase::IsExpand
   mTreeView->IsContainer(mRow, &isContainer);
   if (isContainer) {
     bool isEmpty = false;
     mTreeView->IsContainerEmpty(mRow, &isEmpty);
     if (!isEmpty) {
       RefPtr<nsTreeColumns> columns = mTree->GetColumns();
       if (columns) {
         nsTreeColumn* primaryColumn = columns->GetPrimaryColumn();
-        if (primaryColumn && !nsCoreUtils::IsColumnHidden(primaryColumn))
+        if (primaryColumn && !nsCoreUtils::IsColumnHidden(primaryColumn)) {
           return true;
+        }
       }
     }
   }
 
   return false;
 }
 
 void XULTreeItemAccessibleBase::GetCellName(nsTreeColumn* aColumn,
@@ -971,18 +981,19 @@ void XULTreeItemAccessible::RowInvalidat
 ////////////////////////////////////////////////////////////////////////////////
 
 XULTreeColumAccessible::XULTreeColumAccessible(nsIContent* aContent,
                                                DocAccessible* aDoc)
     : XULColumAccessible(aContent, aDoc) {}
 
 Accessible* XULTreeColumAccessible::GetSiblingAtOffset(int32_t aOffset,
                                                        nsresult* aError) const {
-  if (aOffset < 0)
+  if (aOffset < 0) {
     return XULColumAccessible::GetSiblingAtOffset(aOffset, aError);
+  }
 
   if (aError) *aError = NS_OK;  // fail peacefully
 
   RefPtr<dom::XULTreeElement> tree = nsCoreUtils::GetTree(mContent);
   if (tree) {
     nsCOMPtr<nsITreeView> treeView = tree->GetView(FlushType::None);
     if (treeView) {
       int32_t rowCount = 0;
--- a/accessible/xul/XULTreeGridAccessible.cpp
+++ b/accessible/xul/XULTreeGridAccessible.cpp
@@ -72,35 +72,40 @@ void XULTreeGridAccessible::SelectedCell
       }
     }
   }
 }
 
 void XULTreeGridAccessible::SelectedCellIndices(nsTArray<uint32_t>* aCells) {
   uint32_t colCount = ColCount(), rowCount = RowCount();
 
-  for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++)
-    if (IsRowSelected(rowIdx))
-      for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
+  for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
+    if (IsRowSelected(rowIdx)) {
+      for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
         aCells->AppendElement(rowIdx * colCount + colIdx);
+      }
+    }
+  }
 }
 
 void XULTreeGridAccessible::SelectedColIndices(nsTArray<uint32_t>* aCols) {
   if (RowCount() != SelectedRowCount()) return;
 
   uint32_t colCount = ColCount();
   aCols->SetCapacity(colCount);
-  for (uint32_t colIdx = 0; colIdx < colCount; colIdx++)
+  for (uint32_t colIdx = 0; colIdx < colCount; colIdx++) {
     aCols->AppendElement(colIdx);
+  }
 }
 
 void XULTreeGridAccessible::SelectedRowIndices(nsTArray<uint32_t>* aRows) {
   uint32_t rowCount = RowCount();
-  for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++)
+  for (uint32_t rowIdx = 0; rowIdx < rowCount; rowIdx++) {
     if (IsRowSelected(rowIdx)) aRows->AppendElement(rowIdx);
+  }
 }
 
 Accessible* XULTreeGridAccessible::CellAt(uint32_t aRowIndex,
                                           uint32_t aColumnIndex) {
   Accessible* row = GetTreeItemAccessible(aRowIndex);
   if (!row) return nullptr;
 
   RefPtr<nsTreeColumn> column =
@@ -318,18 +323,19 @@ void XULTreeGridRowAccessible::RowInvali
   for (int32_t colIdx = aStartColIdx; colIdx <= aEndColIdx; ++colIdx) {
     nsTreeColumn* column = treeColumns->GetColumnAt(colIdx);
     if (column && !nsCoreUtils::IsColumnHidden(column)) {
       XULTreeGridCellAccessible* cell = GetCellAccessible(column);
       if (cell) nameChanged |= cell->CellInvalidated();
     }
   }
 
-  if (nameChanged)
+  if (nameChanged) {
     nsEventShell::FireEvent(nsIAccessibleEvent::EVENT_NAME_CHANGE, this);
+  }
 }
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTreeGridCellAccessible
 ////////////////////////////////////////////////////////////////////////////////
 
 XULTreeGridCellAccessible::XULTreeGridCellAccessible(
     nsIContent* aContent, DocAccessible* aDoc,
@@ -341,20 +347,21 @@ XULTreeGridCellAccessible::XULTreeGridCe
       mRow(aRow),
       mColumn(aColumn) {
   mParent = aRowAcc;
   mStateFlags |= eSharedNode;
   mGenericTypes |= eTableCell;
 
   NS_ASSERTION(mTreeView, "mTreeView is null");
 
-  if (mColumn->Type() == dom::TreeColumn_Binding::TYPE_CHECKBOX)
+  if (mColumn->Type() == dom::TreeColumn_Binding::TYPE_CHECKBOX) {
     mTreeView->GetCellValue(mRow, mColumn, mCachedTextEquiv);
-  else
+  } else {
     mTreeView->GetCellText(mRow, mColumn, mCachedTextEquiv);
+  }
 }
 
 XULTreeGridCellAccessible::~XULTreeGridCellAccessible() {}
 
 ////////////////////////////////////////////////////////////////////////////////
 // XULTreeGridCellAccessible: nsISupports implementation
 
 NS_IMPL_CYCLE_COLLECTION_INHERITED(XULTreeGridCellAccessible, LeafAccessible,
@@ -430,18 +437,20 @@ nsRect XULTreeGridCellAccessible::Bounds
                 presContext->CSSPixelsToAppUnits(bounds.Y()),
                 presContext->CSSPixelsToAppUnits(bounds.Width()),
                 presContext->CSSPixelsToAppUnits(bounds.Height()));
 }
 
 uint8_t XULTreeGridCellAccessible::ActionCount() const {
   if (mColumn->Cycler()) return 1;
 
-  if (mColumn->Type() == dom::TreeColumn_Binding::TYPE_CHECKBOX && IsEditable())
+  if (mColumn->Type() == dom::TreeColumn_Binding::TYPE_CHECKBOX &&
+      IsEditable()) {
     return 1;
+  }
 
   return 0;
 }
 
 void XULTreeGridCellAccessible::ActionNameAt(uint8_t aIndex, nsAString& aName) {
   aName.Truncate();
 
   if (aIndex != eAction_Click || !mTreeView) return;
@@ -450,20 +459,21 @@ void XULTreeGridCellAccessible::ActionNa
     aName.AssignLiteral("cycle");
     return;
   }
 
   if (mColumn->Type() == dom::TreeColumn_Binding::TYPE_CHECKBOX &&
       IsEditable()) {
     nsAutoString value;
     mTreeView->GetCellValue(mRow, mColumn, value);
-    if (value.EqualsLiteral("true"))
+    if (value.EqualsLiteral("true")) {
       aName.AssignLiteral("uncheck");
-    else
+    } else {
       aName.AssignLiteral("check");
+    }
   }
 }
 
 bool XULTreeGridCellAccessible::DoAction(uint8_t aIndex) const {
   if (aIndex != eAction_Click) return false;
 
   if (mColumn->Cycler()) {
     DoCommand();
@@ -528,18 +538,19 @@ XULTreeGridCellAccessible::NativeAttribu
   TableAccessible* table = Table();
   if (!table) return attributes.forget();
 
   nsAutoString stringIdx;
   stringIdx.AppendInt(table->CellIndexAt(mRow, ColIdx()));
   nsAccUtils::SetAccAttr(attributes, nsGkAtoms::tableCellIndex, stringIdx);
 
   // "cycles" attribute
-  if (mColumn->Cycler())
+  if (mColumn->Cycler()) {
     nsAccUtils::SetAccAttr(attributes, nsGkAtoms::cycles, u"true"_ns);
+  }
 
   return attributes.forget();
 }
 
 role XULTreeGridCellAccessible::NativeRole() const { return roles::GRID_CELL; }
 
 uint64_t XULTreeGridCellAccessible::NativeState() const {
   if (!mTreeView) return states::DEFUNCT;
@@ -651,14 +662,15 @@ bool XULTreeGridCellAccessible::IsEditab
   // method to check it.
   bool isEditable = false;
   nsresult rv = mTreeView->IsEditable(mRow, mColumn, &isEditable);
   if (NS_FAILED(rv) || !isEditable) return false;
 
   dom::Element* columnElm = mColumn->Element();
 
   if (!columnElm->AttrValueIs(kNameSpaceID_None, nsGkAtoms::editable,
-                              nsGkAtoms::_true, eCaseMatters))
+                              nsGkAtoms::_true, eCaseMatters)) {
     return false;
+  }
 
   return mContent->AsElement()->AttrValueIs(
       kNameSpaceID_None, nsGkAtoms::editable, nsGkAtoms::_true, eCaseMatters);
 }