Bug 1508472 - Part 1: First batch of comment fix-ups in preparation for the tree reformat r=sylvestre
authorEhsan Akhgari <ehsan@mozilla.com>
Tue, 27 Nov 2018 10:08:58 +0000
changeset 504652 fb09acfff1684500e989acc798e97fa7f9358dc0
parent 504651 c0b875613aa06ed1aeb02dab655378510f2a7dca
child 504653 02c470cc3f8dcd686cdcda402a514d3c8501ce89
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssylvestre
bugs1508472
milestone65.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1508472 - Part 1: First batch of comment fix-ups in preparation for the tree reformat r=sylvestre This is a best effort attempt at ensuring that the adverse impact of reformatting the entire tree over the comments would be minimal. I've used a combination of strategies including disabling of formatting, some manual formatting and some changes to formatting to work around some clang-format limitations. Differential Revision: https://phabricator.services.mozilla.com/D13046
accessible/atk/nsStateMap.h
accessible/base/RoleMap.h
accessible/generic/HyperTextAccessible.cpp
accessible/mac/AccessibleWrap.h
accessible/windows/msaa/AccessibleWrap.cpp
accessible/xpcom/xpcAccessibleTable.h
devtools/platform/nsJSInspector.cpp
devtools/platform/nsJSInspector.h
devtools/shared/heapsnapshot/DeserializedNode.cpp
devtools/shared/heapsnapshot/DeserializedNode.h
devtools/shared/heapsnapshot/DominatorTree.cpp
devtools/shared/heapsnapshot/DominatorTree.h
devtools/shared/heapsnapshot/FileDescriptorOutputStream.cpp
devtools/shared/heapsnapshot/FileDescriptorOutputStream.h
devtools/shared/heapsnapshot/HeapSnapshot.cpp
devtools/shared/heapsnapshot/HeapSnapshot.h
devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.cpp
devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.h
devtools/shared/heapsnapshot/tests/gtest/DeserializedNodeUbiNodes.cpp
devtools/shared/heapsnapshot/tests/gtest/DeserializedStackFrameUbiStackFrames.cpp
devtools/shared/heapsnapshot/tests/gtest/DevTools.h
devtools/shared/heapsnapshot/tests/gtest/DoesCrossCompartmentBoundaries.cpp
devtools/shared/heapsnapshot/tests/gtest/DoesntCrossCompartmentBoundaries.cpp
devtools/shared/heapsnapshot/tests/gtest/SerializesEdgeNames.cpp
devtools/shared/heapsnapshot/tests/gtest/SerializesEverythingInHeapGraphOnce.cpp
devtools/shared/heapsnapshot/tests/gtest/SerializesTypeNames.cpp
dom/base/Selection.cpp
dom/base/Selection.h
dom/base/nsContentUtils.cpp
dom/base/nsContentUtils.h
dom/base/nsFocusManager.cpp
dom/base/nsINode.cpp
dom/base/nsPlainTextSerializer.cpp
dom/base/nsWindowMemoryReporter.h
dom/base/nsXMLContentSerializer.cpp
dom/bindings/BindingUtils.h
dom/browser-element/BrowserElementParent.h
dom/canvas/CanvasRenderingContext2D.cpp
dom/canvas/WebGL2Context.h
dom/canvas/WebGLContext.cpp
dom/canvas/WebGLContextGL.cpp
dom/canvas/WebGLExtensionCompressedTextureES3.cpp
dom/canvas/WebGLFormats.cpp
dom/canvas/WebGLFramebuffer.cpp
dom/canvas/WebGLShaderValidator.cpp
dom/canvas/WebGLTexture.cpp
dom/canvas/WebGLTextureUpload.cpp
dom/canvas/gtest/TestImageBitmapColorUtils.cpp
dom/crypto/WebCryptoCommon.h
dom/events/KeyboardEvent.cpp
dom/fetch/InternalRequest.h
dom/html/HTMLInputElement.cpp
dom/html/HTMLMeterElement.h
dom/html/HTMLTableElement.cpp
--- a/accessible/atk/nsStateMap.h
+++ b/accessible/atk/nsStateMap.h
@@ -4,16 +4,17 @@
  * 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 <atk/atk.h>
 #include "AccessibleWrap.h"
 
 #include <type_traits>
 
+// clang-format off
 /******************************************************************************
 The following accessible states aren't translated, just ignored:
   STATE_READONLY:        Supported indirectly via EXT_STATE_EDITABLE
   STATE_HOTTRACKED:      No ATK equivalent.  No known use case.
                          The nsIAccessible state is not currently supported.
   STATE_FLOATING:        No ATK equivalent.  No known use case.
                          The nsIAccessible state is not currently supported.
   STATE_MOVEABLE:        No ATK equivalent.  No known use case.
@@ -31,16 +32,17 @@ The following accessible states aren't t
 
 The following ATK states are not supported:
   ATK_STATE_ARMED:       No clear use case, used briefly when button is activated
   ATK_STATE_HAS_TOOLTIP: No clear use case, no IA2 equivalent
   ATK_STATE_ICONIFIED:   Mozilla does not have elements which are collapsable into icons
   ATK_STATE_TRUNCATED:   No clear use case. Indicates that an object's onscreen content is truncated,
                          e.g. a text value in a spreadsheet cell. No IA2 state.
 ******************************************************************************/
+// clang-format on
 
 enum EStateMapEntryType {
   kMapDirectly,
   kMapOpposite,   // For example, UNAVAILABLE is the opposite of ENABLED
   kNoStateChange, // Don't fire state change event
 };
 
 const AtkStateType kNone = ATK_STATE_INVALID;
--- a/accessible/base/RoleMap.h
+++ b/accessible/base/RoleMap.h
@@ -1,12 +1,13 @@
 /* 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/. */
 
