Bug 1660906 - Introduce .clang-format file for Objective C rules. r=morgan
authorEitan Isaacson <eitan@monotonous.org>
Tue, 25 Aug 2020 21:40:32 +0000
changeset 611601 c79e406f9073b1894dedacf30966e3a631a3f339
parent 611600 ef2f4122bb76847c8d5da8d8033d53995694d6fa
child 611602 6f15be127fc23c730328b31047fad743b1e7055a
push id13943
push userffxbld-merge
push dateMon, 21 Sep 2020 13:41:08 +0000
treeherdermozilla-beta@acc3d41c2c93 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmorgan
bugs1660906
milestone82.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 1660906 - Introduce .clang-format file for Objective C rules. r=morgan I also altered the mode line in all the file headers so that editors use the correct syntax features. Differential Revision: https://phabricator.services.mozilla.com/D88081
accessible/mac/.clang-format
accessible/mac/AccessibleWrap.mm
accessible/mac/DocAccessibleWrap.mm
accessible/mac/GeckoTextMarker.h
accessible/mac/GeckoTextMarker.mm
accessible/mac/HyperTextAccessibleWrap.mm
accessible/mac/MOXAccessibleBase.h
accessible/mac/MOXAccessibleBase.mm
accessible/mac/MOXAccessibleProtocol.h
accessible/mac/MOXMathAccessibles.h
accessible/mac/MOXMathAccessibles.mm
accessible/mac/MOXTextMarkerDelegate.h
accessible/mac/MOXTextMarkerDelegate.mm
accessible/mac/MOXWebAreaAccessible.h
accessible/mac/MOXWebAreaAccessible.mm
accessible/mac/MacUtils.h
accessible/mac/MacUtils.mm
accessible/mac/Platform.mm
accessible/mac/RootAccessibleWrap.mm
accessible/mac/mozAccessible.h
accessible/mac/mozAccessible.mm
accessible/mac/mozAccessibleProtocol.h
accessible/mac/mozActionElements.h
accessible/mac/mozActionElements.mm
accessible/mac/mozHTMLAccessible.h
accessible/mac/mozHTMLAccessible.mm
accessible/mac/mozRootAccessible.h
accessible/mac/mozRootAccessible.mm
accessible/mac/mozSelectableElements.h
accessible/mac/mozSelectableElements.mm
accessible/mac/mozTableAccessible.h
accessible/mac/mozTableAccessible.mm
accessible/mac/mozTextAccessible.h
accessible/mac/mozTextAccessible.mm
new file mode 100644
--- /dev/null
+++ b/accessible/mac/.clang-format
@@ -0,0 +1,11 @@
+---
+# Objective C formatting rules.
+# Since this doesn't derive from the Cpp section, we need to redifine the root rules here.
+Language: ObjC
+BasedOnStyle: Google
+
+DerivePointerAlignment: false
+PointerAlignment: Left
+SortIncludes: false
+ColumnLimit: 80
+IndentPPDirectives: AfterHash
--- a/accessible/mac/AccessibleWrap.mm
+++ b/accessible/mac/AccessibleWrap.mm
@@ -35,62 +35,63 @@ AccessibleWrap::~AccessibleWrap() {}
 
 mozAccessible* AccessibleWrap::GetNativeObject() {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   if (!mNativeInited && !mNativeObject) {
     // We don't creat OSX accessibles for xul tooltips, defunct accessibles,
     // <br> (whitespace) elements, or pruned children.
     //
-    // We also don't create a native object if we're child of a "flat" accessible;
-    // for example, on OS X buttons shouldn't have any children, because that
-    // makes the OS confused.
+    // We also don't create a native object if we're child of a "flat"
+    // accessible; for example, on OS X buttons shouldn't have any children,
+    // because that makes the OS confused.
     //
     // To maintain a scripting environment where the XPCOM accessible hierarchy
     // look the same on all platforms, we still let the C++ objects be created
     // though.
     Accessible* parent = Parent();
     bool mustBePruned = parent && nsAccUtils::MustPrune(parent);
-    if (!IsXULTooltip() && !IsDefunct() && !mustBePruned && Role() != roles::WHITESPACE) {
+    if (!IsXULTooltip() && !IsDefunct() && !mustBePruned &&
+        Role() != roles::WHITESPACE) {
       mNativeObject = [[GetNativeType() alloc] initWithAccessible:this];
     }
   }
 
   mNativeInited = true;
 
   return mNativeObject;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 void AccessibleWrap::GetNativeInterface(void** aOutInterface) {
   *aOutInterface = static_cast<void*>(GetNativeObject());
 }
 
-// overridden in subclasses to create the right kind of object. by default we create a generic
-// 'mozAccessible' node.
+// overridden in subclasses to create the right kind of object. by default we
+// create a generic 'mozAccessible' node.
 Class AccessibleWrap::GetNativeType() {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   if (IsXULTabpanels()) return [mozPaneAccessible class];
 
   if (IsTable()) return [mozTableAccessible class];
 
   if (IsTableRow()) return [mozTableRowAccessible class];
 
   if (IsTableCell()) return [mozTableCellAccessible class];
 
   return GetTypeFromRole(Role());
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
-// this method is very important. it is fired when an accessible object "dies". after this point
-// the object might still be around (because some 3rd party still has a ref to it), but it is
-// in fact 'dead'.
+// this method is very important. it is fired when an accessible object "dies".
+// after this point the object might still be around (because some 3rd party
+// still has a ref to it), but it is in fact 'dead'.
 void AccessibleWrap::Shutdown() {
   // this ensure we will not try to re-create the native object.
   mNativeInited = true;
 
   // we really intend to access the member directly.
   if (mNativeObject) {
     [mNativeObject expire];
     [mNativeObject release];
@@ -142,17 +143,18 @@ nsresult AccessibleWrap::HandleAccEvent(
   eventTarget->GetNativeInterface((void**)&nativeAcc);
   if (!nativeAcc) {
     return NS_ERROR_FAILURE;
   }
 
   switch (eventType) {
     case nsIAccessibleEvent::EVENT_STATE_CHANGE: {
       AccStateChangeEvent* event = downcast_accEvent(aEvent);
-      [nativeAcc stateChanged:event->GetState() isEnabled:event->IsStateEnabled()];
+      [nativeAcc stateChanged:event->GetState()
+                    isEnabled:event->IsStateEnabled()];
       break;
     }
 
     case nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED: {
       MOXTextMarkerDelegate* delegate =
           [MOXTextMarkerDelegate getOrCreateForDoc:aEvent->Document()];
       AccTextSelChangeEvent* event = downcast_accEvent(aEvent);
       AutoTArray<TextRange, 1> ranges;
@@ -172,27 +174,31 @@ nsresult AccessibleWrap::HandleAccEvent(
 
     case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED: {
       AccCaretMoveEvent* event = downcast_accEvent(aEvent);
       if (event->IsSelectionCollapsed()) {
         // If the selection is collapsed, invalidate our text selection cache.
         MOXTextMarkerDelegate* delegate =
             [MOXTextMarkerDelegate getOrCreateForDoc:aEvent->Document()];
         int32_t caretOffset = event->GetCaretOffset();
-        [delegate setSelectionFrom:eventTarget at:caretOffset to:eventTarget at:caretOffset];
+        [delegate setSelectionFrom:eventTarget
+                                at:caretOffset
+                                to:eventTarget
+                                at:caretOffset];
       }
 
       [nativeAcc handleAccessibleEvent:eventType];
       break;
     }
 
     case nsIAccessibleEvent::EVENT_TEXT_INSERTED:
     case nsIAccessibleEvent::EVENT_TEXT_REMOVED: {
       AccTextChangeEvent* tcEvent = downcast_accEvent(aEvent);
-      [nativeAcc handleAccessibleTextChangeEvent:nsCocoaUtils::ToNSString(tcEvent->ModifiedText())
+      [nativeAcc handleAccessibleTextChangeEvent:nsCocoaUtils::ToNSString(
+                                                     tcEvent->ModifiedText())
                                         inserted:tcEvent->IsTextInserted()
                                      inContainer:aEvent->GetAccessible()
                                               at:tcEvent->GetStartOffset()];
       break;
     }
 
     case nsIAccessibleEvent::EVENT_FOCUS:
     case nsIAccessibleEvent::EVENT_TEXT_VALUE_CHANGE:
--- a/accessible/mac/DocAccessibleWrap.mm
+++ b/accessible/mac/DocAccessibleWrap.mm
@@ -1,22 +1,25 @@
-/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*-
- * This Source Code Form is subject to the terms of the Mozilla Public
+/* clang-format off */
+/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
+/* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DocAccessibleWrap.h"
 
 #import "mozAccessible.h"
 #import "MOXTextMarkerDelegate.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
-DocAccessibleWrap::DocAccessibleWrap(dom::Document* aDocument, PresShell* aPresShell)
+DocAccessibleWrap::DocAccessibleWrap(dom::Document* aDocument,
+                                     PresShell* aPresShell)
     : DocAccessible(aDocument, aPresShell) {}
 
 void DocAccessibleWrap::Shutdown() {
   [MOXTextMarkerDelegate destroyForDoc:this];
   DocAccessible::Shutdown();
 }
 
 DocAccessibleWrap::~DocAccessibleWrap() {}
--- a/accessible/mac/GeckoTextMarker.h
+++ b/accessible/mac/GeckoTextMarker.h
@@ -46,36 +46,41 @@ class GeckoTextMarker final {
 
   bool operator<(const GeckoTextMarker& aPoint) const;
 
   AccessibleOrProxy mContainer;
   int32_t mOffset;
 
   HyperTextAccessibleWrap* ContainerAsHyperTextWrap() const {
     return mContainer.IsAccessible()
-               ? static_cast<HyperTextAccessibleWrap*>(mContainer.AsAccessible()->AsHyperText())
+               ? static_cast<HyperTextAccessibleWrap*>(
+                     mContainer.AsAccessible()->AsHyperText())
                : nullptr;
   }
 
  private:
   uint32_t CharacterCount(const AccessibleOrProxy& aContainer);
 
   bool IsEditableRoot();
 };
 
 class GeckoTextMarkerRange final {
  public:
-  GeckoTextMarkerRange(const GeckoTextMarker& aStart, const GeckoTextMarker& aEnd)
+  GeckoTextMarkerRange(const GeckoTextMarker& aStart,
+                       const GeckoTextMarker& aEnd)
       : mStart(aStart), mEnd(aEnd) {}
 
-  GeckoTextMarkerRange(AccessibleOrProxy aDoc, AXTextMarkerRangeRef aTextMarkerRange);
+  GeckoTextMarkerRange(AccessibleOrProxy aDoc,
+                       AXTextMarkerRangeRef aTextMarkerRange);
 
   id CreateAXTextMarkerRange();
 
-  bool IsValid() const { return !mStart.mContainer.IsNull() && !mEnd.mContainer.IsNull(); };
+  bool IsValid() const {
+    return !mStart.mContainer.IsNull() && !mEnd.mContainer.IsNull();
+  };
 
   /**
    * Return text enclosed by the range.
    */
   NSString* Text() const;
 
   /**
    * Return screen bounds of range.
--- a/accessible/mac/GeckoTextMarker.mm
+++ b/accessible/mac/GeckoTextMarker.mm
@@ -1,78 +1,87 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "DocAccessibleParent.h"
 #include "AccessibleOrProxy.h"
 #include "nsCocoaUtils.h"
 
 #include "mozilla/a11y/DocAccessiblePlatformExtParent.h"
 
 #import "GeckoTextMarker.h"
 
 extern "C" {
 
 CFTypeID AXTextMarkerGetTypeID();
 
-AXTextMarkerRef AXTextMarkerCreate(CFAllocatorRef allocator, const UInt8* bytes, CFIndex length);
+AXTextMarkerRef AXTextMarkerCreate(CFAllocatorRef allocator, const UInt8* bytes,
+                                   CFIndex length);
 
 const UInt8* AXTextMarkerGetBytePtr(AXTextMarkerRef text_marker);
 
 size_t AXTextMarkerGetLength(AXTextMarkerRef text_marker);
 
 CFTypeID AXTextMarkerRangeGetTypeID();
 
-AXTextMarkerRangeRef AXTextMarkerRangeCreate(CFAllocatorRef allocator, AXTextMarkerRef start_marker,
+AXTextMarkerRangeRef AXTextMarkerRangeCreate(CFAllocatorRef allocator,
+                                             AXTextMarkerRef start_marker,
                                              AXTextMarkerRef end_marker);
 
-AXTextMarkerRef AXTextMarkerRangeCopyStartMarker(AXTextMarkerRangeRef text_marker_range);
+AXTextMarkerRef AXTextMarkerRangeCopyStartMarker(
+    AXTextMarkerRangeRef text_marker_range);
 
-AXTextMarkerRef AXTextMarkerRangeCopyEndMarker(AXTextMarkerRangeRef text_marker_range);
+AXTextMarkerRef AXTextMarkerRangeCopyEndMarker(
+    AXTextMarkerRangeRef text_marker_range);
 }
 
 namespace mozilla {
 namespace a11y {
 
 struct OpaqueGeckoTextMarker {
-  OpaqueGeckoTextMarker(uintptr_t aID, int32_t aOffset) : mID(aID), mOffset(aOffset) {}
+  OpaqueGeckoTextMarker(uintptr_t aID, int32_t aOffset)
+      : mID(aID), mOffset(aOffset) {}
   OpaqueGeckoTextMarker() {}
   uintptr_t mID;
   int32_t mOffset;
 };
 
 // GeckoTextMarker
 
-GeckoTextMarker::GeckoTextMarker(AccessibleOrProxy aDoc, AXTextMarkerRef aTextMarker) {
+GeckoTextMarker::GeckoTextMarker(AccessibleOrProxy aDoc,
+                                 AXTextMarkerRef aTextMarker) {
   MOZ_ASSERT(!aDoc.IsNull());
   OpaqueGeckoTextMarker opaqueMarker;
   if (AXTextMarkerGetLength(aTextMarker) == sizeof(OpaqueGeckoTextMarker)) {
-    memcpy(&opaqueMarker, AXTextMarkerGetBytePtr(aTextMarker), sizeof(OpaqueGeckoTextMarker));
+    memcpy(&opaqueMarker, AXTextMarkerGetBytePtr(aTextMarker),
+           sizeof(OpaqueGeckoTextMarker));
     if (aDoc.IsProxy()) {
       mContainer = aDoc.AsProxy()->AsDoc()->GetAccessible(opaqueMarker.mID);
     } else {
       mContainer = aDoc.AsAccessible()->AsDoc()->GetAccessibleByUniqueID(
           reinterpret_cast<void*>(opaqueMarker.mID));
     }
 
     mOffset = opaqueMarker.mOffset;
   }
 }
 
 id GeckoTextMarker::CreateAXTextMarker() {
-  uintptr_t identifier = mContainer.IsProxy()
-                             ? mContainer.AsProxy()->ID()
-                             : reinterpret_cast<uintptr_t>(mContainer.AsAccessible()->UniqueID());
+  uintptr_t identifier =
+      mContainer.IsProxy()
+          ? mContainer.AsProxy()->ID()
+          : reinterpret_cast<uintptr_t>(mContainer.AsAccessible()->UniqueID());
   OpaqueGeckoTextMarker opaqueMarker(identifier, mOffset);
-  AXTextMarkerRef cf_text_marker =
-      AXTextMarkerCreate(kCFAllocatorDefault, reinterpret_cast<const UInt8*>(&opaqueMarker),
-                         sizeof(OpaqueGeckoTextMarker));
+  AXTextMarkerRef cf_text_marker = AXTextMarkerCreate(
+      kCFAllocatorDefault, reinterpret_cast<const UInt8*>(&opaqueMarker),
+      sizeof(OpaqueGeckoTextMarker));
 
   return [static_cast<id>(cf_text_marker) autorelease];
 }
 
 bool GeckoTextMarker::operator<(const GeckoTextMarker& aPoint) const {
   if (mContainer == aPoint.mContainer) return mOffset < aPoint.mOffset;
 
   // Build the chain of parents
@@ -98,40 +107,42 @@ bool GeckoTextMarker::operator<(const Ge
     }
   }
 
   MOZ_ASSERT_UNREACHABLE("Broken tree?!");
   return false;
 }
 
 bool GeckoTextMarker::IsEditableRoot() {
-  uint64_t state =
-      mContainer.IsProxy() ? mContainer.AsProxy()->State() : mContainer.AsAccessible()->State();
+  uint64_t state = mContainer.IsProxy() ? mContainer.AsProxy()->State()
+                                        : mContainer.AsAccessible()->State();
   if ((state & states::EDITABLE) == 0) {
     return false;
   }
 
   AccessibleOrProxy parent = mContainer.Parent();
   if (parent.IsNull()) {
-    // Not sure when this can happen, but it would technically be an editable root.
+    // Not sure when this can happen, but it would technically be an editable
+    // root.
     return true;
   }
 
-  state = parent.IsProxy() ? parent.AsProxy()->State() : parent.AsAccessible()->State();
+  state = parent.IsProxy() ? parent.AsProxy()->State()
+                           : parent.AsAccessible()->State();
 
   return (state & states::EDITABLE) == 0;
 }
 
 bool GeckoTextMarker::Next() {
   if (mContainer.IsProxy()) {
     int32_t nextOffset = 0;
     uint64_t nextContainerID = 0;
     DocAccessibleParent* ipcDoc = mContainer.AsProxy()->Document();
-    Unused << ipcDoc->GetPlatformExtension()->SendNextClusterAt(mContainer.AsProxy()->ID(), mOffset,
-                                                                &nextContainerID, &nextOffset);
+    Unused << ipcDoc->GetPlatformExtension()->SendNextClusterAt(
+        mContainer.AsProxy()->ID(), mOffset, &nextContainerID, &nextOffset);
     ProxyAccessible* nextContainer = ipcDoc->GetAccessible(nextContainerID);
     bool moved = nextContainer != mContainer.AsProxy() || nextOffset != mOffset;
     mContainer = nextContainer;
     mOffset = nextOffset;
     return moved;
   } else if (auto htWrap = ContainerAsHyperTextWrap()) {
     HyperTextAccessible* nextContainer = nullptr;
     int32_t nextOffset = 0;
@@ -183,110 +194,117 @@ uint32_t GeckoTextMarker::CharacterCount
 }
 
 GeckoTextMarkerRange GeckoTextMarker::LeftWordRange() {
   MOZ_ASSERT(!mContainer.IsNull());
   if (mContainer.IsProxy()) {
     int32_t startOffset = 0, endOffset = 0;
     uint64_t startContainerID = 0, endContainerID = 0;
     DocAccessibleParent* ipcDoc = mContainer.AsProxy()->Document();
-    Unused << ipcDoc->GetPlatformExtension()->SendLeftWordAt(mContainer.AsProxy()->ID(), mOffset,
-                                                             &startContainerID, &startOffset,
-                                                             &endContainerID, &endOffset);
+    Unused << ipcDoc->GetPlatformExtension()->SendLeftWordAt(
+        mContainer.AsProxy()->ID(), mOffset, &startContainerID, &startOffset,
+        &endContainerID, &endOffset);
     return GeckoTextMarkerRange(
         GeckoTextMarker(ipcDoc->GetAccessible(startContainerID), startOffset),
         GeckoTextMarker(ipcDoc->GetAccessible(endContainerID), endOffset));
   } else if (auto htWrap = ContainerAsHyperTextWrap()) {
     int32_t startOffset = 0, endOffset = 0;
     HyperTextAccessible* startContainer = nullptr;
     HyperTextAccessible* endContainer = nullptr;
-    htWrap->LeftWordAt(mOffset, &startContainer, &startOffset, &endContainer, &endOffset);
+    htWrap->LeftWordAt(mOffset, &startContainer, &startOffset, &endContainer,
+                       &endOffset);
     return GeckoTextMarkerRange(GeckoTextMarker(startContainer, startOffset),
                                 GeckoTextMarker(endContainer, endOffset));
   }
 
   return GeckoTextMarkerRange(GeckoTextMarker(), GeckoTextMarker());
 }
 
 GeckoTextMarkerRange GeckoTextMarker::RightWordRange() {
   MOZ_ASSERT(!mContainer.IsNull());
   if (mContainer.IsProxy()) {
     int32_t startOffset = 0, endOffset = 0;
     uint64_t startContainerID = 0, endContainerID = 0;
     DocAccessibleParent* ipcDoc = mContainer.AsProxy()->Document();
-    Unused << ipcDoc->GetPlatformExtension()->SendRightWordAt(mContainer.AsProxy()->ID(), mOffset,
-                                                              &startContainerID, &startOffset,
-                                                              &endContainerID, &endOffset);
+    Unused << ipcDoc->GetPlatformExtension()->SendRightWordAt(
+        mContainer.AsProxy()->ID(), mOffset, &startContainerID, &startOffset,
+        &endContainerID, &endOffset);
     return GeckoTextMarkerRange(
         GeckoTextMarker(ipcDoc->GetAccessible(startContainerID), startOffset),
         GeckoTextMarker(ipcDoc->GetAccessible(endContainerID), endOffset));
   } else if (auto htWrap = ContainerAsHyperTextWrap()) {
     int32_t startOffset = 0, endOffset = 0;
     HyperTextAccessible* startContainer = nullptr;
     HyperTextAccessible* endContainer = nullptr;
-    htWrap->RightWordAt(mOffset, &startContainer, &startOffset, &endContainer, &endOffset);
+    htWrap->RightWordAt(mOffset, &startContainer, &startOffset, &endContainer,
+                        &endOffset);
     return GeckoTextMarkerRange(GeckoTextMarker(startContainer, startOffset),
                                 GeckoTextMarker(endContainer, endOffset));
   }
 
   return GeckoTextMarkerRange(GeckoTextMarker(), GeckoTextMarker());
 }
 
 // GeckoTextMarkerRange
 
-GeckoTextMarkerRange::GeckoTextMarkerRange(AccessibleOrProxy aDoc,
-                                           AXTextMarkerRangeRef aTextMarkerRange) {
+GeckoTextMarkerRange::GeckoTextMarkerRange(
+    AccessibleOrProxy aDoc, AXTextMarkerRangeRef aTextMarkerRange) {
   if (CFGetTypeID(aTextMarkerRange) != AXTextMarkerRangeGetTypeID()) {
     return;
   }
 
-  AXTextMarkerRef start_marker(AXTextMarkerRangeCopyStartMarker(aTextMarkerRange));
+  AXTextMarkerRef start_marker(
+      AXTextMarkerRangeCopyStartMarker(aTextMarkerRange));
   AXTextMarkerRef end_marker(AXTextMarkerRangeCopyEndMarker(aTextMarkerRange));
 
   mStart = GeckoTextMarker(aDoc, start_marker);
   mEnd = GeckoTextMarker(aDoc, end_marker);
 
   CFRelease(start_marker);
   CFRelease(end_marker);
 }
 
 id GeckoTextMarkerRange::CreateAXTextMarkerRange() {
-  AXTextMarkerRangeRef cf_text_marker_range = AXTextMarkerRangeCreate(
-      kCFAllocatorDefault, mStart.CreateAXTextMarker(), mEnd.CreateAXTextMarker());
+  AXTextMarkerRangeRef cf_text_marker_range =
+      AXTextMarkerRangeCreate(kCFAllocatorDefault, mStart.CreateAXTextMarker(),
+                              mEnd.CreateAXTextMarker());
   return [static_cast<id>(cf_text_marker_range) autorelease];
 }
 
 NSString* GeckoTextMarkerRange::Text() const {
   nsAutoString text;
   if (mStart.mContainer.IsProxy() && mEnd.mContainer.IsProxy()) {
     DocAccessibleParent* ipcDoc = mStart.mContainer.AsProxy()->Document();
     Unused << ipcDoc->GetPlatformExtension()->SendTextForRange(
-        mStart.mContainer.AsProxy()->ID(), mStart.mOffset, mEnd.mContainer.AsProxy()->ID(),
-        mEnd.mOffset, &text);
+        mStart.mContainer.AsProxy()->ID(), mStart.mOffset,
+        mEnd.mContainer.AsProxy()->ID(), mEnd.mOffset, &text);
   } else if (auto htWrap = mStart.ContainerAsHyperTextWrap()) {
-    htWrap->TextForRange(text, mStart.mOffset, mEnd.ContainerAsHyperTextWrap(), mEnd.mOffset);
+    htWrap->TextForRange(text, mStart.mOffset, mEnd.ContainerAsHyperTextWrap(),
+                         mEnd.mOffset);
   }
   return nsCocoaUtils::ToNSString(text);
 }
 
 NSValue* GeckoTextMarkerRange::Bounds() const {
   nsIntRect rect;
   if (mStart.mContainer.IsProxy() && mEnd.mContainer.IsProxy()) {
     DocAccessibleParent* ipcDoc = mStart.mContainer.AsProxy()->Document();
     Unused << ipcDoc->GetPlatformExtension()->SendBoundsForRange(
-        mStart.mContainer.AsProxy()->ID(), mStart.mOffset, mEnd.mContainer.AsProxy()->ID(),
-        mEnd.mOffset, &rect);
+        mStart.mContainer.AsProxy()->ID(), mStart.mOffset,
+        mEnd.mContainer.AsProxy()->ID(), mEnd.mOffset, &rect);
   } else if (auto htWrap = mStart.ContainerAsHyperTextWrap()) {
-    rect = htWrap->BoundsForRange(mStart.mOffset, mEnd.ContainerAsHyperTextWrap(), mEnd.mOffset);
+    rect = htWrap->BoundsForRange(
+        mStart.mOffset, mEnd.ContainerAsHyperTextWrap(), mEnd.mOffset);
   }
 
   NSScreen* mainView = [[NSScreen screens] objectAtIndex:0];
   CGFloat scaleFactor = nsCocoaUtils::GetBackingScaleFactor(mainView);
-  NSRect r = NSMakeRect(
-      static_cast<CGFloat>(rect.x) / scaleFactor,
-      [mainView frame].size.height - static_cast<CGFloat>(rect.y + rect.height) / scaleFactor,
-      static_cast<CGFloat>(rect.width) / scaleFactor,
-      static_cast<CGFloat>(rect.height) / scaleFactor);
+  NSRect r =
+      NSMakeRect(static_cast<CGFloat>(rect.x) / scaleFactor,
+                 [mainView frame].size.height -
+                     static_cast<CGFloat>(rect.y + rect.height) / scaleFactor,
+                 static_cast<CGFloat>(rect.width) / scaleFactor,
+                 static_cast<CGFloat>(rect.height) / scaleFactor);
 
   return [NSValue valueWithRect:r];
 }
 }
 }
--- a/accessible/mac/HyperTextAccessibleWrap.mm
+++ b/accessible/mac/HyperTextAccessibleWrap.mm
@@ -1,9 +1,11 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format off */
+/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "HyperTextAccessibleWrap.h"
 
 #include "Accessible-inl.h"
 #include "HTMLListAccessible.h"
@@ -26,27 +28,25 @@ class HyperTextIterator {
         mCurrentStartOffset(aStartOffset),
         mCurrentEndOffset(aStartOffset),
         mEndContainer(aEndContainer),
         mEndOffset(aEndOffset),
         mSkipBullet(aSkipBullet) {}
 
   bool Next();
 
-  // If offset is set to a child hyperlink, adjust it so it set on the first offset
-  // in the deepest link.
-  // Or, if the offset to the last character, set it to the outermost end offset
-  // in an ancestor.
-  // Returns true if iterator was mutated.
+  // If offset is set to a child hyperlink, adjust it so it set on the first
+  // offset in the deepest link. Or, if the offset to the last character, set it
+  // to the outermost end offset in an ancestor. Returns true if iterator was
+  // mutated.
   bool NormalizeForward();
 
-  // If offset is set right after child hyperlink, adjust it so it set on the last offset
-  // in the deepest link.
-  // Or, if the offset is on the first character of a link, set it to the outermost start offset
-  // in an ancestor.
+  // If offset is set right after child hyperlink, adjust it so it set on the
+  // last offset in the deepest link. Or, if the offset is on the first
+  // character of a link, set it to the outermost start offset in an ancestor.
   // Returns true if iterator was mutated.
   bool NormalizeBackward();
 
   HyperTextAccessible* mCurrentContainer;
   int32_t mCurrentStartOffset;
   int32_t mCurrentEndOffset;
 
  private:
@@ -55,36 +55,37 @@ class HyperTextIterator {
   HyperTextAccessible* mEndContainer;
   int32_t mEndOffset;
 
   bool mSkipBullet;
 };
 
 bool HyperTextIterator::NormalizeForward() {
   if (mCurrentStartOffset == nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT ||
-      mCurrentStartOffset >= static_cast<int32_t>(mCurrentContainer->CharacterCount())) {
+      mCurrentStartOffset >=
+          static_cast<int32_t>(mCurrentContainer->CharacterCount())) {
     // If this is the end of the current container, mutate to its parent's
     // end offset.
     if (!mCurrentContainer->IsLink()) {
       // If we are not a link, it is a root hypertext accessible.
       return false;
     }
     uint32_t endOffset = mCurrentContainer->EndOffset();
     if (endOffset != 0) {
       mCurrentContainer = mCurrentContainer->Parent()->AsHyperText();
       mCurrentStartOffset = endOffset;
 
-      // Call NormalizeForward recursively to get top-most link if at the end of one,
-      // or innermost link if at the beginning.
+      // Call NormalizeForward recursively to get top-most link if at the end of
+      // one, or innermost link if at the beginning.
       NormalizeForward();
       return true;
     }
   } else {
-    Accessible* link =
-        mCurrentContainer->LinkAt(mCurrentContainer->LinkIndexAtOffset(mCurrentStartOffset));
+    Accessible* link = mCurrentContainer->LinkAt(
+        mCurrentContainer->LinkIndexAtOffset(mCurrentStartOffset));
 
     // If there is a link at this offset, mutate into it.
     if (link && link->IsHyperText()) {
       mCurrentContainer = link->AsHyperText();
       if (mSkipBullet && link->IsHTMLListItem()) {
         Accessible* bullet = link->AsHTMLListItem()->Bullet();
         mCurrentStartOffset = bullet ? nsAccUtils::TextLength(bullet) : 0;
       } else {
@@ -109,31 +110,32 @@ bool HyperTextIterator::NormalizeBackwar
       // If we are not a link, it is a root hypertext accessible.
       return false;
     }
 
     uint32_t startOffset = mCurrentContainer->StartOffset();
     mCurrentContainer = mCurrentContainer->Parent()->AsHyperText();
     mCurrentStartOffset = startOffset;
 
-    // Call NormalizeBackward recursively to get top-most link if at the beginning of one,
-    // or innermost link if at the end.
+    // Call NormalizeBackward recursively to get top-most link if at the
+    // beginning of one, or innermost link if at the end.
     NormalizeBackward();
     return true;
   } else {
-    Accessible* link = mCurrentContainer->GetChildAtOffset(mCurrentStartOffset - 1);
+    Accessible* link =
+        mCurrentContainer->GetChildAtOffset(mCurrentStartOffset - 1);
 
     // If there is a link before this offset, mutate into it,
     // and set the offset to its last character.
     if (link && link->IsHyperText()) {
       mCurrentContainer = link->AsHyperText();
       mCurrentStartOffset = mCurrentContainer->CharacterCount();
 
-      // Call NormalizeBackward recursively to get top-most top-most embedding ancestor
-      // if at the beginning of one, or innermost link if at the end.
+      // Call NormalizeBackward recursively to get top-most top-most embedding
+      // ancestor if at the beginning of one, or innermost link if at the end.
       NormalizeBackward();
       return true;
     }
 
     if (mSkipBullet && mCurrentContainer->IsHTMLListItem() &&
         mCurrentContainer->AsHTMLListItem()->Bullet() == link) {
       mCurrentStartOffset = 0;
       NormalizeBackward();
@@ -163,140 +165,162 @@ bool HyperTextIterator::Next() {
       (mCurrentEndOffset == -1 || mEndOffset <= mCurrentEndOffset)) {
     return false;
   } else {
     mCurrentStartOffset = mCurrentEndOffset;
     NormalizeForward();
   }
 
   int32_t nextLinkOffset = NextLinkOffset();
-  if (mCurrentContainer == mEndContainer && (nextLinkOffset == -1 || nextLinkOffset > mEndOffset)) {
-    mCurrentEndOffset = mEndOffset < 0 ? mEndContainer->CharacterCount() : mEndOffset;
+  if (mCurrentContainer == mEndContainer &&
+      (nextLinkOffset == -1 || nextLinkOffset > mEndOffset)) {
+    mCurrentEndOffset =
+        mEndOffset < 0 ? mEndContainer->CharacterCount() : mEndOffset;
   } else {
-    mCurrentEndOffset = nextLinkOffset < 0 ? mCurrentContainer->CharacterCount() : nextLinkOffset;
+    mCurrentEndOffset = nextLinkOffset < 0 ? mCurrentContainer->CharacterCount()
+                                           : nextLinkOffset;
   }
 
   return mCurrentStartOffset != mCurrentEndOffset;
 }
 
-void HyperTextAccessibleWrap::TextForRange(nsAString& aText, int32_t aStartOffset,
-                                           HyperTextAccessible* aEndContainer, int32_t aEndOffset) {
+void HyperTextAccessibleWrap::TextForRange(nsAString& aText,
+                                           int32_t aStartOffset,
+                                           HyperTextAccessible* aEndContainer,
+                                           int32_t aEndOffset) {
   HyperTextIterator iter(this, aStartOffset, aEndContainer, aEndOffset);
   while (iter.Next()) {
     nsAutoString text;
-    iter.mCurrentContainer->TextSubstring(iter.mCurrentStartOffset, iter.mCurrentEndOffset, text);
+    iter.mCurrentContainer->TextSubstring(iter.mCurrentStartOffset,
+                                          iter.mCurrentEndOffset, text);
     aText.Append(text);
   }
 }
 
-nsIntRect HyperTextAccessibleWrap::BoundsForRange(int32_t aStartOffset,
-                                                  HyperTextAccessible* aEndContainer,
-                                                  int32_t aEndOffset) {
+nsIntRect HyperTextAccessibleWrap::BoundsForRange(
+    int32_t aStartOffset, HyperTextAccessible* aEndContainer,
+    int32_t aEndOffset) {
   nsIntRect rect;
   HyperTextIterator iter(this, aStartOffset, aEndContainer, aEndOffset);
   while (iter.Next()) {
-    nsIntRect stringRect =
-        iter.mCurrentContainer->TextBounds(iter.mCurrentStartOffset, iter.mCurrentEndOffset);
+    nsIntRect stringRect = iter.mCurrentContainer->TextBounds(
+        iter.mCurrentStartOffset, iter.mCurrentEndOffset);
     rect.UnionRect(rect, stringRect);
   }
 
   return rect;
 }
 
-void HyperTextAccessibleWrap::LeftWordAt(int32_t aOffset, HyperTextAccessible** aStartContainer,
-                                         int32_t* aStartOffset, HyperTextAccessible** aEndContainer,
+void HyperTextAccessibleWrap::LeftWordAt(int32_t aOffset,
+                                         HyperTextAccessible** aStartContainer,
+                                         int32_t* aStartOffset,
+                                         HyperTextAccessible** aEndContainer,
                                          int32_t* aEndOffset) {
   TextPoint here(this, aOffset);
-  TextPoint start = FindTextPoint(aOffset, eDirPrevious, eSelectWord, eStartWord);
+  TextPoint start =
+      FindTextPoint(aOffset, eDirPrevious, eSelectWord, eStartWord);
   if (!start.mContainer) {
     return;
   }
 
-  if ((NativeState() & states::EDITABLE) && !(start.mContainer->NativeState() & states::EDITABLE)) {
-    // The word search crossed an editable boundary. Return the first word of the editable root.
-    return EditableRoot()->RightWordAt(0, aStartContainer, aStartOffset, aEndContainer, aEndOffset);
+  if ((NativeState() & states::EDITABLE) &&
+      !(start.mContainer->NativeState() & states::EDITABLE)) {
+    // The word search crossed an editable boundary. Return the first word of
+    // the editable root.
+    return EditableRoot()->RightWordAt(0, aStartContainer, aStartOffset,
+                                       aEndContainer, aEndOffset);
   }
 
-  TextPoint end = static_cast<HyperTextAccessibleWrap*>(start.mContainer)
-                      ->FindTextPoint(start.mOffset, eDirNext, eSelectWord, eEndWord);
+  TextPoint end =
+      static_cast<HyperTextAccessibleWrap*>(start.mContainer)
+          ->FindTextPoint(start.mOffset, eDirNext, eSelectWord, eEndWord);
   if (end < here) {
     *aStartContainer = end.mContainer;
     *aEndContainer = here.mContainer;
     *aStartOffset = end.mOffset;
     *aEndOffset = here.mOffset;
   } else {
     *aStartContainer = start.mContainer;
     *aEndContainer = end.mContainer;
     *aStartOffset = start.mOffset;
     *aEndOffset = end.mOffset;
   }
 }
 
-void HyperTextAccessibleWrap::RightWordAt(int32_t aOffset, HyperTextAccessible** aStartContainer,
+void HyperTextAccessibleWrap::RightWordAt(int32_t aOffset,
+                                          HyperTextAccessible** aStartContainer,
                                           int32_t* aStartOffset,
                                           HyperTextAccessible** aEndContainer,
                                           int32_t* aEndOffset) {
   TextPoint here(this, aOffset);
   TextPoint end = FindTextPoint(aOffset, eDirNext, eSelectWord, eEndWord);
   if (!end.mContainer || end < here) {
-    // If we didn't find a word end, or if we wrapped around (bug 1652833), return with no result.
+    // If we didn't find a word end, or if we wrapped around (bug 1652833),
+    // return with no result.
     return;
   }
 
-  if ((NativeState() & states::EDITABLE) && !(end.mContainer->NativeState() & states::EDITABLE)) {
-    // The word search crossed an editable boundary. Return the last word of the editable root.
-    return EditableRoot()->LeftWordAt(nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT, aStartContainer,
-                                      aStartOffset, aEndContainer, aEndOffset);
+  if ((NativeState() & states::EDITABLE) &&
+      !(end.mContainer->NativeState() & states::EDITABLE)) {
+    // The word search crossed an editable boundary. Return the last word of the
+    // editable root.
+    return EditableRoot()->LeftWordAt(
+        nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT, aStartContainer,
+        aStartOffset, aEndContainer, aEndOffset);
   }
 
-  TextPoint start = static_cast<HyperTextAccessibleWrap*>(end.mContainer)
-                        ->FindTextPoint(end.mOffset, eDirPrevious, eSelectWord, eStartWord);
+  TextPoint start =
+      static_cast<HyperTextAccessibleWrap*>(end.mContainer)
+          ->FindTextPoint(end.mOffset, eDirPrevious, eSelectWord, eStartWord);
 
   if (here < start) {
     *aStartContainer = here.mContainer;
     *aEndContainer = start.mContainer;
     *aStartOffset = here.mOffset;
     *aEndOffset = start.mOffset;
   } else {
     *aStartContainer = start.mContainer;
     *aEndContainer = end.mContainer;
     *aStartOffset = start.mOffset;
     *aEndOffset = end.mOffset;
   }
 }
 
-void HyperTextAccessibleWrap::NextClusterAt(int32_t aOffset, HyperTextAccessible** aNextContainer,
-                                            int32_t* aNextOffset) {
+void HyperTextAccessibleWrap::NextClusterAt(
+    int32_t aOffset, HyperTextAccessible** aNextContainer,
+    int32_t* aNextOffset) {
   TextPoint here(this, aOffset);
-  TextPoint next = FindTextPoint(aOffset, eDirNext, eSelectCluster, eDefaultBehavior);
+  TextPoint next =
+      FindTextPoint(aOffset, eDirNext, eSelectCluster, eDefaultBehavior);
 
   if ((next.mOffset == nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT &&
        next.mContainer == Document()) ||
       (next < here)) {
-    // If we reached the end of the doc, or if we wrapped to the start of the doc
-    // return given offset as-is.
+    // If we reached the end of the doc, or if we wrapped to the start of the
+    // doc return given offset as-is.
     *aNextContainer = this;
     *aNextOffset = aOffset;
   } else {
     *aNextContainer = next.mContainer;
     *aNextOffset = next.mOffset;
   }
 }
 
-void HyperTextAccessibleWrap::PreviousClusterAt(int32_t aOffset,
-                                                HyperTextAccessible** aPrevContainer,
-                                                int32_t* aPrevOffset) {
-  TextPoint prev = FindTextPoint(aOffset, eDirPrevious, eSelectCluster, eDefaultBehavior);
+void HyperTextAccessibleWrap::PreviousClusterAt(
+    int32_t aOffset, HyperTextAccessible** aPrevContainer,
+    int32_t* aPrevOffset) {
+  TextPoint prev =
+      FindTextPoint(aOffset, eDirPrevious, eSelectCluster, eDefaultBehavior);
   *aPrevContainer = prev.mContainer;
   *aPrevOffset = prev.mOffset;
 }
 
-TextPoint HyperTextAccessibleWrap::FindTextPoint(int32_t aOffset, nsDirection aDirection,
-                                                 nsSelectionAmount aAmount,
-                                                 EWordMovementType aWordMovementType) {
+TextPoint HyperTextAccessibleWrap::FindTextPoint(
+    int32_t aOffset, nsDirection aDirection, nsSelectionAmount aAmount,
+    EWordMovementType aWordMovementType) {
   // Layout can remain trapped in an editable. We normalize out of
   // it if we are in its last offset.
   HyperTextIterator iter(this, aOffset, this, CharacterCount(), true);
   if (aDirection == eDirNext) {
     iter.NormalizeForward();
   } else {
     iter.NormalizeBackward();
   }
@@ -344,47 +368,51 @@ TextPoint HyperTextAccessibleWrap::FindT
   int32_t innerContentOffset = innerOffset;
   if (child->IsTextLeaf()) {
     NS_ASSERTION(childFrame->IsTextFrame(), "Wrong frame!");
     RenderedToContentOffset(childFrame, innerOffset, &innerContentOffset);
   }
 
   nsIFrame* frameAtOffset = childFrame;
   int32_t unusedOffsetInFrame = 0;
-  childFrame->GetChildFrameContainingOffset(innerContentOffset, true, &unusedOffsetInFrame,
-                                            &frameAtOffset);
+  childFrame->GetChildFrameContainingOffset(
+      innerContentOffset, true, &unusedOffsetInFrame, &frameAtOffset);
 
   const bool kIsJumpLinesOk = true;       // okay to jump lines
   const bool kIsScrollViewAStop = false;  // do not stop at scroll views
   const bool kIsKeyboardSelect = true;    // is keyboard selection
   const bool kIsVisualBidi = false;       // use visual order for bidi text
-  nsPeekOffsetStruct pos(aAmount, aDirection, innerContentOffset, nsPoint(0, 0), kIsJumpLinesOk,
-                         kIsScrollViewAStop, kIsKeyboardSelect, kIsVisualBidi, false,
-                         nsPeekOffsetStruct::ForceEditableRegion::No, aWordMovementType, false);
+  nsPeekOffsetStruct pos(
+      aAmount, aDirection, innerContentOffset, nsPoint(0, 0), kIsJumpLinesOk,
+      kIsScrollViewAStop, kIsKeyboardSelect, kIsVisualBidi, false,
+      nsPeekOffsetStruct::ForceEditableRegion::No, aWordMovementType, false);
   nsresult rv = frameAtOffset->PeekOffset(&pos);
 
   // PeekOffset fails on last/first lines of the text in certain cases.
   if (NS_FAILED(rv) && aAmount == eSelectLine) {
     pos.mAmount = aDirection == eDirNext ? eSelectEndLine : eSelectBeginLine;
     frameAtOffset->PeekOffset(&pos);
   }
   if (!pos.mResultContent) {
     NS_ERROR("No result content!");
     return TextPoint(this, aOffset);
   }
 
   if (aDirection == eDirNext &&
-      nsContentUtils::PositionIsBefore(pos.mResultContent, mContent, nullptr, nullptr)) {
+      nsContentUtils::PositionIsBefore(pos.mResultContent, mContent, nullptr,
+                                       nullptr)) {
     // Bug 1652833 makes us sometimes return the first element on the doc.
     return TextPoint(Document(), nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT);
   }
 
-  HyperTextAccessible* container = nsAccUtils::GetTextContainer(pos.mResultContent);
-  int32_t offset = container ? container->DOMPointToOffset(pos.mResultContent, pos.mContentOffset,
-                                                           aDirection == eDirNext)
+  HyperTextAccessible* container =
+      nsAccUtils::GetTextContainer(pos.mResultContent);
+  int32_t offset = container ? container->DOMPointToOffset(
+                                   pos.mResultContent, pos.mContentOffset,
+                                   aDirection == eDirNext)
                              : 0;
   return TextPoint(container, offset);
 }
 
 HyperTextAccessibleWrap* HyperTextAccessibleWrap::EditableRoot() {
   Accessible* editable = nullptr;
   for (Accessible* acc = this; acc && acc != Document(); acc = acc->Parent()) {
     if (acc->NativeState() & states::EDITABLE) {
--- a/accessible/mac/MOXAccessibleBase.h
+++ b/accessible/mac/MOXAccessibleBase.h
@@ -1,9 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import <Cocoa/Cocoa.h>
 
 #import "mozAccessibleProtocol.h"
 #import "MOXAccessibleProtocol.h"
@@ -62,17 +64,18 @@ inline id<mozAccessible> GetObjectOrRepr
 
 // override, final
 - (NSString*)accessibilityActionDescription:(NSString*)action;
 
 // override, final
 - (NSArray*)accessibilityParameterizedAttributeNames;
 
 // override, final
-- (id)accessibilityAttributeValue:(NSString*)attribute forParameter:(id)parameter;
+- (id)accessibilityAttributeValue:(NSString*)attribute
+                     forParameter:(id)parameter;
 
 // override, final
 - (id)accessibilityHitTest:(NSPoint)point;
 
 // override, final
 - (id)accessibilityFocusedUIElement;
 
 // override, final
@@ -88,17 +91,18 @@ inline id<mozAccessible> GetObjectOrRepr
 
 // override
 - (id)moxFocusedUIElement;
 
 // override
 - (void)moxPostNotification:(NSString*)notification;
 
 // override
-- (void)moxPostNotification:(NSString*)notification withUserInfo:(NSDictionary*)userInfo;
+- (void)moxPostNotification:(NSString*)notification
+               withUserInfo:(NSDictionary*)userInfo;
 
 // override
 - (BOOL)moxBlockSelector:(SEL)selector;
 
 // override
 - (NSArray*)moxUnignoredChildren;
 
 // override
--- a/accessible/mac/MOXAccessibleBase.mm
+++ b/accessible/mac/MOXAccessibleBase.mm
@@ -1,9 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "MOXAccessibleBase.h"
 
 #import "MacSelectorMap.h"
 
@@ -43,17 +45,18 @@ mozilla::LogModule* GetMacAccessibilityL
 
 @implementation NSObject (MOXAccessible)
 
 - (BOOL)isMOXAccessible {
   return [self conformsToProtocol:@protocol(MOXAccessible)];
 }
 
 - (BOOL)hasMOXAccessibles {
-  return [self isKindOfClass:[NSArray class]] && [[(NSArray*)self firstObject] isMOXAccessible];
+  return [self isKindOfClass:[NSArray class]] &&
+         [[(NSArray*)self firstObject] isMOXAccessible];
 }
 
 @end
 
 // Private methods
 @interface MOXAccessibleBase ()
 
 - (BOOL)isSelectorSupported:(SEL)selector;
@@ -108,18 +111,18 @@ mozilla::LogModule* GetMacAccessibilityL
     // If we have a delegate add all the text marker attributes.
     if ([self moxTextMarkerDelegate]) {
       [attributes addObjectsFromArray:[mac::TextAttributeGetters() allKeys]];
     }
 
     // We store a hash table with types as keys, and atttribute lists as values.
     // This lets us cache the atttribute list of each subclass so we only
     // need to gather its MOXAccessible methods once.
-    // XXX: Uncomment when accessibilityAttributeNames is removed from all subclasses.
-    // attributesForEachClass[[self class]] = attributes;
+    // XXX: Uncomment when accessibilityAttributeNames is removed from all
+    // subclasses. attributesForEachClass[[self class]] = attributes;
   }
 
   return attributes;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (id)accessibilityAttributeValue:(NSString*)attribute {
@@ -146,38 +149,41 @@ mozilla::LogModule* GetMacAccessibilityL
         value = [textMarkerDelegate performSelector:selector];
       }
     }
   }
 
   if ([value isMOXAccessible]) {
     // If this is a MOXAccessible, get its represented view or filter it if
     // it should be ignored.
-    value = [value isAccessibilityElement] ? GetObjectOrRepresentedView(value) : nil;
+    value = [value isAccessibilityElement] ? GetObjectOrRepresentedView(value)
+                                           : nil;
   }
 
   if ([value hasMOXAccessibles]) {
-    // If this is an array of mozAccessibles, get each element's represented view
-    // and remove it from the returned array if it should be ignored.
+    // If this is an array of mozAccessibles, get each element's represented
+    // view and remove it from the returned array if it should be ignored.
     NSUInteger arrSize = [value count];
     NSMutableArray* arr = [[NSMutableArray alloc] initWithCapacity:arrSize];
     for (NSUInteger i = 0; i < arrSize; i++) {
       id<mozAccessible> mozAcc = GetObjectOrRepresentedView(value[i]);
       if ([mozAcc isAccessibilityElement]) {
         [arr addObject:mozAcc];
       }
     }
 
     value = arr;
   }
 
   if (MOZ_LOG_TEST(GetMacAccessibilityLog(), LogLevel::Debug)) {
     if (MOZ_LOG_TEST(GetMacAccessibilityLog(), LogLevel::Verbose)) {
-      LOG(LogLevel::Verbose, @"[%@] attributeValue %@ => %@", self, attribute, value);
-    } else if (![attribute isEqualToString:@"AXParent"] && ![attribute isEqualToString:@"AXRole"] &&
+      LOG(LogLevel::Verbose, @"[%@] attributeValue %@ => %@", self, attribute,
+          value);
+    } else if (![attribute isEqualToString:@"AXParent"] &&
+               ![attribute isEqualToString:@"AXRole"] &&
                ![attribute isEqualToString:@"AXChildren"]) {
       LOG(LogLevel::Debug, @"[%@] attributeValue %@", self, attribute);
     }
   }
 
   return value;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
@@ -279,25 +285,27 @@ mozilla::LogModule* GetMacAccessibilityL
     SEL selector = NSSelectorFromString(attributes[attribute]);
     if ([self isSelectorSupported:selector]) {
       [attributeNames addObject:attribute];
     }
   }
 
   // If we have a delegate add all the text marker attributes.
   if ([self moxTextMarkerDelegate]) {
-    [attributeNames addObjectsFromArray:[mac::ParameterizedTextAttributeGetters() allKeys]];
+    [attributeNames
+        addObjectsFromArray:[mac::ParameterizedTextAttributeGetters() allKeys]];
   }
 
   return attributeNames;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
-- (id)accessibilityAttributeValue:(NSString*)attribute forParameter:(id)parameter {
+- (id)accessibilityAttributeValue:(NSString*)attribute
+                     forParameter:(id)parameter {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   if ([self isExpired]) {
     return nil;
   }
 
   id value = nil;
 
@@ -310,24 +318,25 @@ mozilla::LogModule* GetMacAccessibilityL
   } else if (id textMarkerDelegate = [self moxTextMarkerDelegate]) {
     // If we have a delegate, check if attribute is a text marker
     // attribute and call the associated selector on the delegate
     // if so.
     NSDictionary* textMarkerGetters = mac::ParameterizedTextAttributeGetters();
     if (textMarkerGetters[attribute]) {
       SEL selector = NSSelectorFromString(textMarkerGetters[attribute]);
       if ([textMarkerDelegate respondsToSelector:selector]) {
-        value = [textMarkerDelegate performSelector:selector withObject:parameter];
+        value = [textMarkerDelegate performSelector:selector
+                                         withObject:parameter];
       }
     }
   }
 
   if (MOZ_LOG_TEST(GetMacAccessibilityLog(), LogLevel::Verbose)) {
-    LOG(LogLevel::Verbose, @"[%@] attributeValueForParam %@(%@) => %@", self, attribute, parameter,
-        value);
+    LOG(LogLevel::Verbose, @"[%@] attributeValueForParam %@(%@) => %@", self,
+        attribute, parameter, value);
   } else {
     LOG(LogLevel::Debug, @"[%@] attributeValueForParam %@", self, attribute);
   }
 
   return value;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
@@ -374,17 +383,18 @@ mozilla::LogModule* GetMacAccessibilityL
 - (id)moxFocusedUIElement {
   return GetObjectOrRepresentedView(self);
 }
 
 - (void)moxPostNotification:(NSString*)notification {
   [self moxPostNotification:notification withUserInfo:nil];
 }
 
-- (void)moxPostNotification:(NSString*)notification withUserInfo:(NSDictionary*)userInfo {
+- (void)moxPostNotification:(NSString*)notification
+               withUserInfo:(NSDictionary*)userInfo {
   if (MOZ_LOG_TEST(GetMacAccessibilityLog(), LogLevel::Verbose)) {
     LOG(LogLevel::Verbose, @"[%@] notify %@ %@", self, notification, userInfo);
   } else {
     LOG(LogLevel::Debug, @"[%@] notify %@", self, notification);
   }
 
   // This sends events via nsIObserverService to be consumed by our mochitests.
   xpcAccessibleMacEvent::FireEvent(self, notification, userInfo);
@@ -396,20 +406,21 @@ mozilla::LogModule* GetMacAccessibilityL
   }
 
   if (![self isAccessibilityElement]) {
     // If this is an ignored object, don't expose it to system.
     return;
   }
 
   if (userInfo) {
-    NSAccessibilityPostNotificationWithUserInfo(GetObjectOrRepresentedView(self), notification,
-                                                userInfo);
+    NSAccessibilityPostNotificationWithUserInfo(
+        GetObjectOrRepresentedView(self), notification, userInfo);
   } else {
-    NSAccessibilityPostNotification(GetObjectOrRepresentedView(self), notification);
+    NSAccessibilityPostNotification(GetObjectOrRepresentedView(self),
+                                    notification);
   }
 }
 
 - (BOOL)moxBlockSelector:(SEL)selector {
   return NO;
 }
 
 - (NSArray*)moxChildren {
@@ -420,17 +431,18 @@ mozilla::LogModule* GetMacAccessibilityL
   NSMutableArray* unignoredChildren = [[NSMutableArray alloc] init];
   NSArray* allChildren = [self moxChildren];
 
   for (MOXAccessibleBase* nativeChild in allChildren) {
     if ([nativeChild moxIgnoreWithParent:self]) {
       // If this child should be ignored get its unignored children.
       // This will in turn recurse to any unignored descendants if the
       // child is ignored.
-      [unignoredChildren addObjectsFromArray:[nativeChild moxUnignoredChildren]];
+      [unignoredChildren
+          addObjectsFromArray:[nativeChild moxUnignoredChildren]];
     } else {
       [unignoredChildren addObject:nativeChild];
     }
   }
 
   return unignoredChildren;
 }
 
@@ -472,12 +484,13 @@ mozilla::LogModule* GetMacAccessibilityL
   mIsExpired = YES;
 
   [self moxPostNotification:NSAccessibilityUIElementDestroyedNotification];
 }
 
 #pragma mark - Private
 
 - (BOOL)isSelectorSupported:(SEL)selector {
-  return [self respondsToSelector:selector] && ![self moxBlockSelector:selector];
+  return
+      [self respondsToSelector:selector] && ![self moxBlockSelector:selector];
 }
 
 @end
--- a/accessible/mac/MOXAccessibleProtocol.h
+++ b/accessible/mac/MOXAccessibleProtocol.h
@@ -1,25 +1,28 @@
-/* -*- Mode: Objective-C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format off */
+/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 @protocol MOXTextMarkerSupport;
 
-// This protocol's primary use is for abstracting the NSAccessibility informal protocol
-// into a formal internal API. Conforming classes get to choose a subset of the optional
-// methods to implement. Those methods will be mapped to NSAccessibility attributes or actions.
-// A conforming class can implement moxBlockSelector to control which of its implemented
-// methods should be exposed to NSAccessibility.
+// This protocol's primary use is for abstracting the NSAccessibility informal
+// protocol into a formal internal API. Conforming classes get to choose a
+// subset of the optional methods to implement. Those methods will be mapped to
+// NSAccessibility attributes or actions. A conforming class can implement
+// moxBlockSelector to control which of its implemented methods should be
+// exposed to NSAccessibility.
 
 @protocol MOXAccessible
 
-// The deepest descendant of the accessible subtree that contains the specified point.
-// Forwarded from accessibilityHitTest.
+// The deepest descendant of the accessible subtree that contains the specified
+// point. Forwarded from accessibilityHitTest.
 - (id _Nullable)moxHitTest:(NSPoint)point;
 
 // The deepest descendant of the accessible subtree that has the focus.
 // Forwarded from accessibilityFocusedUIElement.
 - (id _Nullable)moxFocusedUIElement;
 
 // Sends a notification to any observing assistive applications.
 - (void)moxPostNotification:(NSString* _Nonnull)notification;
@@ -314,23 +317,26 @@
 
 // AXRTFForRange
 - (NSData* _Nullable)moxRTFForRange:(NSValue* _Nonnull)range;
 
 // AXStyleRangeForIndex
 - (NSValue* _Nullable)moxStyleRangeForIndex:(NSNumber* _Nonnull)index;
 
 // AttributedStringForRange
-- (NSAttributedString* _Nullable)moxAttributedStringForRange:(NSValue* _Nonnull)range;
+- (NSAttributedString* _Nullable)moxAttributedStringForRange:
+    (NSValue* _Nonnull)range;
 
 // AXUIElementsForSearchPredicate
-- (NSArray* _Nullable)moxUIElementsForSearchPredicate:(NSDictionary* _Nonnull)searchPredicate;
+- (NSArray* _Nullable)moxUIElementsForSearchPredicate:
+    (NSDictionary* _Nonnull)searchPredicate;
 
 // AXUIElementCountForSearchPredicate
-- (NSNumber* _Nullable)moxUIElementCountForSearchPredicate:(NSDictionary* _Nonnull)searchPredicate;
+- (NSNumber* _Nullable)moxUIElementCountForSearchPredicate:
+    (NSDictionary* _Nonnull)searchPredicate;
 
 // AXCellForColumnAndRow
 - (id _Nullable)moxCellForColumnAndRow:(NSArray* _Nonnull)columnAndRow;
 
 @end
 
 // This protocol maps text marker and text marker range parameters to
 // methods. It is implemented by a delegate of a MOXAccessible.
@@ -351,35 +357,39 @@
 
 // AXLengthForTextMarkerRange
 - (NSNumber* _Nullable)moxLengthForTextMarkerRange:(id _Nonnull)textMarkerRange;
 
 // AXStringForTextMarkerRange
 - (NSString* _Nullable)moxStringForTextMarkerRange:(id _Nonnull)textMarkerRange;
 
 // AXTextMarkerRangeForUnorderedTextMarkers
-- (id _Nullable)moxTextMarkerRangeForUnorderedTextMarkers:(NSArray* _Nonnull)textMarkers;
+- (id _Nullable)moxTextMarkerRangeForUnorderedTextMarkers:
+    (NSArray* _Nonnull)textMarkers;
 
 // AXLeftWordTextMarkerRangeForTextMarker
 - (id _Nullable)moxLeftWordTextMarkerRangeForTextMarker:(id _Nonnull)textMarker;
 
 // AXRightWordTextMarkerRangeForTextMarker
-- (id _Nullable)moxRightWordTextMarkerRangeForTextMarker:(id _Nonnull)textMarker;
+- (id _Nullable)moxRightWordTextMarkerRangeForTextMarker:
+    (id _Nonnull)textMarker;
 
 // AXStartTextMarkerForTextMarkerRange
-- (id _Nullable)moxStartTextMarkerForTextMarkerRange:(id _Nonnull)textMarkerRange;
+- (id _Nullable)moxStartTextMarkerForTextMarkerRange:
+    (id _Nonnull)textMarkerRange;
 
 // AXEndTextMarkerForTextMarkerRange
 - (id _Nullable)moxEndTextMarkerForTextMarkerRange:(id _Nonnull)textMarkerRange;
 
 // AXNextTextMarkerForTextMarker
 - (id _Nullable)moxNextTextMarkerForTextMarker:(id _Nonnull)textMarker;
 
 // AXPreviousTextMarkerForTextMarker
 - (id _Nullable)moxPreviousTextMarkerForTextMarker:(id _Nonnull)textMarker;
 
 // AXAttributedStringForTextMarkerRange
-- (NSAttributedString* _Nullable)moxAttributedStringForTextMarkerRange:(id _Nonnull)textMarkerRange;
+- (NSAttributedString* _Nullable)moxAttributedStringForTextMarkerRange:
+    (id _Nonnull)textMarkerRange;
 
 // AXBoundsForTextMarkerRange
 - (NSValue* _Nullable)moxBoundsForTextMarkerRange:(id _Nonnull)textMarkerRange;
 
 @end
--- a/accessible/mac/MOXMathAccessibles.h
+++ b/accessible/mac/MOXMathAccessibles.h
@@ -1,11 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "mozAccessible.h"
 
 @interface MOXMathRootAccessible : mozAccessible
 
--- a/accessible/mac/MOXMathAccessibles.mm
+++ b/accessible/mac/MOXMathAccessibles.mm
@@ -1,9 +1,11 @@
-/* -*- (Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset:) 2 -*- */
+/* clang-format off */
+/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "MOXMathAccessibles.h"
 
 #import "MacUtils.h"
 
@@ -52,17 +54,18 @@ using namespace mozilla::a11y;
   // renderer object of the <mfrac> element. It's not clear whether the
   // exact value is relevant to assistive technologies. From a semantic
   // point of view, the only important point is to distinguish between
   // <mfrac> elements that have a fraction bar and those that do not.
   // Per the MathML 3 spec, the latter happens iff the linethickness
   // attribute is of the form [zero-float][optional-unit]. In that case we
   // set line thickness to zero and in the other cases we set it to one.
   if (NSString* thickness = utils::GetAccAttr(self, "thickness")) {
-    NSNumberFormatter* formatter = [[[NSNumberFormatter alloc] init] autorelease];
+    NSNumberFormatter* formatter =
+        [[[NSNumberFormatter alloc] init] autorelease];
     NSNumber* value = [formatter numberFromString:thickness];
     return [NSNumber numberWithBool:[value boolValue]];
   } else {
     return [NSNumber numberWithInteger:0];
   }
 }
 
 @end
--- a/accessible/mac/MOXTextMarkerDelegate.h
+++ b/accessible/mac/MOXTextMarkerDelegate.h
@@ -1,9 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import <Cocoa/Cocoa.h>
 
 #import "MOXAccessibleProtocol.h"
 
@@ -61,14 +63,15 @@
 
 // override
 - (id)moxNextTextMarkerForTextMarker:(id)textMarker;
 
 // override
 - (id)moxPreviousTextMarkerForTextMarker:(id)textMarker;
 
 // override
-- (NSAttributedString*)moxAttributedStringForTextMarkerRange:(id)textMarkerRange;
+- (NSAttributedString*)moxAttributedStringForTextMarkerRange:
+    (id)textMarkerRange;
 
 // override
 - (NSValue*)moxBoundsForTextMarkerRange:(id)textMarkerRange;
 
 @end
--- a/accessible/mac/MOXTextMarkerDelegate.mm
+++ b/accessible/mac/MOXTextMarkerDelegate.mm
@@ -1,9 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import <Cocoa/Cocoa.h>
 
 #import "MOXTextMarkerDelegate.h"
 
@@ -73,24 +75,29 @@ static nsDataHashtable<nsUint64HashKey, 
   GeckoTextMarker geckoTextPoint(mGeckoDocAccessible, 0);
   return geckoTextPoint.CreateAXTextMarker();
 }
 
 - (id)moxEndTextMarker {
   uint32_t characterCount =
       mGeckoDocAccessible.IsProxy()
           ? mGeckoDocAccessible.AsProxy()->CharacterCount()
-          : mGeckoDocAccessible.AsAccessible()->Document()->AsHyperText()->CharacterCount();
+          : mGeckoDocAccessible.AsAccessible()
+                ->Document()
+                ->AsHyperText()
+                ->CharacterCount();
   GeckoTextMarker geckoTextPoint(mGeckoDocAccessible, characterCount);
   return geckoTextPoint.CreateAXTextMarker();
 }
 
 - (id)moxSelectedTextMarkerRange {
-  return mSelection && GeckoTextMarkerRange(mGeckoDocAccessible, mSelection).IsValid() ? mSelection
-                                                                                       : nil;
+  return mSelection &&
+                 GeckoTextMarkerRange(mGeckoDocAccessible, mSelection).IsValid()
+             ? mSelection
+             : nil;
 }
 
 - (NSString*)moxStringForTextMarkerRange:(id)textMarkerRange {
   if (mGeckoDocAccessible.IsAccessible()) {
     if (!mGeckoDocAccessible.AsAccessible()->AsDoc()->HasLoadState(
             DocAccessible::eTreeConstructed)) {
       // If the accessible tree is still being constructed the text tree
       // is not in a traversable state yet.
@@ -101,17 +108,18 @@ static nsDataHashtable<nsUint64HashKey, 
       // In the proxy case we don't have access to load state,
       // so we need to use the less granular generic STALE state
       // this state also includes DOM unloaded, which isn't ideal.
       // Since we really only care if the a11y tree is loaded.
       return @"";
     }
   }
 
-  mozilla::a11y::GeckoTextMarkerRange range(mGeckoDocAccessible, textMarkerRange);
+  mozilla::a11y::GeckoTextMarkerRange range(mGeckoDocAccessible,
+                                            textMarkerRange);
   if (!range.IsValid()) {
     return @"";
   }
 
   return range.Text();
 }
 
 - (NSNumber*)moxLengthForTextMarkerRange:(id)textMarkerRange {
@@ -129,23 +137,25 @@ static nsDataHashtable<nsUint64HashKey, 
 
   bool ordered = p1 < p2;
   GeckoTextMarkerRange range(ordered ? p1 : p2, ordered ? p2 : p1);
 
   return range.CreateAXTextMarkerRange();
 }
 
 - (id)moxStartTextMarkerForTextMarkerRange:(id)textMarkerRange {
-  mozilla::a11y::GeckoTextMarkerRange range(mGeckoDocAccessible, textMarkerRange);
+  mozilla::a11y::GeckoTextMarkerRange range(mGeckoDocAccessible,
+                                            textMarkerRange);
 
   return range.IsValid() ? range.mStart.CreateAXTextMarker() : nil;
 }
 
 - (id)moxEndTextMarkerForTextMarkerRange:(id)textMarkerRange {
-  mozilla::a11y::GeckoTextMarkerRange range(mGeckoDocAccessible, textMarkerRange);
+  mozilla::a11y::GeckoTextMarkerRange range(mGeckoDocAccessible,
+                                            textMarkerRange);
 
   return range.IsValid() ? range.mEnd.CreateAXTextMarker() : nil;
 }
 
 - (id)moxLeftWordTextMarkerRangeForTextMarker:(id)textMarker {
   GeckoTextMarker geckoTextMarker(mGeckoDocAccessible, textMarker);
   if (!geckoTextMarker.IsValid()) {
     return nil;
@@ -184,23 +194,26 @@ static nsDataHashtable<nsUint64HashKey, 
 
   if (!geckoTextMarker.Previous()) {
     return nil;
   }
 
   return geckoTextMarker.CreateAXTextMarker();
 }
 
-- (NSAttributedString*)moxAttributedStringForTextMarkerRange:(id)textMarkerRange {
+- (NSAttributedString*)moxAttributedStringForTextMarkerRange:
+    (id)textMarkerRange {
   return [[[NSAttributedString alloc]
-      initWithString:[self moxStringForTextMarkerRange:textMarkerRange]] autorelease];
+      initWithString:[self moxStringForTextMarkerRange:textMarkerRange]]
+      autorelease];
 }
 
 - (NSValue*)moxBoundsForTextMarkerRange:(id)textMarkerRange {
-  mozilla::a11y::GeckoTextMarkerRange range(mGeckoDocAccessible, textMarkerRange);
+  mozilla::a11y::GeckoTextMarkerRange range(mGeckoDocAccessible,
+                                            textMarkerRange);
   if (!range.IsValid()) {
     return nil;
   }
 
   return range.Bounds();
 }
 
 @end
--- a/accessible/mac/MOXWebAreaAccessible.h
+++ b/accessible/mac/MOXWebAreaAccessible.h
@@ -1,11 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "mozAccessible.h"
 
 namespace mozilla {
 namespace a11y {
@@ -54,17 +54,18 @@ class PivotRule;
 
   // Set to YES if we should search forward, NO if backward
   BOOL mSearchForward;
 
   // Set to YES if we should match on immediate descendants only, NO otherwise
   BOOL mImmediateDescendantsOnly;
 }
 
-- (id)initWithParameters:(NSDictionary*)params andRoot:(mozilla::a11y::AccessibleOrProxy)root;
+- (id)initWithParameters:(NSDictionary*)params
+                 andRoot:(mozilla::a11y::AccessibleOrProxy)root;
 
 - (NSMutableArray*)getMatchesForRule:(mozilla::a11y::PivotRule&)rule;
 
 - (NSArray*)performSearch;
 
 - (void)dealloc;
 
 @end
--- a/accessible/mac/MOXWebAreaAccessible.mm
+++ b/accessible/mac/MOXWebAreaAccessible.mm
@@ -1,9 +1,11 @@
-/* -*- (Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset:) 2 -*- */
+/* clang-format off */
+/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "MOXWebAreaAccessible.h"
 
 #include "nsCocoaUtils.h"
 #include "DocAccessibleParent.h"
@@ -45,54 +47,64 @@ using namespace mozilla::a11y;
 
 // overrides
 - (NSNumber*)moxLoadingProgress {
   if ([self isExpired]) {
     return nil;
   }
 
   if ([self stateWithMask:states::STALE] != 0) {
-    // We expose stale state until the document is ready (DOM is loaded and tree is
-    // constructed) so we indicate load hasn't started while this state is present.
+    // We expose stale state until the document is ready (DOM is loaded and tree
+    // is constructed) so we indicate load hasn't started while this state is
+    // present.
     return @0.0;
   }
 
   if ([self stateWithMask:states::BUSY] != 0) {
-    // We expose state busy until the document and all its subdocuments are completely
-    // loaded, so we indicate partial loading here
+    // We expose state busy until the document and all its subdocuments are
+    // completely loaded, so we indicate partial loading here
     return @0.5;
   }
 
   // if we are not busy and not stale, we are loaded
   return @1.0;
 }
 
 - (NSArray*)moxUIElementsForSearchPredicate:(NSDictionary*)searchPredicate {
   // Create our search object and set it up with the searchPredicate
   // params. The init function does additional parsing. We pass a
   // reference to the web area (mGeckoAccessible) to use as
   // a start element if one is not specified.
-  MOXSearchInfo* search = [[MOXSearchInfo alloc] initWithParameters:searchPredicate
-                                                            andRoot:mGeckoAccessible];
+  MOXSearchInfo* search =
+      [[MOXSearchInfo alloc] initWithParameters:searchPredicate
+                                        andRoot:mGeckoAccessible];
 
   return [search performSearch];
 }
 
-- (NSNumber*)moxUIElementCountForSearchPredicate:(NSDictionary*)searchPredicate {
-  return [NSNumber numberWithDouble:[[self moxUIElementsForSearchPredicate:searchPredicate] count]];
+- (NSNumber*)moxUIElementCountForSearchPredicate:
+    (NSDictionary*)searchPredicate {
+  return [NSNumber
+      numberWithDouble:[[self moxUIElementsForSearchPredicate:searchPredicate]
+                           count]];
 }
 
 - (void)handleAccessibleEvent:(uint32_t)eventType {
   switch (eventType) {
     case nsIAccessibleEvent::EVENT_DOCUMENT_LOAD_COMPLETE:
-      [self moxPostNotification:NSAccessibilityFocusedUIElementChangedNotification];
+      [self moxPostNotification:
+                NSAccessibilityFocusedUIElementChangedNotification];
       if ((mGeckoAccessible.IsProxy() && mGeckoAccessible.AsProxy()->IsDoc() &&
            mGeckoAccessible.AsProxy()->AsDoc()->IsTopLevel()) ||
-          (mGeckoAccessible.IsAccessible() && !mGeckoAccessible.AsAccessible()->IsRoot() &&
-           mGeckoAccessible.AsAccessible()->AsDoc()->ParentDocument()->IsRoot())) {
+          (mGeckoAccessible.IsAccessible() &&
+           !mGeckoAccessible.AsAccessible()->IsRoot() &&
+           mGeckoAccessible.AsAccessible()
+               ->AsDoc()
+               ->ParentDocument()
+               ->IsRoot())) {
         // we fire an AXLoadComplete event on top-level documents only
         [self moxPostNotification:@"AXLoadComplete"];
       } else {
         // otherwise the doc belongs to an iframe (IsTopLevelInContentProcess)
         // and we fire AXLayoutComplete instead
         [self moxPostNotification:@"AXLayoutComplete"];
       }
       break;
@@ -102,43 +114,48 @@ using namespace mozilla::a11y;
 }
 
 @end
 
 @implementation MOXSearchInfo
 
 - (id)initWithParameters:(NSDictionary*)params andRoot:(AccessibleOrProxy)root {
   if (id searchKeyParam = [params objectForKey:@"AXSearchKey"]) {
-    mSearchKeys =
-        [searchKeyParam isKindOfClass:[NSString class]] ? @[ searchKeyParam ] : searchKeyParam;
+    mSearchKeys = [searchKeyParam isKindOfClass:[NSString class]]
+                      ? @[ searchKeyParam ]
+                      : searchKeyParam;
   }
 
   if (id startElemParam = [params objectForKey:@"AXStartElement"]) {
     mStartElem = [startElemParam geckoAccessible];
   } else {
     mStartElem = root;
   }
-  MOZ_ASSERT(!mStartElem.IsNull(), "Performing search with null gecko accessible!");
+  MOZ_ASSERT(!mStartElem.IsNull(),
+             "Performing search with null gecko accessible!");
 
   mWebArea = root;
 
   mResultLimit = [[params objectForKey:@"AXResultsLimit"] intValue];
 
-  mSearchForward = [[params objectForKey:@"AXDirection"] isEqualToString:@"AXDirectionNext"];
+  mSearchForward =
+      [[params objectForKey:@"AXDirection"] isEqualToString:@"AXDirectionNext"];
 
-  mImmediateDescendantsOnly = [[params objectForKey:@"AXImmediateDescendantsOnly"] boolValue];
+  mImmediateDescendantsOnly =
+      [[params objectForKey:@"AXImmediateDescendantsOnly"] boolValue];
 
   return [super init];
 }
 
 - (NSMutableArray*)getMatchesForRule:(PivotRule&)rule {
   int resultLimit = mResultLimit;
   NSMutableArray* matches = [[NSMutableArray alloc] init];
   Pivot p = Pivot(mWebArea);
-  AccessibleOrProxy match = mSearchForward ? p.Next(mStartElem, rule) : p.Prev(mStartElem, rule);
+  AccessibleOrProxy match =
+      mSearchForward ? p.Next(mStartElem, rule) : p.Prev(mStartElem, rule);
   while (!match.IsNull() && resultLimit != 0) {
     // we use mResultLimit != 0 to capture the case where mResultLimit is -1
     // when it is set from the params dictionary. If that's true, we want
     // to return all matches (ie. have no limit)
     mozAccessible* nativeMatch = GetNativeFromGeckoAccessible(match);
     if (nativeMatch) {
       // only add/count results for which there is a matching
       // native accessible
@@ -152,30 +169,33 @@ using namespace mozilla::a11y;
   return matches;
 }
 
 - (NSArray*)performSearch {
   NSMutableArray* matches = [[NSMutableArray alloc] init];
 
   for (id key in mSearchKeys) {
     if ([key isEqualToString:@"AXAnyTypeSearchKey"]) {
-      PivotMatchAllRule rule =
-          mImmediateDescendantsOnly ? PivotMatchAllRule(mStartElem) : PivotMatchAllRule();
+      PivotMatchAllRule rule = mImmediateDescendantsOnly
+                                   ? PivotMatchAllRule(mStartElem)
+                                   : PivotMatchAllRule();
       [matches addObjectsFromArray:[self getMatchesForRule:rule]];
     }
 
     if ([key isEqualToString:@"AXHeadingSearchKey"]) {
-      PivotRoleRule rule = mImmediateDescendantsOnly ? PivotRoleRule(roles::HEADING, mStartElem)
-                                                     : PivotRoleRule(roles::HEADING);
+      PivotRoleRule rule = mImmediateDescendantsOnly
+                               ? PivotRoleRule(roles::HEADING, mStartElem)
+                               : PivotRoleRule(roles::HEADING);
       [matches addObjectsFromArray:[self getMatchesForRule:rule]];
     }
 
     if ([key isEqualToString:@"AXArticleSearchKey"]) {
-      PivotRoleRule rule = mImmediateDescendantsOnly ? PivotRoleRule(roles::ARTICLE, mStartElem)
-                                                     : PivotRoleRule(roles::ARTICLE);
+      PivotRoleRule rule = mImmediateDescendantsOnly
+                               ? PivotRoleRule(roles::ARTICLE, mStartElem)
+                               : PivotRoleRule(roles::ARTICLE);
       [matches addObjectsFromArray:[self getMatchesForRule:rule]];
     }
   }
 
   return matches;
 }
 
 - (void)dealloc {
--- a/accessible/mac/MacUtils.h
+++ b/accessible/mac/MacUtils.h
@@ -1,10 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef _MacUtils_H_
 #define _MacUtils_H_
 
 #include "nsStringFwd.h"
@@ -13,17 +14,18 @@
 
 namespace mozilla {
 namespace a11y {
 namespace utils {
 
 // convert an array of Gecko accessibles to an NSArray of native accessibles
 NSMutableArray* ConvertToNSArray(nsTArray<Accessible*>& aArray);
 
-// convert an array of Gecko proxy accessibles to an NSArray of native accessibles
+// convert an array of Gecko proxy accessibles to an NSArray of native
+// accessibles
 NSMutableArray* ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray);
 
 /**
  * Get a localized string from the string bundle.
  * Return nil if not found.
  */
 NSString* LocalizedString(const nsString& aString);
 
--- a/accessible/mac/MacUtils.mm
+++ b/accessible/mac/MacUtils.mm
@@ -1,10 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "MacUtils.h"
 
 #include "Accessible.h"
 #include "nsCocoaUtils.h"
@@ -19,32 +20,35 @@ namespace utils {
 NSMutableArray* ConvertToNSArray(nsTArray<Accessible*>& aArray) {
   NSMutableArray* nativeArray = [[NSMutableArray alloc] init];
 
   // iterate through the list, and get each native accessible.
   size_t totalCount = aArray.Length();
   for (size_t i = 0; i < totalCount; i++) {
     Accessible* curAccessible = aArray.ElementAt(i);
     mozAccessible* curNative = GetNativeFromGeckoAccessible(curAccessible);
-    if (curNative) [nativeArray addObject:GetObjectOrRepresentedView(curNative)];
+    if (curNative)
+      [nativeArray addObject:GetObjectOrRepresentedView(curNative)];
   }
 
   return nativeArray;
 }
 
-// convert an array of Gecko proxy accessibles to an NSArray of native accessibles
+// convert an array of Gecko proxy accessibles to an NSArray of native
+// accessibles
 NSMutableArray* ConvertToNSArray(nsTArray<ProxyAccessible*>& aArray) {
   NSMutableArray* nativeArray = [[NSMutableArray alloc] init];
 
   // iterate through the list, and get each native accessible.
   size_t totalCount = aArray.Length();
   for (size_t i = 0; i < totalCount; i++) {
     ProxyAccessible* curAccessible = aArray.ElementAt(i);
     mozAccessible* curNative = GetNativeFromGeckoAccessible(curAccessible);
-    if (curNative) [nativeArray addObject:GetObjectOrRepresentedView(curNative)];
+    if (curNative)
+      [nativeArray addObject:GetObjectOrRepresentedView(curNative)];
   }
 
   return nativeArray;
 }
 
 /**
  * Get a localized string from the a11y string bundle.
  * Return nil if not found.
@@ -57,17 +61,18 @@ NSString* LocalizedString(const nsString
   return text.IsEmpty() ? nil : nsCocoaUtils::ToNSString(text);
 }
 
 NSString* GetAccAttr(mozAccessible* aNativeAccessible, const char* aAttrName) {
   nsAutoString result;
   if (Accessible* acc = [aNativeAccessible geckoAccessible].AsAccessible()) {
     nsCOMPtr<nsIPersistentProperties> attributes = acc->Attributes();
     attributes->GetStringProperty(nsCString(aAttrName), result);
-  } else if (ProxyAccessible* proxy = [aNativeAccessible geckoAccessible].AsProxy()) {
+  } else if (ProxyAccessible* proxy =
+                 [aNativeAccessible geckoAccessible].AsProxy()) {
     AutoTArray<Attribute, 10> attrs;
     proxy->Attributes(&attrs);
     for (size_t i = 0; i < attrs.Length(); i++) {
       if (attrs.ElementAt(i).Name() == aAttrName) {
         result = attrs.ElementAt(i).Value();
         break;
       }
     }
--- a/accessible/mac/Platform.mm
+++ b/accessible/mac/Platform.mm
@@ -1,10 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim: set ts=2 et sw=2 tw=80: */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import <Cocoa/Cocoa.h>
 
 #import "MOXTextMarkerDelegate.h"
 
@@ -29,17 +30,18 @@ bool ShouldA11yBeEnabled() {
 }
 
 void PlatformInit() {}
 
 void PlatformShutdown() {}
 
 void ProxyCreated(ProxyAccessible* aProxy, uint32_t) {
   ProxyAccessible* parent = aProxy->Parent();
-  if ((parent && nsAccUtils::MustPrune(parent)) || aProxy->Role() == roles::WHITESPACE) {
+  if ((parent && nsAccUtils::MustPrune(parent)) ||
+      aProxy->Role() == roles::WHITESPACE) {
     // We don't create a native object if we're child of a "flat" accessible;
     // for example, on OS X buttons shouldn't have any children, because that
     // makes the OS confused. We also don't create accessibles for <br>
     // (whitespace) elements.
     return;
   }
 
   // Pass in dummy state for now as retrieving proxy state requires IPC.
@@ -83,76 +85,84 @@ void ProxyEvent(ProxyAccessible* aProxy,
     return;
 
   mozAccessible* wrapper = GetNativeFromGeckoAccessible(aProxy);
   if (wrapper) {
     [wrapper handleAccessibleEvent:aEventType];
   }
 }
 
-void ProxyStateChangeEvent(ProxyAccessible* aProxy, uint64_t aState, bool aEnabled) {
+void ProxyStateChangeEvent(ProxyAccessible* aProxy, uint64_t aState,
+                           bool aEnabled) {
   mozAccessible* wrapper = GetNativeFromGeckoAccessible(aProxy);
   if (wrapper) {
     [wrapper stateChanged:aState isEnabled:aEnabled];
   }
 }
 
-void ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset, bool aIsSelectionCollapsed) {
+void ProxyCaretMoveEvent(ProxyAccessible* aTarget, int32_t aOffset,
+                         bool aIsSelectionCollapsed) {
   mozAccessible* wrapper = GetNativeFromGeckoAccessible(aTarget);
   if (aIsSelectionCollapsed) {
     // If selection is collapsed, invalidate selection.
-    MOXTextMarkerDelegate* delegate = [MOXTextMarkerDelegate getOrCreateForDoc:aTarget->Document()];
+    MOXTextMarkerDelegate* delegate =
+        [MOXTextMarkerDelegate getOrCreateForDoc:aTarget->Document()];
     [delegate setSelectionFrom:aTarget at:aOffset to:aTarget at:aOffset];
   }
 
   if (wrapper) {
     [wrapper handleAccessibleEvent:nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED];
   }
 }
 
-void ProxyTextChangeEvent(ProxyAccessible* aTarget, const nsString& aStr, int32_t aStart,
-                          uint32_t aLen, bool aIsInsert, bool aFromUser) {
+void ProxyTextChangeEvent(ProxyAccessible* aTarget, const nsString& aStr,
+                          int32_t aStart, uint32_t aLen, bool aIsInsert,
+                          bool aFromUser) {
   ProxyAccessible* acc = aTarget;
   // If there is a text input ancestor, use it as the event source.
   while (acc && GetTypeFromRole(acc->Role()) != [mozTextAccessible class]) {
     acc = acc->Parent();
   }
   mozAccessible* wrapper = GetNativeFromGeckoAccessible(acc ? acc : aTarget);
   [wrapper handleAccessibleTextChangeEvent:nsCocoaUtils::ToNSString(aStr)
                                   inserted:aIsInsert
                                inContainer:aTarget
                                         at:aStart];
 }
 
 void ProxyShowHideEvent(ProxyAccessible*, ProxyAccessible*, bool, bool) {}
 
-void ProxySelectionEvent(ProxyAccessible* aTarget, ProxyAccessible* aWidget, uint32_t aEventType) {
+void ProxySelectionEvent(ProxyAccessible* aTarget, ProxyAccessible* aWidget,
+                         uint32_t aEventType) {
   mozAccessible* wrapper = GetNativeFromGeckoAccessible(aWidget);
   if (wrapper) {
     [wrapper handleAccessibleEvent:aEventType];
   }
 }
 
 void ProxyTextSelectionChangeEvent(ProxyAccessible* aTarget,
                                    const nsTArray<TextRangeData>& aSelection) {
   if (aSelection.Length()) {
-    MOXTextMarkerDelegate* delegate = [MOXTextMarkerDelegate getOrCreateForDoc:aTarget->Document()];
+    MOXTextMarkerDelegate* delegate =
+        [MOXTextMarkerDelegate getOrCreateForDoc:aTarget->Document()];
     DocAccessibleParent* doc = aTarget->Document();
-    ProxyAccessible* startContainer = doc->GetAccessible(aSelection[0].StartID());
+    ProxyAccessible* startContainer =
+        doc->GetAccessible(aSelection[0].StartID());
     ProxyAccessible* endContainer = doc->GetAccessible(aSelection[0].EndID());
     // Cache the selection.
     [delegate setSelectionFrom:startContainer
                             at:aSelection[0].StartOffset()
                             to:endContainer
                             at:aSelection[0].EndOffset()];
   }
 
   mozAccessible* wrapper = GetNativeFromGeckoAccessible(aTarget);
   if (wrapper) {
-    [wrapper handleAccessibleEvent:nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED];
+    [wrapper
+        handleAccessibleEvent:nsIAccessibleEvent::EVENT_TEXT_SELECTION_CHANGED];
   }
 }
 
 }  // namespace a11y
 }  // namespace mozilla
 
 @interface GeckoNSApplication (a11y)
 - (void)accessibilitySetValue:(id)value forAttribute:(NSString*)attribute;
--- a/accessible/mac/RootAccessibleWrap.mm
+++ b/accessible/mac/RootAccessibleWrap.mm
@@ -1,9 +1,11 @@
-/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format off */
+/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "RootAccessibleWrap.h"
 
 #include "mozRootAccessible.h"
 
@@ -11,17 +13,18 @@
 #include "nsObjCExceptions.h"
 #include "nsIFrame.h"
 #include "nsView.h"
 #include "nsIWidget.h"
 
 using namespace mozilla;
 using namespace mozilla::a11y;
 
-RootAccessibleWrap::RootAccessibleWrap(dom::Document* aDocument, PresShell* aPresShell)
+RootAccessibleWrap::RootAccessibleWrap(dom::Document* aDocument,
+                                       PresShell* aPresShell)
     : RootAccessible(aDocument, aPresShell) {}
 
 RootAccessibleWrap::~RootAccessibleWrap() {}
 
 Class RootAccessibleWrap::GetNativeType() {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   return [mozRootAccessible class];
@@ -32,14 +35,16 @@ Class RootAccessibleWrap::GetNativeType(
 void RootAccessibleWrap::GetNativeWidget(void** aOutView) {
   nsIFrame* frame = GetFrame();
   if (frame) {
     nsView* view = frame->GetView();
     if (view) {
       nsIWidget* widget = view->GetWidget();
       if (widget) {
         *aOutView = (void**)widget->GetNativeData(NS_NATIVE_WIDGET);
-        NS_ASSERTION(*aOutView, "Couldn't get the native NSView parent we need to connect the "
-                                "accessibility hierarchy!");
+        NS_ASSERTION(
+            *aOutView,
+            "Couldn't get the native NSView parent we need to connect the "
+            "accessibility hierarchy!");
       }
     }
   }
 }
--- a/accessible/mac/mozAccessible.h
+++ b/accessible/mac/mozAccessible.h
@@ -1,9 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "AccessibleWrap.h"
 #include "ProxyAccessible.h"
 #include "AccessibleOrProxy.h"
 
@@ -18,17 +20,18 @@
  * widgets, HTML frames, etc) or are attached to a certain view; for example
  * a document view. When we hand an object off to an AT, we always want
  * to give it the represented view, in the latter case.
  */
 
 namespace mozilla {
 namespace a11y {
 
-inline mozAccessible* GetNativeFromGeckoAccessible(mozilla::a11y::AccessibleOrProxy aAccOrProxy) {
+inline mozAccessible* GetNativeFromGeckoAccessible(
+    mozilla::a11y::AccessibleOrProxy aAccOrProxy) {
   MOZ_ASSERT(!aAccOrProxy.IsNull(), "Cannot get native from null accessible");
   if (Accessible* acc = aAccOrProxy.AsAccessible()) {
     mozAccessible* native = nil;
     acc->GetNativeInterface((void**)&native);
     return native;
   }
 
   ProxyAccessible* proxy = aAccOrProxy.AsProxy();
@@ -73,17 +76,19 @@ inline mozAccessible* GetNativeFromGecko
 // Given a gecko accessibility event type, post the relevant
 // system accessibility notification.
 // Note: when overriding or adding new events, make sure your events aren't
 // filtered out in Platform::ProxyEvent or AccessibleWrap::HandleAccEvent!
 - (void)handleAccessibleEvent:(uint32_t)eventType;
 
 - (void)handleAccessibleTextChangeEvent:(NSString*)change
                                inserted:(BOOL)isInserted
-                            inContainer:(const mozilla::a11y::AccessibleOrProxy&)container
+                            inContainer:
+                                (const mozilla::a11y::AccessibleOrProxy&)
+                                    container
                                      at:(int32_t)start;
 
 // internal method to retrieve a child at a given index.
 - (id)childAt:(uint32_t)i;
 
 // Get gecko accessible's state.
 - (uint64_t)state;
 
--- a/accessible/mac/mozAccessible.mm
+++ b/accessible/mac/mozAccessible.mm
@@ -1,9 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "mozAccessible.h"
 
 #import "MacUtils.h"
 #import "mozView.h"
@@ -96,19 +98,20 @@ using namespace mozilla::a11y;
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   AccessibleOrProxy child = mGeckoAccessible.ChildAt(i);
   return !child.IsNull() ? GetNativeFromGeckoAccessible(child) : nil;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
-static const uint64_t kCachedStates = states::CHECKED | states::PRESSED | states::MIXED |
-                                      states::EXPANDED | states::CURRENT | states::SELECTED |
-                                      states::TRAVERSED | states::LINKED | states::HASPOPUP;
+static const uint64_t kCachedStates =
+    states::CHECKED | states::PRESSED | states::MIXED | states::EXPANDED |
+    states::CURRENT | states::SELECTED | states::TRAVERSED | states::LINKED |
+    states::HASPOPUP;
 static const uint64_t kCacheInitialized = ((uint64_t)0x1) << 63;
 
 - (uint64_t)state {
   uint64_t state = 0;
 
   if (Accessible* acc = mGeckoAccessible.AsAccessible()) {
     state = acc->State();
   }
@@ -121,17 +124,18 @@ static const uint64_t kCacheInitialized 
     mCachedState = state & kCachedStates;
     mCachedState |= kCacheInitialized;
   }
 
   return state;
 }
 
 - (uint64_t)stateWithMask:(uint64_t)mask {
-  if ((mask & kCachedStates) == mask && (mCachedState & kCacheInitialized) != 0) {
+  if ((mask & kCachedStates) == mask &&
+      (mCachedState & kCacheInitialized) != 0) {
     return mCachedState & mask;
   }
 
   return [self state] & mask;
 }
 
 - (void)stateChanged:(uint64_t)state isEnabled:(BOOL)enabled {
   if ((state & kCachedStates) == 0) {
@@ -152,18 +156,19 @@ static const uint64_t kCacheInitialized 
 
 - (void)invalidateState {
   mCachedState = 0;
 }
 
 - (BOOL)providesLabelNotTitle {
   // These accessible types are the exception to the rule of label vs. title:
   // They may be named explicitly, but they still provide a label not a title.
-  return mRole == roles::GROUPING || mRole == roles::RADIO_GROUP || mRole == roles::FIGURE ||
-         mRole == roles::GRAPHIC || mRole == roles::DOCUMENT;
+  return mRole == roles::GROUPING || mRole == roles::RADIO_GROUP ||
+         mRole == roles::FIGURE || mRole == roles::GRAPHIC ||
+         mRole == roles::DOCUMENT;
 }
 
 - (mozilla::a11y::AccessibleOrProxy)geckoAccessible {
   return mGeckoAccessible;
 }
 
 - (mozilla::a11y::AccessibleOrProxy)geckoDocument {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
@@ -210,19 +215,21 @@ static const uint64_t kCacheInitialized 
   mozAccessible* focusedChild = nil;
   if (acc) {
     Accessible* focusedGeckoChild = acc->FocusedChild();
     if (focusedGeckoChild) {
       focusedChild = GetNativeFromGeckoAccessible(focusedGeckoChild);
     } else {
       dom::BrowserParent* browser = dom::BrowserParent::GetFocused();
       if (browser) {
-        a11y::DocAccessibleParent* proxyDoc = browser->GetTopLevelDocAccessible();
+        a11y::DocAccessibleParent* proxyDoc =
+            browser->GetTopLevelDocAccessible();
         if (proxyDoc) {
-          mozAccessible* nativeRemoteChild = GetNativeFromGeckoAccessible(proxyDoc);
+          mozAccessible* nativeRemoteChild =
+              GetNativeFromGeckoAccessible(proxyDoc);
           return [nativeRemoteChild accessibilityFocusedUIElement];
         }
       }
     }
   } else if (proxy) {
     ProxyAccessible* focusedGeckoChild = proxy->FocusedChild();
     if (focusedGeckoChild) {
       focusedChild = GetNativeFromGeckoAccessible(focusedGeckoChild);
@@ -236,39 +243,44 @@ static const uint64_t kCacheInitialized 
   // return ourself if we can't get a native focused child.
   return self;
 }
 
 - (id<MOXTextMarkerSupport>)moxTextMarkerDelegate {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   if (mGeckoAccessible.IsAccessible()) {
-    return [MOXTextMarkerDelegate getOrCreateForDoc:mGeckoAccessible.AsAccessible()->Document()];
+    return [MOXTextMarkerDelegate
+        getOrCreateForDoc:mGeckoAccessible.AsAccessible()->Document()];
   }
 
-  return [MOXTextMarkerDelegate getOrCreateForDoc:mGeckoAccessible.AsProxy()->Document()];
+  return [MOXTextMarkerDelegate
+      getOrCreateForDoc:mGeckoAccessible.AsProxy()->Document()];
 }
 
 - (id)moxHitTest:(NSPoint)point {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   // Convert the given screen-global point in the cocoa coordinate system (with
   // origin in the bottom-left corner of the screen) into point in the Gecko
   // coordinate system (with origin in a top-left screen point).
   NSScreen* mainView = [[NSScreen screens] objectAtIndex:0];
-  NSPoint tmpPoint = NSMakePoint(point.x, [mainView frame].size.height - point.y);
-  LayoutDeviceIntPoint geckoPoint =
-      nsCocoaUtils::CocoaPointsToDevPixels(tmpPoint, nsCocoaUtils::GetBackingScaleFactor(mainView));
+  NSPoint tmpPoint =
+      NSMakePoint(point.x, [mainView frame].size.height - point.y);
+  LayoutDeviceIntPoint geckoPoint = nsCocoaUtils::CocoaPointsToDevPixels(
+      tmpPoint, nsCocoaUtils::GetBackingScaleFactor(mainView));
 
-  AccessibleOrProxy child =
-      mGeckoAccessible.ChildAtPoint(geckoPoint.x, geckoPoint.y, Accessible::eDeepestChild);
+  AccessibleOrProxy child = mGeckoAccessible.ChildAtPoint(
+      geckoPoint.x, geckoPoint.y, Accessible::eDeepestChild);
 
   if (!child.IsNull()) {
     mozAccessible* nativeChild = GetNativeFromGeckoAccessible(child);
-    return [nativeChild isAccessibilityElement] ? nativeChild : [nativeChild moxUnignoredParent];
+    return [nativeChild isAccessibilityElement]
+               ? nativeChild
+               : [nativeChild moxUnignoredParent];
   }
 
   // if we didn't find anything, return ourself or child view.
   return self;
 }
 
 - (id<mozAccessible>)moxParent {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
@@ -281,74 +293,82 @@ static const uint64_t kCacheInitialized 
   if (parent.IsNull()) {
     return nil;
   }
 
   id nativeParent = GetNativeFromGeckoAccessible(parent);
   if (!nativeParent && mGeckoAccessible.IsAccessible()) {
     // Return native of root accessible if we have no direct parent.
     // XXX: need to return a sensible fallback in proxy case as well
-    nativeParent = GetNativeFromGeckoAccessible(mGeckoAccessible.AsAccessible()->RootAccessible());
+    nativeParent = GetNativeFromGeckoAccessible(
+        mGeckoAccessible.AsAccessible()->RootAccessible());
   }
 
   return GetObjectOrRepresentedView(nativeParent);
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 // gets all our native children lazily, including those that are ignored.
 - (NSArray*)moxChildren {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   NSMutableArray* children =
       [[NSMutableArray alloc] initWithCapacity:mGeckoAccessible.ChildCount()];
 
-  for (uint32_t childIdx = 0; childIdx < mGeckoAccessible.ChildCount(); childIdx++) {
+  for (uint32_t childIdx = 0; childIdx < mGeckoAccessible.ChildCount();
+       childIdx++) {
     AccessibleOrProxy child = mGeckoAccessible.ChildAt(childIdx);
     mozAccessible* nativeChild = GetNativeFromGeckoAccessible(child);
     if (!nativeChild) {
       continue;
     }
 
     [children addObject:nativeChild];
   }
 
   return children;
 }
 
 - (NSValue*)moxPosition {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
-  nsIntRect rect = mGeckoAccessible.IsAccessible() ? mGeckoAccessible.AsAccessible()->Bounds()
-                                                   : mGeckoAccessible.AsProxy()->Bounds();
+  nsIntRect rect = mGeckoAccessible.IsAccessible()
+                       ? mGeckoAccessible.AsAccessible()->Bounds()
+                       : mGeckoAccessible.AsProxy()->Bounds();
 
   NSScreen* mainView = [[NSScreen screens] objectAtIndex:0];
   CGFloat scaleFactor = nsCocoaUtils::GetBackingScaleFactor(mainView);
-  NSPoint p = NSMakePoint(
-      static_cast<CGFloat>(rect.x) / scaleFactor,
-      [mainView frame].size.height - static_cast<CGFloat>(rect.y + rect.height) / scaleFactor);
+  NSPoint p =
+      NSMakePoint(static_cast<CGFloat>(rect.x) / scaleFactor,
+                  [mainView frame].size.height -
+                      static_cast<CGFloat>(rect.y + rect.height) / scaleFactor);
 
   return [NSValue valueWithPoint:p];
 }
 
 - (NSValue*)moxSize {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
-  nsIntRect rect = mGeckoAccessible.IsAccessible() ? mGeckoAccessible.AsAccessible()->Bounds()
-                                                   : mGeckoAccessible.AsProxy()->Bounds();
+  nsIntRect rect = mGeckoAccessible.IsAccessible()
+                       ? mGeckoAccessible.AsAccessible()->Bounds()
+                       : mGeckoAccessible.AsProxy()->Bounds();
 
-  CGFloat scaleFactor = nsCocoaUtils::GetBackingScaleFactor([[NSScreen screens] objectAtIndex:0]);
-  return [NSValue valueWithSize:NSMakeSize(static_cast<CGFloat>(rect.width) / scaleFactor,
-                                           static_cast<CGFloat>(rect.height) / scaleFactor)];
+  CGFloat scaleFactor =
+      nsCocoaUtils::GetBackingScaleFactor([[NSScreen screens] objectAtIndex:0]);
+  return [NSValue
+      valueWithSize:NSMakeSize(
+                        static_cast<CGFloat>(rect.width) / scaleFactor,
+                        static_cast<CGFloat>(rect.height) / scaleFactor)];
 }
 
 - (NSString*)moxRole {
-#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, ia2Role, androidClass, \
-             nameRule)                                                                             \
-  case roles::geckoRole:                                                                           \
+#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
+             ia2Role, androidClass, nameRule)                               \
+  case roles::geckoRole:                                                    \
     return macRole;
 
   switch (mRole) {
 #include "RoleMap.h"
     default:
       MOZ_ASSERT_UNREACHABLE("Unknown role.");
       return NSAccessibilityUnknownRole;
   }
@@ -365,17 +385,18 @@ static const uint64_t kCacheInitialized 
   // Deal with landmarks first
   // macOS groups the specific landmark types of DPub ARIA into two broad
   // categories with corresponding subroles: Navigation and region/container.
   if (mRole == roles::LANDMARK) {
     nsAtom* landmark = acc ? acc->LandmarkRole() : proxy->LandmarkRole();
     // HTML Elements treated as landmarks, and ARIA landmarks.
     if (landmark) {
       if (landmark == nsGkAtoms::banner) return @"AXLandmarkBanner";
-      if (landmark == nsGkAtoms::complementary) return @"AXLandmarkComplementary";
+      if (landmark == nsGkAtoms::complementary)
+        return @"AXLandmarkComplementary";
       if (landmark == nsGkAtoms::contentinfo) return @"AXLandmarkContentInfo";
       if (landmark == nsGkAtoms::main) return @"AXLandmarkMain";
       if (landmark == nsGkAtoms::navigation) return @"AXLandmarkNavigation";
       if (landmark == nsGkAtoms::search) return @"AXLandmarkSearch";
     }
 
     // None of the above, so assume DPub ARIA.
     return @"AXLandmarkRegion";
@@ -411,23 +432,23 @@ static const uint64_t kCacheInitialized 
       roleAtom = proxy->ARIARoleAtom();
     }
 
     if (roleAtom && roleAtom == nsGkAtoms::form) {
       return @"AXLandmarkForm";
     }
   }
 
-#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, ia2Role, androidClass, \
-             nameRule)                                                                             \
-  case roles::geckoRole:                                                                           \
-    if (![macSubrole isEqualToString:NSAccessibilityUnknownSubrole]) {                             \
-      return macSubrole;                                                                           \
-    } else {                                                                                       \
-      break;                                                                                       \
+#define ROLE(geckoRole, stringRole, atkRole, macRole, macSubrole, msaaRole, \
+             ia2Role, androidClass, nameRule)                               \
+  case roles::geckoRole:                                                    \
+    if (![macSubrole isEqualToString:NSAccessibilityUnknownSubrole]) {      \
+      return macSubrole;                                                    \
+    } else {                                                                \
+      break;                                                                \
     }
 
   switch (mRole) {
 #include "RoleMap.h"
   }
 
   // These are special. They map to roles::NOTHING
   // and are instructed by the ARIA map to use the native host role.
@@ -453,67 +474,71 @@ static const uint64_t kCacheInitialized 
 #undef ROLE
 }
 
 struct RoleDescrMap {
   NSString* role;
   const nsString description;
 };
 
-static const RoleDescrMap sRoleDescrMap[] = {{@"AXApplicationAlert", u"alert"_ns},
-                                             {@"AXApplicationAlertDialog", u"alertDialog"_ns},
-                                             {@"AXApplicationDialog", u"dialog"_ns},
-                                             {@"AXApplicationLog", u"log"_ns},
-                                             {@"AXApplicationMarquee", u"marquee"_ns},
-                                             {@"AXApplicationStatus", u"status"_ns},
-                                             {@"AXApplicationTimer", u"timer"_ns},
-                                             {@"AXContentSeparator", u"separator"_ns},
-                                             {@"AXDefinition", u"definition"_ns},
-                                             {@"AXDetails", u"details"_ns},
-                                             {@"AXDocument", u"document"_ns},
-                                             {@"AXDocumentArticle", u"article"_ns},
-                                             {@"AXDocumentMath", u"math"_ns},
-                                             {@"AXDocumentNote", u"note"_ns},
-                                             {@"AXLandmarkApplication", u"application"_ns},
-                                             {@"AXLandmarkBanner", u"banner"_ns},
-                                             {@"AXLandmarkComplementary", u"complementary"_ns},
-                                             {@"AXLandmarkContentInfo", u"content"_ns},
-                                             {@"AXLandmarkMain", u"main"_ns},
-                                             {@"AXLandmarkNavigation", u"navigation"_ns},
-                                             {@"AXLandmarkRegion", u"region"_ns},
-                                             {@"AXLandmarkSearch", u"search"_ns},
-                                             {@"AXSearchField", u"searchTextField"_ns},
-                                             {@"AXSummary", u"summary"_ns},
-                                             {@"AXTabPanel", u"tabPanel"_ns},
-                                             {@"AXTerm", u"term"_ns},
-                                             {@"AXUserInterfaceTooltip", u"tooltip"_ns}};
+static const RoleDescrMap sRoleDescrMap[] = {
+    {@"AXApplicationAlert", u"alert"_ns},
+    {@"AXApplicationAlertDialog", u"alertDialog"_ns},
+    {@"AXApplicationDialog", u"dialog"_ns},
+    {@"AXApplicationLog", u"log"_ns},
+    {@"AXApplicationMarquee", u"marquee"_ns},
+    {@"AXApplicationStatus", u"status"_ns},
+    {@"AXApplicationTimer", u"timer"_ns},
+    {@"AXContentSeparator", u"separator"_ns},
+    {@"AXDefinition", u"definition"_ns},
+    {@"AXDetails", u"details"_ns},
+    {@"AXDocument", u"document"_ns},
+    {@"AXDocumentArticle", u"article"_ns},
+    {@"AXDocumentMath", u"math"_ns},
+    {@"AXDocumentNote", u"note"_ns},
+    {@"AXLandmarkApplication", u"application"_ns},
+    {@"AXLandmarkBanner", u"banner"_ns},
+    {@"AXLandmarkComplementary", u"complementary"_ns},
+    {@"AXLandmarkContentInfo", u"content"_ns},
+    {@"AXLandmarkMain", u"main"_ns},
+    {@"AXLandmarkNavigation", u"navigation"_ns},
+    {@"AXLandmarkRegion", u"region"_ns},
+    {@"AXLandmarkSearch", u"search"_ns},
+    {@"AXSearchField", u"searchTextField"_ns},
+    {@"AXSummary", u"summary"_ns},
+    {@"AXTabPanel", u"tabPanel"_ns},
+    {@"AXTerm", u"term"_ns},
+    {@"AXUserInterfaceTooltip", u"tooltip"_ns}};
 
 struct RoleDescrComparator {
   const NSString* mRole;
   explicit RoleDescrComparator(const NSString* aRole) : mRole(aRole) {}
-  int operator()(const RoleDescrMap& aEntry) const { return [mRole compare:aEntry.role]; }
+  int operator()(const RoleDescrMap& aEntry) const {
+    return [mRole compare:aEntry.role];
+  }
 };
 
 - (NSString*)moxRoleDescription {
-  if (mRole == roles::DOCUMENT) return utils::LocalizedString(u"htmlContent"_ns);
+  if (mRole == roles::DOCUMENT)
+    return utils::LocalizedString(u"htmlContent"_ns);
 
   if (mRole == roles::FIGURE) return utils::LocalizedString(u"figure"_ns);
 
   if (mRole == roles::HEADING) return utils::LocalizedString(u"heading"_ns);
 
   if (mRole == roles::MARK) {
     return utils::LocalizedString(u"highlight"_ns);
   }
 
   NSString* subrole = [self moxSubrole];
 
   if (subrole) {
     size_t idx = 0;
-    if (BinarySearchIf(sRoleDescrMap, 0, ArrayLength(sRoleDescrMap), RoleDescrComparator(subrole),
-                       &idx)) {
+    if (BinarySearchIf(sRoleDescrMap, 0, ArrayLength(sRoleDescrMap),
+                       RoleDescrComparator(subrole), &idx)) {
       return utils::LocalizedString(sRoleDescrMap[idx].description);
     }
   }
 
   return NSAccessibilityRoleDescription([self moxRole], subrole);
 }
 
 - (NSString*)moxLabel {
@@ -545,17 +570,18 @@ struct RoleDescrComparator {
     }
   } else if (proxy) {
     uint32_t flag = proxy->Name(name);
     if (flag == eNameFromSubtree) {
       return nil;
     }
 
     if (![self providesLabelNotTitle]) {
-      nsTArray<ProxyAccessible*> rels = proxy->RelationByType(RelationType::LABELLED_BY);
+      nsTArray<ProxyAccessible*> rels =
+          proxy->RelationByType(RelationType::LABELLED_BY);
       if (rels.Length() == 1) {
         return nil;
       }
     }
   }
 
   return nsCocoaUtils::ToNSString(name);
 }
@@ -675,17 +701,18 @@ struct RoleDescrComparator {
       mozAccessible* label = GetNativeFromGeckoAccessible(tempAcc);
       return [label isAccessibilityElement] ? label : nil;
     }
 
     return nil;
   }
 
   ProxyAccessible* proxy = mGeckoAccessible.AsProxy();
-  nsTArray<ProxyAccessible*> rel = proxy->RelationByType(RelationType::LABELLED_BY);
+  nsTArray<ProxyAccessible*> rel =
+      proxy->RelationByType(RelationType::LABELLED_BY);
   ProxyAccessible* tempProxy = rel.SafeElementAt(0);
   if (tempProxy && rel.Length() <= 1) {
     mozAccessible* label = GetNativeFromGeckoAccessible(tempProxy);
     return [label isAccessibilityElement] ? label : nil;
   }
 
   return nil;
 }
@@ -724,37 +751,42 @@ struct RoleDescrComparator {
 - (void)moxPerformScrollToVisible {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   if (mGeckoAccessible.IsAccessible()) {
     // Need strong ref because of MOZ_CAN_RUN_SCRIPT
     RefPtr<Accessible> acc = mGeckoAccessible.AsAccessible();
     acc->ScrollTo(nsIAccessibleScrollType::SCROLL_TYPE_ANYWHERE);
   } else {
-    mGeckoAccessible.AsProxy()->ScrollTo(nsIAccessibleScrollType::SCROLL_TYPE_ANYWHERE);
+    mGeckoAccessible.AsProxy()->ScrollTo(
+        nsIAccessibleScrollType::SCROLL_TYPE_ANYWHERE);
   }
 }
 
 - (void)moxPerformShowMenu {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
-  nsIntRect bounds = mGeckoAccessible.IsAccessible() ? mGeckoAccessible.AsAccessible()->Bounds()
-                                                     : mGeckoAccessible.AsProxy()->Bounds();
+  nsIntRect bounds = mGeckoAccessible.IsAccessible()
+                         ? mGeckoAccessible.AsAccessible()->Bounds()
+                         : mGeckoAccessible.AsProxy()->Bounds();
   // We don't need to convert this rect into mac coordinates because the
   // mouse event synthesizer expects layout (gecko) coordinates.
   LayoutDeviceIntRect geckoRect = LayoutDeviceIntRect::FromUnknownRect(bounds);
 
-  Accessible* rootAcc =
-      mGeckoAccessible.IsAccessible()
-          ? mGeckoAccessible.AsAccessible()->RootAccessible()
-          : mGeckoAccessible.AsProxy()->OuterDocOfRemoteBrowser()->RootAccessible();
-  id objOrView = GetObjectOrRepresentedView(GetNativeFromGeckoAccessible(rootAcc));
+  Accessible* rootAcc = mGeckoAccessible.IsAccessible()
+                            ? mGeckoAccessible.AsAccessible()->RootAccessible()
+                            : mGeckoAccessible.AsProxy()
+                                  ->OuterDocOfRemoteBrowser()
+                                  ->RootAccessible();
+  id objOrView =
+      GetObjectOrRepresentedView(GetNativeFromGeckoAccessible(rootAcc));
 
-  LayoutDeviceIntPoint p = LayoutDeviceIntPoint(geckoRect.X() + (geckoRect.Width() / 2),
-                                                geckoRect.Y() + (geckoRect.Height() / 2));
+  LayoutDeviceIntPoint p =
+      LayoutDeviceIntPoint(geckoRect.X() + (geckoRect.Width() / 2),
+                           geckoRect.Y() + (geckoRect.Height() / 2));
   nsIWidget* widget = [objOrView widget];
   // XXX: NSRightMouseDown is depreciated in 10.12, should be
   // changed to NSEventTypeRightMouseDown after refactoring.
   widget->SynthesizeNativeMouseEvent(p, NSRightMouseDown, 0, nullptr);
 }
 
 - (void)moxPerformPress {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
@@ -766,17 +798,18 @@ struct RoleDescrComparator {
   }
 
   // Activating accessible may alter its state.
   [self invalidateState];
 }
 
 #pragma mark -
 
-// objc-style description (from NSObject); not to be confused with the accessible description above.
+// objc-style description (from NSObject); not to be confused with the
+// accessible description above.
 - (NSString*)description {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
   return [NSString stringWithFormat:@"(%p) %@", self, [self moxRole]];
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
@@ -789,43 +822,49 @@ struct RoleDescrComparator {
                             inContainer:(const AccessibleOrProxy&)container
                                      at:(int32_t)start {
   // XXX: Eventually live region handling will go here.
 }
 
 - (void)handleAccessibleEvent:(uint32_t)eventType {
   switch (eventType) {
     case nsIAccessibleEvent::EVENT_FOCUS:
-      [self moxPostNotification:NSAccessibilityFocusedUIElementChangedNotification];
+      [self moxPostNotification:
+                NSAccessibilityFocusedUIElementChangedNotification];
       break;
     case nsIAccessibleEvent::EVENT_MENUPOPUP_START:
       [self moxPostNotification:@"AXMenuOpened"];
       break;
     case nsIAccessibleEvent::EVENT_MENUPOPUP_END:
       [self moxPostNotification:@"AXMenuClosed"];
       break;
     case nsIAccessibleEvent::EVENT_SELECTION:
     case nsIAccessibleEvent::EVENT_SELECTION_ADD:
     case nsIAccessibleEvent::EVENT_SELECTION_REMOVE:
     case nsIAccessibleEvent::EVENT_SELECTION_WITHIN:
-      [self moxPostNotification:NSAccessibilitySelectedChildrenChangedNotification];
+      [self moxPostNotification:
+                NSAccessibilitySelectedChildrenChangedNotification];
       break;
     case nsIAccessibleEvent::EVENT_TEXT_CARET_MOVED: {
       // We consider any caret move event to be a selected text change event.
-      // So dispatching an event for EVENT_TEXT_SELECTION_CHANGED would be reduntant.
+      // So dispatching an event for EVENT_TEXT_SELECTION_CHANGED would be
+      // reduntant.
       id<MOXTextMarkerSupport> delegate = [self moxTextMarkerDelegate];
       id selectedRange = [delegate moxSelectedTextMarkerRange];
       NSDictionary* userInfo = @{
         @"AXTextChangeElement" : self,
-        @"AXSelectedTextMarkerRange" : (selectedRange ? selectedRange : [NSNull null])
+        @"AXSelectedTextMarkerRange" :
+            (selectedRange ? selectedRange : [NSNull null])
       };
 
-      mozAccessible* webArea = GetNativeFromGeckoAccessible([self geckoDocument]);
-      [webArea moxPostNotification:NSAccessibilitySelectedTextChangedNotification
-                      withUserInfo:userInfo];
+      mozAccessible* webArea =
+          GetNativeFromGeckoAccessible([self geckoDocument]);
+      [webArea
+          moxPostNotification:NSAccessibilitySelectedTextChangedNotification
+                 withUserInfo:userInfo];
       [self moxPostNotification:NSAccessibilitySelectedTextChangedNotification
                    withUserInfo:userInfo];
       break;
     }
   }
 }
 
 - (void)expire {
--- a/accessible/mac/mozAccessibleProtocol.h
+++ b/accessible/mac/mozAccessibleProtocol.h
@@ -1,38 +1,41 @@
-/* -*- Mode: Objective-C; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format off */
+/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import <Cocoa/Cocoa.h>
 
 #import "mozView.h"
 
 /* This protocol's primary use is so widget/cocoa can talk back to us
    properly.
 
-   ChildView owns the topmost mozRootAccessible, and needs to take care of setting up
-   that parent/child relationship.
+   ChildView owns the topmost mozRootAccessible, and needs to take care of
+   setting up that parent/child relationship.
 
    This protocol is thus used to make sure it knows it's talking to us, and not
    just some random |id|.
 */
 
 @protocol mozAccessible
 
 // returns whether this accessible is the root accessible. there is one
 // root accessible per window.
 - (BOOL)isRoot;
 
-// some mozAccessibles implement accessibility support in place of another object. for example,
-// ChildView gets its support from us.
+// some mozAccessibles implement accessibility support in place of another
+// object. for example, ChildView gets its support from us.
 //
-// instead of returning a mozAccessible to the OS when it wants an object, we need to pass the view
-// we represent, so the OS doesn't get confused and think we return some random object.
+// instead of returning a mozAccessible to the OS when it wants an object, we
+// need to pass the view we represent, so the OS doesn't get confused and think
+// we return some random object.
 - (BOOL)hasRepresentedView;
 - (id)representedView;
 
 /*** general ***/
 
 // returns the accessible at the specified point.
 - (id)accessibilityHitTest:(NSPoint)point;
 
--- a/accessible/mac/mozActionElements.h
+++ b/accessible/mac/mozActionElements.h
@@ -1,9 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import <Cocoa/Cocoa.h>
 #import "mozAccessible.h"
 
 /* Simple subclasses for things like checkboxes, buttons, etc. */
--- a/accessible/mac/mozActionElements.mm
+++ b/accessible/mac/mozActionElements.mm
@@ -1,9 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "mozActionElements.h"
 
 #import "MacUtils.h"
 #include "Accessible-inl.h"
@@ -72,22 +74,24 @@ enum CheckboxValue {
     if (mozAccessible* popup = (mozAccessible*)[self childAt:0]) {
       [popup moxPostNotification:(enabled ? @"AXMenuOpened" : @"AXMenuClosed")];
     }
   }
 }
 
 - (BOOL)moxIgnoreWithParent:(mozAccessible*)parent {
   if (Accessible* acc = mGeckoAccessible.AsAccessible()) {
-    if (acc->IsContent() && acc->GetContent()->IsXULElement(nsGkAtoms::menulist)) {
-      // The way select elements work is that content has a COMBOBOX accessible, when it is clicked
-      // it expands a COMBOBOX in our top-level main XUL window. The latter COMBOBOX is a stand-in
-      // for the content one while it is expanded.
-      // XXX: VO focus behaves weirdly if we expose the dummy XUL COMBOBOX in the tree.
-      // We are only interested in its menu child.
+    if (acc->IsContent() &&
+        acc->GetContent()->IsXULElement(nsGkAtoms::menulist)) {
+      // The way select elements work is that content has a COMBOBOX accessible,
+      // when it is clicked it expands a COMBOBOX in our top-level main XUL
+      // window. The latter COMBOBOX is a stand-in for the content one while it
+      // is expanded.
+      // XXX: VO focus behaves weirdly if we expose the dummy XUL COMBOBOX in
+      // the tree. We are only interested in its menu child.
       return YES;
     }
   }
 
   return [super moxIgnoreWithParent:parent];
 }
 
 @end
@@ -107,33 +111,35 @@ enum CheckboxValue {
       Relation rel = radioAcc->RelationByType(RelationType::MEMBER_OF);
       Accessible* tempAcc;
       while ((tempAcc = rel.Next())) {
         [radioSiblings addObject:GetNativeFromGeckoAccessible(tempAcc)];
       }
       return radioSiblings;
     } else {
       ProxyAccessible* proxy = mGeckoAccessible.AsProxy();
-      nsTArray<ProxyAccessible*> accs = proxy->RelationByType(RelationType::MEMBER_OF);
+      nsTArray<ProxyAccessible*> accs =
+          proxy->RelationByType(RelationType::MEMBER_OF);
       return utils::ConvertToNSArray(accs);
     }
   }
 
   return [super accessibilityAttributeValue:attribute];
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 @end
 
 @implementation mozCheckboxAccessible
 
 - (int)isChecked {
   // check if we're checked or in a mixed state
-  uint64_t state = [self stateWithMask:(states::CHECKED | states::PRESSED | states::MIXED)];
+  uint64_t state =
+      [self stateWithMask:(states::CHECKED | states::PRESSED | states::MIXED)];
   if (state & (states::CHECKED | states::PRESSED)) {
     return kChecked;
   }
 
   if (state & states::MIXED) {
     return kMixed;
   }
 
@@ -150,28 +156,32 @@ enum CheckboxValue {
 
 @end
 
 @implementation mozPaneAccessible
 
 - (NSArray*)moxChildren {
   if (!mGeckoAccessible.AsAccessible()) return nil;
 
-  nsDeckFrame* deckFrame = do_QueryFrame(mGeckoAccessible.AsAccessible()->GetFrame());
+  nsDeckFrame* deckFrame =
+      do_QueryFrame(mGeckoAccessible.AsAccessible()->GetFrame());
   nsIFrame* selectedFrame = deckFrame ? deckFrame->GetSelectedBox() : nullptr;
 
   Accessible* selectedAcc = nullptr;
   if (selectedFrame) {
     nsINode* node = selectedFrame->GetContent();
-    selectedAcc = mGeckoAccessible.AsAccessible()->Document()->GetAccessible(node);
+    selectedAcc =
+        mGeckoAccessible.AsAccessible()->Document()->GetAccessible(node);
   }
 
   if (selectedAcc) {
     mozAccessible* curNative = GetNativeFromGeckoAccessible(selectedAcc);
-    if (curNative) return [NSArray arrayWithObjects:GetObjectOrRepresentedView(curNative), nil];
+    if (curNative)
+      return
+          [NSArray arrayWithObjects:GetObjectOrRepresentedView(curNative), nil];
   }
 
   return nil;
 }
 
 @end
 
 @implementation mozIncrementableAccessible
--- a/accessible/mac/mozHTMLAccessible.h
+++ b/accessible/mac/mozHTMLAccessible.h
@@ -1,11 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "mozAccessible.h"
 
 @interface mozHeadingAccessible : mozAccessible
 
--- a/accessible/mac/mozHTMLAccessible.mm
+++ b/accessible/mac/mozHTMLAccessible.mm
@@ -1,11 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "mozHTMLAccessible.h"
 
 #import "Accessible-inl.h"
 #import "HyperTextAccessible.h"
--- a/accessible/mac/mozRootAccessible.h
+++ b/accessible/mac/mozRootAccessible.h
@@ -1,9 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import <Cocoa/Cocoa.h>
 #import "mozAccessible.h"
 
 // our protocol that we implement (so cocoa widgets can talk to us)
--- a/accessible/mac/mozRootAccessible.mm
+++ b/accessible/mac/mozRootAccessible.mm
@@ -1,26 +1,30 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "RootAccessibleWrap.h"
 
 #import "mozRootAccessible.h"
 
 #import "mozView.h"
 
 // This must be included last:
 #include "nsObjCExceptions.h"
 
 using namespace mozilla::a11y;
 
-static id<mozAccessible, mozView> getNativeViewFromRootAccessible(Accessible* aAccessible) {
-  RootAccessibleWrap* root = static_cast<RootAccessibleWrap*>(aAccessible->AsRoot());
+static id<mozAccessible, mozView> getNativeViewFromRootAccessible(
+    Accessible* aAccessible) {
+  RootAccessibleWrap* root =
+      static_cast<RootAccessibleWrap*>(aAccessible->AsRoot());
   id<mozAccessible, mozView> nativeView = nil;
   root->GetNativeWidget((void**)&nativeView);
   return nativeView;
 }
 
 #pragma mark -
 
 @implementation mozRootAccessible
@@ -44,36 +48,39 @@ static id<mozAccessible, mozView> getNat
 - (NSNumber*)moxMinimized {
   return @([[self moxWindow] isMiniaturized]);
 }
 
 // return the AXParent that our parallell NSView tells us about.
 - (id)moxUnignoredParent {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
-  if (!mParallelView) mParallelView = (id<mozView, mozAccessible>)[self representedView];
+  if (!mParallelView)
+    mParallelView = (id<mozView, mozAccessible>)[self representedView];
 
   if (mParallelView)
-    return [mParallelView accessibilityAttributeValue:NSAccessibilityParentAttribute];
+    return [mParallelView
+        accessibilityAttributeValue:NSAccessibilityParentAttribute];
 
   MOZ_ASSERT(mParallelView, "we're a root accessible w/o native view?");
   return [super moxUnignoredParent];
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (BOOL)hasRepresentedView {
   return YES;
 }
 
 // this will return our parallell NSView. see mozDocAccessible.h
 - (id)representedView {
   NS_OBJC_BEGIN_TRY_ABORT_BLOCK_NIL;
 
-  MOZ_ASSERT(mParallelView, "root accessible does not have a native parallel view.");
+  MOZ_ASSERT(mParallelView,
+             "root accessible does not have a native parallel view.");
 
   return mParallelView;
 
   NS_OBJC_END_TRY_ABORT_BLOCK_NIL;
 }
 
 - (BOOL)isRoot {
   return YES;
--- a/accessible/mac/mozSelectableElements.h
+++ b/accessible/mac/mozSelectableElements.h
@@ -1,9 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import <Cocoa/Cocoa.h>
 #import "mozAccessible.h"
 
 @interface mozSelectableAccessible : mozAccessible
--- a/accessible/mac/mozSelectableElements.mm
+++ b/accessible/mac/mozSelectableElements.mm
@@ -1,61 +1,66 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "mozSelectableElements.h"
 
 @implementation mozSelectableAccessible
 
 /**
  * Return the mozAccessibles that are selectable.
  */
 - (NSArray*)selectableChildren {
   return [[self moxUnignoredChildren]
-      filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(mozAccessible* child,
-                                                                        NSDictionary* bindings) {
+      filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(
+                                                   mozAccessible* child,
+                                                   NSDictionary* bindings) {
         return [child isKindOfClass:[mozSelectableChildAccessible class]];
       }]];
 }
 
 - (void)moxSetSelectedChildren:(NSArray*)selectedChildren {
   for (id child in [self selectableChildren]) {
-    BOOL selected = [selectedChildren indexOfObjectIdenticalTo:child] != NSNotFound;
+    BOOL selected =
+        [selectedChildren indexOfObjectIdenticalTo:child] != NSNotFound;
     [child moxSetSelected:@(selected)];
   }
 }
 
 /**
  * Return the mozAccessibles that are actually selected.
  */
 - (NSArray*)moxSelectedChildren {
   return [[self moxUnignoredChildren]
-      filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(mozAccessible* child,
-                                                                        NSDictionary* bindings) {
-        // Return mozSelectableChildAccessibles that have are selected (truthy value).
+      filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(
+                                                   mozAccessible* child,
+                                                   NSDictionary* bindings) {
+        // Return mozSelectableChildAccessibles that have are selected (truthy
+        // value).
         return [child isKindOfClass:[mozSelectableChildAccessible class]] &&
                [[(mozSelectableChildAccessible*)child moxSelected] boolValue];
       }]];
 }
 
 @end
 
 @implementation mozSelectableChildAccessible
 
 - (NSNumber*)moxSelected {
   return @([self stateWithMask:states::SELECTED] != 0);
 }
 
 - (void)moxSetSelected:(NSNumber*)selected {
   // Get SELECTABLE and UNAVAILABLE state.
-  uint64_t state = [self stateWithMask:(states::SELECTABLE | states::UNAVAILABLE)];
+  uint64_t state =
+      [self stateWithMask:(states::SELECTABLE | states::UNAVAILABLE)];
   if ((state & states::SELECTABLE) == 0 || (state & states::UNAVAILABLE) != 0) {
     // The object is either not selectable or is unavailable. Don't do anything.
     return;
   }
 
   if (Accessible* acc = mGeckoAccessible.AsAccessible()) {
     acc->SetSelected([selected boolValue]);
   } else {
@@ -169,23 +174,25 @@
 @implementation mozMenuItemAccessible
 
 - (NSString*)moxLabel {
   return @"";
 }
 
 - (NSString*)moxMenuItemMarkChar {
   Accessible* acc = mGeckoAccessible.AsAccessible();
-  if (acc && acc->IsContent() && acc->GetContent()->IsXULElement(nsGkAtoms::menuitem)) {
+  if (acc && acc->IsContent() &&
+      acc->GetContent()->IsXULElement(nsGkAtoms::menuitem)) {
     // We need to provide a marker character. This is the visible "√" you see
     // on dropdown menus. In our a11y tree this is a single child text node
     // of the menu item.
-    // We do this only with XUL menuitems that conform to the native theme, and not
-    // with aria menu items that might have a pseudo element or something.
-    if (acc->ChildCount() == 1 && acc->FirstChild()->Role() == roles::STATICTEXT) {
+    // We do this only with XUL menuitems that conform to the native theme, and
+    // not with aria menu items that might have a pseudo element or something.
+    if (acc->ChildCount() == 1 &&
+        acc->FirstChild()->Role() == roles::STATICTEXT) {
       nsAutoString marker;
       acc->FirstChild()->Name(marker);
       if (marker.Length() == 1) {
         return nsCocoaUtils::ToNSString(marker);
       }
     }
   }
 
@@ -197,16 +204,17 @@
   return @([self stateWithMask:states::FOCUSED] != 0);
 }
 
 - (void)handleAccessibleEvent:(uint32_t)eventType {
   switch (eventType) {
     case nsIAccessibleEvent::EVENT_FOCUS:
       // Our focused state is equivelent to native selected states for menus.
       mozAccessible* parent = (mozAccessible*)[self moxUnignoredParent];
-      [parent moxPostNotification:NSAccessibilitySelectedChildrenChangedNotification];
+      [parent moxPostNotification:
+                  NSAccessibilitySelectedChildrenChangedNotification];
       break;
   }
 
   [super handleAccessibleEvent:eventType];
 }
 
 @end
--- a/accessible/mac/mozTableAccessible.h
+++ b/accessible/mac/mozTableAccessible.h
@@ -1,11 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "mozAccessible.h"
 
 @interface mozColumnContainer : MOXAccessibleBase {
   uint32_t mIndex;
--- a/accessible/mac/mozTableAccessible.mm
+++ b/accessible/mac/mozTableAccessible.mm
@@ -1,11 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
-/* vim:expandtab:shiftwidth=2:tabstop=2:
- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "mozTableAccessible.h"
 #import "nsCocoaUtils.h"
 #import "MacUtils.h"
 
@@ -45,28 +45,30 @@ using namespace mozilla::a11y;
 
   if (Accessible* acc = [mParent geckoAccessible].AsAccessible()) {
     TableAccessible* table = acc->AsTable();
     MOZ_ASSERT(table, "Got null table when fetching column children!");
     uint32_t numRows = table->RowCount();
 
     for (uint32_t j = 0; j < numRows; j++) {
       Accessible* cell = table->CellAt(j, mIndex);
-      mozAccessible* nativeCell = cell ? GetNativeFromGeckoAccessible(cell) : nil;
+      mozAccessible* nativeCell =
+          cell ? GetNativeFromGeckoAccessible(cell) : nil;
       if ([nativeCell isAccessibilityElement]) {
         [mChildren addObject:nativeCell];
       }
     }
 
   } else if (ProxyAccessible* proxy = [mParent geckoAccessible].AsProxy()) {
     uint32_t numRows = proxy->TableRowCount();
 
     for (uint32_t j = 0; j < numRows; j++) {
       ProxyAccessible* cell = proxy->TableCellAt(j, mIndex);
-      mozAccessible* nativeCell = cell ? GetNativeFromGeckoAccessible(cell) : nil;
+      mozAccessible* nativeCell =
+          cell ? GetNativeFromGeckoAccessible(cell) : nil;
       if ([nativeCell isAccessibilityElement]) {
         [mChildren addObject:nativeCell];
       }
     }
   }
 
   return mChildren;
 }
@@ -164,32 +166,35 @@ using namespace mozilla::a11y;
   [super dealloc];
 
   NS_OBJC_END_TRY_ABORT_BLOCK;
 }
 
 - (NSNumber*)moxRowCount {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
-  return mGeckoAccessible.IsAccessible() ? @(mGeckoAccessible.AsAccessible()->AsTable()->RowCount())
-                                         : @(mGeckoAccessible.AsProxy()->TableRowCount());
+  return mGeckoAccessible.IsAccessible()
+             ? @(mGeckoAccessible.AsAccessible()->AsTable()->RowCount())
+             : @(mGeckoAccessible.AsProxy()->TableRowCount());
 }
 
 - (NSNumber*)moxColumnCount {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
-  return mGeckoAccessible.IsAccessible() ? @(mGeckoAccessible.AsAccessible()->AsTable()->ColCount())
-                                         : @(mGeckoAccessible.AsProxy()->TableColumnCount());
+  return mGeckoAccessible.IsAccessible()
+             ? @(mGeckoAccessible.AsAccessible()->AsTable()->ColCount())
+             : @(mGeckoAccessible.AsProxy()->TableColumnCount());
 }
 
 - (NSArray*)moxRows {
   // Create a new array with the list of table rows.
   return [[self moxChildren]
-      filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(mozAccessible* child,
-                                                                        NSDictionary* bindings) {
+      filteredArrayUsingPredicate:[NSPredicate predicateWithBlock:^BOOL(
+                                                   mozAccessible* child,
+                                                   NSDictionary* bindings) {
         return [child isKindOfClass:[mozTableRowAccessible class]];
       }]];
 }
 
 - (NSArray*)moxColumns {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   if (mColContainers) {
@@ -201,41 +206,44 @@ using namespace mozilla::a11y;
 
   if (Accessible* acc = mGeckoAccessible.AsAccessible()) {
     numCols = acc->AsTable()->ColCount();
   } else {
     numCols = mGeckoAccessible.AsProxy()->TableColumnCount();
   }
 
   for (uint32_t i = 0; i < numCols; i++) {
-    mozColumnContainer* container = [[mozColumnContainer alloc] initWithIndex:i andParent:self];
+    mozColumnContainer* container =
+        [[mozColumnContainer alloc] initWithIndex:i andParent:self];
     [mColContainers addObject:container];
   }
 
   return mColContainers;
 }
 
 - (NSArray*)moxUnignoredChildren {
-  return [[super moxUnignoredChildren] arrayByAddingObjectsFromArray:[self moxColumns]];
+  return [[super moxUnignoredChildren]
+      arrayByAddingObjectsFromArray:[self moxColumns]];
 }
 
 - (NSArray*)moxColumnHeaderUIElements {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   uint32_t numCols = 0;
   TableAccessible* table = nullptr;
 
   if (Accessible* acc = mGeckoAccessible.AsAccessible()) {
     table = mGeckoAccessible.AsAccessible()->AsTable();
     numCols = table->ColCount();
   } else {
     numCols = mGeckoAccessible.AsProxy()->TableColumnCount();
   }
 
-  NSMutableArray* colHeaders = [[NSMutableArray alloc] initWithCapacity:numCols];
+  NSMutableArray* colHeaders =
+      [[NSMutableArray alloc] initWithCapacity:numCols];
 
   for (uint32_t i = 0; i < numCols; i++) {
     AccessibleOrProxy cell;
     if (table) {
       cell = table->CellAt(0, i);
     } else {
       cell = mGeckoAccessible.AsProxy()->TableCellAt(0, i);
     }
@@ -306,32 +314,36 @@ using namespace mozilla::a11y;
 
 @implementation mozTableCellAccessible
 
 - (NSValue*)moxRowIndexRange {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   if (mGeckoAccessible.IsAccessible()) {
     TableCellAccessible* cell = mGeckoAccessible.AsAccessible()->AsTableCell();
-    return [NSValue valueWithRange:NSMakeRange(cell->RowIdx(), cell->RowExtent())];
+    return
+        [NSValue valueWithRange:NSMakeRange(cell->RowIdx(), cell->RowExtent())];
   } else {
     ProxyAccessible* proxy = mGeckoAccessible.AsProxy();
-    return [NSValue valueWithRange:NSMakeRange(proxy->RowIdx(), proxy->RowExtent())];
+    return [NSValue
+        valueWithRange:NSMakeRange(proxy->RowIdx(), proxy->RowExtent())];
   }
 }
 
 - (NSValue*)moxColumnIndexRange {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   if (mGeckoAccessible.IsAccessible()) {
     TableCellAccessible* cell = mGeckoAccessible.AsAccessible()->AsTableCell();
-    return [NSValue valueWithRange:NSMakeRange(cell->ColIdx(), cell->ColExtent())];
+    return
+        [NSValue valueWithRange:NSMakeRange(cell->ColIdx(), cell->ColExtent())];
   } else {
     ProxyAccessible* proxy = mGeckoAccessible.AsProxy();
-    return [NSValue valueWithRange:NSMakeRange(proxy->ColIdx(), proxy->ColExtent())];
+    return [NSValue
+        valueWithRange:NSMakeRange(proxy->ColIdx(), proxy->ColExtent())];
   }
 }
 
 - (NSArray*)moxRowHeaderUIElements {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   if (mGeckoAccessible.IsAccessible()) {
     TableCellAccessible* cell = mGeckoAccessible.AsAccessible()->AsTableCell();
--- a/accessible/mac/mozTextAccessible.h
+++ b/accessible/mac/mozTextAccessible.h
@@ -1,8 +1,11 @@
+/* clang-format off */
+/* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #import "mozAccessible.h"
 
 @interface mozTextAccessible : mozAccessible
 
@@ -66,17 +69,19 @@
 // override
 - (NSValue*)moxBoundsForRange:(NSValue*)range;
 
 #pragma mark - mozAccessible
 
 // override
 - (void)handleAccessibleTextChangeEvent:(NSString*)change
                                inserted:(BOOL)isInserted
-                            inContainer:(const mozilla::a11y::AccessibleOrProxy&)container
+                            inContainer:
+                                (const mozilla::a11y::AccessibleOrProxy&)
+                                    container
                                      at:(int32_t)start;
 
 // override
 - (void)handleAccessibleEvent:(uint32_t)eventType;
 
 @end
 
 @interface mozTextLeafAccessible : mozAccessible
--- a/accessible/mac/mozTextAccessible.mm
+++ b/accessible/mac/mozTextAccessible.mm
@@ -1,9 +1,11 @@
+/* clang-format off */
 /* -*- Mode: Objective-C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
+/* clang-format on */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #include "Accessible-inl.h"
 #include "HyperTextAccessible-inl.h"
 #include "mozilla/a11y/PDocAccessible.h"
 #include "nsCocoaUtils.h"
@@ -74,17 +76,18 @@ inline NSString* ToNSString(id aValue) {
     if (Accessible* acc = mGeckoAccessible.AsAccessible()) {
       HyperTextAccessible* text = acc->AsHyperText();
       if (!text || !text->IsTextRole()) {
         // we can't get the attribute, but we should still respect the
         // invalid state flag
         return @"true";
       }
       nsAutoString invalidStr;
-      nsCOMPtr<nsIPersistentProperties> attributes = text->DefaultTextAttributes();
+      nsCOMPtr<nsIPersistentProperties> attributes =
+          text->DefaultTextAttributes();
       nsAccUtils::GetAccAttr(attributes, nsGkAtoms::invalid, invalidStr);
       if (invalidStr.IsEmpty()) {
         // if the attribute had no value, we should still respect the
         // invalid state flag.
         return @"true";
       }
       return nsCocoaUtils::ToNSString(invalidStr);
     } else {
@@ -112,17 +115,18 @@ inline NSString* ToNSString(id aValue) {
   return @"false";
 }
 
 - (NSNumber*)moxInsertionPointLineNumber {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   int32_t lineNumber = -1;
   if (mGeckoAccessible.IsAccessible()) {
-    if (HyperTextAccessible* textAcc = mGeckoAccessible.AsAccessible()->AsHyperText()) {
+    if (HyperTextAccessible* textAcc =
+            mGeckoAccessible.AsAccessible()->AsHyperText()) {
       lineNumber = textAcc->CaretLineNumber() - 1;
     }
   } else {
     lineNumber = mGeckoAccessible.AsProxy()->CaretLineNumber() - 1;
   }
 
   return (lineNumber >= 0) ? [NSNumber numberWithInt:lineNumber] : nil;
 }
@@ -159,17 +163,18 @@ inline NSString* ToNSString(id aValue) {
 }
 
 - (NSString*)moxSelectedText {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   int32_t start = 0, end = 0;
   nsAutoString selText;
   if (mGeckoAccessible.IsAccessible()) {
-    if (HyperTextAccessible* textAcc = mGeckoAccessible.AsAccessible()->AsHyperText()) {
+    if (HyperTextAccessible* textAcc =
+            mGeckoAccessible.AsAccessible()->AsHyperText()) {
       textAcc->SelectionBoundsAt(0, &start, &end);
       if (start != end) {
         textAcc->TextSubstring(start, end, selText);
       }
     }
   } else {
     mGeckoAccessible.AsProxy()->SelectionBoundsAt(0, selText, &start, &end);
   }
@@ -178,17 +183,18 @@ inline NSString* ToNSString(id aValue) {
 }
 
 - (NSValue*)moxSelectedTextRange {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   int32_t start = 0;
   int32_t end = 0;
   if (mGeckoAccessible.IsAccessible()) {
-    if (HyperTextAccessible* textAcc = mGeckoAccessible.AsAccessible()->AsHyperText()) {
+    if (HyperTextAccessible* textAcc =
+            mGeckoAccessible.AsAccessible()->AsHyperText()) {
       if (textAcc->SelectionCount()) {
         textAcc->SelectionBoundsAt(0, &start, &end);
       } else {
         start = textAcc->CaretOffset();
         start = start != -1 ? start : 0;
       }
     }
   } else {
@@ -211,34 +217,36 @@ inline NSString* ToNSString(id aValue) {
   Accessible* acc = mGeckoAccessible.AsAccessible();
   ProxyAccessible* proxy = mGeckoAccessible.AsProxy();
   HyperTextAccessible* textAcc = acc ? acc->AsHyperText() : nullptr;
   if (!textAcc && !proxy) {
     return nil;
   }
 
   return [NSValue
-      valueWithRange:NSMakeRange(0, textAcc ? textAcc->CharacterCount() : proxy->CharacterCount())];
+      valueWithRange:NSMakeRange(0, textAcc ? textAcc->CharacterCount()
+                                            : proxy->CharacterCount())];
 }
 
 - (BOOL)moxBlockSelector:(SEL)selector {
   if (selector == @selector(moxSetValue:) && [self isReadOnly]) {
     return YES;
   }
 
   return [super moxBlockSelector:selector];
 }
 
 - (void)moxSetValue:(id)value {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   nsString text;
   nsCocoaUtils::GetStringForNSString(value, text);
   if (mGeckoAccessible.IsAccessible()) {
-    if (HyperTextAccessible* textAcc = mGeckoAccessible.AsAccessible()->AsHyperText()) {
+    if (HyperTextAccessible* textAcc =
+            mGeckoAccessible.AsAccessible()->AsHyperText()) {
       textAcc->ReplaceText(text);
     }
   } else {
     mGeckoAccessible.AsProxy()->ReplaceText(text);
   }
 }
 
 - (void)moxSetSelectedText:(NSString*)selectedText {
@@ -247,17 +255,18 @@ inline NSString* ToNSString(id aValue) {
   NSString* stringValue = ToNSString(selectedText);
   if (!stringValue) {
     return;
   }
 
   int32_t start = 0, end = 0;
   nsString text;
   if (mGeckoAccessible.IsAccessible()) {
-    if (HyperTextAccessible* textAcc = mGeckoAccessible.AsAccessible()->AsHyperText()) {
+    if (HyperTextAccessible* textAcc =
+            mGeckoAccessible.AsAccessible()->AsHyperText()) {
       textAcc->SelectionBoundsAt(0, &start, &end);
       textAcc->DeleteText(start, end - start);
       nsCocoaUtils::GetStringForNSString(stringValue, text);
       textAcc->InsertText(text, start);
     }
   } else {
     ProxyAccessible* proxy = mGeckoAccessible.AsProxy();
     nsString data;
@@ -272,62 +281,69 @@ inline NSString* ToNSString(id aValue) {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   NSRange range;
   if (!ToNSRange(selectedTextRange, &range)) {
     return;
   }
 
   if (mGeckoAccessible.IsAccessible()) {
-    if (HyperTextAccessible* textAcc = mGeckoAccessible.AsAccessible()->AsHyperText()) {
-      textAcc->SetSelectionBoundsAt(0, range.location, range.location + range.length);
+    if (HyperTextAccessible* textAcc =
+            mGeckoAccessible.AsAccessible()->AsHyperText()) {
+      textAcc->SetSelectionBoundsAt(0, range.location,
+                                    range.location + range.length);
     }
   } else {
-    mGeckoAccessible.AsProxy()->SetSelectionBoundsAt(0, range.location,
-                                                     range.location + range.length);
+    mGeckoAccessible.AsProxy()->SetSelectionBoundsAt(
+        0, range.location, range.location + range.length);
   }
 }
 
 - (void)moxSetVisibleCharacterRange:(NSValue*)visibleCharacterRange {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   NSRange range;
   if (!ToNSRange(visibleCharacterRange, &range)) {
     return;
   }
 
   if (mGeckoAccessible.IsAccessible()) {
-    if (HyperTextAccessible* textAcc = mGeckoAccessible.AsAccessible()->AsHyperText()) {
+    if (HyperTextAccessible* textAcc =
+            mGeckoAccessible.AsAccessible()->AsHyperText()) {
       textAcc->ScrollSubstringTo(range.location, range.location + range.length,
                                  nsIAccessibleScrollType::SCROLL_TYPE_TOP_EDGE);
     }
   } else {
-    mGeckoAccessible.AsProxy()->ScrollSubstringTo(range.location, range.location + range.length,
-                                                  nsIAccessibleScrollType::SCROLL_TYPE_TOP_EDGE);
+    mGeckoAccessible.AsProxy()->ScrollSubstringTo(
+        range.location, range.location + range.length,
+        nsIAccessibleScrollType::SCROLL_TYPE_TOP_EDGE);
   }
 }
 
 - (NSString*)moxStringForRange:(NSValue*)range {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   NSRange r = [range rangeValue];
   nsAutoString text;
   if (mGeckoAccessible.IsAccessible()) {
-    if (HyperTextAccessible* textAcc = mGeckoAccessible.AsAccessible()->AsHyperText()) {
+    if (HyperTextAccessible* textAcc =
+            mGeckoAccessible.AsAccessible()->AsHyperText()) {
       textAcc->TextSubstring(r.location, r.location + r.length, text);
     }
   } else {
-    mGeckoAccessible.AsProxy()->TextSubstring(r.location, r.location + r.length, text);
+    mGeckoAccessible.AsProxy()->TextSubstring(r.location, r.location + r.length,
+                                              text);
   }
 
   return nsCocoaUtils::ToNSString(text);
 }
 
 - (NSAttributedString*)moxAttributedStringForRange:(NSValue*)range {
-  return [[[NSAttributedString alloc] initWithString:[self moxStringForRange:range]] autorelease];
+  return [[[NSAttributedString alloc]
+      initWithString:[self moxStringForRange:range]] autorelease];
 }
 
 - (NSValue*)moxRangeForLine:(NSNumber*)line {
   // XXX: actually get the integer value for the line #
   return [NSValue valueWithRange:NSMakeRange(0, [self textLength])];
 }
 
 - (NSNumber*)moxLineForIndex:(NSNumber*)index {
@@ -338,21 +354,23 @@ inline NSString* ToNSString(id aValue) {
 - (NSValue*)moxBoundsForRange:(NSValue*)range {
   MOZ_ASSERT(!mGeckoAccessible.IsNull());
 
   NSRange r = [range rangeValue];
   int32_t start = r.location;
   int32_t end = start + r.length;
   DesktopIntRect bounds;
   if (mGeckoAccessible.IsAccessible()) {
-    if (HyperTextAccessible* textAcc = mGeckoAccessible.AsAccessible()->AsHyperText()) {
+    if (HyperTextAccessible* textAcc =
+            mGeckoAccessible.AsAccessible()->AsHyperText()) {
       bounds = DesktopIntRect::FromUnknownRect(textAcc->TextBounds(start, end));
     }
   } else {
-    bounds = DesktopIntRect::FromUnknownRect(mGeckoAccessible.AsProxy()->TextBounds(start, end));
+    bounds = DesktopIntRect::FromUnknownRect(
+        mGeckoAccessible.AsProxy()->TextBounds(start, end));
   }
 
   return [NSValue valueWithRect:nsCocoaUtils::GeckoRectToCocoaRect(bounds)];
 }
 
 #pragma mark - mozAccessible
 
 enum AXTextEditType {
@@ -379,23 +397,26 @@ enum AXTextStateChangeType {
                                      at:(int32_t)start {
   GeckoTextMarker startMarker(container, start);
   NSDictionary* userInfo = @{
     @"AXTextChangeElement" : self,
     @"AXTextStateChangeType" : @(AXTextStateChangeTypeEdit),
     @"AXTextChangeValues" : @[ @{
       @"AXTextChangeValue" : (change ? change : @""),
       @"AXTextChangeValueStartMarker" : startMarker.CreateAXTextMarker(),
-      @"AXTextEditType" : isInserted ? @(AXTextEditTypeTyping) : @(AXTextEditTypeDelete)
+      @"AXTextEditType" : isInserted ? @(AXTextEditTypeTyping)
+                                     : @(AXTextEditTypeDelete)
     } ]
   };
 
   mozAccessible* webArea = GetNativeFromGeckoAccessible([self geckoDocument]);
-  [webArea moxPostNotification:NSAccessibilityValueChangedNotification withUserInfo:userInfo];
-  [self moxPostNotification:NSAccessibilityValueChangedNotification withUserInfo:userInfo];
+  [webArea moxPostNotification:NSAccessibilityValueChangedNotification
+                  withUserInfo:userInfo];
+  [self moxPostNotification:NSAccessibilityValueChangedNotification
+               withUserInfo:userInfo];
 
   [self moxPostNotification:NSAccessibilityValueChangedNotification];
 }
 
 - (void)handleAccessibleEvent:(uint32_t)eventType {
   switch (eventType) {
     default:
       [super handleAccessibleEvent:eventType];
@@ -427,32 +448,36 @@ enum AXTextStateChangeType {
 
   // A password text field returns an empty value
   if (mRole == roles::PASSWORD_TEXT) {
     return @"";
   }
 
   nsAutoString text;
   if (mGeckoAccessible.IsAccessible()) {
-    if (HyperTextAccessible* textAcc = mGeckoAccessible.AsAccessible()->AsHyperText()) {
-      textAcc->TextSubstring(0, nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT, text);
+    if (HyperTextAccessible* textAcc =
+            mGeckoAccessible.AsAccessible()->AsHyperText()) {
+      textAcc->TextSubstring(0, nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT,
+                             text);
     }
   } else {
-    mGeckoAccessible.AsProxy()->TextSubstring(0, nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT, text);
+    mGeckoAccessible.AsProxy()->TextSubstring(
+        0, nsIAccessibleText::TEXT_OFFSET_END_OF_TEXT, text);
   }
 
   return nsCocoaUtils::ToNSString(text);
 }
 
 @end
 
 @implementation mozTextLeafAccessible
 
 - (BOOL)moxBlockSelector:(SEL)selector {
-  if (selector == @selector(moxChildren) || selector == @selector(moxTitleUIElement)) {
+  if (selector == @selector(moxChildren) || selector == @selector
+                                                (moxTitleUIElement)) {
     return YES;
   }
 
   return [super moxBlockSelector:selector];
 }
 
 - (NSString*)moxValue {
   return [super moxTitle];