+// clang-format off
 /**
  * Usage: declare the macro ROLE()with the following arguments:
  * ROLE(geckoRole, stringRole, atkRole, macRole, msaaRole, ia2Role, nameRule)
  */
 
 ROLE(NOTHING,
      "nothing",
      ATK_ROLE_UNKNOWN,
@@ -1624,8 +1625,9 @@ ROLE(CONTENT_INSERTION,
 ROLE(FORM_LANDMARK,
      "form",
      ATK_ROLE_LANDMARK,
      NSAccessibilityGroupRole,
      USE_ROLE_STRING,
      IA2_ROLE_FORM,
      java::SessionAccessibility::CLASSNAME_VIEW,
      eNoNameRule)
+// clang-format on
--- a/accessible/generic/HyperTextAccessible.cpp
+++ b/accessible/generic/HyperTextAccessible.cpp
@@ -1513,17 +1513,19 @@ HyperTextAccessible::GetCaretRect(nsIWid
   // Offset from widget origin to the frame origin, which includes chrome
   // on the widget.
   *aWidget = frame->GetNearestWidget(offset);
   NS_ENSURE_TRUE(*aWidget, LayoutDeviceIntRect());
   rect.MoveBy(offset);
 
   LayoutDeviceIntRect caretRect = LayoutDeviceIntRect::FromUnknownRect(
     rect.ToOutsidePixels(frame->PresContext()->AppUnitsPerDevPixel()));
+  // clang-format off
   // ((content screen origin) - (content offset in the widget)) = widget origin on the screen
+  // clang-format on
   caretRect.MoveBy((*aWidget)->WidgetToScreenOffset() - (*aWidget)->GetClientOffset());
 
   // Correct for character size, so that caret always matches the size of
   // the character. This is important for font size transitions, and is
   // necessary because the Gecko caret uses the previous character's size as
   // the user moves forward in the text by character.
   nsIntRect charRect = CharBounds(CaretOffset(),
                                   nsIAccessibleCoordinateType::COORDTYPE_SCREEN_RELATIVE);
--- a/accessible/mac/AccessibleWrap.h
+++ b/accessible/mac/AccessibleWrap.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/. */
 
 /* For documentation of the accessibility architecture,
  * see http://lxr.mozilla.org/seamonkey/source/accessible/accessible-docs.html
  */
 
--- a/accessible/windows/msaa/AccessibleWrap.cpp
+++ b/accessible/windows/msaa/AccessibleWrap.cpp
@@ -646,22 +646,24 @@ STDMETHODIMP
 AccessibleWrap::get_accFocus(
       /* [retval][out] */ VARIANT __RPC_FAR *pvarChild)
 {
   if (!pvarChild)
     return E_INVALIDARG;
 
   VariantInit(pvarChild);
 
+  // clang-format off
   // VT_EMPTY:    None. This object does not have the keyboard focus itself
   //              and does not contain a child that has the keyboard focus.
   // VT_I4:       lVal is CHILDID_SELF. The object itself has the keyboard focus.
   // VT_I4:       lVal contains the child ID of the child element with the keyboard focus.
   // VT_DISPATCH: pdispVal member is the address of the IDispatch interface
   //              for the child object with the keyboard focus.
+  // clang-format on
   if (IsDefunct())
     return CO_E_OBJNOTCONNECTED;
 
   // Return the current IAccessible child that has focus
   Accessible* focusedAccessible = FocusedChild();
 
   if (focusedAccessible == this) {
     pvarChild->vt = VT_I4;
--- a/accessible/xpcom/xpcAccessibleTable.h
+++ b/accessible/xpcom/xpcAccessibleTable.h
@@ -1,9 +1,9 @@
-/* -*- Mode: C++ final; tab-width: 2 final; indent-tabs-mode: nil final; c-basic-offset: 2 -*- */
+/* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
 /* vim: set ts=2 et sw=2 tw=80: */
 /* This Source Code Form is subject to the terms of the Mozilla Public
  * License, v. 2.0. If a copy of the MPL was not distributed with this file,
  * You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 #ifndef mozilla_a11y_xpcAccessibleTable_h_
 #define mozilla_a11y_xpcAccessibleTable_h_
 
--- a/devtools/platform/nsJSInspector.cpp
+++ b/devtools/platform/nsJSInspector.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 "nsJSInspector.h"
 #include "nsIXPConnect.h"
 #include "nsThreadUtils.h"
 #include "jsfriendapi.h"
--- a/devtools/platform/nsJSInspector.h
+++ b/devtools/platform/nsJSInspector.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 COMPONENTS_JSINSPECTOR_H
 #define COMPONENTS_JSINSPECTOR_H
 
 #include "nsIJSInspector.h"
--- a/devtools/shared/heapsnapshot/DeserializedNode.cpp
+++ b/devtools/shared/heapsnapshot/DeserializedNode.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 "mozilla/devtools/DeserializedNode.h"
 #include "mozilla/devtools/HeapSnapshot.h"
 #include "nsCRTGlue.h"
 
--- a/devtools/shared/heapsnapshot/DeserializedNode.h
+++ b/devtools/shared/heapsnapshot/DeserializedNode.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 mozilla_devtools_DeserializedNode__
 #define mozilla_devtools_DeserializedNode__
 
 #include "js/UbiNode.h"
--- a/devtools/shared/heapsnapshot/DominatorTree.cpp
+++ b/devtools/shared/heapsnapshot/DominatorTree.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 "mozilla/devtools/DominatorTree.h"
 #include "mozilla/dom/DominatorTreeBinding.h"
 
 namespace mozilla {
--- a/devtools/shared/heapsnapshot/DominatorTree.h
+++ b/devtools/shared/heapsnapshot/DominatorTree.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 mozilla_devtools_DominatorTree__
 #define mozilla_devtools_DominatorTree__
 
 #include "mozilla/devtools/HeapSnapshot.h"
--- a/devtools/shared/heapsnapshot/FileDescriptorOutputStream.cpp
+++ b/devtools/shared/heapsnapshot/FileDescriptorOutputStream.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 "mozilla/devtools/FileDescriptorOutputStream.h"
 #include "private/pprio.h"
 
 namespace mozilla {
--- a/devtools/shared/heapsnapshot/FileDescriptorOutputStream.h
+++ b/devtools/shared/heapsnapshot/FileDescriptorOutputStream.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 mozilla_devtools_FileDescriptorOutputStream_h
 #define mozilla_devtools_FileDescriptorOutputStream_h
 
 #include <prio.h>
--- a/devtools/shared/heapsnapshot/HeapSnapshot.cpp
+++ b/devtools/shared/heapsnapshot/HeapSnapshot.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 "HeapSnapshot.h"
 
 #include <google/protobuf/io/coded_stream.h>
 #include <google/protobuf/io/gzip_stream.h>
@@ -66,17 +66,17 @@ GetCurrentThreadDebuggerMallocSizeOf()
   MOZ_ASSERT(ccjscx);
   auto cx = ccjscx->Context();
   MOZ_ASSERT(cx);
   auto mallocSizeOf = JS::dbg::GetDebuggerMallocSizeOf(cx);
   MOZ_ASSERT(mallocSizeOf);
   return mallocSizeOf;
 }
 
-/*** Cycle Collection Boilerplate *****************************************************************/
+/*** Cycle Collection Boilerplate *********************************************/
 
 NS_IMPL_CYCLE_COLLECTION_WRAPPERCACHE(HeapSnapshot, mParent)
 
 NS_IMPL_CYCLE_COLLECTING_ADDREF(HeapSnapshot)
 NS_IMPL_CYCLE_COLLECTING_RELEASE(HeapSnapshot)
 
 NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(HeapSnapshot)
   NS_WRAPPERCACHE_INTERFACE_MAP_ENTRY
@@ -84,17 +84,17 @@ NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
 NS_INTERFACE_MAP_END
 
 /* virtual */ JSObject*
 HeapSnapshot::WrapObject(JSContext* aCx, HandleObject aGivenProto)
 {
   return HeapSnapshot_Binding::Wrap(aCx, this, aGivenProto);
 }
 
-/*** Reading Heap Snapshots ***********************************************************************/
+/*** Reading Heap Snapshots ***************************************************/
 
 /* static */ already_AddRefed<HeapSnapshot>
 HeapSnapshot::Create(JSContext* cx,
                      GlobalObject& global,
                      const uint8_t* buffer,
                      uint32_t size,
                      ErrorResult& rv)
 {
@@ -461,17 +461,17 @@ HeapSnapshot::init(JSContext* cx, const 
     if (NS_WARN_IF(!nodes.has(iter.get())))
       return false;
   }
 
   return true;
 }
 
 
-/*** Heap Snapshot Analyses ***********************************************************************/
+/*** Heap Snapshot Analyses ***************************************************/
 
 void
 HeapSnapshot::TakeCensus(JSContext* cx, JS::HandleObject options,
                          JS::MutableHandleValue rval, ErrorResult& rv)
 {
   JS::ubi::Census census(cx);
 
   JS::ubi::CountTypePtr rootType;
@@ -692,17 +692,17 @@ HeapSnapshot::ComputeShortestPaths(JSCon
       rv.Throw(NS_ERROR_OUT_OF_MEMORY);
       return;
     }
   }
 
   results.set(resultsMap);
 }
 
-/*** Saving Heap Snapshots ************************************************************************/
+/*** Saving Heap Snapshots ****************************************************/
 
 // If we are only taking a snapshot of the heap affected by the given set of
 // globals, find the set of compartments the globals are allocated
 // within. Returns false on OOM failure.
 static bool
 PopulateCompartmentsWithGlobals(CompartmentSet& compartments, AutoObjectVector& globals)
 {
   unsigned length = globals.length();
--- a/devtools/shared/heapsnapshot/HeapSnapshot.h
+++ b/devtools/shared/heapsnapshot/HeapSnapshot.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 mozilla_devtools_HeapSnapshot__
 #define mozilla_devtools_HeapSnapshot__
 
 #include "js/HashTable.h"
--- a/devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.cpp
+++ b/devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 "mozilla/devtools/ZeroCopyNSIOutputStream.h"
 
 #include "mozilla/DebugOnly.h"
 #include "mozilla/Unused.h"
--- a/devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.h
+++ b/devtools/shared/heapsnapshot/ZeroCopyNSIOutputStream.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 mozilla_devtools_ZeroCopyNSIOutputStream__
 #define mozilla_devtools_ZeroCopyNSIOutputStream__
 
 #include <google/protobuf/io/zero_copy_stream.h>
--- a/devtools/shared/heapsnapshot/tests/gtest/DeserializedNodeUbiNodes.cpp
+++ b/devtools/shared/heapsnapshot/tests/gtest/DeserializedNodeUbiNodes.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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/. */
 
 // Test that the `JS::ubi::Node`s we create from
 // `mozilla::devtools::DeserializedNode` instances look and behave as we would
 // like.
 
--- a/devtools/shared/heapsnapshot/tests/gtest/DeserializedStackFrameUbiStackFrames.cpp
+++ b/devtools/shared/heapsnapshot/tests/gtest/DeserializedStackFrameUbiStackFrames.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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/. */
 
 // Test that the `JS::ubi::StackFrame`s we create from
 // `mozilla::devtools::DeserializedStackFrame` instances look and behave as we would
 // like.
 
--- a/devtools/shared/heapsnapshot/tests/gtest/DevTools.h
+++ b/devtools/shared/heapsnapshot/tests/gtest/DevTools.h
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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 mozilla_devtools_gtest_DevTools__
 #define mozilla_devtools_gtest_DevTools__
 
 #include "CoreDump.pb.h"
--- a/devtools/shared/heapsnapshot/tests/gtest/DoesCrossCompartmentBoundaries.cpp
+++ b/devtools/shared/heapsnapshot/tests/gtest/DoesCrossCompartmentBoundaries.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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/. */
 
 // Test that heap snapshots cross compartment boundaries when expected.
 
 #include "DevTools.h"
 
--- a/devtools/shared/heapsnapshot/tests/gtest/DoesntCrossCompartmentBoundaries.cpp
+++ b/devtools/shared/heapsnapshot/tests/gtest/DoesntCrossCompartmentBoundaries.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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/. */
 
 // Test that heap snapshots walk the compartment boundaries correctly.
 
 #include "DevTools.h"
 
--- a/devtools/shared/heapsnapshot/tests/gtest/SerializesEdgeNames.cpp
+++ b/devtools/shared/heapsnapshot/tests/gtest/SerializesEdgeNames.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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/. */
 
 // Test that edge names get serialized correctly.
 
 #include "DevTools.h"
 
--- a/devtools/shared/heapsnapshot/tests/gtest/SerializesEverythingInHeapGraphOnce.cpp
+++ b/devtools/shared/heapsnapshot/tests/gtest/SerializesEverythingInHeapGraphOnce.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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/. */
 
 // Test that everything in the heap graph gets serialized once, and only once.
 
 #include "DevTools.h"
 
--- a/devtools/shared/heapsnapshot/tests/gtest/SerializesTypeNames.cpp
+++ b/devtools/shared/heapsnapshot/tests/gtest/SerializesTypeNames.cpp
@@ -1,9 +1,9 @@
-/* -*-  Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2; -*- */
+/* -*- Mode: 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
  * 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/. */
 
 // Test that a ubi::Node's typeName gets properly serialized into a core dump.
 
 #include "DevTools.h"
 
--- a/dom/base/Selection.cpp
+++ b/dom/base/Selection.cpp
@@ -544,24 +544,24 @@ Selection::GetTableCellLocationFromRange
 
   // Must have access to frame selection to get cell info
   if (!mFrameSelection) return NS_OK;
 
   nsresult result = GetTableSelectionType(aRange, aSelectionType);
   if (NS_FAILED(result)) return result;
 
   // Don't fail if range does not point to a single table cell,
-  //  let aSelectionType tell user if we don't have a cell
+  // let aSelectionType tell user if we don't have a cell
   if (*aSelectionType  != TableSelection::Cell) {
     return NS_OK;
   }
 
   // Get the child content (the cell) pointed to by starting node of range
   // We do minimal checking since GetTableSelectionType assures
-  //   us that this really is a table cell
+  // us that this really is a table cell
   nsCOMPtr<nsIContent> child = aRange->GetChildAtStartOffset();
   if (!child)
     return NS_ERROR_FAILURE;
 
   // GetCellLayout depends on current frame, we need flush frame to get
   // nsITableCellLayout
   nsCOMPtr<nsIPresShell> presShell = mFrameSelection->GetShell();
   if (presShell) {
@@ -609,17 +609,17 @@ Selection::AddTableCellRange(nsRange* aR
   if (tableMode != TableSelection::Cell)
   {
     mFrameSelection->mSelectingTableCellMode = tableMode;
     // Don't fail if range isn't a selected cell, aDidAddRange tells caller if we didn't proceed
     return NS_OK;
   }
 
   // Set frame selection mode only if not already set to a table mode
-  //  so we don't lose the select row and column flags (not detected by getTableCellLocation)
+  // so we don't lose the select row and column flags (not detected by getTableCellLocation)
   if (mFrameSelection->mSelectingTableCellMode == TableSelection::None)
     mFrameSelection->mSelectingTableCellMode = tableMode;
 
   *aDidAddRange = true;
   return AddItem(aRange, aOutIndex);
 }
 
 //TODO: Figure out TableSelection::Column and TableSelection::AllCells
@@ -3801,44 +3801,44 @@ Selection::SelectionLanguageChange(bool 
   if (!context) {
     return NS_ERROR_FAILURE;
   }
 
   nsBidiLevel level = focusFrame->GetEmbeddingLevel();
   int32_t focusOffset = static_cast<int32_t>(FocusOffset());
   if ((focusOffset != frameStart) && (focusOffset != frameEnd))
     // the cursor is not at a frame boundary, so the level of both the characters (logically) before and after the cursor
-    //  is equal to the frame level
+    // is equal to the frame level
     levelBefore = levelAfter = level;
   else {
     // the cursor is at a frame boundary, so use GetPrevNextBidiLevels to find the level of the characters
-    //  before and after the cursor
+    // before and after the cursor
     nsCOMPtr<nsIContent> focusContent = do_QueryInterface(GetFocusNode());
     nsPrevNextBidiLevels levels = frameSelection->
       GetPrevNextBidiLevels(focusContent, focusOffset, false);
 
     levelBefore = levels.mLevelBefore;
     levelAfter = levels.mLevelAfter;
   }
 
   if (IS_SAME_DIRECTION(levelBefore, levelAfter)) {
     // if cursor is between two characters with the same orientation, changing the keyboard language
-    //  must toggle the cursor level between the level of the character with the lowest level
-    //  (if the new language corresponds to the orientation of that character) and this level plus 1
-    //  (if the new language corresponds to the opposite orientation)
+    // must toggle the cursor level between the level of the character with the lowest level
+    // (if the new language corresponds to the orientation of that character) and this level plus 1
+    // (if the new language corresponds to the opposite orientation)
     if ((level != levelBefore) && (level != levelAfter))
       level = std::min(levelBefore, levelAfter);
     if (IS_SAME_DIRECTION(level, kbdBidiLevel))
       frameSelection->SetCaretBidiLevel(level);
     else
       frameSelection->SetCaretBidiLevel(level + 1);
   }
   else {
     // if cursor is between characters with opposite orientations, changing the keyboard language must change
-    //  the cursor level to that of the adjacent character with the orientation corresponding to the new language.
+    // the cursor level to that of the adjacent character with the orientation corresponding to the new language.
     if (IS_SAME_DIRECTION(levelBefore, kbdBidiLevel))
       frameSelection->SetCaretBidiLevel(levelBefore);
     else
       frameSelection->SetCaretBidiLevel(levelAfter);
   }
 
   // The caret might have moved, so invalidate the desired position
   // for future usages of up-arrow or down-arrow
--- a/dom/base/Selection.h
+++ b/dom/base/Selection.h
@@ -420,17 +420,18 @@ public:
    * versions that bindings call.
    */
 
   /**
    * Collapses the selection to a single point, at the specified offset
    * in the given node. When the selection is collapsed, and the content
    * is focused and editable, the caret will blink there.
    * @param aContainer The given node where the selection will be set
-   * @param offset      Where in given dom node to place the selection (the offset into the given node)
+   * @param offset      Where in given dom node to place the selection (the
+   *                    offset into the given node)
    */
   void Collapse(nsINode& aContainer, uint32_t aOffset, ErrorResult& aRv)
   {
     Collapse(RawRangeBoundary(&aContainer, aOffset), aRv);
   }
 
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
   void Collapse(const RawRangeBoundary& aPoint, ErrorResult& aRv);
@@ -451,17 +452,18 @@ public:
 
   /**
    * Extends the selection by moving the selection end to the specified node and
    * offset, preserving the selection begin position. The new selection end
    * result will always be from the anchorNode to the new focusNode, regardless
    * of direction.
    *
    * @param aContainer The node where the selection will be extended to
-   * @param aOffset    Where in aContainer to place the offset of the new selection end.
+   * @param aOffset    Where in aContainer to place the offset of the new
+   *                   selection end.
    */
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
   void Extend(nsINode& aContainer, uint32_t aOffset, ErrorResult& aRv);
 
   MOZ_CAN_RUN_SCRIPT_BOUNDARY
   void AddRange(nsRange& aRange, mozilla::ErrorResult& aRv);
 
   /**
--- a/dom/base/nsContentUtils.cpp
+++ b/dom/base/nsContentUtils.cpp
@@ -9165,18 +9165,18 @@ nsContentUtils::InternalStorageAllowedFo
   // BEFORE:
   // localStorage, caches: allowed in 3rd-party iframes always
   // IndexedDB: allowed in 3rd-party iframes only if 3rd party URI is an about:
   //   URI within a specific whitelist
   //
   // AFTER:
   // localStorage, caches: allowed in 3rd-party iframes by default. Preference
   //   can be set to disable in 3rd-party, which will not disallow in about: URIs.
-  // IndexedDB: allowed in 3rd-party iframes by default. Preference can be set to
-  //   disable in 3rd-party, which will disallow in about: URIs, unless they are
+  // IndexedDB: allowed in 3rd-party iframes by default. Preference can be set
+  //   to disable in 3rd-party, which will disallow in about: URIs, unless they are
   //   within a specific whitelist.
   //
   // This means that behavior for storage with internal about: URIs should not be
   // affected, which is desireable due to the lack of automated testing for about:
   // URIs with these preferences set, and the importance of the correct functioning
   // of these URIs even with custom preferences.
   nsCOMPtr<nsIURI> uri = aURI;
   if (!uri) {
--- a/dom/base/nsContentUtils.h
+++ b/dom/base/nsContentUtils.h
@@ -2724,21 +2724,23 @@ public:
   static void SplitMimeType(const nsAString& aValue, nsString& aType,
                             nsString& aParams);
 
   /**
    * Function checks if the user is idle.
    *
    * @param aRequestedIdleTimeInMS    The idle observer's requested idle time.
    * @param aUserIsIdle               boolean indicating if the user
-   *                                  is currently idle or not.   *
-   * @return NS_OK                    NS_OK returned if the requested idle service and
-   *                                  the current idle time were successfully obtained.
-   *                                  NS_ERROR_FAILURE returned if the the requested
-   *                                  idle service or the current idle were not obtained.
+   *                                  is currently idle or not.
+   * @return NS_OK                    NS_OK returned if the requested idle
+   *                                  service and the current idle time were
+   *                                  successfully obtained.
+   *                                  NS_ERROR_FAILURE returned if the the
+   *                                  requested idle service or the current
+   *                                  idle were not obtained.
    */
   static nsresult IsUserIdle(uint32_t aRequestedIdleTimeInMS, bool* aUserIsIdle);
 
   /**
    * Takes a selection, and a text control element (<input> or <textarea>), and
    * returns the offsets in the text content corresponding to the selection.
    * The selection's anchor and focus must both be in the root node passed or a
    * descendant.
--- a/dom/base/nsFocusManager.cpp
+++ b/dom/base/nsFocusManager.cpp
@@ -3648,19 +3648,21 @@ nsFocusManager::GetNextTabbableContent(n
           }
         }
       }
 
       // TabIndex not set defaults to 0 for form elements, anchors and other
       // elements that are normally focusable. Tabindex defaults to -1
       // for elements that are not normally focusable.
       // The returned computed tabindex from IsFocusable() is as follows:
+      // clang-format off
       //          < 0 not tabbable at all
       //          == 0 in normal tab order (last after positive tabindexed items)
       //          > 0 can be tabbed to in the order specified by this value
+      // clang-format on
       int32_t tabIndex;
       frame->IsFocusable(&tabIndex, 0);
 
       LOGCONTENTNAVIGATION("Next Tabbable %s:", frame->GetContent());
       LOGFOCUSNAVIGATION(("  with tabindex: %d expected: %d", tabIndex, aCurrentTabIndex));
 
       if (tabIndex >= 0) {
         NS_ASSERTION(currentContent, "IsFocusable set a tabindex for a frame with no content");
--- a/dom/base/nsINode.cpp
+++ b/dom/base/nsINode.cpp
@@ -2667,18 +2667,18 @@ nsINode::AddSizeOfExcludingThis(nsWindow
   }
 
   // Measurement of the following members may be added later if DMD finds it is
   // worthwhile:
   // - mNodeInfo
   // - mSlots
   //
   // The following members are not measured:
-  // - mParent, mNextSibling, mPreviousOrLastSibling, mFirstChild: because they're
-  //   non-owning, from "exclusive ownership" point of view.
+  // - mParent, mNextSibling, mPreviousOrLastSibling, mFirstChild: because
+  //   they're non-owning, from "exclusive ownership" point of view.
 }
 
 void
 nsINode::AddSizeOfIncludingThis(nsWindowSizes& aSizes, size_t* aNodeSize) const
 {
   *aNodeSize += aSizes.mState.mMallocSizeOf(this);
   AddSizeOfExcludingThis(aSizes, aNodeSize);
 }
--- a/dom/base/nsPlainTextSerializer.cpp
+++ b/dom/base/nsPlainTextSerializer.cpp
@@ -1735,18 +1735,18 @@ nsPlainTextSerializer::Write(const nsASt
 
   while (bol < totLen) {    // Loop over lines
     // Find a place where we may have to do whitespace compression
     nextpos = str.FindCharInSet(" \t\n\r", bol);
 #ifdef DEBUG_wrapping
     nsAutoString remaining;
     str.Right(remaining, totLen - bol);
     foo = ToNewCString(remaining);
-    //    printf("Next line: bol = %d, newlinepos = %d, totLen = %d, string = '%s'\n",
-    //           bol, nextpos, totLen, foo);
+    // printf("Next line: bol = %d, newlinepos = %d, totLen = %d, "
+    //        "string = '%s'\n", bol, nextpos, totLen, foo);
     free(foo);
 #endif
 
     if (nextpos == kNotFound) {
       // The rest of the string
       offsetIntoBuffer = str.get() + bol;
       AddToLine(offsetIntoBuffer, totLen-bol);
       bol=totLen;
--- a/dom/base/nsWindowMemoryReporter.h
+++ b/dom/base/nsWindowMemoryReporter.h
@@ -56,17 +56,18 @@
  * nsWindowMemoryReporter observes window detachment and uses mDetachedWindows
  * to remember when a window first met criteria (1) and (2).  When we generate
  * a memory report, we use this accounting to determine which windows are
  * ghosts.
  *
  *
  * We use the following memory reporter path for active and cached windows:
  *
- *   explicit/window-objects/top(<top-outer-uri>, id=<top-outer-id>)/<category>/window(<window-uri>)/...
+ *   explicit/window-objects/top(<top-outer-uri>, id=<top-outer-id>)/
+ *       <category>/window(<window-uri>)/...
  *
  * For detached and ghost windows, we use
  *
  *   explicit/window-objects/top(none)/<category>/window(<window-uri>)/...
  *
  * Where
  *
  * - <category> is "active", "cached", "detached", or "ghost", as described
--- a/dom/base/nsXMLContentSerializer.cpp
+++ b/dom/base/nsXMLContentSerializer.cpp
@@ -653,21 +653,21 @@ nsXMLContentSerializer::SerializeAttr(co
         bIncludesDouble = true;
         if (bIncludesSingle) {
           break;
         }
       }
     }
 
     // Delimiter and escaping is according to the following table
-    //    bIncludesDouble     bIncludesSingle     Delimiter       Escape Double Quote
-    //    FALSE               FALSE               "               FALSE
-    //    FALSE               TRUE                "               FALSE
-    //    TRUE                FALSE               '               FALSE
-    //    TRUE                TRUE                "               TRUE
+    //    bIncludesDouble   bIncludesSingle   Delimiter    Escape Double Quote
+    //    FALSE             FALSE             "            FALSE
+    //    FALSE             TRUE              "            FALSE
+    //    TRUE              FALSE             '            FALSE
+    //    TRUE              TRUE              "            TRUE
     char16_t cDelimiter =
         (bIncludesDouble && !bIncludesSingle) ? char16_t('\'') : char16_t('"');
     NS_ENSURE_TRUE(attrString.Append(char16_t('='), mozilla::fallible), false);
     NS_ENSURE_TRUE(attrString.Append(cDelimiter, mozilla::fallible), false);
     nsAutoString sValue(aValue);
     NS_ENSURE_TRUE(sValue.ReplaceSubstring(NS_LITERAL_STRING("&"),
                                            NS_LITERAL_STRING("&amp;"), mozilla::fallible), false);
     if (bIncludesDouble && bIncludesSingle) {
--- a/dom/bindings/BindingUtils.h
+++ b/dom/bindings/BindingUtils.h
@@ -681,16 +681,17 @@ struct JSNativeHolder
 
 struct NamedConstructor
 {
   const char* mName;
   const JSNativeHolder mHolder;
   unsigned mNargs;
 };
 
+// clang-format off
 /*
  * Create a DOM interface object (if constructorClass is non-null) and/or a
  * DOM interface prototype object (if protoClass is non-null).
  *
  * global is used as the parent of the interface object and the interface
  *        prototype object
  * protoProto is the prototype to use for the interface prototype object.
  * interfaceProto is the prototype to use for the interface object.  This can be
@@ -733,16 +734,17 @@ struct NamedConstructor
  *        [PrimaryGlobal] interface, and hence shouldn't define properties on
  *        the prototype object.
  *
  * At least one of protoClass, constructorClass or constructor should be
  * non-null. If constructorClass or constructor are non-null, the resulting
  * interface object will be defined on the given global with property name
  * |name|, which must also be non-null.
  */
+// clang-format on
 void
 CreateInterfaceObjects(JSContext* cx, JS::Handle<JSObject*> global,
                        JS::Handle<JSObject*> protoProto,
                        const js::Class* protoClass, JS::Heap<JSObject*>* protoCache,
                        const char* toStringTag,
                        JS::Handle<JSObject*> interfaceProto,
                        const js::Class* constructorClass,
                        unsigned ctorNargs, const NamedConstructor* namedConstructors,
--- a/dom/browser-element/BrowserElementParent.h
+++ b/dom/browser-element/BrowserElementParent.h
@@ -34,21 +34,24 @@ class TabParent;
  * the JS and C++ parts are completely separate.
  */
 class BrowserElementParent
 {
 public:
 
   /**
    * Possible results from a window.open call.
-   * ADDED     - The frame was added to a document (i.e. handled by the embedder).
-   * IGNORED   - The frame was not added to a document and the embedder didn't
-   *             call preventDefault() to prevent the platform from handling the call.
+   * ADDED     - The frame was added to a document (i.e. handled by the
+   *             embedder).
+   * IGNORED   - The frame was not added to a document and the embedder
+   *             didn't call preventDefault() to prevent the platform from
+   *             handling the call.
    * CANCELLED - The frame was not added to a document, but the embedder still
-   *             called preventDefault() to prevent the platform from handling the call.
+   *             called preventDefault() to prevent the platform from handling
+   *             the call.
    */
 
   enum OpenWindowResult {
     OPEN_WINDOW_ADDED,
     OPEN_WINDOW_IGNORED,
     OPEN_WINDOW_CANCELLED
   };
 
--- a/dom/canvas/CanvasRenderingContext2D.cpp
+++ b/dom/canvas/CanvasRenderingContext2D.cpp
@@ -4866,20 +4866,23 @@ CanvasRenderingContext2D::CachedSurfaceF
   res.mIsWriteOnly = false;
   res.mImageRequest = imgRequest.forget();
 
   return res;
 }
 
 // drawImage(in HTMLImageElement image, in float dx, in float dy);
 //   -- render image from 0,0 at dx,dy top-left coords
-// drawImage(in HTMLImageElement image, in float dx, in float dy, in float dw, in float dh);
+// drawImage(in HTMLImageElement image, in float dx, in float dy, in float dw,
+//           in float dh);
 //   -- render image from 0,0 at dx,dy top-left coords clipping it to dw,dh
-// drawImage(in HTMLImageElement image, in float sx, in float sy, in float sw, in float sh, in float dx, in float dy, in float dw, in float dh);
-//   -- render the region defined by (sx,sy,sw,wh) in image-local space into the region (dx,dy,dw,dh) on the canvas
+// drawImage(in HTMLImageElement image, in float sx, in float sy, in float sw,
+//           in float sh, in float dx, in float dy, in float dw, in float dh);
+//   -- render the region defined by (sx,sy,sw,wh) in image-local space into the
+//      region (dx,dy,dw,dh) on the canvas
 
 // If only dx and dy are passed in then optional_argc should be 0. If only
 // dx, dy, dw and dh are passed in then optional_argc should be 2. The only
 // other valid value for optional_argc is 6 if sx, sy, sw, sh, dx, dy, dw and dh
 // are all passed in.
 
 void
 CanvasRenderingContext2D::DrawImage(const CanvasImageSource& aImage,
--- a/dom/canvas/WebGL2Context.h
+++ b/dom/canvas/WebGL2Context.h
@@ -301,18 +301,20 @@ public:
         VertexAttribI4ui(index, itr[0], itr[1], itr[2], itr[3]);
     }
 
     // -------------------------------------------------------------------------
     // Writing to the drawing buffer
 
     /* Implemented in WebGLContext
     void VertexAttribDivisor(GLuint index, GLuint divisor);
-    void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count, GLsizei instanceCount);
-    void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type, GLintptr offset, GLsizei instanceCount);
+    void DrawArraysInstanced(GLenum mode, GLint first, GLsizei count,
+                             GLsizei instanceCount);
+    void DrawElementsInstanced(GLenum mode, GLsizei count, GLenum type,
+                               GLintptr offset, GLsizei instanceCount);
     */
 
     void DrawRangeElements(GLenum mode, GLuint start, GLuint end, GLsizei count,
                            GLenum type, WebGLintptr byteOffset)
     {
         const FuncScope funcScope(*this, "drawRangeElements");
         if (IsContextLost())
             return;
@@ -406,17 +408,18 @@ public:
     GetTransformFeedbackVarying(const WebGLProgram& program, GLuint index);
 
 
     // -------------------------------------------------------------------------
     // Uniform Buffer Objects and Transform Feedback Buffers - WebGL2ContextUniforms.cpp
     // TODO(djg): Implemented in WebGLContext
 /*
     void BindBufferBase(GLenum target, GLuint index, WebGLBuffer* buffer);
-    void BindBufferRange(GLenum target, GLuint index, WebGLBuffer* buffer, GLintptr offset, GLsizeiptr size);
+    void BindBufferRange(GLenum target, GLuint index, WebGLBuffer* buffer,
+                         GLintptr offset, GLsizeiptr size);
 */
     virtual JS::Value GetParameter(JSContext* cx, GLenum pname, ErrorResult& rv) override;
     // Make the inline version from the superclass visible here.
     using WebGLContext::GetParameter;
     void GetIndexedParameter(JSContext* cx, GLenum target, GLuint index,
                              JS::MutableHandleValue retval, ErrorResult& rv);
     void GetUniformIndices(const WebGLProgram& program,
                            const dom::Sequence<nsString>& uniformNames,
--- a/dom/canvas/WebGLContext.cpp
+++ b/dom/canvas/WebGLContext.cpp
@@ -1595,28 +1595,29 @@ public:
 
 void
 WebGLContext::EnqueueUpdateContextLossStatus()
 {
     nsCOMPtr<nsIRunnable> task = new UpdateContextLossStatusTask(this);
     NS_DispatchToCurrentThread(task);
 }
 
-// We use this timer for many things. Here are the things that it is activated for:
+// We use this timer for many things. Here are the things that it is activated
+// for:
 // 1) If a script is using the MOZ_WEBGL_lose_context extension.
 // 2) If we are using EGL and _NOT ANGLE_, we query periodically to see if the
 //    CONTEXT_LOST_WEBGL error has been triggered.
 // 3) If we are using ANGLE, or anything that supports ARB_robustness, query the
 //    GPU periodically to see if the reset status bit has been set.
 // In all of these situations, we use this timer to send the script context lost
-// and restored events asynchronously. For example, if it triggers a context loss,
-// the webglcontextlost event will be sent to it the next time the robustness timer
-// fires.
-// Note that this timer mechanism is not used unless one of these 3 criteria
-// are met.
+// and restored events asynchronously. For example, if it triggers a context
+// loss, the webglcontextlost event will be sent to it the next time the
+// robustness timer fires.
+// Note that this timer mechanism is not used unless one of these 3 criteria are
+// met.
 // At a bare minimum, from context lost to context restores, it would take 3
 // full timer iterations: detection, webglcontextlost, webglcontextrestored.
 void
 WebGLContext::UpdateContextLossStatus()
 {
     if (!mCanvasElement && !mOffscreenCanvas) {
         // the canvas is gone. That happens when the page was closed before we got
         // this timer event. In this case, there's nothing to do here, just don't crash.
--- a/dom/canvas/WebGLContextGL.cpp
+++ b/dom/canvas/WebGLContextGL.cpp
@@ -1700,18 +1700,18 @@ WebGLContext::ReadPixelsImpl(GLint x, GL
         DoReadPixelsAndConvert(srcFormat->format, x, y, width, height, packFormat,
                                packType, dest, dataLen, rowStride);
         return;
     }
 
     // Read request contains out-of-bounds pixels. Unfortunately:
     // GLES 3.0.4 p194 "Obtaining Pixels from the Framebuffer":
     // "If any of these pixels lies outside of the window allocated to the current GL
-    //  context, or outside of the image attached to the currently bound framebuffer
-    //  object, then the values obtained for those pixels are undefined."
+    // context, or outside of the image attached to the currently bound framebuffer
+    // object, then the values obtained for those pixels are undefined."
 
     // This is a slow-path, so warn people away!
     GenerateWarning("Out-of-bounds reads with readPixels are deprecated, and"
                     " may be slow.");
 
     ////////////////////////////////////
     // Read only the in-bounds pixels.
 
--- a/dom/canvas/WebGLExtensionCompressedTextureES3.cpp
+++ b/dom/canvas/WebGLExtensionCompressedTextureES3.cpp
@@ -15,21 +15,21 @@ WebGLExtensionCompressedTextureES3::WebG
     : WebGLExtensionBase(webgl)
 {
     // GLES 3.0.4, p147, table 3.19
     // GLES 3.0.4, p286+, $C.1 "ETC Compressed Texture Image Formats"
     // Note that all compressed texture formats are filterable:
     // GLES 3.0.4 p161:
     // "[A] texture is complete unless any of the following conditions hold true:
     //  [...]
-    //  * The effective internal format specified for the texture arrays is a sized
-    //    internal color format that is not texture-filterable (see table 3.13) and [the
-    //    mag filter requires filtering]."
-    // Compressed formats are not sized internal color formats, and indeed they are not
-    // listed in table 3.13.
+    //  * The effective internal format specified for the texture arrays is a
+    //    sized internal color format that is not texture-filterable (see table
+    //    3.13) and [the mag filter requires filtering]."
+    // Compressed formats are not sized internal color formats, and indeed they
+    // are not listed in table 3.13.
 
     RefPtr<WebGLContext> webgl_ = webgl; // Bug 1201275
     const auto fnAdd = [&webgl_](GLenum sizedFormat, webgl::EffectiveFormat effFormat) {
         auto& fua = webgl_->mFormatUsage;
 
         auto usage = fua->EditUsage(effFormat);
         usage->isFilterable = true;
         fua->AllowSizedTexFormat(sizedFormat, usage);
--- a/dom/canvas/WebGLFormats.cpp
+++ b/dom/canvas/WebGLFormats.cpp
@@ -1077,17 +1077,17 @@ FormatUsageAuthority::CreateForWebGL2(gl
     fnAllowES3TexFormat(FOO(DEPTH_COMPONENT32F), true, false);
     fnAllowES3TexFormat(FOO(DEPTH24_STENCIL8  ), true, false);
     fnAllowES3TexFormat(FOO(DEPTH32F_STENCIL8 ), true, false);
 
 #undef FOO
 
     // GLES 3.0.4, p206, "Required Renderbuffer Formats":
     // "Implementations are also required to support STENCIL_INDEX8. Requesting this
-    //  internal format for a renderbuffer will allocate at least 8 stencil bit planes."
+    // internal format for a renderbuffer will allocate at least 8 stencil bit planes."
 
     auto usage = ptr->EditUsage(EffectiveFormat::STENCIL_INDEX8);
     usage->SetRenderable();
     ptr->AllowRBFormat(LOCAL_GL_STENCIL_INDEX8, usage);
 
     ////////////////
     // Legacy formats
 
--- a/dom/canvas/WebGLFramebuffer.cpp
+++ b/dom/canvas/WebGLFramebuffer.cpp
@@ -260,24 +260,24 @@ JS::Value
 WebGLFBAttachPoint::GetParameter(WebGLContext* webgl, JSContext* cx,
                                  GLenum target, GLenum attachment, GLenum pname,
                                  ErrorResult* const out_error) const
 {
     if (!HasAttachment()) {
         // Divergent between GLES 3 and 2.
 
         // GLES 2.0.25 p127:
-        // "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then querying any
-        //  other pname will generate INVALID_ENUM."
+        //   "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, then querying any
+        //   other pname will generate INVALID_ENUM."
 
         // GLES 3.0.4 p240:
-        // "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no framebuffer is
-        //  bound to target. In this case querying pname
-        //  FRAMEBUFFER_ATTACHMENT_OBJECT_NAME will return zero, and all other queries
-        //  will generate an INVALID_OPERATION error."
+        //   "If the value of FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE is NONE, no framebuffer is
+        //   bound to target. In this case querying pname
+        //   FRAMEBUFFER_ATTACHMENT_OBJECT_NAME will return zero, and all other queries
+        //   will generate an INVALID_OPERATION error."
         switch (pname) {
         case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE:
             return JS::Int32Value(LOCAL_GL_NONE);
 
         case LOCAL_GL_FRAMEBUFFER_ATTACHMENT_OBJECT_NAME:
             if (webgl->IsWebGL2())
                 return JS::NullValue();
 
@@ -1088,23 +1088,23 @@ WebGLFramebuffer::DrawBuffers(const dom:
         return;
     }
 
     std::vector<const WebGLFBAttachPoint*> newColorDrawBuffers;
     newColorDrawBuffers.reserve(buffers.Length());
 
     for (size_t i = 0; i < buffers.Length(); i++) {
         // "If the GL is bound to a draw framebuffer object, the `i`th buffer listed in
-        //  bufs must be COLOR_ATTACHMENTi or NONE. Specifying a buffer out of order,
-        //  BACK, or COLOR_ATTACHMENTm where `m` is greater than or equal to the value of
+        // bufs must be COLOR_ATTACHMENTi or NONE. Specifying a buffer out of order,
+        // BACK, or COLOR_ATTACHMENTm where `m` is greater than or equal to the value of
         // MAX_COLOR_ATTACHMENTS, will generate the error INVALID_OPERATION.
 
         // WEBGL_draw_buffers:
         // "The value of the MAX_COLOR_ATTACHMENTS_WEBGL parameter must be greater than or
-        //  equal to that of the MAX_DRAW_BUFFERS_WEBGL parameter."
+        // equal to that of the MAX_DRAW_BUFFERS_WEBGL parameter."
         // This means that if buffers.Length() isn't larger than MaxDrawBuffers, it won't
         // be larger than MaxColorAttachments.
         const auto& cur = buffers[i];
         if (cur == LOCAL_GL_COLOR_ATTACHMENT0 + i) {
             const auto& attach = mColorAttachments[i];
             newColorDrawBuffers.push_back(&attach);
         } else if (cur != LOCAL_GL_NONE) {
             const bool isColorEnum = (cur >= LOCAL_GL_COLOR_ATTACHMENT0 &&
--- a/dom/canvas/WebGLShaderValidator.cpp
+++ b/dom/canvas/WebGLShaderValidator.cpp
@@ -117,17 +117,17 @@ ShaderOutput(gl::GLContext* gl)
         case 400: return SH_GLSL_400_CORE_OUTPUT;
         case 410: return SH_GLSL_410_CORE_OUTPUT;
         case 420: return SH_GLSL_420_CORE_OUTPUT;
         case 430: return SH_GLSL_430_CORE_OUTPUT;
         case 440: return SH_GLSL_440_CORE_OUTPUT;
         default:
             if (version >= 450) {
                 // "OpenGL 4.6 is also guaranteed to support all previous versions of the
-                //  OpenGL Shading Language back to version 1.10."
+                // OpenGL Shading Language back to version 1.10."
                 return SH_GLSL_450_CORE_OUTPUT;
             }
             gfxCriticalNote << "Unexpected GLSL version: " << version;
         }
     }
 
     return SH_GLSL_COMPATIBILITY_OUTPUT;
 }
--- a/dom/canvas/WebGLTexture.cpp
+++ b/dom/canvas/WebGLTexture.cpp
@@ -162,27 +162,27 @@ WebGLTexture::IsMipAndCubeComplete(const
 
     // Reference dimensions based on baseLevel.
     auto ref = BaseImageInfo();
     MOZ_ASSERT(ref.mWidth && ref.mHeight && ref.mDepth);
 
     for (auto level = mBaseMipmapLevel; level <= maxLevel; ++level) {
         // GLES 3.0.4, p161
         // "A cube map texture is mipmap complete if each of the six texture images,
-        //  considered individually, is mipmap complete."
+        // considered individually, is mipmap complete."
 
         for (uint8_t face = 0; face < mFaceCount; face++) {
             auto& cur = ImageInfoAtFace(face, level);
 
-            // "* The set of mipmap arrays `level_base` through `q` (where `q` is defined
-            //    the "Mipmapping" discussion of section 3.8.10) were each specified with
-            //    the same effective internal format."
+            // "* The set of mipmap arrays `level_base` through `q` (where `q`
+            //    is defined the "Mipmapping" discussion of section 3.8.10) were
+            //    each specified with the same effective internal format."
 
-            // "* The dimensions of the arrays follow the sequence described in the
-            //    "Mipmapping" discussion of section 3.8.10."
+            // "* The dimensions of the arrays follow the sequence described in
+            //    the "Mipmapping" discussion of section 3.8.10."
 
             if (cur.mWidth != ref.mWidth ||
                 cur.mHeight != ref.mHeight ||
                 cur.mDepth != ref.mDepth ||
                 cur.mFormat != ref.mFormat)
             {
                 return false;
             }
@@ -334,32 +334,32 @@ WebGLTexture::CalcSampleableInfo(const W
 
     const bool isMinFilteringNearest = (minFilter == LOCAL_GL_NEAREST ||
                                         minFilter == LOCAL_GL_NEAREST_MIPMAP_NEAREST);
     const bool isMagFilteringNearest = (magFilter == LOCAL_GL_NEAREST);
     const bool isFilteringNearestOnly = (isMinFilteringNearest && isMagFilteringNearest);
     if (!isFilteringNearestOnly) {
         bool isFilterable = completeness->usage->isFilterable;
 
-        // "* The effective internal format specified for the texture arrays is a sized
-        //    internal depth or depth and stencil format, the value of
+        // "* The effective internal format specified for the texture arrays is a
+        //    sized internal depth or depth and stencil format, the value of
         //    TEXTURE_COMPARE_MODE is NONE[1], and either the magnification filter is not
         //    NEAREST, or the minification filter is neither NEAREST nor
         //    NEAREST_MIPMAP_NEAREST."
-        // [1]: This sounds suspect, but is explicitly noted in the change log for GLES
-        //      3.0.1:
-        //      "* Clarify that a texture is incomplete if it has a depth component, no
-        //         shadow comparison, and linear filtering (also Bug 9481)."
+        // [1]: This sounds suspect, but is explicitly noted in the change log for
+        //      GLES 3.0.1:
+        //      "* Clarify that a texture is incomplete if it has a depth component,
+        //         no shadow comparison, and linear filtering (also Bug 9481)."
         // In short, depth formats are not filterable, but shadow-samplers are.
         if (ret->isDepthTexCompare) {
             isFilterable = true;
         }
 
-        // "* The effective internal format specified for the texture arrays is a sized
-        //    internal color format that is not texture-filterable, and either the
+        // "* The effective internal format specified for the texture arrays is a
+        //    sized internal color format that is not texture-filterable, and either the
         //    magnification filter is not NEAREST or the minification filter is neither
         //    NEAREST nor NEAREST_MIPMAP_NEAREST."
         // Since all (GLES3) unsized color formats are filterable just like their sized
         // equivalents, we don't have to care whether its sized or not.
         if (!isFilterable) {
             ret->incompleteReason = "Minification or magnification filtering is not"
                                     " NEAREST or NEAREST_MIPMAP_NEAREST, and the"
                                     " texture's format is not \"texture-filterable\".";
@@ -372,44 +372,44 @@ WebGLTexture::CalcSampleableInfo(const W
     // vertex shaders, as noted on GLES 2.0.25, p41.
     if (!mContext->IsWebGL2() &&
         !completeness->powerOfTwo)
     {
         // GLES 2.0.25, p87-88:
         // "Calling a sampler from a fragment shader will return (R,G,B,A)=(0,0,0,1) if
         //  any of the following conditions are true:"
 
-        // "* A two-dimensional sampler is called, the minification filter is one that
-        //    requires a mipmap[...], and the sampler's associated texture object is not
+        // "* A two-dimensional sampler is called, the minification filter is one
+        //    that requires a mipmap[...], and the sampler's associated texture object is not
         //    complete[.]"
         // (already covered)
 
-        // "* A two-dimensional sampler is called, the minification filter is not one that
-        //    requires a mipmap (either NEAREST nor[sic] LINEAR), and either dimension of
+        // "* A two-dimensional sampler is called, the minification filter is
+        //    not one that requires a mipmap (either NEAREST nor[sic] LINEAR), and either dimension of
         //    the level zero array of the associated texture object is not positive."
         // (already covered)
 
-        // "* A two-dimensional sampler is called, the corresponding texture image is a
-        //    non-power-of-two image[...], and either the texture wrap mode is not
+        // "* A two-dimensional sampler is called, the corresponding texture
+        //    image is a non-power-of-two image[...], and either the texture wrap mode is not
         //    CLAMP_TO_EDGE, or the minification filter is neither NEAREST nor LINEAR."
 
-        // "* A cube map sampler is called, any of the corresponding texture images are
-        //    non-power-of-two images, and either the texture wrap mode is not
+        // "* A cube map sampler is called, any of the corresponding texture
+        //    images are non-power-of-two images, and either the texture wrap mode is not
         //    CLAMP_TO_EDGE, or the minification filter is neither NEAREST nor LINEAR."
         // "either the texture wrap mode is not CLAMP_TO_EDGE"
         if (sampling->wrapS != LOCAL_GL_CLAMP_TO_EDGE ||
             sampling->wrapT != LOCAL_GL_CLAMP_TO_EDGE)
         {
             ret->incompleteReason = "Non-power-of-two textures must have a wrap mode of"
                                     " CLAMP_TO_EDGE.";
             return ret;
         }
 
-        // "* A cube map sampler is called, and either the corresponding cube map texture
-        //    image is not cube complete, or TEXTURE_MIN_FILTER is one that requires a
+        // "* A cube map sampler is called, and either the corresponding cube
+        //    map texture image is not cube complete, or TEXTURE_MIN_FILTER is one that requires a
         //    mipmap and the texture is not mipmap cube complete."
         // (already covered)
     }
 
     // Mark complete.
     ret->incompleteReason = nullptr;    // NB: incompleteReason is also null for undefined
     ret->levels = completeness->levels; //   textures.
     ret->usage = completeness->usage;
@@ -733,18 +733,18 @@ WebGLTexture::BindTexture(TexTarget texT
 
     return true;
 }
 
 void
 WebGLTexture::GenerateMipmap()
 {
     // GLES 3.0.4 p160:
-    // "Mipmap generation replaces texel array levels level base + 1 through q with arrays
-    //  derived from the level base array, regardless of their previous contents. All
+    // "Mipmap generation replaces texel array levels level base + 1 through q
+    //  with arrrays derived from the level base array, regardless of their previous contents. All
     //  other mipmap arrays, including the level base array, are left unchanged by this
     //  computation."
     // But only check and init the base level.
     const bool ensureInit = true;
     const bool skipMips = true;
     const auto completeness = CalcCompletenessInfo(ensureInit, skipMips);
     if (!completeness || !completeness->levels) {
         mContext->ErrorInvalidOperation("The texture's base level must be complete.");
--- a/dom/canvas/WebGLTextureUpload.cpp
+++ b/dom/canvas/WebGLTextureUpload.cpp
@@ -28,40 +28,43 @@
 #include "WebGLTexelConversions.h"
 
 namespace mozilla {
 
 /* This file handles:
  * TexStorage2D(texTarget, levels, internalFormat, width, height)
  * TexStorage3D(texTarget, levels, intenralFormat, width, height, depth)
  *
- * TexImage2D(texImageTarget, level, internalFormat, width, height, border, unpackFormat,
- *            unpackType, data)
- * TexImage3D(texImageTarget, level, internalFormat, width, height, depth, border,
+ * TexImage2D(texImageTarget, level, internalFormat, width, height, border,
  *            unpackFormat, unpackType, data)
- * TexSubImage2D(texImageTarget, level, xOffset, yOffset, width, height, unpackFormat,
- *               unpackType, data)
- * TexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset, width, height, depth,
+ * TexImage3D(texImageTarget, level, internalFormat, width, height, depth,
+ *            border, unpackFormat, unpackType, data)
+ * TexSubImage2D(texImageTarget, level, xOffset, yOffset, width, height,
  *               unpackFormat, unpackType, data)
+ * TexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset, width,
+ *               height, depth, unpackFormat, unpackType, data)
  *
- * CompressedTexImage2D(texImageTarget, level, internalFormat, width, height, border,
- *                      imageSize, data)
- * CompressedTexImage3D(texImageTarget, level, internalFormat, width, height, depth,
+ * CompressedTexImage2D(texImageTarget, level, internalFormat, width, height,
  *                      border, imageSize, data)
- * CompressedTexSubImage2D(texImageTarget, level, xOffset, yOffset, width, height,
- *                         sizedUnpackFormat, imageSize, data)
- * CompressedTexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset, width,
- *                         height, depth, sizedUnpackFormat, imageSize, data)
+ * CompressedTexImage3D(texImageTarget, level, internalFormat, width, height,
+ *                      depth, border, imageSize, data)
+ * CompressedTexSubImage2D(texImageTarget, level, xOffset, yOffset, width,
+ *                         height, sizedUnpackFormat, imageSize, data)
+ * CompressedTexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset,
+ *                         width, height, depth, sizedUnpackFormat, imageSize,
+ *                         data)
  *
- * CopyTexImage2D(texImageTarget, level, internalFormat, x, y, width, height, border)
- * CopyTexImage3D - "Because the framebuffer is inhererntly two-dimensional, there is no
- *                   CopyTexImage3D command."
- * CopyTexSubImage2D(texImageTarget, level, xOffset, yOffset, x, y, width, height)
- * CopyTexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset, x, y, width,
+ * CopyTexImage2D(texImageTarget, level, internalFormat, x, y, width, height,
+ *                border)
+ * CopyTexImage3D - "Because the framebuffer is inhererntly two-dimensional,
+ *                   there is no CopyTexImage3D command."
+ * CopyTexSubImage2D(texImageTarget, level, xOffset, yOffset, x, y, width,
  *                   height)
+ * CopyTexSubImage3D(texImageTarget, level, xOffset, yOffset, zOffset, x, y,
+ *                   width, height)
  */
 
 static bool
 ValidateExtents(WebGLContext* webgl, GLsizei width, GLsizei height,
                 GLsizei depth, GLint border, uint32_t* const out_width,
                 uint32_t* const out_height, uint32_t* const out_depth)
 {
     // Check border
@@ -242,17 +245,17 @@ FromImageBitmap(WebGLContext* webgl, Tex
     }
 
     if (!height) {
         height = surf->GetSize().height;
     }
 
     // WhatWG "HTML Living Standard" (30 October 2015):
     // "The getImageData(sx, sy, sw, sh) method [...] Pixels must be returned as
-    //  non-premultiplied alpha values."
+    // non-premultiplied alpha values."
     return MakeUnique<webgl::TexUnpackSurface>(webgl, target, width, height, depth, surf,
                                                cloneData->mAlphaType);
 }
 
 static UniquePtr<webgl::TexUnpackBlob>
 FromImageData(WebGLContext* webgl, TexImageTarget target,
               uint32_t width, uint32_t height, uint32_t depth,
               const dom::ImageData& imageData, dom::Uint8ClampedArray* scopedArr)
@@ -265,17 +268,17 @@ FromImageData(WebGLContext* webgl, TexIm
     const void* const data = scopedArr->Data();
 
     const gfx::IntSize size(imageData.Width(), imageData.Height());
     const size_t stride = size.width * 4;
     const gfx::SurfaceFormat surfFormat = gfx::SurfaceFormat::R8G8B8A8;
 
     // WhatWG "HTML Living Standard" (30 October 2015):
     // "The getImageData(sx, sy, sw, sh) method [...] Pixels must be returned as
-    //  non-premultiplied alpha values."
+    // non-premultiplied alpha values."
     const auto alphaType = gfxAlphaType::NonPremult;
 
     MOZ_ASSERT(dataSize == stride * size.height);
 
     uint8_t* wrappableData = (uint8_t*)data;
 
     const RefPtr<gfx::DataSourceSurface> surf =
         gfx::Factory::CreateWrappingDataSourceSurface(wrappableData, stride, size,
@@ -589,17 +592,17 @@ WebGLTexture::ValidateTexImageSpecificat
         maxWidthHeight = mContext->mGLMax3DTextureSize >> level;
         maxDepth = maxWidthHeight;
         maxLevel = CeilingLog2(mContext->mGLMax3DTextureSize);
         break;
 
     case LOCAL_GL_TEXTURE_2D_ARRAY:
         maxWidthHeight = mContext->mGLMaxTextureSize >> level;
         // "The maximum number of layers for two-dimensional array textures (depth)
-        //  must be at least MAX_ARRAY_TEXTURE_LAYERS for all levels."
+        // must be at least MAX_ARRAY_TEXTURE_LAYERS for all levels."
         maxDepth = mContext->mGLMaxArrayTextureLayers;
         maxLevel = CeilingLog2(mContext->mGLMaxTextureSize);
         break;
 
     default: // cube maps
         MOZ_ASSERT(IsCubeMap());
         maxWidthHeight = mContext->mGLMaxCubeMapTextureSize >> level;
         maxDepth = 1;
@@ -1018,19 +1021,19 @@ ValidateCompressedTexImageRestrictions(W
 }
 
 static bool
 ValidateTargetForFormat(WebGLContext* webgl, TexImageTarget target,
                         const webgl::FormatInfo* format)
 {
     // GLES 3.0.4 p127:
     // "Textures with a base internal format of DEPTH_COMPONENT or DEPTH_STENCIL are
-    //  supported by texture image specification commands only if `target` is TEXTURE_2D,
-    //  TEXTURE_2D_ARRAY, or TEXTURE_CUBE_MAP. Using these formats in conjunction with any
-    //  other `target` will result in an INVALID_OPERATION error."
+    // supported by texture image specification commands only if `target` is TEXTURE_2D,
+    // TEXTURE_2D_ARRAY, or TEXTURE_CUBE_MAP. Using these formats in conjunction with any
+    // other `target` will result in an INVALID_OPERATION error."
     const bool ok = [&]() {
         if (bool(format->d) & (target == LOCAL_GL_TEXTURE_3D))
             return false;
 
         if (format->compression) {
             switch (format->compression->family) {
             case webgl::CompressionFamily::ES3:
             case webgl::CompressionFamily::S3TC:
--- a/dom/canvas/gtest/TestImageBitmapColorUtils.cpp
+++ b/dom/canvas/gtest/TestImageBitmapColorUtils.cpp
@@ -603,19 +603,20 @@ TEST(ImageBitmapColorUtils, RGB24ToBGRA3
 //  yuvPixel[2] = v;
 //
 //  int rv = libyuv::I420ToABGR(yuvPixel + 0, 1,
 //                              yuvPixel + 1, 1,
 //                              yuvPixel + 2, 1,
 //                              rgbaPixel, 4,
 //                              1, 1);
 //
-//  printf_stderr("\nlibyuv: (%hhu, %hhu, %hhu) --> (%hhu, %hhu, %hhu, %hhu) \n",
-//                yuvPixel[0], yuvPixel[1], yuvPixel[2],
-//                rgbaPixel[0], rgbaPixel[1], rgbaPixel[2], rgbaPixel[3]);
+//  printf_stderr(
+//    "\nlibyuv: (%hhu, %hhu, %hhu) --> (%hhu, %hhu, %hhu, %hhu) \n",
+//    yuvPixel[0], yuvPixel[1], yuvPixel[2],
+//    gbaPixel[0], rgbaPixel[1], rgbaPixel[2], rgbaPixel[3]);
 //}
 
 TEST(ImageBitmapColorUtils, RGB24ToYUV444P)
 {
   const RGB24Data srcData;
   const YUV444PData dstData;
 
   YUVImage result_(srcData.mWidth, srcData.mHeight, srcData.mStride,
--- a/dom/crypto/WebCryptoCommon.h
+++ b/dom/crypto/WebCryptoCommon.h
@@ -105,17 +105,19 @@
 #define UNKNOWN_CK_MECHANISM        CKM_VENDOR_DEFINED+1
 
 // python security/pkix/tools/DottedOIDToCode.py id-ecDH 1.3.132.112
 static const uint8_t id_ecDH[] = { 0x2b, 0x81, 0x04, 0x70 };
 const SECItem SEC_OID_DATA_EC_DH = { siBuffer, (unsigned char*)id_ecDH,
                                      static_cast<unsigned int>(
                                        mozilla::ArrayLength(id_ecDH)) };
 
+// clang-format off
 // python security/pkix/tools/DottedOIDToCode.py dhKeyAgreement 1.2.840.113549.1.3.1
+// clang-format on
 static const uint8_t dhKeyAgreement[] = {
   0x2a, 0x86, 0x48, 0x86, 0xf7, 0x0d, 0x01, 0x03, 0x01
 };
 const SECItem SEC_OID_DATA_DH_KEY_AGREEMENT = { siBuffer,
                                                 (unsigned char*)dhKeyAgreement,
                                                 static_cast<unsigned int>(
                                                   mozilla::ArrayLength(dhKeyAgreement)) };
 
--- a/dom/events/KeyboardEvent.cpp
+++ b/dom/events/KeyboardEvent.cpp
@@ -400,18 +400,18 @@ KeyboardEvent::InitKeyboardEventJS(const
 bool
 KeyboardEvent::ShouldResistFingerprinting(CallerType aCallerType)
 {
   // There are five situations we don't need to spoof this keyboard event.
   //   1. This event is initialized by scripts.
   //   2. This event is from Numpad.
   //   3. This event is in the system group.
   //   4. The caller type is system.
-  //   5. The pref privcy.resistFingerprinting' is false, we fast return here since
-  //      we don't need to do any QI of following codes.
+  //   5. The pref privcy.resistFingerprinting' is false, we fast return here
+  //      since we don't need to do any QI of following codes.
   if (mInitializedByJS ||
       aCallerType == CallerType::System ||
       mEvent->mFlags.mInSystemGroup ||
       !nsContentUtils::ShouldResistFingerprinting() ||
       mEvent->AsKeyboardEvent()->mLocation ==
         KeyboardEvent_Binding::DOM_KEY_LOCATION_NUMPAD) {
     return false;
   }
--- a/dom/fetch/InternalRequest.h
+++ b/dom/fetch/InternalRequest.h
@@ -43,22 +43,26 @@ namespace dom {
  * embed             | TYPE_INTERNAL_EMBED
  * font              | TYPE_FONT
  * image             | TYPE_INTERNAL_IMAGE, TYPE_INTERNAL_IMAGE_PRELOAD,
  *                   | TYPE_IMAGE, TYPE_INTERNAL_IMAGE_FAVICON, TYPE_IMAGESET
  * manifest          | TYPE_WEB_MANIFEST
  * object            | TYPE_INTERNAL_OBJECT, TYPE_OBJECT
  * "paintworklet"    | TODO
  * report"           | TODO
- * script            | TYPE_INTERNAL_SCRIPT, TYPE_INTERNAL_SCRIPT_PRELOAD, TYPE_SCRIPT
- *                   | TYPE_INTERNAL_SERVICE_WORKER, TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS
+ * script            | TYPE_INTERNAL_SCRIPT, TYPE_INTERNAL_SCRIPT_PRELOAD,
+ *                   | TYPE_SCRIPT,
+ *                   | TYPE_INTERNAL_SERVICE_WORKER,
+ *                   | TYPE_INTERNAL_WORKER_IMPORT_SCRIPTS
  * sharedworker      | TYPE_INTERNAL_SHARED_WORKER
- * serviceworker     | The spec lists this as a valid value for the enum,however it
- *                   | is impossible to observe a request with this destination value.
- * style             | TYPE_INTERNAL_STYLESHEET, TYPE_INTERNAL_STYLESHEET_PRELOAD,
+ * serviceworker     | The spec lists this as a valid value for the enum,
+ *                   | however it is impossible to observe a request with this
+ *                   | destination value.
+ * style             | TYPE_INTERNAL_STYLESHEET,
+ *                   | TYPE_INTERNAL_STYLESHEET_PRELOAD,
  *                   | TYPE_STYLESHEET
  * track             | TYPE_INTERNAL_TRACK
  * video             | TYPE_INTERNAL_VIDEO
  * worker            | TYPE_INTERNAL_WORKER
  * xslt              | TYPE_XSLT
  * _empty            | Default for everything else.
  *
  */
--- a/dom/html/HTMLInputElement.cpp
+++ b/dom/html/HTMLInputElement.cpp
@@ -5214,17 +5214,17 @@ HTMLInputElement::ParseWeek(const nsAStr
 
 }
 
 bool
 HTMLInputElement::ParseDate(const nsAString& aValue, uint32_t* aYear,
                             uint32_t* aMonth, uint32_t* aDay) const
 {
 /*
- * Parse the year, month, day values out a date string formatted as 'yyyy-mm-dd'.
+ * Parse the year, month, day values out a date string formatted as yyyy-mm-dd.
  * -The year must be 4 or more digits long, and year > 0
  * -The month must be exactly 2 digits long, and 01 <= month <= 12
  * -The day must be exactly 2 digit long, and 01 <= day <= maxday
  *  Where maxday is the number of days in the month 'month' and year 'year'
  */
   if (aValue.Length() < 10) {
     return false;
   }
--- a/dom/html/HTMLMeterElement.h
+++ b/dom/html/HTMLMeterElement.h
@@ -84,18 +84,20 @@ private:
 
   static const double kDefaultValue;
   static const double kDefaultMin;
   static const double kDefaultMax;
 
   /**
    * Returns the optimum state of the element.
    * NS_EVENT_STATE_OPTIMUM if the actual value is in the optimum region.
-   * NS_EVENT_STATE_SUB_OPTIMUM if the actual value is in the sub-optimal region.
-   * NS_EVENT_STATE_SUB_SUB_OPTIMUM if the actual value is in the sub-sub-optimal region.
+   * NS_EVENT_STATE_SUB_OPTIMUM if the actual value is in the sub-optimal
+   *                            region.
+   * NS_EVENT_STATE_SUB_SUB_OPTIMUM if the actual value is in the
+   *                                sub-sub-optimal region.
    *
    * @return the optimum state of the element.
    */
   EventStates GetOptimumState() const;
 };
 
 } // namespace dom
 } // namespace mozilla
--- a/dom/html/HTMLTableElement.cpp
+++ b/dom/html/HTMLTableElement.cpp
@@ -14,17 +14,17 @@
 #include "nsContentUtils.h"
 #include "jsfriendapi.h"
 
 NS_IMPL_NS_NEW_HTML_ELEMENT(Table)
 
 namespace mozilla {
 namespace dom {
 
-/* ------------------------------ TableRowsCollection -------------------------------- */
+/* ------------------------- TableRowsCollection --------------------------- */
 /**
  * This class provides a late-bound collection of rows in a table.
  * mParent is NOT ref-counted to avoid circular references
  */
 class TableRowsCollection final : public nsIHTMLCollection
                                 , public nsStubMutationObserver
                                 , public nsWrapperCache
 {