Bug 1424548 - Part 9a: clang-format generated HTML parser code. r=hsivonen
authorChris Peterson <cpeterson@mozilla.com>
Thu, 21 Dec 2017 00:02:43 -0800
changeset 397346 9874df8448d800bfb874741b0c183f45b9dcfca6
parent 397345 7516d49fc7317f7bfa60e5634cd9e381027775db
child 397347 091d01097937d8a543f5bf1242533e4ac42e1c64
push id33133
push usershindli@mozilla.com
push dateFri, 22 Dec 2017 21:42:06 +0000
treeherdermozilla-central@10aa75f277af [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewershsivonen
bugs1424548
milestone59.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 1424548 - Part 9a: clang-format generated HTML parser code. r=hsivonen
parser/html/nsHtml5AttributeName.cpp
parser/html/nsHtml5AttributeName.h
parser/html/nsHtml5ElementName.cpp
parser/html/nsHtml5ElementName.h
parser/html/nsHtml5MetaScanner.cpp
parser/html/nsHtml5MetaScanner.h
parser/html/nsHtml5Portability.h
parser/html/nsHtml5StackNode.cpp
parser/html/nsHtml5StackNode.h
parser/html/nsHtml5StateSnapshot.cpp
parser/html/nsHtml5StateSnapshot.h
parser/html/nsHtml5Tokenizer.cpp
parser/html/nsHtml5Tokenizer.h
parser/html/nsHtml5TreeBuilder.cpp
parser/html/nsHtml5TreeBuilder.h
parser/html/nsHtml5UTF16Buffer.h
--- a/parser/html/nsHtml5AttributeName.cpp
+++ b/parser/html/nsHtml5AttributeName.cpp
@@ -57,47 +57,47 @@
 int32_t* nsHtml5AttributeName::ALL_NO_NS = 0;
 int32_t* nsHtml5AttributeName::XMLNS_NS = 0;
 int32_t* nsHtml5AttributeName::XML_NS = 0;
 int32_t* nsHtml5AttributeName::XLINK_NS = 0;
 nsAtom** nsHtml5AttributeName::ALL_NO_PREFIX = 0;
 nsAtom** nsHtml5AttributeName::XMLNS_PREFIX = 0;
 nsAtom** nsHtml5AttributeName::XLINK_PREFIX = 0;
 nsAtom** nsHtml5AttributeName::XML_PREFIX = 0;
-nsAtom** 
+nsAtom**
 nsHtml5AttributeName::SVG_DIFFERENT(nsAtom* name, nsAtom* camel)
 {
   nsAtom** arr = new nsAtom*[4];
   arr[0] = name;
   arr[1] = name;
   arr[2] = camel;
   return arr;
 }
 
-nsAtom** 
+nsAtom**
 nsHtml5AttributeName::MATH_DIFFERENT(nsAtom* name, nsAtom* camel)
 {
   nsAtom** arr = new nsAtom*[4];
   arr[0] = name;
   arr[1] = camel;
   arr[2] = name;
   return arr;
 }
 
-nsAtom** 
+nsAtom**
 nsHtml5AttributeName::COLONIFIED_LOCAL(nsAtom* name, nsAtom* suffix)
 {
   nsAtom** arr = new nsAtom*[4];
   arr[0] = name;
   arr[1] = suffix;
   arr[2] = suffix;
   return arr;
 }
 
-nsAtom** 
+nsAtom**
 nsHtml5AttributeName::SAME_LOCAL(nsAtom* name)
 {
   nsAtom** arr = new nsAtom*[4];
   arr[0] = name;
   arr[1] = name;
   arr[2] = name;
   return arr;
 }
@@ -125,42 +125,41 @@ nsHtml5AttributeName::nsHtml5AttributeNa
 nsHtml5AttributeName*
 nsHtml5AttributeName::createAttributeName(nsAtom* name)
 {
   return new nsHtml5AttributeName(nsHtml5AttributeName::ALL_NO_NS,
                                   nsHtml5AttributeName::SAME_LOCAL(name),
                                   ALL_NO_PREFIX);
 }
 
-
 nsHtml5AttributeName::~nsHtml5AttributeName()
 {
   MOZ_COUNT_DTOR(nsHtml5AttributeName);
   delete[] local;
 }
 
-int32_t 
+int32_t
 nsHtml5AttributeName::getUri(int32_t mode)
 {
   return uri[mode];
 }
 
-nsAtom* 
+nsAtom*
 nsHtml5AttributeName::getLocal(int32_t mode)
 {
   return local[mode];
 }
 
-nsAtom* 
+nsAtom*
 nsHtml5AttributeName::getPrefix(int32_t mode)
 {
   return prefix[mode];
 }
 
-bool 
+bool
 nsHtml5AttributeName::equalsAnother(nsHtml5AttributeName* another)
 {
   return this->getLocal(nsHtml5AttributeName::HTML) ==
          another->getLocal(nsHtml5AttributeName::HTML);
 }
 
 nsHtml5AttributeName* nsHtml5AttributeName::ATTR_ALT = nullptr;
 nsHtml5AttributeName* nsHtml5AttributeName::ATTR_DIR = nullptr;
@@ -738,17 +737,20 @@ static int32_t const ATTRIBUTE_HASHES_DA
   1972962123, 1974849131, 1982254612, 1983157559, 1983290011, 1983398182,
   1983432389, 1984430082, 1987422362, 1988784439, 1989522022, 1990107683,
   1991220282, 1991625270, 1993343287, 2000096287, 2000160071, 2000752725,
   2001527900, 2001634458, 2001669449, 2001710298, 2001732764, 2001826027,
   2001898809, 2004846654, 2005342360, 2006459190, 2006824246, 2007021895,
   2007064819, 2008401563, 2009041198, 2009079867, 2009231684, 2010716309,
   2016711994, 2016810187, 2017010843, 2019887833, 2023342821, 2024647008
 };
-staticJArray<int32_t,int32_t> nsHtml5AttributeName::ATTRIBUTE_HASHES = { ATTRIBUTE_HASHES_DATA, MOZ_ARRAY_LENGTH(ATTRIBUTE_HASHES_DATA) };
+staticJArray<int32_t, int32_t> nsHtml5AttributeName::ATTRIBUTE_HASHES = {
+  ATTRIBUTE_HASHES_DATA,
+  MOZ_ARRAY_LENGTH(ATTRIBUTE_HASHES_DATA)
+};
 void
 nsHtml5AttributeName::initializeStatics()
 {
   ALL_NO_NS = new int32_t[3];
   ALL_NO_NS[0] = kNameSpaceID_None;
   ALL_NO_NS[1] = kNameSpaceID_None;
   ALL_NO_NS[2] = kNameSpaceID_None;
   XMLNS_NS = new int32_t[3];
@@ -2896,10 +2898,8 @@ nsHtml5AttributeName::releaseStatics()
   delete ATTR_BY;
   delete ATTR_CY;
   delete ATTR_DY;
   delete ATTR_FY;
   delete ATTR_RY;
   delete ATTR_REFY;
   delete[] ATTRIBUTE_NAMES;
 }
-
-
--- a/parser/html/nsHtml5AttributeName.h
+++ b/parser/html/nsHtml5AttributeName.h
@@ -49,636 +49,638 @@ class nsHtml5StreamParser;
 class nsHtml5ElementName;
 class nsHtml5Tokenizer;
 class nsHtml5TreeBuilder;
 class nsHtml5MetaScanner;
 class nsHtml5UTF16Buffer;
 class nsHtml5StateSnapshot;
 class nsHtml5Portability;
 
-
 class nsHtml5AttributeName
 {
-  public:
-    static int32_t* ALL_NO_NS;
-  private:
-    static int32_t* XMLNS_NS;
-    static int32_t* XML_NS;
-    static int32_t* XLINK_NS;
-  public:
-    static nsAtom** ALL_NO_PREFIX;
+public:
+  static int32_t* ALL_NO_NS;
+
+private:
+  static int32_t* XMLNS_NS;
+  static int32_t* XML_NS;
+  static int32_t* XLINK_NS;
 
-  private:
-    static nsAtom** XMLNS_PREFIX;
-    static nsAtom** XLINK_PREFIX;
-    static nsAtom** XML_PREFIX;
-    static nsAtom** SVG_DIFFERENT(nsAtom* name, nsAtom* camel);
-    static nsAtom** MATH_DIFFERENT(nsAtom* name, nsAtom* camel);
-    static nsAtom** COLONIFIED_LOCAL(nsAtom* name, nsAtom* suffix);
+public:
+  static nsAtom** ALL_NO_PREFIX;
+
+private:
+  static nsAtom** XMLNS_PREFIX;
+  static nsAtom** XLINK_PREFIX;
+  static nsAtom** XML_PREFIX;
+  static nsAtom** SVG_DIFFERENT(nsAtom* name, nsAtom* camel);
+  static nsAtom** MATH_DIFFERENT(nsAtom* name, nsAtom* camel);
+  static nsAtom** COLONIFIED_LOCAL(nsAtom* name, nsAtom* suffix);
 
-  public:
-    static nsAtom** SAME_LOCAL(nsAtom* name);
-    inline static int32_t levelOrderBinarySearch(jArray<int32_t, int32_t> data,
-                                                 int32_t key)
-    {
-      int32_t n = data.length;
-      int32_t i = 0;
-      while (i < n) {
-        int32_t val = data[i];
-        if (val < key) {
-          i = 2 * i + 2;
-        } else if (val > key) {
-          i = 2 * i + 1;
-        } else {
-          return i;
-        }
+public:
+  static nsAtom** SAME_LOCAL(nsAtom* name);
+  inline static int32_t levelOrderBinarySearch(jArray<int32_t, int32_t> data,
+                                               int32_t key)
+  {
+    int32_t n = data.length;
+    int32_t i = 0;
+    while (i < n) {
+      int32_t val = data[i];
+      if (val < key) {
+        i = 2 * i + 2;
+      } else if (val > key) {
+        i = 2 * i + 1;
+      } else {
+        return i;
       }
-      return -1;
     }
+    return -1;
+  }
 
-    inline static nsHtml5AttributeName* nameByBuffer(char16_t* buf,
-                                                     int32_t length,
-                                                     nsHtml5AtomTable* interner)
-    {
-      uint32_t hash = nsHtml5AttributeName::bufToHash(buf, length);
-      jArray<int32_t, int32_t> hashes;
-      hashes = nsHtml5AttributeName::ATTRIBUTE_HASHES;
-      int32_t index = levelOrderBinarySearch(hashes, hash);
-      if (index < 0) {
-        return nullptr;
-      }
-      nsHtml5AttributeName* attributeName =
-        nsHtml5AttributeName::ATTRIBUTE_NAMES[index];
-      nsAtom* name = attributeName->getLocal(0);
-      if (!nsHtml5Portability::localEqualsBuffer(name, buf, length)) {
-        return nullptr;
-      }
-      return attributeName;
+  inline static nsHtml5AttributeName* nameByBuffer(char16_t* buf,
+                                                   int32_t length,
+                                                   nsHtml5AtomTable* interner)
+  {
+    uint32_t hash = nsHtml5AttributeName::bufToHash(buf, length);
+    jArray<int32_t, int32_t> hashes;
+    hashes = nsHtml5AttributeName::ATTRIBUTE_HASHES;
+    int32_t index = levelOrderBinarySearch(hashes, hash);
+    if (index < 0) {
+      return nullptr;
     }
+    nsHtml5AttributeName* attributeName =
+      nsHtml5AttributeName::ATTRIBUTE_NAMES[index];
+    nsAtom* name = attributeName->getLocal(0);
+    if (!nsHtml5Portability::localEqualsBuffer(name, buf, length)) {
+      return nullptr;
+    }
+    return attributeName;
+  }
 
-  private:
-    inline static uint32_t bufToHash(char16_t* buf, int32_t length)
-    {
-      uint32_t len = length;
-      uint32_t first = buf[0];
-      first <<= 19;
-      uint32_t second = 1 << 23;
-      uint32_t third = 0;
-      uint32_t fourth = 0;
-      uint32_t fifth = 0;
-      uint32_t sixth = 0;
-      if (length >= 4) {
-        second = buf[length - 4];
-        second <<= 4;
-        third = buf[1];
-        third <<= 9;
-        fourth = buf[length - 2];
-        fourth <<= 14;
-        fifth = buf[3];
-        fifth <<= 24;
-        sixth = buf[length - 1];
-        sixth <<= 11;
-      } else if (length == 3) {
-        second = buf[1];
-        second <<= 4;
-        third = buf[2];
-        third <<= 9;
-      } else if (length == 2) {
-        second = buf[1];
-        second <<= 24;
-      }
-      return len + first + second + third + fourth + fifth + sixth;
+private:
+  inline static uint32_t bufToHash(char16_t* buf, int32_t length)
+  {
+    uint32_t len = length;
+    uint32_t first = buf[0];
+    first <<= 19;
+    uint32_t second = 1 << 23;
+    uint32_t third = 0;
+    uint32_t fourth = 0;
+    uint32_t fifth = 0;
+    uint32_t sixth = 0;
+    if (length >= 4) {
+      second = buf[length - 4];
+      second <<= 4;
+      third = buf[1];
+      third <<= 9;
+      fourth = buf[length - 2];
+      fourth <<= 14;
+      fifth = buf[3];
+      fifth <<= 24;
+      sixth = buf[length - 1];
+      sixth <<= 11;
+    } else if (length == 3) {
+      second = buf[1];
+      second <<= 4;
+      third = buf[2];
+      third <<= 9;
+    } else if (length == 2) {
+      second = buf[1];
+      second <<= 24;
     }
-
-  public:
-    static const int32_t HTML = 0;
+    return len + first + second + third + fourth + fifth + sixth;
+  }
 
-    static const int32_t MATHML = 1;
+public:
+  static const int32_t HTML = 0;
 
-    static const int32_t SVG = 2;
+  static const int32_t MATHML = 1;
+
+  static const int32_t SVG = 2;
 
-  private:
-    int32_t* uri;
-    nsAtom** local;
-    nsAtom** prefix;
-    bool custom;
-    nsHtml5AttributeName(int32_t* uri, nsAtom** local, nsAtom** prefix);
+private:
+  int32_t* uri;
+  nsAtom** local;
+  nsAtom** prefix;
+  bool custom;
+  nsHtml5AttributeName(int32_t* uri, nsAtom** local, nsAtom** prefix);
 
-  public:
-    nsHtml5AttributeName();
-    inline bool isInterned() { return !custom; }
+public:
+  nsHtml5AttributeName();
+  inline bool isInterned() { return !custom; }
 
-    inline void setNameForNonInterned(nsAtom* name)
-    {
-      MOZ_ASSERT(custom);
-      local[0] = name;
-      local[1] = name;
-      local[2] = name;
-    }
+  inline void setNameForNonInterned(nsAtom* name)
+  {
+    MOZ_ASSERT(custom);
+    local[0] = name;
+    local[1] = name;
+    local[2] = name;
+  }
 
-    static nsHtml5AttributeName* createAttributeName(nsAtom* name);
-    ~nsHtml5AttributeName();
-    int32_t getUri(int32_t mode);
-    nsAtom* getLocal(int32_t mode);
-    nsAtom* getPrefix(int32_t mode);
-    bool equalsAnother(nsHtml5AttributeName* another);
-    static nsHtml5AttributeName* ATTR_ALT;
-    static nsHtml5AttributeName* ATTR_DIR;
-    static nsHtml5AttributeName* ATTR_DUR;
-    static nsHtml5AttributeName* ATTR_END;
-    static nsHtml5AttributeName* ATTR_FOR;
-    static nsHtml5AttributeName* ATTR_IN2;
-    static nsHtml5AttributeName* ATTR_LOW;
-    static nsHtml5AttributeName* ATTR_MIN;
-    static nsHtml5AttributeName* ATTR_MAX;
-    static nsHtml5AttributeName* ATTR_REL;
-    static nsHtml5AttributeName* ATTR_REV;
-    static nsHtml5AttributeName* ATTR_SRC;
-    static nsHtml5AttributeName* ATTR_D;
-    static nsHtml5AttributeName* ATTR_R;
-    static nsHtml5AttributeName* ATTR_X;
-    static nsHtml5AttributeName* ATTR_Y;
-    static nsHtml5AttributeName* ATTR_Z;
-    static nsHtml5AttributeName* ATTR_K1;
-    static nsHtml5AttributeName* ATTR_X1;
-    static nsHtml5AttributeName* ATTR_Y1;
-    static nsHtml5AttributeName* ATTR_K2;
-    static nsHtml5AttributeName* ATTR_X2;
-    static nsHtml5AttributeName* ATTR_Y2;
-    static nsHtml5AttributeName* ATTR_K3;
-    static nsHtml5AttributeName* ATTR_K4;
-    static nsHtml5AttributeName* ATTR_XML_SPACE;
-    static nsHtml5AttributeName* ATTR_XML_LANG;
-    static nsHtml5AttributeName* ATTR_XML_BASE;
-    static nsHtml5AttributeName* ATTR_ARIA_GRAB;
-    static nsHtml5AttributeName* ATTR_ARIA_VALUEMAX;
-    static nsHtml5AttributeName* ATTR_ARIA_LABELLEDBY;
-    static nsHtml5AttributeName* ATTR_ARIA_DESCRIBEDBY;
-    static nsHtml5AttributeName* ATTR_ARIA_DISABLED;
-    static nsHtml5AttributeName* ATTR_ARIA_CHECKED;
-    static nsHtml5AttributeName* ATTR_ARIA_SELECTED;
-    static nsHtml5AttributeName* ATTR_ARIA_DROPEFFECT;
-    static nsHtml5AttributeName* ATTR_ARIA_REQUIRED;
-    static nsHtml5AttributeName* ATTR_ARIA_EXPANDED;
-    static nsHtml5AttributeName* ATTR_ARIA_PRESSED;
-    static nsHtml5AttributeName* ATTR_ARIA_LEVEL;
-    static nsHtml5AttributeName* ATTR_ARIA_CHANNEL;
-    static nsHtml5AttributeName* ATTR_ARIA_HIDDEN;
-    static nsHtml5AttributeName* ATTR_ARIA_SECRET;
-    static nsHtml5AttributeName* ATTR_ARIA_POSINSET;
-    static nsHtml5AttributeName* ATTR_ARIA_ATOMIC;
-    static nsHtml5AttributeName* ATTR_ARIA_INVALID;
-    static nsHtml5AttributeName* ATTR_ARIA_TEMPLATEID;
-    static nsHtml5AttributeName* ATTR_ARIA_VALUEMIN;
-    static nsHtml5AttributeName* ATTR_ARIA_MULTISELECTABLE;
-    static nsHtml5AttributeName* ATTR_ARIA_CONTROLS;
-    static nsHtml5AttributeName* ATTR_ARIA_MULTILINE;
-    static nsHtml5AttributeName* ATTR_ARIA_READONLY;
-    static nsHtml5AttributeName* ATTR_ARIA_OWNS;
-    static nsHtml5AttributeName* ATTR_ARIA_ACTIVEDESCENDANT;
-    static nsHtml5AttributeName* ATTR_ARIA_RELEVANT;
-    static nsHtml5AttributeName* ATTR_ARIA_DATATYPE;
-    static nsHtml5AttributeName* ATTR_ARIA_VALUENOW;
-    static nsHtml5AttributeName* ATTR_ARIA_SORT;
-    static nsHtml5AttributeName* ATTR_ARIA_AUTOCOMPLETE;
-    static nsHtml5AttributeName* ATTR_ARIA_FLOWTO;
-    static nsHtml5AttributeName* ATTR_ARIA_BUSY;
-    static nsHtml5AttributeName* ATTR_ARIA_LIVE;
-    static nsHtml5AttributeName* ATTR_ARIA_HASPOPUP;
-    static nsHtml5AttributeName* ATTR_ARIA_SETSIZE;
-    static nsHtml5AttributeName* ATTR_CLEAR;
-    static nsHtml5AttributeName* ATTR_DISABLED;
-    static nsHtml5AttributeName* ATTR_DEFAULT;
-    static nsHtml5AttributeName* ATTR_DATA;
-    static nsHtml5AttributeName* ATTR_EQUALCOLUMNS;
-    static nsHtml5AttributeName* ATTR_EQUALROWS;
-    static nsHtml5AttributeName* ATTR_HSPACE;
-    static nsHtml5AttributeName* ATTR_ISMAP;
-    static nsHtml5AttributeName* ATTR_LOCAL;
-    static nsHtml5AttributeName* ATTR_LSPACE;
-    static nsHtml5AttributeName* ATTR_MOVABLELIMITS;
-    static nsHtml5AttributeName* ATTR_NOTATION;
-    static nsHtml5AttributeName* ATTR_ONDATAAVAILABLE;
-    static nsHtml5AttributeName* ATTR_ONPASTE;
-    static nsHtml5AttributeName* ATTR_RSPACE;
-    static nsHtml5AttributeName* ATTR_ROWALIGN;
-    static nsHtml5AttributeName* ATTR_ROTATE;
-    static nsHtml5AttributeName* ATTR_SEPARATOR;
-    static nsHtml5AttributeName* ATTR_SEPARATORS;
-    static nsHtml5AttributeName* ATTR_VSPACE;
-    static nsHtml5AttributeName* ATTR_XCHANNELSELECTOR;
-    static nsHtml5AttributeName* ATTR_YCHANNELSELECTOR;
-    static nsHtml5AttributeName* ATTR_ENABLE_BACKGROUND;
-    static nsHtml5AttributeName* ATTR_ONDBLCLICK;
-    static nsHtml5AttributeName* ATTR_ONABORT;
-    static nsHtml5AttributeName* ATTR_CALCMODE;
-    static nsHtml5AttributeName* ATTR_CHECKED;
-    static nsHtml5AttributeName* ATTR_FENCE;
-    static nsHtml5AttributeName* ATTR_ONSCROLL;
-    static nsHtml5AttributeName* ATTR_ONACTIVATE;
-    static nsHtml5AttributeName* ATTR_OPACITY;
-    static nsHtml5AttributeName* ATTR_SPACING;
-    static nsHtml5AttributeName* ATTR_SPECULAREXPONENT;
-    static nsHtml5AttributeName* ATTR_SPECULARCONSTANT;
-    static nsHtml5AttributeName* ATTR_BORDER;
-    static nsHtml5AttributeName* ATTR_ID;
-    static nsHtml5AttributeName* ATTR_GRADIENTTRANSFORM;
-    static nsHtml5AttributeName* ATTR_GRADIENTUNITS;
-    static nsHtml5AttributeName* ATTR_HIDDEN;
-    static nsHtml5AttributeName* ATTR_HEADERS;
-    static nsHtml5AttributeName* ATTR_READONLY;
-    static nsHtml5AttributeName* ATTR_RENDERING_INTENT;
-    static nsHtml5AttributeName* ATTR_SEED;
-    static nsHtml5AttributeName* ATTR_SRCDOC;
-    static nsHtml5AttributeName* ATTR_STDDEVIATION;
-    static nsHtml5AttributeName* ATTR_SANDBOX;
-    static nsHtml5AttributeName* ATTR_WORD_SPACING;
-    static nsHtml5AttributeName* ATTR_ACCENTUNDER;
-    static nsHtml5AttributeName* ATTR_ACCEPT_CHARSET;
-    static nsHtml5AttributeName* ATTR_ACCESSKEY;
-    static nsHtml5AttributeName* ATTR_ACCENT;
-    static nsHtml5AttributeName* ATTR_ACCEPT;
-    static nsHtml5AttributeName* ATTR_BEVELLED;
-    static nsHtml5AttributeName* ATTR_BASEFREQUENCY;
-    static nsHtml5AttributeName* ATTR_BASELINE_SHIFT;
-    static nsHtml5AttributeName* ATTR_BASEPROFILE;
-    static nsHtml5AttributeName* ATTR_BASELINE;
-    static nsHtml5AttributeName* ATTR_BASE;
-    static nsHtml5AttributeName* ATTR_CODE;
-    static nsHtml5AttributeName* ATTR_CODETYPE;
-    static nsHtml5AttributeName* ATTR_CODEBASE;
-    static nsHtml5AttributeName* ATTR_CITE;
-    static nsHtml5AttributeName* ATTR_DEFER;
-    static nsHtml5AttributeName* ATTR_DATETIME;
-    static nsHtml5AttributeName* ATTR_DIRECTION;
-    static nsHtml5AttributeName* ATTR_EDGEMODE;
-    static nsHtml5AttributeName* ATTR_EDGE;
-    static nsHtml5AttributeName* ATTR_FACE;
-    static nsHtml5AttributeName* ATTR_INDEX;
-    static nsHtml5AttributeName* ATTR_INTERCEPT;
-    static nsHtml5AttributeName* ATTR_INTEGRITY;
-    static nsHtml5AttributeName* ATTR_LINEBREAK;
-    static nsHtml5AttributeName* ATTR_LABEL;
-    static nsHtml5AttributeName* ATTR_LINETHICKNESS;
-    static nsHtml5AttributeName* ATTR_MODE;
-    static nsHtml5AttributeName* ATTR_NAME;
-    static nsHtml5AttributeName* ATTR_NORESIZE;
-    static nsHtml5AttributeName* ATTR_ONBEFOREUNLOAD;
-    static nsHtml5AttributeName* ATTR_ONREPEAT;
-    static nsHtml5AttributeName* ATTR_OBJECT;
-    static nsHtml5AttributeName* ATTR_ONSELECT;
-    static nsHtml5AttributeName* ATTR_ORDER;
-    static nsHtml5AttributeName* ATTR_OTHER;
-    static nsHtml5AttributeName* ATTR_ONRESET;
-    static nsHtml5AttributeName* ATTR_ONREADYSTATECHANGE;
-    static nsHtml5AttributeName* ATTR_ONMESSAGE;
-    static nsHtml5AttributeName* ATTR_ONBEGIN;
-    static nsHtml5AttributeName* ATTR_ONBEFOREPRINT;
-    static nsHtml5AttributeName* ATTR_ORIENT;
-    static nsHtml5AttributeName* ATTR_ORIENTATION;
-    static nsHtml5AttributeName* ATTR_ONBEFORECOPY;
-    static nsHtml5AttributeName* ATTR_ONSELECTSTART;
-    static nsHtml5AttributeName* ATTR_ONBEFOREPASTE;
-    static nsHtml5AttributeName* ATTR_ONKEYPRESS;
-    static nsHtml5AttributeName* ATTR_ONKEYUP;
-    static nsHtml5AttributeName* ATTR_ONBEFORECUT;
-    static nsHtml5AttributeName* ATTR_ONKEYDOWN;
-    static nsHtml5AttributeName* ATTR_ONRESIZE;
-    static nsHtml5AttributeName* ATTR_REPEAT;
-    static nsHtml5AttributeName* ATTR_REFERRERPOLICY;
-    static nsHtml5AttributeName* ATTR_RULES;
-    static nsHtml5AttributeName* ATTR_ROLE;
-    static nsHtml5AttributeName* ATTR_REPEATCOUNT;
-    static nsHtml5AttributeName* ATTR_REPEATDUR;
-    static nsHtml5AttributeName* ATTR_SELECTED;
-    static nsHtml5AttributeName* ATTR_SIZES;
-    static nsHtml5AttributeName* ATTR_SUPERSCRIPTSHIFT;
-    static nsHtml5AttributeName* ATTR_STRETCHY;
-    static nsHtml5AttributeName* ATTR_SCHEME;
-    static nsHtml5AttributeName* ATTR_SPREADMETHOD;
-    static nsHtml5AttributeName* ATTR_SELECTION;
-    static nsHtml5AttributeName* ATTR_SIZE;
-    static nsHtml5AttributeName* ATTR_TYPE;
-    static nsHtml5AttributeName* ATTR_DIFFUSECONSTANT;
-    static nsHtml5AttributeName* ATTR_HREF;
-    static nsHtml5AttributeName* ATTR_HREFLANG;
-    static nsHtml5AttributeName* ATTR_ONAFTERPRINT;
-    static nsHtml5AttributeName* ATTR_PROFILE;
-    static nsHtml5AttributeName* ATTR_SURFACESCALE;
-    static nsHtml5AttributeName* ATTR_XREF;
-    static nsHtml5AttributeName* ATTR_ALIGN;
-    static nsHtml5AttributeName* ATTR_ALIGNMENT_BASELINE;
-    static nsHtml5AttributeName* ATTR_ALIGNMENTSCOPE;
-    static nsHtml5AttributeName* ATTR_DRAGGABLE;
-    static nsHtml5AttributeName* ATTR_HEIGHT;
-    static nsHtml5AttributeName* ATTR_IMAGE_RENDERING;
-    static nsHtml5AttributeName* ATTR_LANGUAGE;
-    static nsHtml5AttributeName* ATTR_LANG;
-    static nsHtml5AttributeName* ATTR_LARGEOP;
-    static nsHtml5AttributeName* ATTR_LONGDESC;
-    static nsHtml5AttributeName* ATTR_LENGTHADJUST;
-    static nsHtml5AttributeName* ATTR_MARGINHEIGHT;
-    static nsHtml5AttributeName* ATTR_MARGINWIDTH;
-    static nsHtml5AttributeName* ATTR_ORIGIN;
-    static nsHtml5AttributeName* ATTR_PING;
-    static nsHtml5AttributeName* ATTR_TARGET;
-    static nsHtml5AttributeName* ATTR_TARGETX;
-    static nsHtml5AttributeName* ATTR_TARGETY;
-    static nsHtml5AttributeName* ATTR_ARCHIVE;
-    static nsHtml5AttributeName* ATTR_HIGH;
-    static nsHtml5AttributeName* ATTR_LIGHTING_COLOR;
-    static nsHtml5AttributeName* ATTR_MATHBACKGROUND;
-    static nsHtml5AttributeName* ATTR_METHOD;
-    static nsHtml5AttributeName* ATTR_MATHVARIANT;
-    static nsHtml5AttributeName* ATTR_MATHCOLOR;
-    static nsHtml5AttributeName* ATTR_MATHSIZE;
-    static nsHtml5AttributeName* ATTR_NOSHADE;
-    static nsHtml5AttributeName* ATTR_ONCHANGE;
-    static nsHtml5AttributeName* ATTR_PATHLENGTH;
-    static nsHtml5AttributeName* ATTR_PATH;
-    static nsHtml5AttributeName* ATTR_ALTIMG;
-    static nsHtml5AttributeName* ATTR_ACTIONTYPE;
-    static nsHtml5AttributeName* ATTR_ACTION;
-    static nsHtml5AttributeName* ATTR_ACTIVE;
-    static nsHtml5AttributeName* ATTR_ADDITIVE;
-    static nsHtml5AttributeName* ATTR_BEGIN;
-    static nsHtml5AttributeName* ATTR_DOMINANT_BASELINE;
-    static nsHtml5AttributeName* ATTR_DIVISOR;
-    static nsHtml5AttributeName* ATTR_DEFINITIONURL;
-    static nsHtml5AttributeName* ATTR_LIMITINGCONEANGLE;
-    static nsHtml5AttributeName* ATTR_MEDIA;
-    static nsHtml5AttributeName* ATTR_MANIFEST;
-    static nsHtml5AttributeName* ATTR_ONFINISH;
-    static nsHtml5AttributeName* ATTR_OPTIMUM;
-    static nsHtml5AttributeName* ATTR_RADIOGROUP;
-    static nsHtml5AttributeName* ATTR_RADIUS;
-    static nsHtml5AttributeName* ATTR_SCRIPTLEVEL;
-    static nsHtml5AttributeName* ATTR_SCRIPTSIZEMULTIPLIER;
-    static nsHtml5AttributeName* ATTR_SCRIPTMINSIZE;
-    static nsHtml5AttributeName* ATTR_TABINDEX;
-    static nsHtml5AttributeName* ATTR_VALIGN;
-    static nsHtml5AttributeName* ATTR_VISIBILITY;
-    static nsHtml5AttributeName* ATTR_BACKGROUND;
-    static nsHtml5AttributeName* ATTR_LINK;
-    static nsHtml5AttributeName* ATTR_MARKER_MID;
-    static nsHtml5AttributeName* ATTR_MARKERHEIGHT;
-    static nsHtml5AttributeName* ATTR_MARKER_END;
-    static nsHtml5AttributeName* ATTR_MASK;
-    static nsHtml5AttributeName* ATTR_MARKER_START;
-    static nsHtml5AttributeName* ATTR_MARKERWIDTH;
-    static nsHtml5AttributeName* ATTR_MASKUNITS;
-    static nsHtml5AttributeName* ATTR_MARKERUNITS;
-    static nsHtml5AttributeName* ATTR_MASKCONTENTUNITS;
-    static nsHtml5AttributeName* ATTR_AMPLITUDE;
-    static nsHtml5AttributeName* ATTR_CELLSPACING;
-    static nsHtml5AttributeName* ATTR_CELLPADDING;
-    static nsHtml5AttributeName* ATTR_DECLARE;
-    static nsHtml5AttributeName* ATTR_FILL_RULE;
-    static nsHtml5AttributeName* ATTR_FILL;
-    static nsHtml5AttributeName* ATTR_FILL_OPACITY;
-    static nsHtml5AttributeName* ATTR_MAXLENGTH;
-    static nsHtml5AttributeName* ATTR_ONCLICK;
-    static nsHtml5AttributeName* ATTR_ONBLUR;
-    static nsHtml5AttributeName* ATTR_REPLACE;
-    static nsHtml5AttributeName* ATTR_ROWLINES;
-    static nsHtml5AttributeName* ATTR_SCALE;
-    static nsHtml5AttributeName* ATTR_STYLE;
-    static nsHtml5AttributeName* ATTR_TABLEVALUES;
-    static nsHtml5AttributeName* ATTR_TITLE;
-    static nsHtml5AttributeName* ATTR_AZIMUTH;
-    static nsHtml5AttributeName* ATTR_FORMAT;
-    static nsHtml5AttributeName* ATTR_FRAMEBORDER;
-    static nsHtml5AttributeName* ATTR_FRAME;
-    static nsHtml5AttributeName* ATTR_FRAMESPACING;
-    static nsHtml5AttributeName* ATTR_FROM;
-    static nsHtml5AttributeName* ATTR_FORM;
-    static nsHtml5AttributeName* ATTR_PROMPT;
-    static nsHtml5AttributeName* ATTR_PRIMITIVEUNITS;
-    static nsHtml5AttributeName* ATTR_SYMMETRIC;
-    static nsHtml5AttributeName* ATTR_SUMMARY;
-    static nsHtml5AttributeName* ATTR_USEMAP;
-    static nsHtml5AttributeName* ATTR_ZOOMANDPAN;
-    static nsHtml5AttributeName* ATTR_ASYNC;
-    static nsHtml5AttributeName* ATTR_ALINK;
-    static nsHtml5AttributeName* ATTR_IN;
-    static nsHtml5AttributeName* ATTR_ICON;
-    static nsHtml5AttributeName* ATTR_KERNELMATRIX;
-    static nsHtml5AttributeName* ATTR_KERNING;
-    static nsHtml5AttributeName* ATTR_KERNELUNITLENGTH;
-    static nsHtml5AttributeName* ATTR_ONUNLOAD;
-    static nsHtml5AttributeName* ATTR_OPEN;
-    static nsHtml5AttributeName* ATTR_ONINVALID;
-    static nsHtml5AttributeName* ATTR_ONEND;
-    static nsHtml5AttributeName* ATTR_ONINPUT;
-    static nsHtml5AttributeName* ATTR_POINTER_EVENTS;
-    static nsHtml5AttributeName* ATTR_POINTS;
-    static nsHtml5AttributeName* ATTR_POINTSATX;
-    static nsHtml5AttributeName* ATTR_POINTSATY;
-    static nsHtml5AttributeName* ATTR_POINTSATZ;
-    static nsHtml5AttributeName* ATTR_SPAN;
-    static nsHtml5AttributeName* ATTR_STANDBY;
-    static nsHtml5AttributeName* ATTR_TRANSFORM;
-    static nsHtml5AttributeName* ATTR_VLINK;
-    static nsHtml5AttributeName* ATTR_WHEN;
-    static nsHtml5AttributeName* ATTR_XLINK_HREF;
-    static nsHtml5AttributeName* ATTR_XLINK_TITLE;
-    static nsHtml5AttributeName* ATTR_XLINK_ROLE;
-    static nsHtml5AttributeName* ATTR_XLINK_ARCROLE;
-    static nsHtml5AttributeName* ATTR_XMLNS_XLINK;
-    static nsHtml5AttributeName* ATTR_XMLNS;
-    static nsHtml5AttributeName* ATTR_XLINK_TYPE;
-    static nsHtml5AttributeName* ATTR_XLINK_SHOW;
-    static nsHtml5AttributeName* ATTR_XLINK_ACTUATE;
-    static nsHtml5AttributeName* ATTR_AUTOPLAY;
-    static nsHtml5AttributeName* ATTR_AUTOCOMPLETE;
-    static nsHtml5AttributeName* ATTR_AUTOFOCUS;
-    static nsHtml5AttributeName* ATTR_BGCOLOR;
-    static nsHtml5AttributeName* ATTR_COLOR_PROFILE;
-    static nsHtml5AttributeName* ATTR_COLOR_RENDERING;
-    static nsHtml5AttributeName* ATTR_COLOR_INTERPOLATION;
-    static nsHtml5AttributeName* ATTR_COLOR;
-    static nsHtml5AttributeName* ATTR_COLOR_INTERPOLATION_FILTERS;
-    static nsHtml5AttributeName* ATTR_ENCODING;
-    static nsHtml5AttributeName* ATTR_EXPONENT;
-    static nsHtml5AttributeName* ATTR_FLOOD_COLOR;
-    static nsHtml5AttributeName* ATTR_FLOOD_OPACITY;
-    static nsHtml5AttributeName* ATTR_LQUOTE;
-    static nsHtml5AttributeName* ATTR_NUMOCTAVES;
-    static nsHtml5AttributeName* ATTR_ONLOAD;
-    static nsHtml5AttributeName* ATTR_ONMOUSEWHEEL;
-    static nsHtml5AttributeName* ATTR_ONMOUSEENTER;
-    static nsHtml5AttributeName* ATTR_ONMOUSEOVER;
-    static nsHtml5AttributeName* ATTR_ONFOCUSIN;
-    static nsHtml5AttributeName* ATTR_ONCONTEXTMENU;
-    static nsHtml5AttributeName* ATTR_ONZOOM;
-    static nsHtml5AttributeName* ATTR_ONCOPY;
-    static nsHtml5AttributeName* ATTR_ONMOUSELEAVE;
-    static nsHtml5AttributeName* ATTR_ONMOUSEMOVE;
-    static nsHtml5AttributeName* ATTR_ONMOUSEUP;
-    static nsHtml5AttributeName* ATTR_ONFOCUS;
-    static nsHtml5AttributeName* ATTR_ONMOUSEOUT;
-    static nsHtml5AttributeName* ATTR_ONFOCUSOUT;
-    static nsHtml5AttributeName* ATTR_ONMOUSEDOWN;
-    static nsHtml5AttributeName* ATTR_TO;
-    static nsHtml5AttributeName* ATTR_RQUOTE;
-    static nsHtml5AttributeName* ATTR_STROKE_LINECAP;
-    static nsHtml5AttributeName* ATTR_STROKE_DASHARRAY;
-    static nsHtml5AttributeName* ATTR_STROKE_DASHOFFSET;
-    static nsHtml5AttributeName* ATTR_STROKE_LINEJOIN;
-    static nsHtml5AttributeName* ATTR_STROKE_MITERLIMIT;
-    static nsHtml5AttributeName* ATTR_STROKE;
-    static nsHtml5AttributeName* ATTR_SCROLLING;
-    static nsHtml5AttributeName* ATTR_STROKE_WIDTH;
-    static nsHtml5AttributeName* ATTR_STROKE_OPACITY;
-    static nsHtml5AttributeName* ATTR_COMPACT;
-    static nsHtml5AttributeName* ATTR_CLIP;
-    static nsHtml5AttributeName* ATTR_CLIP_RULE;
-    static nsHtml5AttributeName* ATTR_CLIP_PATH;
-    static nsHtml5AttributeName* ATTR_CLIPPATHUNITS;
-    static nsHtml5AttributeName* ATTR_DISPLAY;
-    static nsHtml5AttributeName* ATTR_DISPLAYSTYLE;
-    static nsHtml5AttributeName* ATTR_GLYPH_ORIENTATION_VERTICAL;
-    static nsHtml5AttributeName* ATTR_GLYPH_ORIENTATION_HORIZONTAL;
-    static nsHtml5AttributeName* ATTR_GLYPHREF;
-    static nsHtml5AttributeName* ATTR_HTTP_EQUIV;
-    static nsHtml5AttributeName* ATTR_KEYPOINTS;
-    static nsHtml5AttributeName* ATTR_LOOP;
-    static nsHtml5AttributeName* ATTR_PROPERTY;
-    static nsHtml5AttributeName* ATTR_SCOPED;
-    static nsHtml5AttributeName* ATTR_STEP;
-    static nsHtml5AttributeName* ATTR_SHAPE_RENDERING;
-    static nsHtml5AttributeName* ATTR_SCOPE;
-    static nsHtml5AttributeName* ATTR_SHAPE;
-    static nsHtml5AttributeName* ATTR_SLOPE;
-    static nsHtml5AttributeName* ATTR_STOP_COLOR;
-    static nsHtml5AttributeName* ATTR_STOP_OPACITY;
-    static nsHtml5AttributeName* ATTR_TEMPLATE;
-    static nsHtml5AttributeName* ATTR_WRAP;
-    static nsHtml5AttributeName* ATTR_ABBR;
-    static nsHtml5AttributeName* ATTR_ATTRIBUTENAME;
-    static nsHtml5AttributeName* ATTR_ATTRIBUTETYPE;
-    static nsHtml5AttributeName* ATTR_CHAR;
-    static nsHtml5AttributeName* ATTR_COORDS;
-    static nsHtml5AttributeName* ATTR_CHAROFF;
-    static nsHtml5AttributeName* ATTR_CHARSET;
-    static nsHtml5AttributeName* ATTR_NOWRAP;
-    static nsHtml5AttributeName* ATTR_NOHREF;
-    static nsHtml5AttributeName* ATTR_ONDRAG;
-    static nsHtml5AttributeName* ATTR_ONDRAGENTER;
-    static nsHtml5AttributeName* ATTR_ONDRAGOVER;
-    static nsHtml5AttributeName* ATTR_ONDRAGEND;
-    static nsHtml5AttributeName* ATTR_ONDROP;
-    static nsHtml5AttributeName* ATTR_ONDRAGDROP;
-    static nsHtml5AttributeName* ATTR_ONERROR;
-    static nsHtml5AttributeName* ATTR_OPERATOR;
-    static nsHtml5AttributeName* ATTR_OVERFLOW;
-    static nsHtml5AttributeName* ATTR_ONDRAGSTART;
-    static nsHtml5AttributeName* ATTR_ONDRAGLEAVE;
-    static nsHtml5AttributeName* ATTR_STARTOFFSET;
-    static nsHtml5AttributeName* ATTR_START;
-    static nsHtml5AttributeName* ATTR_AXIS;
-    static nsHtml5AttributeName* ATTR_BIAS;
-    static nsHtml5AttributeName* ATTR_COLSPAN;
-    static nsHtml5AttributeName* ATTR_CLASSID;
-    static nsHtml5AttributeName* ATTR_CROSSORIGIN;
-    static nsHtml5AttributeName* ATTR_COLS;
-    static nsHtml5AttributeName* ATTR_CURSOR;
-    static nsHtml5AttributeName* ATTR_CLOSURE;
-    static nsHtml5AttributeName* ATTR_CLOSE;
-    static nsHtml5AttributeName* ATTR_CLASS;
-    static nsHtml5AttributeName* ATTR_IS;
-    static nsHtml5AttributeName* ATTR_KEYSYSTEM;
-    static nsHtml5AttributeName* ATTR_KEYSPLINES;
-    static nsHtml5AttributeName* ATTR_LOWSRC;
-    static nsHtml5AttributeName* ATTR_MAXSIZE;
-    static nsHtml5AttributeName* ATTR_MINSIZE;
-    static nsHtml5AttributeName* ATTR_OFFSET;
-    static nsHtml5AttributeName* ATTR_PRESERVEALPHA;
-    static nsHtml5AttributeName* ATTR_PRESERVEASPECTRATIO;
-    static nsHtml5AttributeName* ATTR_ROWSPAN;
-    static nsHtml5AttributeName* ATTR_ROWSPACING;
-    static nsHtml5AttributeName* ATTR_ROWS;
-    static nsHtml5AttributeName* ATTR_SRCSET;
-    static nsHtml5AttributeName* ATTR_SUBSCRIPTSHIFT;
-    static nsHtml5AttributeName* ATTR_VERSION;
-    static nsHtml5AttributeName* ATTR_ALTTEXT;
-    static nsHtml5AttributeName* ATTR_CONTENTEDITABLE;
-    static nsHtml5AttributeName* ATTR_CONTROLS;
-    static nsHtml5AttributeName* ATTR_CONTENT;
-    static nsHtml5AttributeName* ATTR_CONTEXTMENU;
-    static nsHtml5AttributeName* ATTR_DEPTH;
-    static nsHtml5AttributeName* ATTR_ENCTYPE;
-    static nsHtml5AttributeName* ATTR_FONT_STRETCH;
-    static nsHtml5AttributeName* ATTR_FILTER;
-    static nsHtml5AttributeName* ATTR_FONTWEIGHT;
-    static nsHtml5AttributeName* ATTR_FONT_WEIGHT;
-    static nsHtml5AttributeName* ATTR_FONTSTYLE;
-    static nsHtml5AttributeName* ATTR_FONT_STYLE;
-    static nsHtml5AttributeName* ATTR_FONTFAMILY;
-    static nsHtml5AttributeName* ATTR_FONT_FAMILY;
-    static nsHtml5AttributeName* ATTR_FONT_VARIANT;
-    static nsHtml5AttributeName* ATTR_FONT_SIZE_ADJUST;
-    static nsHtml5AttributeName* ATTR_FILTERUNITS;
-    static nsHtml5AttributeName* ATTR_FONTSIZE;
-    static nsHtml5AttributeName* ATTR_FONT_SIZE;
-    static nsHtml5AttributeName* ATTR_KEYTIMES;
-    static nsHtml5AttributeName* ATTR_LETTER_SPACING;
-    static nsHtml5AttributeName* ATTR_LIST;
-    static nsHtml5AttributeName* ATTR_MULTIPLE;
-    static nsHtml5AttributeName* ATTR_RT;
-    static nsHtml5AttributeName* ATTR_ONSTOP;
-    static nsHtml5AttributeName* ATTR_ONSTART;
-    static nsHtml5AttributeName* ATTR_POSTER;
-    static nsHtml5AttributeName* ATTR_PATTERNTRANSFORM;
-    static nsHtml5AttributeName* ATTR_PATTERN;
-    static nsHtml5AttributeName* ATTR_PATTERNUNITS;
-    static nsHtml5AttributeName* ATTR_PATTERNCONTENTUNITS;
-    static nsHtml5AttributeName* ATTR_RESTART;
-    static nsHtml5AttributeName* ATTR_STITCHTILES;
-    static nsHtml5AttributeName* ATTR_SYSTEMLANGUAGE;
-    static nsHtml5AttributeName* ATTR_TEXT_RENDERING;
-    static nsHtml5AttributeName* ATTR_TEXT_DECORATION;
-    static nsHtml5AttributeName* ATTR_TEXT_ANCHOR;
-    static nsHtml5AttributeName* ATTR_TEXTLENGTH;
-    static nsHtml5AttributeName* ATTR_TEXT;
-    static nsHtml5AttributeName* ATTR_WRITING_MODE;
-    static nsHtml5AttributeName* ATTR_WIDTH;
-    static nsHtml5AttributeName* ATTR_ACCUMULATE;
-    static nsHtml5AttributeName* ATTR_COLUMNSPAN;
-    static nsHtml5AttributeName* ATTR_COLUMNLINES;
-    static nsHtml5AttributeName* ATTR_COLUMNALIGN;
-    static nsHtml5AttributeName* ATTR_COLUMNSPACING;
-    static nsHtml5AttributeName* ATTR_COLUMNWIDTH;
-    static nsHtml5AttributeName* ATTR_GROUPALIGN;
-    static nsHtml5AttributeName* ATTR_INPUTMODE;
-    static nsHtml5AttributeName* ATTR_ONSUBMIT;
-    static nsHtml5AttributeName* ATTR_ONCUT;
-    static nsHtml5AttributeName* ATTR_REQUIRED;
-    static nsHtml5AttributeName* ATTR_REQUIREDFEATURES;
-    static nsHtml5AttributeName* ATTR_RESULT;
-    static nsHtml5AttributeName* ATTR_REQUIREDEXTENSIONS;
-    static nsHtml5AttributeName* ATTR_VALUES;
-    static nsHtml5AttributeName* ATTR_VALUETYPE;
-    static nsHtml5AttributeName* ATTR_VALUE;
-    static nsHtml5AttributeName* ATTR_ELEVATION;
-    static nsHtml5AttributeName* ATTR_VIEWTARGET;
-    static nsHtml5AttributeName* ATTR_VIEWBOX;
-    static nsHtml5AttributeName* ATTR_CX;
-    static nsHtml5AttributeName* ATTR_DX;
-    static nsHtml5AttributeName* ATTR_FX;
-    static nsHtml5AttributeName* ATTR_RX;
-    static nsHtml5AttributeName* ATTR_REFX;
-    static nsHtml5AttributeName* ATTR_BY;
-    static nsHtml5AttributeName* ATTR_CY;
-    static nsHtml5AttributeName* ATTR_DY;
-    static nsHtml5AttributeName* ATTR_FY;
-    static nsHtml5AttributeName* ATTR_RY;
-    static nsHtml5AttributeName* ATTR_REFY;
-  private:
-    static nsHtml5AttributeName** ATTRIBUTE_NAMES;
-    static staticJArray<int32_t,int32_t> ATTRIBUTE_HASHES;
-  public:
-    static void initializeStatics();
-    static void releaseStatics();
+  static nsHtml5AttributeName* createAttributeName(nsAtom* name);
+  ~nsHtml5AttributeName();
+  int32_t getUri(int32_t mode);
+  nsAtom* getLocal(int32_t mode);
+  nsAtom* getPrefix(int32_t mode);
+  bool equalsAnother(nsHtml5AttributeName* another);
+  static nsHtml5AttributeName* ATTR_ALT;
+  static nsHtml5AttributeName* ATTR_DIR;
+  static nsHtml5AttributeName* ATTR_DUR;
+  static nsHtml5AttributeName* ATTR_END;
+  static nsHtml5AttributeName* ATTR_FOR;
+  static nsHtml5AttributeName* ATTR_IN2;
+  static nsHtml5AttributeName* ATTR_LOW;
+  static nsHtml5AttributeName* ATTR_MIN;
+  static nsHtml5AttributeName* ATTR_MAX;
+  static nsHtml5AttributeName* ATTR_REL;
+  static nsHtml5AttributeName* ATTR_REV;
+  static nsHtml5AttributeName* ATTR_SRC;
+  static nsHtml5AttributeName* ATTR_D;
+  static nsHtml5AttributeName* ATTR_R;
+  static nsHtml5AttributeName* ATTR_X;
+  static nsHtml5AttributeName* ATTR_Y;
+  static nsHtml5AttributeName* ATTR_Z;
+  static nsHtml5AttributeName* ATTR_K1;
+  static nsHtml5AttributeName* ATTR_X1;
+  static nsHtml5AttributeName* ATTR_Y1;
+  static nsHtml5AttributeName* ATTR_K2;
+  static nsHtml5AttributeName* ATTR_X2;
+  static nsHtml5AttributeName* ATTR_Y2;
+  static nsHtml5AttributeName* ATTR_K3;
+  static nsHtml5AttributeName* ATTR_K4;
+  static nsHtml5AttributeName* ATTR_XML_SPACE;
+  static nsHtml5AttributeName* ATTR_XML_LANG;
+  static nsHtml5AttributeName* ATTR_XML_BASE;
+  static nsHtml5AttributeName* ATTR_ARIA_GRAB;
+  static nsHtml5AttributeName* ATTR_ARIA_VALUEMAX;
+  static nsHtml5AttributeName* ATTR_ARIA_LABELLEDBY;
+  static nsHtml5AttributeName* ATTR_ARIA_DESCRIBEDBY;
+  static nsHtml5AttributeName* ATTR_ARIA_DISABLED;
+  static nsHtml5AttributeName* ATTR_ARIA_CHECKED;
+  static nsHtml5AttributeName* ATTR_ARIA_SELECTED;
+  static nsHtml5AttributeName* ATTR_ARIA_DROPEFFECT;
+  static nsHtml5AttributeName* ATTR_ARIA_REQUIRED;
+  static nsHtml5AttributeName* ATTR_ARIA_EXPANDED;
+  static nsHtml5AttributeName* ATTR_ARIA_PRESSED;
+  static nsHtml5AttributeName* ATTR_ARIA_LEVEL;
+  static nsHtml5AttributeName* ATTR_ARIA_CHANNEL;
+  static nsHtml5AttributeName* ATTR_ARIA_HIDDEN;
+  static nsHtml5AttributeName* ATTR_ARIA_SECRET;
+  static nsHtml5AttributeName* ATTR_ARIA_POSINSET;
+  static nsHtml5AttributeName* ATTR_ARIA_ATOMIC;
+  static nsHtml5AttributeName* ATTR_ARIA_INVALID;
+  static nsHtml5AttributeName* ATTR_ARIA_TEMPLATEID;
+  static nsHtml5AttributeName* ATTR_ARIA_VALUEMIN;
+  static nsHtml5AttributeName* ATTR_ARIA_MULTISELECTABLE;
+  static nsHtml5AttributeName* ATTR_ARIA_CONTROLS;
+  static nsHtml5AttributeName* ATTR_ARIA_MULTILINE;
+  static nsHtml5AttributeName* ATTR_ARIA_READONLY;
+  static nsHtml5AttributeName* ATTR_ARIA_OWNS;
+  static nsHtml5AttributeName* ATTR_ARIA_ACTIVEDESCENDANT;
+  static nsHtml5AttributeName* ATTR_ARIA_RELEVANT;
+  static nsHtml5AttributeName* ATTR_ARIA_DATATYPE;
+  static nsHtml5AttributeName* ATTR_ARIA_VALUENOW;
+  static nsHtml5AttributeName* ATTR_ARIA_SORT;
+  static nsHtml5AttributeName* ATTR_ARIA_AUTOCOMPLETE;
+  static nsHtml5AttributeName* ATTR_ARIA_FLOWTO;
+  static nsHtml5AttributeName* ATTR_ARIA_BUSY;
+  static nsHtml5AttributeName* ATTR_ARIA_LIVE;
+  static nsHtml5AttributeName* ATTR_ARIA_HASPOPUP;
+  static nsHtml5AttributeName* ATTR_ARIA_SETSIZE;
+  static nsHtml5AttributeName* ATTR_CLEAR;
+  static nsHtml5AttributeName* ATTR_DISABLED;
+  static nsHtml5AttributeName* ATTR_DEFAULT;
+  static nsHtml5AttributeName* ATTR_DATA;
+  static nsHtml5AttributeName* ATTR_EQUALCOLUMNS;
+  static nsHtml5AttributeName* ATTR_EQUALROWS;
+  static nsHtml5AttributeName* ATTR_HSPACE;
+  static nsHtml5AttributeName* ATTR_ISMAP;
+  static nsHtml5AttributeName* ATTR_LOCAL;
+  static nsHtml5AttributeName* ATTR_LSPACE;
+  static nsHtml5AttributeName* ATTR_MOVABLELIMITS;
+  static nsHtml5AttributeName* ATTR_NOTATION;
+  static nsHtml5AttributeName* ATTR_ONDATAAVAILABLE;
+  static nsHtml5AttributeName* ATTR_ONPASTE;
+  static nsHtml5AttributeName* ATTR_RSPACE;
+  static nsHtml5AttributeName* ATTR_ROWALIGN;
+  static nsHtml5AttributeName* ATTR_ROTATE;
+  static nsHtml5AttributeName* ATTR_SEPARATOR;
+  static nsHtml5AttributeName* ATTR_SEPARATORS;
+  static nsHtml5AttributeName* ATTR_VSPACE;
+  static nsHtml5AttributeName* ATTR_XCHANNELSELECTOR;
+  static nsHtml5AttributeName* ATTR_YCHANNELSELECTOR;
+  static nsHtml5AttributeName* ATTR_ENABLE_BACKGROUND;
+  static nsHtml5AttributeName* ATTR_ONDBLCLICK;
+  static nsHtml5AttributeName* ATTR_ONABORT;
+  static nsHtml5AttributeName* ATTR_CALCMODE;
+  static nsHtml5AttributeName* ATTR_CHECKED;
+  static nsHtml5AttributeName* ATTR_FENCE;
+  static nsHtml5AttributeName* ATTR_ONSCROLL;
+  static nsHtml5AttributeName* ATTR_ONACTIVATE;
+  static nsHtml5AttributeName* ATTR_OPACITY;
+  static nsHtml5AttributeName* ATTR_SPACING;
+  static nsHtml5AttributeName* ATTR_SPECULAREXPONENT;
+  static nsHtml5AttributeName* ATTR_SPECULARCONSTANT;
+  static nsHtml5AttributeName* ATTR_BORDER;
+  static nsHtml5AttributeName* ATTR_ID;
+  static nsHtml5AttributeName* ATTR_GRADIENTTRANSFORM;
+  static nsHtml5AttributeName* ATTR_GRADIENTUNITS;
+  static nsHtml5AttributeName* ATTR_HIDDEN;
+  static nsHtml5AttributeName* ATTR_HEADERS;
+  static nsHtml5AttributeName* ATTR_READONLY;
+  static nsHtml5AttributeName* ATTR_RENDERING_INTENT;
+  static nsHtml5AttributeName* ATTR_SEED;
+  static nsHtml5AttributeName* ATTR_SRCDOC;
+  static nsHtml5AttributeName* ATTR_STDDEVIATION;
+  static nsHtml5AttributeName* ATTR_SANDBOX;
+  static nsHtml5AttributeName* ATTR_WORD_SPACING;
+  static nsHtml5AttributeName* ATTR_ACCENTUNDER;
+  static nsHtml5AttributeName* ATTR_ACCEPT_CHARSET;
+  static nsHtml5AttributeName* ATTR_ACCESSKEY;
+  static nsHtml5AttributeName* ATTR_ACCENT;
+  static nsHtml5AttributeName* ATTR_ACCEPT;
+  static nsHtml5AttributeName* ATTR_BEVELLED;
+  static nsHtml5AttributeName* ATTR_BASEFREQUENCY;
+  static nsHtml5AttributeName* ATTR_BASELINE_SHIFT;
+  static nsHtml5AttributeName* ATTR_BASEPROFILE;
+  static nsHtml5AttributeName* ATTR_BASELINE;
+  static nsHtml5AttributeName* ATTR_BASE;
+  static nsHtml5AttributeName* ATTR_CODE;
+  static nsHtml5AttributeName* ATTR_CODETYPE;
+  static nsHtml5AttributeName* ATTR_CODEBASE;
+  static nsHtml5AttributeName* ATTR_CITE;
+  static nsHtml5AttributeName* ATTR_DEFER;
+  static nsHtml5AttributeName* ATTR_DATETIME;
+  static nsHtml5AttributeName* ATTR_DIRECTION;
+  static nsHtml5AttributeName* ATTR_EDGEMODE;
+  static nsHtml5AttributeName* ATTR_EDGE;
+  static nsHtml5AttributeName* ATTR_FACE;
+  static nsHtml5AttributeName* ATTR_INDEX;
+  static nsHtml5AttributeName* ATTR_INTERCEPT;
+  static nsHtml5AttributeName* ATTR_INTEGRITY;
+  static nsHtml5AttributeName* ATTR_LINEBREAK;
+  static nsHtml5AttributeName* ATTR_LABEL;
+  static nsHtml5AttributeName* ATTR_LINETHICKNESS;
+  static nsHtml5AttributeName* ATTR_MODE;
+  static nsHtml5AttributeName* ATTR_NAME;
+  static nsHtml5AttributeName* ATTR_NORESIZE;
+  static nsHtml5AttributeName* ATTR_ONBEFOREUNLOAD;
+  static nsHtml5AttributeName* ATTR_ONREPEAT;
+  static nsHtml5AttributeName* ATTR_OBJECT;
+  static nsHtml5AttributeName* ATTR_ONSELECT;
+  static nsHtml5AttributeName* ATTR_ORDER;
+  static nsHtml5AttributeName* ATTR_OTHER;
+  static nsHtml5AttributeName* ATTR_ONRESET;
+  static nsHtml5AttributeName* ATTR_ONREADYSTATECHANGE;
+  static nsHtml5AttributeName* ATTR_ONMESSAGE;
+  static nsHtml5AttributeName* ATTR_ONBEGIN;
+  static nsHtml5AttributeName* ATTR_ONBEFOREPRINT;
+  static nsHtml5AttributeName* ATTR_ORIENT;
+  static nsHtml5AttributeName* ATTR_ORIENTATION;
+  static nsHtml5AttributeName* ATTR_ONBEFORECOPY;
+  static nsHtml5AttributeName* ATTR_ONSELECTSTART;
+  static nsHtml5AttributeName* ATTR_ONBEFOREPASTE;
+  static nsHtml5AttributeName* ATTR_ONKEYPRESS;
+  static nsHtml5AttributeName* ATTR_ONKEYUP;
+  static nsHtml5AttributeName* ATTR_ONBEFORECUT;
+  static nsHtml5AttributeName* ATTR_ONKEYDOWN;
+  static nsHtml5AttributeName* ATTR_ONRESIZE;
+  static nsHtml5AttributeName* ATTR_REPEAT;
+  static nsHtml5AttributeName* ATTR_REFERRERPOLICY;
+  static nsHtml5AttributeName* ATTR_RULES;
+  static nsHtml5AttributeName* ATTR_ROLE;
+  static nsHtml5AttributeName* ATTR_REPEATCOUNT;
+  static nsHtml5AttributeName* ATTR_REPEATDUR;
+  static nsHtml5AttributeName* ATTR_SELECTED;
+  static nsHtml5AttributeName* ATTR_SIZES;
+  static nsHtml5AttributeName* ATTR_SUPERSCRIPTSHIFT;
+  static nsHtml5AttributeName* ATTR_STRETCHY;
+  static nsHtml5AttributeName* ATTR_SCHEME;
+  static nsHtml5AttributeName* ATTR_SPREADMETHOD;
+  static nsHtml5AttributeName* ATTR_SELECTION;
+  static nsHtml5AttributeName* ATTR_SIZE;
+  static nsHtml5AttributeName* ATTR_TYPE;
+  static nsHtml5AttributeName* ATTR_DIFFUSECONSTANT;
+  static nsHtml5AttributeName* ATTR_HREF;
+  static nsHtml5AttributeName* ATTR_HREFLANG;
+  static nsHtml5AttributeName* ATTR_ONAFTERPRINT;
+  static nsHtml5AttributeName* ATTR_PROFILE;
+  static nsHtml5AttributeName* ATTR_SURFACESCALE;
+  static nsHtml5AttributeName* ATTR_XREF;
+  static nsHtml5AttributeName* ATTR_ALIGN;
+  static nsHtml5AttributeName* ATTR_ALIGNMENT_BASELINE;
+  static nsHtml5AttributeName* ATTR_ALIGNMENTSCOPE;
+  static nsHtml5AttributeName* ATTR_DRAGGABLE;
+  static nsHtml5AttributeName* ATTR_HEIGHT;
+  static nsHtml5AttributeName* ATTR_IMAGE_RENDERING;
+  static nsHtml5AttributeName* ATTR_LANGUAGE;
+  static nsHtml5AttributeName* ATTR_LANG;
+  static nsHtml5AttributeName* ATTR_LARGEOP;
+  static nsHtml5AttributeName* ATTR_LONGDESC;
+  static nsHtml5AttributeName* ATTR_LENGTHADJUST;
+  static nsHtml5AttributeName* ATTR_MARGINHEIGHT;
+  static nsHtml5AttributeName* ATTR_MARGINWIDTH;
+  static nsHtml5AttributeName* ATTR_ORIGIN;
+  static nsHtml5AttributeName* ATTR_PING;
+  static nsHtml5AttributeName* ATTR_TARGET;
+  static nsHtml5AttributeName* ATTR_TARGETX;
+  static nsHtml5AttributeName* ATTR_TARGETY;
+  static nsHtml5AttributeName* ATTR_ARCHIVE;
+  static nsHtml5AttributeName* ATTR_HIGH;
+  static nsHtml5AttributeName* ATTR_LIGHTING_COLOR;
+  static nsHtml5AttributeName* ATTR_MATHBACKGROUND;
+  static nsHtml5AttributeName* ATTR_METHOD;
+  static nsHtml5AttributeName* ATTR_MATHVARIANT;
+  static nsHtml5AttributeName* ATTR_MATHCOLOR;
+  static nsHtml5AttributeName* ATTR_MATHSIZE;
+  static nsHtml5AttributeName* ATTR_NOSHADE;
+  static nsHtml5AttributeName* ATTR_ONCHANGE;
+  static nsHtml5AttributeName* ATTR_PATHLENGTH;
+  static nsHtml5AttributeName* ATTR_PATH;
+  static nsHtml5AttributeName* ATTR_ALTIMG;
+  static nsHtml5AttributeName* ATTR_ACTIONTYPE;
+  static nsHtml5AttributeName* ATTR_ACTION;
+  static nsHtml5AttributeName* ATTR_ACTIVE;
+  static nsHtml5AttributeName* ATTR_ADDITIVE;
+  static nsHtml5AttributeName* ATTR_BEGIN;
+  static nsHtml5AttributeName* ATTR_DOMINANT_BASELINE;
+  static nsHtml5AttributeName* ATTR_DIVISOR;
+  static nsHtml5AttributeName* ATTR_DEFINITIONURL;
+  static nsHtml5AttributeName* ATTR_LIMITINGCONEANGLE;
+  static nsHtml5AttributeName* ATTR_MEDIA;
+  static nsHtml5AttributeName* ATTR_MANIFEST;
+  static nsHtml5AttributeName* ATTR_ONFINISH;
+  static nsHtml5AttributeName* ATTR_OPTIMUM;
+  static nsHtml5AttributeName* ATTR_RADIOGROUP;
+  static nsHtml5AttributeName* ATTR_RADIUS;
+  static nsHtml5AttributeName* ATTR_SCRIPTLEVEL;
+  static nsHtml5AttributeName* ATTR_SCRIPTSIZEMULTIPLIER;
+  static nsHtml5AttributeName* ATTR_SCRIPTMINSIZE;
+  static nsHtml5AttributeName* ATTR_TABINDEX;
+  static nsHtml5AttributeName* ATTR_VALIGN;
+  static nsHtml5AttributeName* ATTR_VISIBILITY;
+  static nsHtml5AttributeName* ATTR_BACKGROUND;
+  static nsHtml5AttributeName* ATTR_LINK;
+  static nsHtml5AttributeName* ATTR_MARKER_MID;
+  static nsHtml5AttributeName* ATTR_MARKERHEIGHT;
+  static nsHtml5AttributeName* ATTR_MARKER_END;
+  static nsHtml5AttributeName* ATTR_MASK;
+  static nsHtml5AttributeName* ATTR_MARKER_START;
+  static nsHtml5AttributeName* ATTR_MARKERWIDTH;
+  static nsHtml5AttributeName* ATTR_MASKUNITS;
+  static nsHtml5AttributeName* ATTR_MARKERUNITS;
+  static nsHtml5AttributeName* ATTR_MASKCONTENTUNITS;
+  static nsHtml5AttributeName* ATTR_AMPLITUDE;
+  static nsHtml5AttributeName* ATTR_CELLSPACING;
+  static nsHtml5AttributeName* ATTR_CELLPADDING;
+  static nsHtml5AttributeName* ATTR_DECLARE;
+  static nsHtml5AttributeName* ATTR_FILL_RULE;
+  static nsHtml5AttributeName* ATTR_FILL;
+  static nsHtml5AttributeName* ATTR_FILL_OPACITY;
+  static nsHtml5AttributeName* ATTR_MAXLENGTH;
+  static nsHtml5AttributeName* ATTR_ONCLICK;
+  static nsHtml5AttributeName* ATTR_ONBLUR;
+  static nsHtml5AttributeName* ATTR_REPLACE;
+  static nsHtml5AttributeName* ATTR_ROWLINES;
+  static nsHtml5AttributeName* ATTR_SCALE;
+  static nsHtml5AttributeName* ATTR_STYLE;
+  static nsHtml5AttributeName* ATTR_TABLEVALUES;
+  static nsHtml5AttributeName* ATTR_TITLE;
+  static nsHtml5AttributeName* ATTR_AZIMUTH;
+  static nsHtml5AttributeName* ATTR_FORMAT;
+  static nsHtml5AttributeName* ATTR_FRAMEBORDER;
+  static nsHtml5AttributeName* ATTR_FRAME;
+  static nsHtml5AttributeName* ATTR_FRAMESPACING;
+  static nsHtml5AttributeName* ATTR_FROM;
+  static nsHtml5AttributeName* ATTR_FORM;
+  static nsHtml5AttributeName* ATTR_PROMPT;
+  static nsHtml5AttributeName* ATTR_PRIMITIVEUNITS;
+  static nsHtml5AttributeName* ATTR_SYMMETRIC;
+  static nsHtml5AttributeName* ATTR_SUMMARY;
+  static nsHtml5AttributeName* ATTR_USEMAP;
+  static nsHtml5AttributeName* ATTR_ZOOMANDPAN;
+  static nsHtml5AttributeName* ATTR_ASYNC;
+  static nsHtml5AttributeName* ATTR_ALINK;
+  static nsHtml5AttributeName* ATTR_IN;
+  static nsHtml5AttributeName* ATTR_ICON;
+  static nsHtml5AttributeName* ATTR_KERNELMATRIX;
+  static nsHtml5AttributeName* ATTR_KERNING;
+  static nsHtml5AttributeName* ATTR_KERNELUNITLENGTH;
+  static nsHtml5AttributeName* ATTR_ONUNLOAD;
+  static nsHtml5AttributeName* ATTR_OPEN;
+  static nsHtml5AttributeName* ATTR_ONINVALID;
+  static nsHtml5AttributeName* ATTR_ONEND;
+  static nsHtml5AttributeName* ATTR_ONINPUT;
+  static nsHtml5AttributeName* ATTR_POINTER_EVENTS;
+  static nsHtml5AttributeName* ATTR_POINTS;
+  static nsHtml5AttributeName* ATTR_POINTSATX;
+  static nsHtml5AttributeName* ATTR_POINTSATY;
+  static nsHtml5AttributeName* ATTR_POINTSATZ;
+  static nsHtml5AttributeName* ATTR_SPAN;
+  static nsHtml5AttributeName* ATTR_STANDBY;
+  static nsHtml5AttributeName* ATTR_TRANSFORM;
+  static nsHtml5AttributeName* ATTR_VLINK;
+  static nsHtml5AttributeName* ATTR_WHEN;
+  static nsHtml5AttributeName* ATTR_XLINK_HREF;
+  static nsHtml5AttributeName* ATTR_XLINK_TITLE;
+  static nsHtml5AttributeName* ATTR_XLINK_ROLE;
+  static nsHtml5AttributeName* ATTR_XLINK_ARCROLE;
+  static nsHtml5AttributeName* ATTR_XMLNS_XLINK;
+  static nsHtml5AttributeName* ATTR_XMLNS;
+  static nsHtml5AttributeName* ATTR_XLINK_TYPE;
+  static nsHtml5AttributeName* ATTR_XLINK_SHOW;
+  static nsHtml5AttributeName* ATTR_XLINK_ACTUATE;
+  static nsHtml5AttributeName* ATTR_AUTOPLAY;
+  static nsHtml5AttributeName* ATTR_AUTOCOMPLETE;
+  static nsHtml5AttributeName* ATTR_AUTOFOCUS;
+  static nsHtml5AttributeName* ATTR_BGCOLOR;
+  static nsHtml5AttributeName* ATTR_COLOR_PROFILE;
+  static nsHtml5AttributeName* ATTR_COLOR_RENDERING;
+  static nsHtml5AttributeName* ATTR_COLOR_INTERPOLATION;
+  static nsHtml5AttributeName* ATTR_COLOR;
+  static nsHtml5AttributeName* ATTR_COLOR_INTERPOLATION_FILTERS;
+  static nsHtml5AttributeName* ATTR_ENCODING;
+  static nsHtml5AttributeName* ATTR_EXPONENT;
+  static nsHtml5AttributeName* ATTR_FLOOD_COLOR;
+  static nsHtml5AttributeName* ATTR_FLOOD_OPACITY;
+  static nsHtml5AttributeName* ATTR_LQUOTE;
+  static nsHtml5AttributeName* ATTR_NUMOCTAVES;
+  static nsHtml5AttributeName* ATTR_ONLOAD;
+  static nsHtml5AttributeName* ATTR_ONMOUSEWHEEL;
+  static nsHtml5AttributeName* ATTR_ONMOUSEENTER;
+  static nsHtml5AttributeName* ATTR_ONMOUSEOVER;
+  static nsHtml5AttributeName* ATTR_ONFOCUSIN;
+  static nsHtml5AttributeName* ATTR_ONCONTEXTMENU;
+  static nsHtml5AttributeName* ATTR_ONZOOM;
+  static nsHtml5AttributeName* ATTR_ONCOPY;
+  static nsHtml5AttributeName* ATTR_ONMOUSELEAVE;
+  static nsHtml5AttributeName* ATTR_ONMOUSEMOVE;
+  static nsHtml5AttributeName* ATTR_ONMOUSEUP;
+  static nsHtml5AttributeName* ATTR_ONFOCUS;
+  static nsHtml5AttributeName* ATTR_ONMOUSEOUT;
+  static nsHtml5AttributeName* ATTR_ONFOCUSOUT;
+  static nsHtml5AttributeName* ATTR_ONMOUSEDOWN;
+  static nsHtml5AttributeName* ATTR_TO;
+  static nsHtml5AttributeName* ATTR_RQUOTE;
+  static nsHtml5AttributeName* ATTR_STROKE_LINECAP;
+  static nsHtml5AttributeName* ATTR_STROKE_DASHARRAY;
+  static nsHtml5AttributeName* ATTR_STROKE_DASHOFFSET;
+  static nsHtml5AttributeName* ATTR_STROKE_LINEJOIN;
+  static nsHtml5AttributeName* ATTR_STROKE_MITERLIMIT;
+  static nsHtml5AttributeName* ATTR_STROKE;
+  static nsHtml5AttributeName* ATTR_SCROLLING;
+  static nsHtml5AttributeName* ATTR_STROKE_WIDTH;
+  static nsHtml5AttributeName* ATTR_STROKE_OPACITY;
+  static nsHtml5AttributeName* ATTR_COMPACT;
+  static nsHtml5AttributeName* ATTR_CLIP;
+  static nsHtml5AttributeName* ATTR_CLIP_RULE;
+  static nsHtml5AttributeName* ATTR_CLIP_PATH;
+  static nsHtml5AttributeName* ATTR_CLIPPATHUNITS;
+  static nsHtml5AttributeName* ATTR_DISPLAY;
+  static nsHtml5AttributeName* ATTR_DISPLAYSTYLE;
+  static nsHtml5AttributeName* ATTR_GLYPH_ORIENTATION_VERTICAL;
+  static nsHtml5AttributeName* ATTR_GLYPH_ORIENTATION_HORIZONTAL;
+  static nsHtml5AttributeName* ATTR_GLYPHREF;
+  static nsHtml5AttributeName* ATTR_HTTP_EQUIV;
+  static nsHtml5AttributeName* ATTR_KEYPOINTS;
+  static nsHtml5AttributeName* ATTR_LOOP;
+  static nsHtml5AttributeName* ATTR_PROPERTY;
+  static nsHtml5AttributeName* ATTR_SCOPED;
+  static nsHtml5AttributeName* ATTR_STEP;
+  static nsHtml5AttributeName* ATTR_SHAPE_RENDERING;
+  static nsHtml5AttributeName* ATTR_SCOPE;
+  static nsHtml5AttributeName* ATTR_SHAPE;
+  static nsHtml5AttributeName* ATTR_SLOPE;
+  static nsHtml5AttributeName* ATTR_STOP_COLOR;
+  static nsHtml5AttributeName* ATTR_STOP_OPACITY;
+  static nsHtml5AttributeName* ATTR_TEMPLATE;
+  static nsHtml5AttributeName* ATTR_WRAP;
+  static nsHtml5AttributeName* ATTR_ABBR;
+  static nsHtml5AttributeName* ATTR_ATTRIBUTENAME;
+  static nsHtml5AttributeName* ATTR_ATTRIBUTETYPE;
+  static nsHtml5AttributeName* ATTR_CHAR;
+  static nsHtml5AttributeName* ATTR_COORDS;
+  static nsHtml5AttributeName* ATTR_CHAROFF;
+  static nsHtml5AttributeName* ATTR_CHARSET;
+  static nsHtml5AttributeName* ATTR_NOWRAP;
+  static nsHtml5AttributeName* ATTR_NOHREF;
+  static nsHtml5AttributeName* ATTR_ONDRAG;
+  static nsHtml5AttributeName* ATTR_ONDRAGENTER;
+  static nsHtml5AttributeName* ATTR_ONDRAGOVER;
+  static nsHtml5AttributeName* ATTR_ONDRAGEND;
+  static nsHtml5AttributeName* ATTR_ONDROP;
+  static nsHtml5AttributeName* ATTR_ONDRAGDROP;
+  static nsHtml5AttributeName* ATTR_ONERROR;
+  static nsHtml5AttributeName* ATTR_OPERATOR;
+  static nsHtml5AttributeName* ATTR_OVERFLOW;
+  static nsHtml5AttributeName* ATTR_ONDRAGSTART;
+  static nsHtml5AttributeName* ATTR_ONDRAGLEAVE;
+  static nsHtml5AttributeName* ATTR_STARTOFFSET;
+  static nsHtml5AttributeName* ATTR_START;
+  static nsHtml5AttributeName* ATTR_AXIS;
+  static nsHtml5AttributeName* ATTR_BIAS;
+  static nsHtml5AttributeName* ATTR_COLSPAN;
+  static nsHtml5AttributeName* ATTR_CLASSID;
+  static nsHtml5AttributeName* ATTR_CROSSORIGIN;
+  static nsHtml5AttributeName* ATTR_COLS;
+  static nsHtml5AttributeName* ATTR_CURSOR;
+  static nsHtml5AttributeName* ATTR_CLOSURE;
+  static nsHtml5AttributeName* ATTR_CLOSE;
+  static nsHtml5AttributeName* ATTR_CLASS;
+  static nsHtml5AttributeName* ATTR_IS;
+  static nsHtml5AttributeName* ATTR_KEYSYSTEM;
+  static nsHtml5AttributeName* ATTR_KEYSPLINES;
+  static nsHtml5AttributeName* ATTR_LOWSRC;
+  static nsHtml5AttributeName* ATTR_MAXSIZE;
+  static nsHtml5AttributeName* ATTR_MINSIZE;
+  static nsHtml5AttributeName* ATTR_OFFSET;
+  static nsHtml5AttributeName* ATTR_PRESERVEALPHA;
+  static nsHtml5AttributeName* ATTR_PRESERVEASPECTRATIO;
+  static nsHtml5AttributeName* ATTR_ROWSPAN;
+  static nsHtml5AttributeName* ATTR_ROWSPACING;
+  static nsHtml5AttributeName* ATTR_ROWS;
+  static nsHtml5AttributeName* ATTR_SRCSET;
+  static nsHtml5AttributeName* ATTR_SUBSCRIPTSHIFT;
+  static nsHtml5AttributeName* ATTR_VERSION;
+  static nsHtml5AttributeName* ATTR_ALTTEXT;
+  static nsHtml5AttributeName* ATTR_CONTENTEDITABLE;
+  static nsHtml5AttributeName* ATTR_CONTROLS;
+  static nsHtml5AttributeName* ATTR_CONTENT;
+  static nsHtml5AttributeName* ATTR_CONTEXTMENU;
+  static nsHtml5AttributeName* ATTR_DEPTH;
+  static nsHtml5AttributeName* ATTR_ENCTYPE;
+  static nsHtml5AttributeName* ATTR_FONT_STRETCH;
+  static nsHtml5AttributeName* ATTR_FILTER;
+  static nsHtml5AttributeName* ATTR_FONTWEIGHT;
+  static nsHtml5AttributeName* ATTR_FONT_WEIGHT;
+  static nsHtml5AttributeName* ATTR_FONTSTYLE;
+  static nsHtml5AttributeName* ATTR_FONT_STYLE;
+  static nsHtml5AttributeName* ATTR_FONTFAMILY;
+  static nsHtml5AttributeName* ATTR_FONT_FAMILY;
+  static nsHtml5AttributeName* ATTR_FONT_VARIANT;
+  static nsHtml5AttributeName* ATTR_FONT_SIZE_ADJUST;
+  static nsHtml5AttributeName* ATTR_FILTERUNITS;
+  static nsHtml5AttributeName* ATTR_FONTSIZE;
+  static nsHtml5AttributeName* ATTR_FONT_SIZE;
+  static nsHtml5AttributeName* ATTR_KEYTIMES;
+  static nsHtml5AttributeName* ATTR_LETTER_SPACING;
+  static nsHtml5AttributeName* ATTR_LIST;
+  static nsHtml5AttributeName* ATTR_MULTIPLE;
+  static nsHtml5AttributeName* ATTR_RT;
+  static nsHtml5AttributeName* ATTR_ONSTOP;
+  static nsHtml5AttributeName* ATTR_ONSTART;
+  static nsHtml5AttributeName* ATTR_POSTER;
+  static nsHtml5AttributeName* ATTR_PATTERNTRANSFORM;
+  static nsHtml5AttributeName* ATTR_PATTERN;
+  static nsHtml5AttributeName* ATTR_PATTERNUNITS;
+  static nsHtml5AttributeName* ATTR_PATTERNCONTENTUNITS;
+  static nsHtml5AttributeName* ATTR_RESTART;
+  static nsHtml5AttributeName* ATTR_STITCHTILES;
+  static nsHtml5AttributeName* ATTR_SYSTEMLANGUAGE;
+  static nsHtml5AttributeName* ATTR_TEXT_RENDERING;
+  static nsHtml5AttributeName* ATTR_TEXT_DECORATION;
+  static nsHtml5AttributeName* ATTR_TEXT_ANCHOR;
+  static nsHtml5AttributeName* ATTR_TEXTLENGTH;
+  static nsHtml5AttributeName* ATTR_TEXT;
+  static nsHtml5AttributeName* ATTR_WRITING_MODE;
+  static nsHtml5AttributeName* ATTR_WIDTH;
+  static nsHtml5AttributeName* ATTR_ACCUMULATE;
+  static nsHtml5AttributeName* ATTR_COLUMNSPAN;
+  static nsHtml5AttributeName* ATTR_COLUMNLINES;
+  static nsHtml5AttributeName* ATTR_COLUMNALIGN;
+  static nsHtml5AttributeName* ATTR_COLUMNSPACING;
+  static nsHtml5AttributeName* ATTR_COLUMNWIDTH;
+  static nsHtml5AttributeName* ATTR_GROUPALIGN;
+  static nsHtml5AttributeName* ATTR_INPUTMODE;
+  static nsHtml5AttributeName* ATTR_ONSUBMIT;
+  static nsHtml5AttributeName* ATTR_ONCUT;
+  static nsHtml5AttributeName* ATTR_REQUIRED;
+  static nsHtml5AttributeName* ATTR_REQUIREDFEATURES;
+  static nsHtml5AttributeName* ATTR_RESULT;
+  static nsHtml5AttributeName* ATTR_REQUIREDEXTENSIONS;
+  static nsHtml5AttributeName* ATTR_VALUES;
+  static nsHtml5AttributeName* ATTR_VALUETYPE;
+  static nsHtml5AttributeName* ATTR_VALUE;
+  static nsHtml5AttributeName* ATTR_ELEVATION;
+  static nsHtml5AttributeName* ATTR_VIEWTARGET;
+  static nsHtml5AttributeName* ATTR_VIEWBOX;
+  static nsHtml5AttributeName* ATTR_CX;
+  static nsHtml5AttributeName* ATTR_DX;
+  static nsHtml5AttributeName* ATTR_FX;
+  static nsHtml5AttributeName* ATTR_RX;
+  static nsHtml5AttributeName* ATTR_REFX;
+  static nsHtml5AttributeName* ATTR_BY;
+  static nsHtml5AttributeName* ATTR_CY;
+  static nsHtml5AttributeName* ATTR_DY;
+  static nsHtml5AttributeName* ATTR_FY;
+  static nsHtml5AttributeName* ATTR_RY;
+  static nsHtml5AttributeName* ATTR_REFY;
+
+private:
+  static nsHtml5AttributeName** ATTRIBUTE_NAMES;
+  static staticJArray<int32_t, int32_t> ATTRIBUTE_HASHES;
+
+public:
+  static void initializeStatics();
+  static void releaseStatics();
 };
 
 #endif
-
--- a/parser/html/nsHtml5ElementName.cpp
+++ b/parser/html/nsHtml5ElementName.cpp
@@ -74,17 +74,16 @@ nsHtml5ElementName::nsHtml5ElementName()
   , camelCaseName(nullptr)
   , htmlCreator(NS_NewHTMLUnknownElement)
   , svgCreator(NS_NewSVGUnknownElement)
   , flags(nsHtml5TreeBuilder::OTHER | NOT_INTERNED)
 {
   MOZ_COUNT_CTOR(nsHtml5ElementName);
 }
 
-
 nsHtml5ElementName::~nsHtml5ElementName()
 {
   MOZ_COUNT_DTOR(nsHtml5ElementName);
 }
 
 nsHtml5ElementName* nsHtml5ElementName::ELT_ANNOTATION_XML = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_BIG = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_BDO = nullptr;
@@ -325,17 +324,20 @@ static int32_t const ELEMENT_HASHES_DATA
   1757146773, 1757268168, 1766992520, 1783210839, 1783388498, 1790207270,
   1798686984, 1803929812, 1805502724, 1806806678, 1818230786, 1853642948,
   1854228698, 1857653029, 1868312196, 1870268949, 1874053333, 1881288348,
   1881613047, 1884120164, 1889085973, 1898753862, 1900845386, 1903302038,
   1905563974, 1906135367, 1907661127, 1914900309, 1925844629, 1934172497,
   1938817026, 1941178676, 1963982850, 1965334268, 1967128578, 1967788867,
   1967795958, 1968836118
 };
-staticJArray<int32_t,int32_t> nsHtml5ElementName::ELEMENT_HASHES = { ELEMENT_HASHES_DATA, MOZ_ARRAY_LENGTH(ELEMENT_HASHES_DATA) };
+staticJArray<int32_t, int32_t> nsHtml5ElementName::ELEMENT_HASHES = {
+  ELEMENT_HASHES_DATA,
+  MOZ_ARRAY_LENGTH(ELEMENT_HASHES_DATA)
+};
 void
 nsHtml5ElementName::initializeStatics()
 {
   ELT_ANNOTATION_XML = new nsHtml5ElementName(
     nsGkAtoms::annotation_xml_,
     nsGkAtoms::annotation_xml_,
     NS_NewHTMLUnknownElement,
     NS_NewSVGUnknownElement,
@@ -1921,10 +1923,8 @@ nsHtml5ElementName::releaseStatics()
   delete ELT_FECONVOLVEMATRIX;
   delete ELT_BODY;
   delete ELT_FEMORPHOLOGY;
   delete ELT_RUBY;
   delete ELT_SUMMARY;
   delete ELT_TBODY;
   delete[] ELEMENT_NAMES;
 }
-
-
--- a/parser/html/nsHtml5ElementName.h
+++ b/parser/html/nsHtml5ElementName.h
@@ -49,17 +49,16 @@ class nsHtml5StreamParser;
 class nsHtml5AttributeName;
 class nsHtml5Tokenizer;
 class nsHtml5TreeBuilder;
 class nsHtml5MetaScanner;
 class nsHtml5UTF16Buffer;
 class nsHtml5StateSnapshot;
 class nsHtml5Portability;
 
-
 class nsHtml5ElementName
 {
 public:
   static const int32_t GROUP_MASK = 127;
 
   static const int32_t NOT_INTERNED = (1 << 30);
 
   static const int32_t SPECIAL = (1 << 29);
@@ -138,281 +137,282 @@ public:
       nsHtml5ElementName* elementName =
         nsHtml5ElementName::ELEMENT_NAMES[index];
       nsAtom* name = elementName->name;
       if (!nsHtml5Portability::localEqualsBuffer(name, buf, length)) {
         return nullptr;
       }
       return elementName;
     }
-    }
+  }
 
-  private:
-    inline static uint32_t bufToHash(char16_t* buf, int32_t length)
-    {
-      uint32_t len = length;
-      uint32_t first = buf[0];
-      first <<= 19;
-      uint32_t second = 1 << 23;
-      uint32_t third = 0;
-      uint32_t fourth = 0;
-      uint32_t fifth = 0;
-      if (length >= 4) {
-        second = buf[length - 4];
-        second <<= 4;
-        third = buf[length - 3];
-        third <<= 9;
-        fourth = buf[length - 2];
-        fourth <<= 14;
-        fifth = buf[length - 1];
-        fifth <<= 24;
-      } else if (length == 3) {
-        second = buf[1];
-        second <<= 4;
-        third = buf[2];
-        third <<= 9;
-      } else if (length == 2) {
-        second = buf[1];
-        second <<= 24;
-      }
-      return len + first + second + third + fourth + fifth;
+private:
+  inline static uint32_t bufToHash(char16_t* buf, int32_t length)
+  {
+    uint32_t len = length;
+    uint32_t first = buf[0];
+    first <<= 19;
+    uint32_t second = 1 << 23;
+    uint32_t third = 0;
+    uint32_t fourth = 0;
+    uint32_t fifth = 0;
+    if (length >= 4) {
+      second = buf[length - 4];
+      second <<= 4;
+      third = buf[length - 3];
+      third <<= 9;
+      fourth = buf[length - 2];
+      fourth <<= 14;
+      fifth = buf[length - 1];
+      fifth <<= 24;
+    } else if (length == 3) {
+      second = buf[1];
+      second <<= 4;
+      third = buf[2];
+      third <<= 9;
+    } else if (length == 2) {
+      second = buf[1];
+      second <<= 24;
     }
+    return len + first + second + third + fourth + fifth;
+  }
 
-    nsHtml5ElementName(nsAtom* name,
-                       nsAtom* camelCaseName,
-                       mozilla::dom::HTMLContentCreatorFunction htmlCreator,
-                       mozilla::dom::SVGContentCreatorFunction svgCreator,
-                       int32_t flags);
+  nsHtml5ElementName(nsAtom* name,
+                     nsAtom* camelCaseName,
+                     mozilla::dom::HTMLContentCreatorFunction htmlCreator,
+                     mozilla::dom::SVGContentCreatorFunction svgCreator,
+                     int32_t flags);
 
-  public:
-    nsHtml5ElementName();
-    ~nsHtml5ElementName();
-    inline void setNameForNonInterned(nsAtom* name, bool custom)
-    {
-      this->name = name;
-      this->camelCaseName = name;
-      if (custom) {
-        this->htmlCreator = NS_NewCustomElement;
-      } else {
-        this->htmlCreator = NS_NewHTMLUnknownElement;
-      }
-      MOZ_ASSERT(this->flags == nsHtml5ElementName::NOT_INTERNED);
+public:
+  nsHtml5ElementName();
+  ~nsHtml5ElementName();
+  inline void setNameForNonInterned(nsAtom* name, bool custom)
+  {
+    this->name = name;
+    this->camelCaseName = name;
+    if (custom) {
+      this->htmlCreator = NS_NewCustomElement;
+    } else {
+      this->htmlCreator = NS_NewHTMLUnknownElement;
     }
+    MOZ_ASSERT(this->flags == nsHtml5ElementName::NOT_INTERNED);
+  }
 
-    inline bool isCustom() { return this->htmlCreator == NS_NewCustomElement; }
+  inline bool isCustom() { return this->htmlCreator == NS_NewCustomElement; }
 
-    static nsHtml5ElementName* ELT_ANNOTATION_XML;
-    static nsHtml5ElementName* ELT_BIG;
-    static nsHtml5ElementName* ELT_BDO;
-    static nsHtml5ElementName* ELT_COL;
-    static nsHtml5ElementName* ELT_DEL;
-    static nsHtml5ElementName* ELT_DFN;
-    static nsHtml5ElementName* ELT_DIR;
-    static nsHtml5ElementName* ELT_DIV;
-    static nsHtml5ElementName* ELT_IMG;
-    static nsHtml5ElementName* ELT_INS;
-    static nsHtml5ElementName* ELT_KBD;
-    static nsHtml5ElementName* ELT_MAP;
-    static nsHtml5ElementName* ELT_NAV;
-    static nsHtml5ElementName* ELT_PRE;
-    static nsHtml5ElementName* ELT_A;
-    static nsHtml5ElementName* ELT_B;
-    static nsHtml5ElementName* ELT_RTC;
-    static nsHtml5ElementName* ELT_SUB;
-    static nsHtml5ElementName* ELT_SVG;
-    static nsHtml5ElementName* ELT_SUP;
-    static nsHtml5ElementName* ELT_SET;
-    static nsHtml5ElementName* ELT_USE;
-    static nsHtml5ElementName* ELT_VAR;
-    static nsHtml5ElementName* ELT_G;
-    static nsHtml5ElementName* ELT_WBR;
-    static nsHtml5ElementName* ELT_XMP;
-    static nsHtml5ElementName* ELT_I;
-    static nsHtml5ElementName* ELT_P;
-    static nsHtml5ElementName* ELT_Q;
-    static nsHtml5ElementName* ELT_S;
-    static nsHtml5ElementName* ELT_U;
-    static nsHtml5ElementName* ELT_H1;
-    static nsHtml5ElementName* ELT_H2;
-    static nsHtml5ElementName* ELT_H3;
-    static nsHtml5ElementName* ELT_H4;
-    static nsHtml5ElementName* ELT_H5;
-    static nsHtml5ElementName* ELT_H6;
-    static nsHtml5ElementName* ELT_AREA;
-    static nsHtml5ElementName* ELT_DATA;
-    static nsHtml5ElementName* ELT_FEFUNCA;
-    static nsHtml5ElementName* ELT_METADATA;
-    static nsHtml5ElementName* ELT_META;
-    static nsHtml5ElementName* ELT_TEXTAREA;
-    static nsHtml5ElementName* ELT_FEFUNCB;
-    static nsHtml5ElementName* ELT_RB;
-    static nsHtml5ElementName* ELT_DESC;
-    static nsHtml5ElementName* ELT_DD;
-    static nsHtml5ElementName* ELT_BGSOUND;
-    static nsHtml5ElementName* ELT_EMBED;
-    static nsHtml5ElementName* ELT_FEBLEND;
-    static nsHtml5ElementName* ELT_FEFLOOD;
-    static nsHtml5ElementName* ELT_HEAD;
-    static nsHtml5ElementName* ELT_LEGEND;
-    static nsHtml5ElementName* ELT_NOEMBED;
-    static nsHtml5ElementName* ELT_TD;
-    static nsHtml5ElementName* ELT_THEAD;
-    static nsHtml5ElementName* ELT_ASIDE;
-    static nsHtml5ElementName* ELT_ARTICLE;
-    static nsHtml5ElementName* ELT_ANIMATE;
-    static nsHtml5ElementName* ELT_BASE;
-    static nsHtml5ElementName* ELT_BLOCKQUOTE;
-    static nsHtml5ElementName* ELT_CODE;
-    static nsHtml5ElementName* ELT_CIRCLE;
-    static nsHtml5ElementName* ELT_CITE;
-    static nsHtml5ElementName* ELT_ELLIPSE;
-    static nsHtml5ElementName* ELT_FETURBULENCE;
-    static nsHtml5ElementName* ELT_FEMERGENODE;
-    static nsHtml5ElementName* ELT_FEIMAGE;
-    static nsHtml5ElementName* ELT_FEMERGE;
-    static nsHtml5ElementName* ELT_FETILE;
-    static nsHtml5ElementName* ELT_FRAME;
-    static nsHtml5ElementName* ELT_FIGURE;
-    static nsHtml5ElementName* ELT_FECOMPOSITE;
-    static nsHtml5ElementName* ELT_IMAGE;
-    static nsHtml5ElementName* ELT_IFRAME;
-    static nsHtml5ElementName* ELT_LINE;
-    static nsHtml5ElementName* ELT_MARQUEE;
-    static nsHtml5ElementName* ELT_POLYLINE;
-    static nsHtml5ElementName* ELT_PICTURE;
-    static nsHtml5ElementName* ELT_SOURCE;
-    static nsHtml5ElementName* ELT_STRIKE;
-    static nsHtml5ElementName* ELT_STYLE;
-    static nsHtml5ElementName* ELT_TABLE;
-    static nsHtml5ElementName* ELT_TITLE;
-    static nsHtml5ElementName* ELT_TIME;
-    static nsHtml5ElementName* ELT_TEMPLATE;
-    static nsHtml5ElementName* ELT_ALTGLYPHDEF;
-    static nsHtml5ElementName* ELT_GLYPHREF;
-    static nsHtml5ElementName* ELT_DIALOG;
-    static nsHtml5ElementName* ELT_FEFUNCG;
-    static nsHtml5ElementName* ELT_FEDIFFUSELIGHTING;
-    static nsHtml5ElementName* ELT_FESPECULARLIGHTING;
-    static nsHtml5ElementName* ELT_LISTING;
-    static nsHtml5ElementName* ELT_STRONG;
-    static nsHtml5ElementName* ELT_ALTGLYPH;
-    static nsHtml5ElementName* ELT_CLIPPATH;
-    static nsHtml5ElementName* ELT_MGLYPH;
-    static nsHtml5ElementName* ELT_MATH;
-    static nsHtml5ElementName* ELT_MPATH;
-    static nsHtml5ElementName* ELT_PATH;
-    static nsHtml5ElementName* ELT_TH;
-    static nsHtml5ElementName* ELT_SWITCH;
-    static nsHtml5ElementName* ELT_TEXTPATH;
-    static nsHtml5ElementName* ELT_LI;
-    static nsHtml5ElementName* ELT_MI;
-    static nsHtml5ElementName* ELT_LINK;
-    static nsHtml5ElementName* ELT_MARK;
-    static nsHtml5ElementName* ELT_MALIGNMARK;
-    static nsHtml5ElementName* ELT_MASK;
-    static nsHtml5ElementName* ELT_TRACK;
-    static nsHtml5ElementName* ELT_DL;
-    static nsHtml5ElementName* ELT_HTML;
-    static nsHtml5ElementName* ELT_OL;
-    static nsHtml5ElementName* ELT_LABEL;
-    static nsHtml5ElementName* ELT_UL;
-    static nsHtml5ElementName* ELT_SMALL;
-    static nsHtml5ElementName* ELT_SYMBOL;
-    static nsHtml5ElementName* ELT_ALTGLYPHITEM;
-    static nsHtml5ElementName* ELT_ANIMATETRANSFORM;
-    static nsHtml5ElementName* ELT_ACRONYM;
-    static nsHtml5ElementName* ELT_EM;
-    static nsHtml5ElementName* ELT_FORM;
-    static nsHtml5ElementName* ELT_MENUITEM;
-    static nsHtml5ElementName* ELT_PARAM;
-    static nsHtml5ElementName* ELT_ANIMATEMOTION;
-    static nsHtml5ElementName* ELT_BUTTON;
-    static nsHtml5ElementName* ELT_CAPTION;
-    static nsHtml5ElementName* ELT_FIGCAPTION;
-    static nsHtml5ElementName* ELT_MN;
-    static nsHtml5ElementName* ELT_KEYGEN;
-    static nsHtml5ElementName* ELT_MAIN;
-    static nsHtml5ElementName* ELT_OPTION;
-    static nsHtml5ElementName* ELT_POLYGON;
-    static nsHtml5ElementName* ELT_PATTERN;
-    static nsHtml5ElementName* ELT_SPAN;
-    static nsHtml5ElementName* ELT_SECTION;
-    static nsHtml5ElementName* ELT_TSPAN;
-    static nsHtml5ElementName* ELT_AUDIO;
-    static nsHtml5ElementName* ELT_MO;
-    static nsHtml5ElementName* ELT_VIDEO;
-    static nsHtml5ElementName* ELT_COLGROUP;
-    static nsHtml5ElementName* ELT_FEDISPLACEMENTMAP;
-    static nsHtml5ElementName* ELT_HGROUP;
-    static nsHtml5ElementName* ELT_RP;
-    static nsHtml5ElementName* ELT_OPTGROUP;
-    static nsHtml5ElementName* ELT_SAMP;
-    static nsHtml5ElementName* ELT_STOP;
-    static nsHtml5ElementName* ELT_BR;
-    static nsHtml5ElementName* ELT_ABBR;
-    static nsHtml5ElementName* ELT_ANIMATECOLOR;
-    static nsHtml5ElementName* ELT_CENTER;
-    static nsHtml5ElementName* ELT_HR;
-    static nsHtml5ElementName* ELT_FEFUNCR;
-    static nsHtml5ElementName* ELT_FECOMPONENTTRANSFER;
-    static nsHtml5ElementName* ELT_FILTER;
-    static nsHtml5ElementName* ELT_FOOTER;
-    static nsHtml5ElementName* ELT_FEGAUSSIANBLUR;
-    static nsHtml5ElementName* ELT_HEADER;
-    static nsHtml5ElementName* ELT_MARKER;
-    static nsHtml5ElementName* ELT_METER;
-    static nsHtml5ElementName* ELT_NOBR;
-    static nsHtml5ElementName* ELT_TR;
-    static nsHtml5ElementName* ELT_ADDRESS;
-    static nsHtml5ElementName* ELT_CANVAS;
-    static nsHtml5ElementName* ELT_DEFS;
-    static nsHtml5ElementName* ELT_DETAILS;
-    static nsHtml5ElementName* ELT_MS;
-    static nsHtml5ElementName* ELT_NOFRAMES;
-    static nsHtml5ElementName* ELT_PROGRESS;
-    static nsHtml5ElementName* ELT_DT;
-    static nsHtml5ElementName* ELT_APPLET;
-    static nsHtml5ElementName* ELT_BASEFONT;
-    static nsHtml5ElementName* ELT_DATALIST;
-    static nsHtml5ElementName* ELT_FOREIGNOBJECT;
-    static nsHtml5ElementName* ELT_FIELDSET;
-    static nsHtml5ElementName* ELT_FRAMESET;
-    static nsHtml5ElementName* ELT_FEOFFSET;
-    static nsHtml5ElementName* ELT_FESPOTLIGHT;
-    static nsHtml5ElementName* ELT_FEPOINTLIGHT;
-    static nsHtml5ElementName* ELT_FEDISTANTLIGHT;
-    static nsHtml5ElementName* ELT_FONT;
-    static nsHtml5ElementName* ELT_INPUT;
-    static nsHtml5ElementName* ELT_LINEARGRADIENT;
-    static nsHtml5ElementName* ELT_MTEXT;
-    static nsHtml5ElementName* ELT_NOSCRIPT;
-    static nsHtml5ElementName* ELT_RT;
-    static nsHtml5ElementName* ELT_OBJECT;
-    static nsHtml5ElementName* ELT_OUTPUT;
-    static nsHtml5ElementName* ELT_PLAINTEXT;
-    static nsHtml5ElementName* ELT_TT;
-    static nsHtml5ElementName* ELT_RECT;
-    static nsHtml5ElementName* ELT_RADIALGRADIENT;
-    static nsHtml5ElementName* ELT_SELECT;
-    static nsHtml5ElementName* ELT_SLOT;
-    static nsHtml5ElementName* ELT_SCRIPT;
-    static nsHtml5ElementName* ELT_TFOOT;
-    static nsHtml5ElementName* ELT_TEXT;
-    static nsHtml5ElementName* ELT_MENU;
-    static nsHtml5ElementName* ELT_FEDROPSHADOW;
-    static nsHtml5ElementName* ELT_VIEW;
-    static nsHtml5ElementName* ELT_FECOLORMATRIX;
-    static nsHtml5ElementName* ELT_FECONVOLVEMATRIX;
-    static nsHtml5ElementName* ELT_BODY;
-    static nsHtml5ElementName* ELT_FEMORPHOLOGY;
-    static nsHtml5ElementName* ELT_RUBY;
-    static nsHtml5ElementName* ELT_SUMMARY;
-    static nsHtml5ElementName* ELT_TBODY;
-  private:
-    static nsHtml5ElementName** ELEMENT_NAMES;
-    static staticJArray<int32_t,int32_t> ELEMENT_HASHES;
-  public:
-    static void initializeStatics();
-    static void releaseStatics();
+  static nsHtml5ElementName* ELT_ANNOTATION_XML;
+  static nsHtml5ElementName* ELT_BIG;
+  static nsHtml5ElementName* ELT_BDO;
+  static nsHtml5ElementName* ELT_COL;
+  static nsHtml5ElementName* ELT_DEL;
+  static nsHtml5ElementName* ELT_DFN;
+  static nsHtml5ElementName* ELT_DIR;
+  static nsHtml5ElementName* ELT_DIV;
+  static nsHtml5ElementName* ELT_IMG;
+  static nsHtml5ElementName* ELT_INS;
+  static nsHtml5ElementName* ELT_KBD;
+  static nsHtml5ElementName* ELT_MAP;
+  static nsHtml5ElementName* ELT_NAV;
+  static nsHtml5ElementName* ELT_PRE;
+  static nsHtml5ElementName* ELT_A;
+  static nsHtml5ElementName* ELT_B;
+  static nsHtml5ElementName* ELT_RTC;
+  static nsHtml5ElementName* ELT_SUB;
+  static nsHtml5ElementName* ELT_SVG;
+  static nsHtml5ElementName* ELT_SUP;
+  static nsHtml5ElementName* ELT_SET;
+  static nsHtml5ElementName* ELT_USE;
+  static nsHtml5ElementName* ELT_VAR;
+  static nsHtml5ElementName* ELT_G;
+  static nsHtml5ElementName* ELT_WBR;
+  static nsHtml5ElementName* ELT_XMP;
+  static nsHtml5ElementName* ELT_I;
+  static nsHtml5ElementName* ELT_P;
+  static nsHtml5ElementName* ELT_Q;
+  static nsHtml5ElementName* ELT_S;
+  static nsHtml5ElementName* ELT_U;
+  static nsHtml5ElementName* ELT_H1;
+  static nsHtml5ElementName* ELT_H2;
+  static nsHtml5ElementName* ELT_H3;
+  static nsHtml5ElementName* ELT_H4;
+  static nsHtml5ElementName* ELT_H5;
+  static nsHtml5ElementName* ELT_H6;
+  static nsHtml5ElementName* ELT_AREA;
+  static nsHtml5ElementName* ELT_DATA;
+  static nsHtml5ElementName* ELT_FEFUNCA;
+  static nsHtml5ElementName* ELT_METADATA;
+  static nsHtml5ElementName* ELT_META;
+  static nsHtml5ElementName* ELT_TEXTAREA;
+  static nsHtml5ElementName* ELT_FEFUNCB;
+  static nsHtml5ElementName* ELT_RB;
+  static nsHtml5ElementName* ELT_DESC;
+  static nsHtml5ElementName* ELT_DD;
+  static nsHtml5ElementName* ELT_BGSOUND;
+  static nsHtml5ElementName* ELT_EMBED;
+  static nsHtml5ElementName* ELT_FEBLEND;
+  static nsHtml5ElementName* ELT_FEFLOOD;
+  static nsHtml5ElementName* ELT_HEAD;
+  static nsHtml5ElementName* ELT_LEGEND;
+  static nsHtml5ElementName* ELT_NOEMBED;
+  static nsHtml5ElementName* ELT_TD;
+  static nsHtml5ElementName* ELT_THEAD;
+  static nsHtml5ElementName* ELT_ASIDE;
+  static nsHtml5ElementName* ELT_ARTICLE;
+  static nsHtml5ElementName* ELT_ANIMATE;
+  static nsHtml5ElementName* ELT_BASE;
+  static nsHtml5ElementName* ELT_BLOCKQUOTE;
+  static nsHtml5ElementName* ELT_CODE;
+  static nsHtml5ElementName* ELT_CIRCLE;
+  static nsHtml5ElementName* ELT_CITE;
+  static nsHtml5ElementName* ELT_ELLIPSE;
+  static nsHtml5ElementName* ELT_FETURBULENCE;
+  static nsHtml5ElementName* ELT_FEMERGENODE;
+  static nsHtml5ElementName* ELT_FEIMAGE;
+  static nsHtml5ElementName* ELT_FEMERGE;
+  static nsHtml5ElementName* ELT_FETILE;
+  static nsHtml5ElementName* ELT_FRAME;
+  static nsHtml5ElementName* ELT_FIGURE;
+  static nsHtml5ElementName* ELT_FECOMPOSITE;
+  static nsHtml5ElementName* ELT_IMAGE;
+  static nsHtml5ElementName* ELT_IFRAME;
+  static nsHtml5ElementName* ELT_LINE;
+  static nsHtml5ElementName* ELT_MARQUEE;
+  static nsHtml5ElementName* ELT_POLYLINE;
+  static nsHtml5ElementName* ELT_PICTURE;
+  static nsHtml5ElementName* ELT_SOURCE;
+  static nsHtml5ElementName* ELT_STRIKE;
+  static nsHtml5ElementName* ELT_STYLE;
+  static nsHtml5ElementName* ELT_TABLE;
+  static nsHtml5ElementName* ELT_TITLE;
+  static nsHtml5ElementName* ELT_TIME;
+  static nsHtml5ElementName* ELT_TEMPLATE;
+  static nsHtml5ElementName* ELT_ALTGLYPHDEF;
+  static nsHtml5ElementName* ELT_GLYPHREF;
+  static nsHtml5ElementName* ELT_DIALOG;
+  static nsHtml5ElementName* ELT_FEFUNCG;
+  static nsHtml5ElementName* ELT_FEDIFFUSELIGHTING;
+  static nsHtml5ElementName* ELT_FESPECULARLIGHTING;
+  static nsHtml5ElementName* ELT_LISTING;
+  static nsHtml5ElementName* ELT_STRONG;
+  static nsHtml5ElementName* ELT_ALTGLYPH;
+  static nsHtml5ElementName* ELT_CLIPPATH;
+  static nsHtml5ElementName* ELT_MGLYPH;
+  static nsHtml5ElementName* ELT_MATH;
+  static nsHtml5ElementName* ELT_MPATH;
+  static nsHtml5ElementName* ELT_PATH;
+  static nsHtml5ElementName* ELT_TH;
+  static nsHtml5ElementName* ELT_SWITCH;
+  static nsHtml5ElementName* ELT_TEXTPATH;
+  static nsHtml5ElementName* ELT_LI;
+  static nsHtml5ElementName* ELT_MI;
+  static nsHtml5ElementName* ELT_LINK;
+  static nsHtml5ElementName* ELT_MARK;
+  static nsHtml5ElementName* ELT_MALIGNMARK;
+  static nsHtml5ElementName* ELT_MASK;
+  static nsHtml5ElementName* ELT_TRACK;
+  static nsHtml5ElementName* ELT_DL;
+  static nsHtml5ElementName* ELT_HTML;
+  static nsHtml5ElementName* ELT_OL;
+  static nsHtml5ElementName* ELT_LABEL;
+  static nsHtml5ElementName* ELT_UL;
+  static nsHtml5ElementName* ELT_SMALL;
+  static nsHtml5ElementName* ELT_SYMBOL;
+  static nsHtml5ElementName* ELT_ALTGLYPHITEM;
+  static nsHtml5ElementName* ELT_ANIMATETRANSFORM;
+  static nsHtml5ElementName* ELT_ACRONYM;
+  static nsHtml5ElementName* ELT_EM;
+  static nsHtml5ElementName* ELT_FORM;
+  static nsHtml5ElementName* ELT_MENUITEM;
+  static nsHtml5ElementName* ELT_PARAM;
+  static nsHtml5ElementName* ELT_ANIMATEMOTION;
+  static nsHtml5ElementName* ELT_BUTTON;
+  static nsHtml5ElementName* ELT_CAPTION;
+  static nsHtml5ElementName* ELT_FIGCAPTION;
+  static nsHtml5ElementName* ELT_MN;
+  static nsHtml5ElementName* ELT_KEYGEN;
+  static nsHtml5ElementName* ELT_MAIN;
+  static nsHtml5ElementName* ELT_OPTION;
+  static nsHtml5ElementName* ELT_POLYGON;
+  static nsHtml5ElementName* ELT_PATTERN;
+  static nsHtml5ElementName* ELT_SPAN;
+  static nsHtml5ElementName* ELT_SECTION;
+  static nsHtml5ElementName* ELT_TSPAN;
+  static nsHtml5ElementName* ELT_AUDIO;
+  static nsHtml5ElementName* ELT_MO;
+  static nsHtml5ElementName* ELT_VIDEO;
+  static nsHtml5ElementName* ELT_COLGROUP;
+  static nsHtml5ElementName* ELT_FEDISPLACEMENTMAP;
+  static nsHtml5ElementName* ELT_HGROUP;
+  static nsHtml5ElementName* ELT_RP;
+  static nsHtml5ElementName* ELT_OPTGROUP;
+  static nsHtml5ElementName* ELT_SAMP;
+  static nsHtml5ElementName* ELT_STOP;
+  static nsHtml5ElementName* ELT_BR;
+  static nsHtml5ElementName* ELT_ABBR;
+  static nsHtml5ElementName* ELT_ANIMATECOLOR;
+  static nsHtml5ElementName* ELT_CENTER;
+  static nsHtml5ElementName* ELT_HR;
+  static nsHtml5ElementName* ELT_FEFUNCR;
+  static nsHtml5ElementName* ELT_FECOMPONENTTRANSFER;
+  static nsHtml5ElementName* ELT_FILTER;
+  static nsHtml5ElementName* ELT_FOOTER;
+  static nsHtml5ElementName* ELT_FEGAUSSIANBLUR;
+  static nsHtml5ElementName* ELT_HEADER;
+  static nsHtml5ElementName* ELT_MARKER;
+  static nsHtml5ElementName* ELT_METER;
+  static nsHtml5ElementName* ELT_NOBR;
+  static nsHtml5ElementName* ELT_TR;
+  static nsHtml5ElementName* ELT_ADDRESS;
+  static nsHtml5ElementName* ELT_CANVAS;
+  static nsHtml5ElementName* ELT_DEFS;
+  static nsHtml5ElementName* ELT_DETAILS;
+  static nsHtml5ElementName* ELT_MS;
+  static nsHtml5ElementName* ELT_NOFRAMES;
+  static nsHtml5ElementName* ELT_PROGRESS;
+  static nsHtml5ElementName* ELT_DT;
+  static nsHtml5ElementName* ELT_APPLET;
+  static nsHtml5ElementName* ELT_BASEFONT;
+  static nsHtml5ElementName* ELT_DATALIST;
+  static nsHtml5ElementName* ELT_FOREIGNOBJECT;
+  static nsHtml5ElementName* ELT_FIELDSET;
+  static nsHtml5ElementName* ELT_FRAMESET;
+  static nsHtml5ElementName* ELT_FEOFFSET;
+  static nsHtml5ElementName* ELT_FESPOTLIGHT;
+  static nsHtml5ElementName* ELT_FEPOINTLIGHT;
+  static nsHtml5ElementName* ELT_FEDISTANTLIGHT;
+  static nsHtml5ElementName* ELT_FONT;
+  static nsHtml5ElementName* ELT_INPUT;
+  static nsHtml5ElementName* ELT_LINEARGRADIENT;
+  static nsHtml5ElementName* ELT_MTEXT;
+  static nsHtml5ElementName* ELT_NOSCRIPT;
+  static nsHtml5ElementName* ELT_RT;
+  static nsHtml5ElementName* ELT_OBJECT;
+  static nsHtml5ElementName* ELT_OUTPUT;
+  static nsHtml5ElementName* ELT_PLAINTEXT;
+  static nsHtml5ElementName* ELT_TT;
+  static nsHtml5ElementName* ELT_RECT;
+  static nsHtml5ElementName* ELT_RADIALGRADIENT;
+  static nsHtml5ElementName* ELT_SELECT;
+  static nsHtml5ElementName* ELT_SLOT;
+  static nsHtml5ElementName* ELT_SCRIPT;
+  static nsHtml5ElementName* ELT_TFOOT;
+  static nsHtml5ElementName* ELT_TEXT;
+  static nsHtml5ElementName* ELT_MENU;
+  static nsHtml5ElementName* ELT_FEDROPSHADOW;
+  static nsHtml5ElementName* ELT_VIEW;
+  static nsHtml5ElementName* ELT_FECOLORMATRIX;
+  static nsHtml5ElementName* ELT_FECONVOLVEMATRIX;
+  static nsHtml5ElementName* ELT_BODY;
+  static nsHtml5ElementName* ELT_FEMORPHOLOGY;
+  static nsHtml5ElementName* ELT_RUBY;
+  static nsHtml5ElementName* ELT_SUMMARY;
+  static nsHtml5ElementName* ELT_TBODY;
+
+private:
+  static nsHtml5ElementName** ELEMENT_NAMES;
+  static staticJArray<int32_t, int32_t> ELEMENT_HASHES;
+
+public:
+  static void initializeStatics();
+  static void releaseStatics();
 };
 
 #endif
-
--- a/parser/html/nsHtml5MetaScanner.cpp
+++ b/parser/html/nsHtml5MetaScanner.cpp
@@ -51,23 +51,37 @@
 #include "nsHtml5StackNode.h"
 #include "nsHtml5UTF16Buffer.h"
 #include "nsHtml5StateSnapshot.h"
 #include "nsHtml5Portability.h"
 
 #include "nsHtml5MetaScanner.h"
 
 static char16_t const CHARSET_DATA[] = { 'h', 'a', 'r', 's', 'e', 't' };
-staticJArray<char16_t,int32_t> nsHtml5MetaScanner::CHARSET = { CHARSET_DATA, MOZ_ARRAY_LENGTH(CHARSET_DATA) };
+staticJArray<char16_t, int32_t> nsHtml5MetaScanner::CHARSET = {
+  CHARSET_DATA,
+  MOZ_ARRAY_LENGTH(CHARSET_DATA)
+};
 static char16_t const CONTENT_DATA[] = { 'o', 'n', 't', 'e', 'n', 't' };
-staticJArray<char16_t,int32_t> nsHtml5MetaScanner::CONTENT = { CONTENT_DATA, MOZ_ARRAY_LENGTH(CONTENT_DATA) };
-static char16_t const HTTP_EQUIV_DATA[] = { 't', 't', 'p', '-', 'e', 'q', 'u', 'i', 'v' };
-staticJArray<char16_t,int32_t> nsHtml5MetaScanner::HTTP_EQUIV = { HTTP_EQUIV_DATA, MOZ_ARRAY_LENGTH(HTTP_EQUIV_DATA) };
-static char16_t const CONTENT_TYPE_DATA[] = { 'c', 'o', 'n', 't', 'e', 'n', 't', '-', 't', 'y', 'p', 'e' };
-staticJArray<char16_t,int32_t> nsHtml5MetaScanner::CONTENT_TYPE = { CONTENT_TYPE_DATA, MOZ_ARRAY_LENGTH(CONTENT_TYPE_DATA) };
+staticJArray<char16_t, int32_t> nsHtml5MetaScanner::CONTENT = {
+  CONTENT_DATA,
+  MOZ_ARRAY_LENGTH(CONTENT_DATA)
+};
+static char16_t const HTTP_EQUIV_DATA[] = { 't', 't', 'p', '-', 'e',
+                                            'q', 'u', 'i', 'v' };
+staticJArray<char16_t, int32_t> nsHtml5MetaScanner::HTTP_EQUIV = {
+  HTTP_EQUIV_DATA,
+  MOZ_ARRAY_LENGTH(HTTP_EQUIV_DATA)
+};
+static char16_t const CONTENT_TYPE_DATA[] = { 'c', 'o', 'n', 't', 'e', 'n',
+                                              't', '-', 't', 'y', 'p', 'e' };
+staticJArray<char16_t, int32_t> nsHtml5MetaScanner::CONTENT_TYPE = {
+  CONTENT_TYPE_DATA,
+  MOZ_ARRAY_LENGTH(CONTENT_TYPE_DATA)
+};
 
 nsHtml5MetaScanner::nsHtml5MetaScanner(nsHtml5TreeBuilder* tb)
   : readable(nullptr)
   , metaState(NO)
   , contentIndex(INT32_MAX)
   , charsetIndex(INT32_MAX)
   , httpEquivIndex(INT32_MAX)
   , contentTypeIndex(INT32_MAX)
@@ -78,57 +92,57 @@ nsHtml5MetaScanner::nsHtml5MetaScanner(n
   , charset(nullptr)
   , httpEquivState(HTTP_EQUIV_NOT_SEEN)
   , treeBuilder(tb)
   , mEncoding(nullptr)
 {
   MOZ_COUNT_CTOR(nsHtml5MetaScanner);
 }
 
-
 nsHtml5MetaScanner::~nsHtml5MetaScanner()
 {
   MOZ_COUNT_DTOR(nsHtml5MetaScanner);
   content.Release();
   charset.Release();
 }
 
-void 
+void
 nsHtml5MetaScanner::stateLoop(int32_t state)
 {
   int32_t c = -1;
   bool reconsume = false;
-  stateloop: for (; ; ) {
-    switch(state) {
+stateloop:
+  for (;;) {
+    switch (state) {
       case DATA: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             c = read();
           }
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case '<': {
               state = nsHtml5MetaScanner::TAG_OPEN;
               NS_HTML5_BREAK(dataloop);
             }
             default: {
               continue;
             }
           }
         }
-        dataloop_end: ;
+      dataloop_end:;
       }
       case TAG_OPEN: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case 'm':
             case 'M': {
               metaState = M;
               state = nsHtml5MetaScanner::TAG_NAME;
               NS_HTML5_BREAK(tagopenloop);
@@ -153,22 +167,22 @@ nsHtml5MetaScanner::stateLoop(int32_t st
                 NS_HTML5_BREAK(tagopenloop);
               }
               state = nsHtml5MetaScanner::DATA;
               reconsume = true;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        tagopenloop_end: ;
+      tagopenloop_end:;
       }
       case TAG_NAME: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case ' ':
             case '\t':
             case '\n':
             case '\f': {
               state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
@@ -210,26 +224,26 @@ nsHtml5MetaScanner::stateLoop(int32_t st
               continue;
             }
             default: {
               metaState = NO;
               continue;
             }
           }
         }
-        tagnameloop_end: ;
+      tagnameloop_end:;
       }
       case BEFORE_ATTRIBUTE_NAME: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             c = read();
           }
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case ' ':
             case '\t':
             case '\n':
             case '\f': {
               continue;
@@ -268,22 +282,22 @@ nsHtml5MetaScanner::stateLoop(int32_t st
               charsetIndex = INT32_MAX;
               httpEquivIndex = INT32_MAX;
               contentTypeIndex = INT32_MAX;
               state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
               NS_HTML5_BREAK(beforeattributenameloop);
             }
           }
         }
-        beforeattributenameloop_end: ;
+      beforeattributenameloop_end:;
       }
       case ATTRIBUTE_NAME: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case ' ':
             case '\t':
             case '\n':
             case '\f': {
               state = nsHtml5MetaScanner::AFTER_ATTRIBUTE_NAME;
@@ -306,42 +320,45 @@ nsHtml5MetaScanner::stateLoop(int32_t st
               state = nsHtml5MetaScanner::DATA;
               NS_HTML5_CONTINUE(stateloop);
             }
             default: {
               if (metaState == A) {
                 if (c >= 'A' && c <= 'Z') {
                   c += 0x20;
                 }
-                if (contentIndex < CONTENT.length && c == CONTENT[contentIndex]) {
+                if (contentIndex < CONTENT.length &&
+                    c == CONTENT[contentIndex]) {
                   ++contentIndex;
                 } else {
                   contentIndex = INT32_MAX;
                 }
-                if (charsetIndex < CHARSET.length && c == CHARSET[charsetIndex]) {
+                if (charsetIndex < CHARSET.length &&
+                    c == CHARSET[charsetIndex]) {
                   ++charsetIndex;
                 } else {
                   charsetIndex = INT32_MAX;
                 }
-                if (httpEquivIndex < HTTP_EQUIV.length && c == HTTP_EQUIV[httpEquivIndex]) {
+                if (httpEquivIndex < HTTP_EQUIV.length &&
+                    c == HTTP_EQUIV[httpEquivIndex]) {
                   ++httpEquivIndex;
                 } else {
                   httpEquivIndex = INT32_MAX;
                 }
               }
               continue;
             }
           }
         }
-        attributenameloop_end: ;
+      attributenameloop_end:;
       }
       case BEFORE_ATTRIBUTE_VALUE: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case ' ':
             case '\t':
             case '\n':
             case '\f': {
               continue;
@@ -363,46 +380,46 @@ nsHtml5MetaScanner::stateLoop(int32_t st
             }
             default: {
               handleCharInAttributeValue(c);
               state = nsHtml5MetaScanner::ATTRIBUTE_VALUE_UNQUOTED;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        beforeattributevalueloop_end: ;
+      beforeattributevalueloop_end:;
       }
       case ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             c = read();
           }
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case '\"': {
               handleAttributeValue();
               state = nsHtml5MetaScanner::AFTER_ATTRIBUTE_VALUE_QUOTED;
               NS_HTML5_BREAK(attributevaluedoublequotedloop);
             }
             default: {
               handleCharInAttributeValue(c);
               continue;
             }
           }
         }
-        attributevaluedoublequotedloop_end: ;
+      attributevaluedoublequotedloop_end:;
       }
       case AFTER_ATTRIBUTE_VALUE_QUOTED: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case ' ':
             case '\t':
             case '\n':
             case '\f': {
               state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
@@ -421,21 +438,21 @@ nsHtml5MetaScanner::stateLoop(int32_t st
             }
             default: {
               state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
               reconsume = true;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        afterattributevaluequotedloop_end: ;
+      afterattributevaluequotedloop_end:;
       }
       case SELF_CLOSING_START_TAG: {
         c = read();
-        switch(c) {
+        switch (c) {
           case -1: {
             NS_HTML5_BREAK(stateloop);
           }
           case '>': {
             if (handleTag()) {
               NS_HTML5_BREAK(stateloop);
             }
             state = nsHtml5MetaScanner::DATA;
@@ -444,23 +461,23 @@ nsHtml5MetaScanner::stateLoop(int32_t st
           default: {
             state = nsHtml5MetaScanner::BEFORE_ATTRIBUTE_NAME;
             reconsume = true;
             NS_HTML5_CONTINUE(stateloop);
           }
         }
       }
       case ATTRIBUTE_VALUE_UNQUOTED: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             c = read();
           }
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case ' ':
             case '\t':
             case '\n':
             case '\f': {
               handleAttributeValue();
@@ -478,19 +495,19 @@ nsHtml5MetaScanner::stateLoop(int32_t st
             default: {
               handleCharInAttributeValue(c);
               continue;
             }
           }
         }
       }
       case AFTER_ATTRIBUTE_NAME: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case ' ':
             case '\t':
             case '\n':
             case '\f': {
               continue;
@@ -526,59 +543,59 @@ nsHtml5MetaScanner::stateLoop(int32_t st
               charsetIndex = INT32_MAX;
               state = nsHtml5MetaScanner::ATTRIBUTE_NAME;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       }
       case MARKUP_DECLARATION_OPEN: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case '-': {
               state = nsHtml5MetaScanner::MARKUP_DECLARATION_HYPHEN;
               NS_HTML5_BREAK(markupdeclarationopenloop);
             }
             default: {
               state = nsHtml5MetaScanner::SCAN_UNTIL_GT;
               reconsume = true;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        markupdeclarationopenloop_end: ;
+      markupdeclarationopenloop_end:;
       }
       case MARKUP_DECLARATION_HYPHEN: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case '-': {
               state = nsHtml5MetaScanner::COMMENT_START;
               NS_HTML5_BREAK(markupdeclarationhyphenloop);
             }
             default: {
               state = nsHtml5MetaScanner::SCAN_UNTIL_GT;
               reconsume = true;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        markupdeclarationhyphenloop_end: ;
+      markupdeclarationhyphenloop_end:;
       }
       case COMMENT_START: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case '-': {
               state = nsHtml5MetaScanner::COMMENT_START_DASH;
               NS_HTML5_CONTINUE(stateloop);
             }
             case '>': {
@@ -586,59 +603,59 @@ nsHtml5MetaScanner::stateLoop(int32_t st
               NS_HTML5_CONTINUE(stateloop);
             }
             default: {
               state = nsHtml5MetaScanner::COMMENT;
               NS_HTML5_BREAK(commentstartloop);
             }
           }
         }
-        commentstartloop_end: ;
+      commentstartloop_end:;
       }
       case COMMENT: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case '-': {
               state = nsHtml5MetaScanner::COMMENT_END_DASH;
               NS_HTML5_BREAK(commentloop);
             }
             default: {
               continue;
             }
           }
         }
-        commentloop_end: ;
+      commentloop_end:;
       }
       case COMMENT_END_DASH: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case '-': {
               state = nsHtml5MetaScanner::COMMENT_END;
               NS_HTML5_BREAK(commentenddashloop);
             }
             default: {
               state = nsHtml5MetaScanner::COMMENT;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        commentenddashloop_end: ;
+      commentenddashloop_end:;
       }
       case COMMENT_END: {
-        for (; ; ) {
+        for (;;) {
           c = read();
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case '>': {
               state = nsHtml5MetaScanner::DATA;
               NS_HTML5_CONTINUE(stateloop);
             }
             case '-': {
@@ -648,17 +665,17 @@ nsHtml5MetaScanner::stateLoop(int32_t st
               state = nsHtml5MetaScanner::COMMENT;
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       }
       case COMMENT_START_DASH: {
         c = read();
-        switch(c) {
+        switch (c) {
           case -1: {
             NS_HTML5_BREAK(stateloop);
           }
           case '-': {
             state = nsHtml5MetaScanner::COMMENT_END;
             NS_HTML5_CONTINUE(stateloop);
           }
           case '>': {
@@ -667,93 +684,95 @@ nsHtml5MetaScanner::stateLoop(int32_t st
           }
           default: {
             state = nsHtml5MetaScanner::COMMENT;
             NS_HTML5_CONTINUE(stateloop);
           }
         }
       }
       case ATTRIBUTE_VALUE_SINGLE_QUOTED: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             c = read();
           }
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case '\'': {
               handleAttributeValue();
               state = nsHtml5MetaScanner::AFTER_ATTRIBUTE_VALUE_QUOTED;
               NS_HTML5_CONTINUE(stateloop);
             }
             default: {
               handleCharInAttributeValue(c);
               continue;
             }
           }
         }
       }
       case SCAN_UNTIL_GT: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             c = read();
           }
-          switch(c) {
+          switch (c) {
             case -1: {
               NS_HTML5_BREAK(stateloop);
             }
             case '>': {
               state = nsHtml5MetaScanner::DATA;
               NS_HTML5_CONTINUE(stateloop);
             }
             default: {
               continue;
             }
           }
         }
       }
     }
   }
-  stateloop_end: ;
+stateloop_end:;
   stateSave = state;
 }
 
-void 
+void
 nsHtml5MetaScanner::handleCharInAttributeValue(int32_t c)
 {
   if (metaState == A) {
     if (contentIndex == CONTENT.length || charsetIndex == CHARSET.length) {
       addToBuffer(c);
     } else if (httpEquivIndex == HTTP_EQUIV.length) {
-      if (contentTypeIndex < CONTENT_TYPE.length && toAsciiLowerCase(c) == CONTENT_TYPE[contentTypeIndex]) {
+      if (contentTypeIndex < CONTENT_TYPE.length &&
+          toAsciiLowerCase(c) == CONTENT_TYPE[contentTypeIndex]) {
         ++contentTypeIndex;
       } else {
         contentTypeIndex = INT32_MAX;
       }
     }
   }
 }
 
-void 
+void
 nsHtml5MetaScanner::addToBuffer(int32_t c)
 {
   if (strBufLen == strBuf.length) {
-    jArray<char16_t,int32_t> newBuf = jArray<char16_t,int32_t>::newJArray(strBuf.length + (strBuf.length << 1));
+    jArray<char16_t, int32_t> newBuf = jArray<char16_t, int32_t>::newJArray(
+      strBuf.length + (strBuf.length << 1));
     nsHtml5ArrayCopy::arraycopy(strBuf, newBuf, strBuf.length);
     strBuf = newBuf;
   }
-  strBuf[strBufLen++] = (char16_t) c;
+  strBuf[strBufLen++] = (char16_t)c;
 }
 
-void 
+void
 nsHtml5MetaScanner::handleAttributeValue()
 {
   if (metaState != A) {
     return;
   }
   if (contentIndex == CONTENT.length && !content) {
     content = nsHtml5Portability::newStringFromBuffer(
       strBuf, 0, strBufLen, treeBuilder, false);
@@ -768,29 +787,29 @@ nsHtml5MetaScanner::handleAttributeValue
       httpEquivState == HTTP_EQUIV_NOT_SEEN) {
     httpEquivState = (contentTypeIndex == CONTENT_TYPE.length)
                        ? HTTP_EQUIV_CONTENT_TYPE
                        : HTTP_EQUIV_OTHER;
     return;
   }
 }
 
-bool 
+bool
 nsHtml5MetaScanner::handleTag()
 {
   bool stop = handleTagInner();
   content.Release();
   content = nullptr;
   charset.Release();
   charset = nullptr;
   httpEquivState = HTTP_EQUIV_NOT_SEEN;
   return stop;
 }
 
-bool 
+bool
 nsHtml5MetaScanner::handleTagInner()
 {
   if (!!charset && tryCharset(charset)) {
     return true;
   }
   if (!!content && httpEquivState == HTTP_EQUIV_CONTENT_TYPE) {
     nsHtml5String extract =
       nsHtml5TreeBuilder::extractCharsetFromContent(content, treeBuilder);
@@ -809,11 +828,9 @@ nsHtml5MetaScanner::initializeStatics()
 {
 }
 
 void
 nsHtml5MetaScanner::releaseStatics()
 {
 }
 
-
 #include "nsHtml5MetaScannerCppSupplement.h"
-
--- a/parser/html/nsHtml5MetaScanner.h
+++ b/parser/html/nsHtml5MetaScanner.h
@@ -50,119 +50,125 @@ class nsHtml5StreamParser;
 class nsHtml5AttributeName;
 class nsHtml5ElementName;
 class nsHtml5Tokenizer;
 class nsHtml5TreeBuilder;
 class nsHtml5UTF16Buffer;
 class nsHtml5StateSnapshot;
 class nsHtml5Portability;
 
-
 class nsHtml5MetaScanner
 {
-  private:
-    static staticJArray<char16_t,int32_t> CHARSET;
-    static staticJArray<char16_t,int32_t> CONTENT;
-    static staticJArray<char16_t,int32_t> HTTP_EQUIV;
-    static staticJArray<char16_t,int32_t> CONTENT_TYPE;
-    static const int32_t NO = 0;
+private:
+  static staticJArray<char16_t, int32_t> CHARSET;
+  static staticJArray<char16_t, int32_t> CONTENT;
+  static staticJArray<char16_t, int32_t> HTTP_EQUIV;
+  static staticJArray<char16_t, int32_t> CONTENT_TYPE;
+  static const int32_t NO = 0;
 
-    static const int32_t M = 1;
+  static const int32_t M = 1;
 
-    static const int32_t E = 2;
+  static const int32_t E = 2;
+
+  static const int32_t T = 3;
 
-    static const int32_t T = 3;
+  static const int32_t A = 4;
 
-    static const int32_t A = 4;
+  static const int32_t DATA = 0;
 
-    static const int32_t DATA = 0;
+  static const int32_t TAG_OPEN = 1;
 
-    static const int32_t TAG_OPEN = 1;
+  static const int32_t SCAN_UNTIL_GT = 2;
 
-    static const int32_t SCAN_UNTIL_GT = 2;
+  static const int32_t TAG_NAME = 3;
 
-    static const int32_t TAG_NAME = 3;
+  static const int32_t BEFORE_ATTRIBUTE_NAME = 4;
 
-    static const int32_t BEFORE_ATTRIBUTE_NAME = 4;
+  static const int32_t ATTRIBUTE_NAME = 5;
 
-    static const int32_t ATTRIBUTE_NAME = 5;
+  static const int32_t AFTER_ATTRIBUTE_NAME = 6;
 
-    static const int32_t AFTER_ATTRIBUTE_NAME = 6;
+  static const int32_t BEFORE_ATTRIBUTE_VALUE = 7;
 
-    static const int32_t BEFORE_ATTRIBUTE_VALUE = 7;
+  static const int32_t ATTRIBUTE_VALUE_DOUBLE_QUOTED = 8;
 
-    static const int32_t ATTRIBUTE_VALUE_DOUBLE_QUOTED = 8;
+  static const int32_t ATTRIBUTE_VALUE_SINGLE_QUOTED = 9;
+
+  static const int32_t ATTRIBUTE_VALUE_UNQUOTED = 10;
 
-    static const int32_t ATTRIBUTE_VALUE_SINGLE_QUOTED = 9;
+  static const int32_t AFTER_ATTRIBUTE_VALUE_QUOTED = 11;
 
-    static const int32_t ATTRIBUTE_VALUE_UNQUOTED = 10;
+  static const int32_t MARKUP_DECLARATION_OPEN = 13;
 
-    static const int32_t AFTER_ATTRIBUTE_VALUE_QUOTED = 11;
+  static const int32_t MARKUP_DECLARATION_HYPHEN = 14;
 
-    static const int32_t MARKUP_DECLARATION_OPEN = 13;
+  static const int32_t COMMENT_START = 15;
 
-    static const int32_t MARKUP_DECLARATION_HYPHEN = 14;
+  static const int32_t COMMENT_START_DASH = 16;
 
-    static const int32_t COMMENT_START = 15;
+  static const int32_t COMMENT = 17;
 
-    static const int32_t COMMENT_START_DASH = 16;
+  static const int32_t COMMENT_END_DASH = 18;
 
-    static const int32_t COMMENT = 17;
+  static const int32_t COMMENT_END = 19;
 
-    static const int32_t COMMENT_END_DASH = 18;
+  static const int32_t SELF_CLOSING_START_TAG = 20;
 
-    static const int32_t COMMENT_END = 19;
+  static const int32_t HTTP_EQUIV_NOT_SEEN = 0;
+
+  static const int32_t HTTP_EQUIV_CONTENT_TYPE = 1;
 
-    static const int32_t SELF_CLOSING_START_TAG = 20;
+  static const int32_t HTTP_EQUIV_OTHER = 2;
+
+protected:
+  nsHtml5ByteReadable* readable;
 
-    static const int32_t HTTP_EQUIV_NOT_SEEN = 0;
+private:
+  int32_t metaState;
+  int32_t contentIndex;
+  int32_t charsetIndex;
+  int32_t httpEquivIndex;
+  int32_t contentTypeIndex;
 
-    static const int32_t HTTP_EQUIV_CONTENT_TYPE = 1;
+protected:
+  int32_t stateSave;
 
-    static const int32_t HTTP_EQUIV_OTHER = 2;
+private:
+  int32_t strBufLen;
+  autoJArray<char16_t, int32_t> strBuf;
+  nsHtml5String content;
+  nsHtml5String charset;
+  int32_t httpEquivState;
+  nsHtml5TreeBuilder* treeBuilder;
 
-  protected:
-    nsHtml5ByteReadable* readable;
-  private:
-    int32_t metaState;
-    int32_t contentIndex;
-    int32_t charsetIndex;
-    int32_t httpEquivIndex;
-    int32_t contentTypeIndex;
-  protected:
-    int32_t stateSave;
-  private:
-    int32_t strBufLen;
-    autoJArray<char16_t,int32_t> strBuf;
-    nsHtml5String content;
-    nsHtml5String charset;
-    int32_t httpEquivState;
-    nsHtml5TreeBuilder* treeBuilder;
-  public:
-    explicit nsHtml5MetaScanner(nsHtml5TreeBuilder* tb);
-    ~nsHtml5MetaScanner();
-  protected:
-    void stateLoop(int32_t state);
-  private:
-    void handleCharInAttributeValue(int32_t c);
-    inline int32_t toAsciiLowerCase(int32_t c)
-    {
-      if (c >= 'A' && c <= 'Z') {
-        return c + 0x20;
-      }
-      return c;
+public:
+  explicit nsHtml5MetaScanner(nsHtml5TreeBuilder* tb);
+  ~nsHtml5MetaScanner();
+
+protected:
+  void stateLoop(int32_t state);
+
+private:
+  void handleCharInAttributeValue(int32_t c);
+  inline int32_t toAsciiLowerCase(int32_t c)
+  {
+    if (c >= 'A' && c <= 'Z') {
+      return c + 0x20;
     }
+    return c;
+  }
 
-    void addToBuffer(int32_t c);
-    void handleAttributeValue();
-    bool handleTag();
-    bool handleTagInner();
-  protected:
-    bool tryCharset(nsHtml5String encoding);
-  public:
-    static void initializeStatics();
-    static void releaseStatics();
+  void addToBuffer(int32_t c);
+  void handleAttributeValue();
+  bool handleTag();
+  bool handleTagInner();
+
+protected:
+  bool tryCharset(nsHtml5String encoding);
+
+public:
+  static void initializeStatics();
+  static void releaseStatics();
 
 #include "nsHtml5MetaScannerHSupplement.h"
 };
 
 #endif
-
--- a/parser/html/nsHtml5Portability.h
+++ b/parser/html/nsHtml5Portability.h
@@ -48,40 +48,39 @@ class nsHtml5StreamParser;
 class nsHtml5AttributeName;
 class nsHtml5ElementName;
 class nsHtml5Tokenizer;
 class nsHtml5TreeBuilder;
 class nsHtml5MetaScanner;
 class nsHtml5UTF16Buffer;
 class nsHtml5StateSnapshot;
 
-
 class nsHtml5Portability
 {
-  public:
-    static nsAtom* newLocalNameFromBuffer(char16_t* buf, int32_t length, nsHtml5AtomTable* interner);
-    static nsHtml5String newStringFromBuffer(char16_t* buf,
-                                             int32_t offset,
-                                             int32_t length,
-                                             nsHtml5TreeBuilder* treeBuilder,
-                                             bool maybeAtomize);
-    static nsHtml5String newEmptyString();
-    static nsHtml5String newStringFromLiteral(const char* literal);
-    static nsHtml5String newStringFromString(nsHtml5String string);
-    static jArray<char16_t,int32_t> newCharArrayFromLocal(nsAtom* local);
-    static jArray<char16_t, int32_t> newCharArrayFromString(
-      nsHtml5String string);
-    static nsAtom* newLocalFromLocal(nsAtom* local, nsHtml5AtomTable* interner);
-    static bool localEqualsBuffer(nsAtom* local, char16_t* buf, int32_t length);
-    static bool lowerCaseLiteralIsPrefixOfIgnoreAsciiCaseString(
-      const char* lowerCaseLiteral,
-      nsHtml5String string);
-    static bool lowerCaseLiteralEqualsIgnoreAsciiCaseString(
-      const char* lowerCaseLiteral,
-      nsHtml5String string);
-    static bool literalEqualsString(const char* literal, nsHtml5String string);
-    static bool stringEqualsString(nsHtml5String one, nsHtml5String other);
-    static void initializeStatics();
-    static void releaseStatics();
+public:
+  static nsAtom* newLocalNameFromBuffer(char16_t* buf,
+                                        int32_t length,
+                                        nsHtml5AtomTable* interner);
+  static nsHtml5String newStringFromBuffer(char16_t* buf,
+                                           int32_t offset,
+                                           int32_t length,
+                                           nsHtml5TreeBuilder* treeBuilder,
+                                           bool maybeAtomize);
+  static nsHtml5String newEmptyString();
+  static nsHtml5String newStringFromLiteral(const char* literal);
+  static nsHtml5String newStringFromString(nsHtml5String string);
+  static jArray<char16_t, int32_t> newCharArrayFromLocal(nsAtom* local);
+  static jArray<char16_t, int32_t> newCharArrayFromString(nsHtml5String string);
+  static nsAtom* newLocalFromLocal(nsAtom* local, nsHtml5AtomTable* interner);
+  static bool localEqualsBuffer(nsAtom* local, char16_t* buf, int32_t length);
+  static bool lowerCaseLiteralIsPrefixOfIgnoreAsciiCaseString(
+    const char* lowerCaseLiteral,
+    nsHtml5String string);
+  static bool lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+    const char* lowerCaseLiteral,
+    nsHtml5String string);
+  static bool literalEqualsString(const char* literal, nsHtml5String string);
+  static bool stringEqualsString(nsHtml5String one, nsHtml5String other);
+  static void initializeStatics();
+  static void releaseStatics();
 };
 
 #endif
-
--- a/parser/html/nsHtml5StackNode.cpp
+++ b/parser/html/nsHtml5StackNode.cpp
@@ -50,41 +50,41 @@
 #include "nsHtml5TreeBuilder.h"
 #include "nsHtml5MetaScanner.h"
 #include "nsHtml5UTF16Buffer.h"
 #include "nsHtml5StateSnapshot.h"
 #include "nsHtml5Portability.h"
 
 #include "nsHtml5StackNode.h"
 
-int32_t 
+int32_t
 nsHtml5StackNode::getGroup()
 {
   return flags & nsHtml5ElementName::GROUP_MASK;
 }
 
-bool 
+bool
 nsHtml5StackNode::isScoping()
 {
   return (flags & nsHtml5ElementName::SCOPING);
 }
 
-bool 
+bool
 nsHtml5StackNode::isSpecial()
 {
   return (flags & nsHtml5ElementName::SPECIAL);
 }
 
-bool 
+bool
 nsHtml5StackNode::isFosterParenting()
 {
   return (flags & nsHtml5ElementName::FOSTER_PARENTING);
 }
 
-bool 
+bool
 nsHtml5StackNode::isHtmlIntegrationPoint()
 {
   return (flags & nsHtml5ElementName::HTML_INTEGRATION_POINT);
 }
 
 nsHtml5StackNode::nsHtml5StackNode(int32_t idxInTreeBuilder)
   : idxInTreeBuilder(idxInTreeBuilder)
   , refcount(0)
@@ -199,57 +199,56 @@ nsHtml5StackNode::setValues(nsHtml5Eleme
   this->popName = popName;
   this->ns = kNameSpaceID_MathML;
   this->node = node;
   this->attributes = nullptr;
   this->refcount = 1;
   this->htmlCreator = nullptr;
 }
 
-int32_t 
+int32_t
 nsHtml5StackNode::prepareSvgFlags(int32_t flags)
 {
   flags &=
     ~(nsHtml5ElementName::FOSTER_PARENTING | nsHtml5ElementName::SCOPING |
       nsHtml5ElementName::SPECIAL | nsHtml5ElementName::OPTIONAL_END_TAG);
   if ((flags & nsHtml5ElementName::SCOPING_AS_SVG)) {
     flags |= (nsHtml5ElementName::SCOPING | nsHtml5ElementName::SPECIAL |
               nsHtml5ElementName::HTML_INTEGRATION_POINT);
   }
   return flags;
 }
 
-int32_t 
+int32_t
 nsHtml5StackNode::prepareMathFlags(int32_t flags, bool markAsIntegrationPoint)
 {
   flags &=
     ~(nsHtml5ElementName::FOSTER_PARENTING | nsHtml5ElementName::SCOPING |
       nsHtml5ElementName::SPECIAL | nsHtml5ElementName::OPTIONAL_END_TAG);
   if ((flags & nsHtml5ElementName::SCOPING_AS_MATHML)) {
     flags |= (nsHtml5ElementName::SCOPING | nsHtml5ElementName::SPECIAL);
   }
   if (markAsIntegrationPoint) {
     flags |= nsHtml5ElementName::HTML_INTEGRATION_POINT;
   }
   return flags;
 }
 
-
 nsHtml5StackNode::~nsHtml5StackNode()
 {
   MOZ_COUNT_DTOR(nsHtml5StackNode);
 }
 
-void 
+void
 nsHtml5StackNode::dropAttributes()
 {
   attributes = nullptr;
 }
 
-void 
+void
 nsHtml5StackNode::retain()
 {
   refcount++;
 }
 
 void
 nsHtml5StackNode::release(nsHtml5TreeBuilder* owningTreeBuilder)
 {
@@ -276,10 +275,8 @@ void
 nsHtml5StackNode::initializeStatics()
 {
 }
 
 void
 nsHtml5StackNode::releaseStatics()
 {
 }
-
-
--- a/parser/html/nsHtml5StackNode.h
+++ b/parser/html/nsHtml5StackNode.h
@@ -51,72 +51,70 @@ class nsHtml5AttributeName;
 class nsHtml5ElementName;
 class nsHtml5Tokenizer;
 class nsHtml5TreeBuilder;
 class nsHtml5MetaScanner;
 class nsHtml5UTF16Buffer;
 class nsHtml5StateSnapshot;
 class nsHtml5Portability;
 
-
 class nsHtml5StackNode
 {
-  public:
-    int32_t idxInTreeBuilder;
-    int32_t flags;
-    nsAtom* name;
-    nsAtom* popName;
-    int32_t ns;
-    nsIContentHandle* node;
-    nsHtml5HtmlAttributes* attributes;
-  private:
-    int32_t refcount;
-    mozilla::dom::HTMLContentCreatorFunction htmlCreator;
-  public:
-    inline int32_t getFlags()
-    {
-      return flags;
-    }
+public:
+  int32_t idxInTreeBuilder;
+  int32_t flags;
+  nsAtom* name;
+  nsAtom* popName;
+  int32_t ns;
+  nsIContentHandle* node;
+  nsHtml5HtmlAttributes* attributes;
+
+private:
+  int32_t refcount;
+  mozilla::dom::HTMLContentCreatorFunction htmlCreator;
+
+public:
+  inline int32_t getFlags() { return flags; }
 
-    int32_t getGroup();
-    bool isScoping();
-    bool isSpecial();
-    bool isFosterParenting();
-    bool isHtmlIntegrationPoint();
-    explicit nsHtml5StackNode(int32_t idxInTreeBuilder);
-    mozilla::dom::HTMLContentCreatorFunction getHtmlCreator();
-    void setValues(int32_t flags,
-                   int32_t ns,
-                   nsAtom* name,
-                   nsIContentHandle* node,
-                   nsAtom* popName,
-                   nsHtml5HtmlAttributes* attributes,
-                   mozilla::dom::HTMLContentCreatorFunction htmlCreator);
-    void setValues(nsHtml5ElementName* elementName, nsIContentHandle* node);
-    void setValues(nsHtml5ElementName* elementName,
-                   nsIContentHandle* node,
-                   nsHtml5HtmlAttributes* attributes);
-    void setValues(nsHtml5ElementName* elementName,
-                   nsIContentHandle* node,
-                   nsAtom* popName);
-    void setValues(nsHtml5ElementName* elementName,
-                   nsAtom* popName,
-                   nsIContentHandle* node);
-    void setValues(nsHtml5ElementName* elementName,
-                   nsIContentHandle* node,
-                   nsAtom* popName,
-                   bool markAsIntegrationPoint);
+  int32_t getGroup();
+  bool isScoping();
+  bool isSpecial();
+  bool isFosterParenting();
+  bool isHtmlIntegrationPoint();
+  explicit nsHtml5StackNode(int32_t idxInTreeBuilder);
+  mozilla::dom::HTMLContentCreatorFunction getHtmlCreator();
+  void setValues(int32_t flags,
+                 int32_t ns,
+                 nsAtom* name,
+                 nsIContentHandle* node,
+                 nsAtom* popName,
+                 nsHtml5HtmlAttributes* attributes,
+                 mozilla::dom::HTMLContentCreatorFunction htmlCreator);
+  void setValues(nsHtml5ElementName* elementName, nsIContentHandle* node);
+  void setValues(nsHtml5ElementName* elementName,
+                 nsIContentHandle* node,
+                 nsHtml5HtmlAttributes* attributes);
+  void setValues(nsHtml5ElementName* elementName,
+                 nsIContentHandle* node,
+                 nsAtom* popName);
+  void setValues(nsHtml5ElementName* elementName,
+                 nsAtom* popName,
+                 nsIContentHandle* node);
+  void setValues(nsHtml5ElementName* elementName,
+                 nsIContentHandle* node,
+                 nsAtom* popName,
+                 bool markAsIntegrationPoint);
 
-  private:
-    static int32_t prepareSvgFlags(int32_t flags);
-    static int32_t prepareMathFlags(int32_t flags, bool markAsIntegrationPoint);
-  public:
-    ~nsHtml5StackNode();
-    void dropAttributes();
-    void retain();
-    void release(nsHtml5TreeBuilder* owningTreeBuilder);
-    bool isUnused();
-    static void initializeStatics();
-    static void releaseStatics();
+private:
+  static int32_t prepareSvgFlags(int32_t flags);
+  static int32_t prepareMathFlags(int32_t flags, bool markAsIntegrationPoint);
+
+public:
+  ~nsHtml5StackNode();
+  void dropAttributes();
+  void retain();
+  void release(nsHtml5TreeBuilder* owningTreeBuilder);
+  bool isUnused();
+  static void initializeStatics();
+  static void releaseStatics();
 };
 
 #endif
-
--- a/parser/html/nsHtml5StateSnapshot.cpp
+++ b/parser/html/nsHtml5StateSnapshot.cpp
@@ -1,27 +1,27 @@
 /*
  * Copyright (c) 2009-2010 Mozilla Foundation
  *
- * Permission is hereby granted, free of charge, to any person obtaining a 
- * copy of this software and associated documentation files (the "Software"), 
- * to deal in the Software without restriction, including without limitation 
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, 
- * and/or sell copies of the Software, and to permit persons to whom the 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
  *
- * The above copyright notice and this permission notice shall be included in 
+ * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
 
 /*
  * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
  * Please edit StateSnapshot.java instead and regenerate.
  */
 
@@ -49,118 +49,127 @@
 #include "nsHtml5TreeBuilder.h"
 #include "nsHtml5MetaScanner.h"
 #include "nsHtml5StackNode.h"
 #include "nsHtml5UTF16Buffer.h"
 #include "nsHtml5Portability.h"
 
 #include "nsHtml5StateSnapshot.h"
 
-
-nsHtml5StateSnapshot::nsHtml5StateSnapshot(jArray<nsHtml5StackNode*,int32_t> stack, jArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements, jArray<int32_t,int32_t> templateModeStack, nsIContentHandle* formPointer, nsIContentHandle* headPointer, nsIContentHandle* deepTreeSurrogateParent, int32_t mode, int32_t originalMode, bool framesetOk, bool needToDropLF, bool quirks)
-  : stack(stack),
-    listOfActiveFormattingElements(listOfActiveFormattingElements),
-    templateModeStack(templateModeStack),
-    formPointer(formPointer),
-    headPointer(headPointer),
-    deepTreeSurrogateParent(deepTreeSurrogateParent),
-    mode(mode),
-    originalMode(originalMode),
-    framesetOk(framesetOk),
-    needToDropLF(needToDropLF),
-    quirks(quirks)
+nsHtml5StateSnapshot::nsHtml5StateSnapshot(
+  jArray<nsHtml5StackNode*, int32_t> stack,
+  jArray<nsHtml5StackNode*, int32_t> listOfActiveFormattingElements,
+  jArray<int32_t, int32_t> templateModeStack,
+  nsIContentHandle* formPointer,
+  nsIContentHandle* headPointer,
+  nsIContentHandle* deepTreeSurrogateParent,
+  int32_t mode,
+  int32_t originalMode,
+  bool framesetOk,
+  bool needToDropLF,
+  bool quirks)
+  : stack(stack)
+  , listOfActiveFormattingElements(listOfActiveFormattingElements)
+  , templateModeStack(templateModeStack)
+  , formPointer(formPointer)
+  , headPointer(headPointer)
+  , deepTreeSurrogateParent(deepTreeSurrogateParent)
+  , mode(mode)
+  , originalMode(originalMode)
+  , framesetOk(framesetOk)
+  , needToDropLF(needToDropLF)
+  , quirks(quirks)
 {
   MOZ_COUNT_CTOR(nsHtml5StateSnapshot);
 }
 
-jArray<nsHtml5StackNode*,int32_t> 
+jArray<nsHtml5StackNode*, int32_t>
 nsHtml5StateSnapshot::getStack()
 {
   return stack;
 }
 
-jArray<int32_t,int32_t> 
+jArray<int32_t, int32_t>
 nsHtml5StateSnapshot::getTemplateModeStack()
 {
   return templateModeStack;
 }
 
-jArray<nsHtml5StackNode*,int32_t> 
+jArray<nsHtml5StackNode*, int32_t>
 nsHtml5StateSnapshot::getListOfActiveFormattingElements()
 {
   return listOfActiveFormattingElements;
 }
 
-nsIContentHandle* 
+nsIContentHandle*
 nsHtml5StateSnapshot::getFormPointer()
 {
   return formPointer;
 }
 
-nsIContentHandle* 
+nsIContentHandle*
 nsHtml5StateSnapshot::getHeadPointer()
 {
   return headPointer;
 }
 
-nsIContentHandle* 
+nsIContentHandle*
 nsHtml5StateSnapshot::getDeepTreeSurrogateParent()
 {
   return deepTreeSurrogateParent;
 }
 
-int32_t 
+int32_t
 nsHtml5StateSnapshot::getMode()
 {
   return mode;
 }
 
-int32_t 
+int32_t
 nsHtml5StateSnapshot::getOriginalMode()
 {
   return originalMode;
 }
 
-bool 
+bool
 nsHtml5StateSnapshot::isFramesetOk()
 {
   return framesetOk;
 }
 
-bool 
+bool
 nsHtml5StateSnapshot::isNeedToDropLF()
 {
   return needToDropLF;
 }
 
-bool 
+bool
 nsHtml5StateSnapshot::isQuirks()
 {
   return quirks;
 }
 
-int32_t 
+int32_t
 nsHtml5StateSnapshot::getListOfActiveFormattingElementsLength()
 {
   return listOfActiveFormattingElements.length;
 }
 
-int32_t 
+int32_t
 nsHtml5StateSnapshot::getStackLength()
 {
   return stack.length;
 }
 
-int32_t 
+int32_t
 nsHtml5StateSnapshot::getTemplateModeStackLength()
 {
   return templateModeStack.length;
 }
 
-
 nsHtml5StateSnapshot::~nsHtml5StateSnapshot()
 {
   MOZ_COUNT_DTOR(nsHtml5StateSnapshot);
   for (int32_t i = 0; i < stack.length; i++) {
     stack[i]->release(nullptr);
   }
   for (int32_t i = 0; i < listOfActiveFormattingElements.length; i++) {
     if (listOfActiveFormattingElements[i]) {
@@ -173,10 +182,8 @@ void
 nsHtml5StateSnapshot::initializeStatics()
 {
 }
 
 void
 nsHtml5StateSnapshot::releaseStatics()
 {
 }
-
-
--- a/parser/html/nsHtml5StateSnapshot.h
+++ b/parser/html/nsHtml5StateSnapshot.h
@@ -1,27 +1,27 @@
 /*
  * Copyright (c) 2009-2010 Mozilla Foundation
  *
- * Permission is hereby granted, free of charge, to any person obtaining a 
- * copy of this software and associated documentation files (the "Software"), 
- * to deal in the Software without restriction, including without limitation 
- * the rights to use, copy, modify, merge, publish, distribute, sublicense, 
- * and/or sell copies of the Software, and to permit persons to whom the 
+ * Permission is hereby granted, free of charge, to any person obtaining a
+ * copy of this software and associated documentation files (the "Software"),
+ * to deal in the Software without restriction, including without limitation
+ * the rights to use, copy, modify, merge, publish, distribute, sublicense,
+ * and/or sell copies of the Software, and to permit persons to whom the
  * Software is furnished to do so, subject to the following conditions:
  *
- * The above copyright notice and this permission notice shall be included in 
+ * The above copyright notice and this permission notice shall be included in
  * all copies or substantial portions of the Software.
  *
- * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 
- * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 
- * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL 
- * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 
- * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 
- * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER 
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
+ * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
+ * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
+ * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
+ * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
+ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
  * DEALINGS IN THE SOFTWARE.
  */
 
 /*
  * THIS IS A GENERATED FILE. PLEASE DO NOT EDIT.
  * Please edit StateSnapshot.java instead and regenerate.
  */
 
@@ -49,46 +49,56 @@ class nsHtml5StreamParser;
 class nsHtml5AttributeName;
 class nsHtml5ElementName;
 class nsHtml5Tokenizer;
 class nsHtml5TreeBuilder;
 class nsHtml5MetaScanner;
 class nsHtml5UTF16Buffer;
 class nsHtml5Portability;
 
-
 class nsHtml5StateSnapshot : public nsAHtml5TreeBuilderState
 {
-  private:
-    autoJArray<nsHtml5StackNode*,int32_t> stack;
-    autoJArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements;
-    autoJArray<int32_t,int32_t> templateModeStack;
-    nsIContentHandle* formPointer;
-    nsIContentHandle* headPointer;
-    nsIContentHandle* deepTreeSurrogateParent;
-    int32_t mode;
-    int32_t originalMode;
-    bool framesetOk;
-    bool needToDropLF;
-    bool quirks;
-  public:
-    nsHtml5StateSnapshot(jArray<nsHtml5StackNode*,int32_t> stack, jArray<nsHtml5StackNode*,int32_t> listOfActiveFormattingElements, jArray<int32_t,int32_t> templateModeStack, nsIContentHandle* formPointer, nsIContentHandle* headPointer, nsIContentHandle* deepTreeSurrogateParent, int32_t mode, int32_t originalMode, bool framesetOk, bool needToDropLF, bool quirks);
-    jArray<nsHtml5StackNode*,int32_t> getStack();
-    jArray<int32_t,int32_t> getTemplateModeStack();
-    jArray<nsHtml5StackNode*,int32_t> getListOfActiveFormattingElements();
-    nsIContentHandle* getFormPointer();
-    nsIContentHandle* getHeadPointer();
-    nsIContentHandle* getDeepTreeSurrogateParent();
-    int32_t getMode();
-    int32_t getOriginalMode();
-    bool isFramesetOk();
-    bool isNeedToDropLF();
-    bool isQuirks();
-    int32_t getListOfActiveFormattingElementsLength();
-    int32_t getStackLength();
-    int32_t getTemplateModeStackLength();
-    ~nsHtml5StateSnapshot();
-    static void initializeStatics();
-    static void releaseStatics();
+private:
+  autoJArray<nsHtml5StackNode*, int32_t> stack;
+  autoJArray<nsHtml5StackNode*, int32_t> listOfActiveFormattingElements;
+  autoJArray<int32_t, int32_t> templateModeStack;
+  nsIContentHandle* formPointer;
+  nsIContentHandle* headPointer;
+  nsIContentHandle* deepTreeSurrogateParent;
+  int32_t mode;
+  int32_t originalMode;
+  bool framesetOk;
+  bool needToDropLF;
+  bool quirks;
+
+public:
+  nsHtml5StateSnapshot(
+    jArray<nsHtml5StackNode*, int32_t> stack,
+    jArray<nsHtml5StackNode*, int32_t> listOfActiveFormattingElements,
+    jArray<int32_t, int32_t> templateModeStack,
+    nsIContentHandle* formPointer,
+    nsIContentHandle* headPointer,
+    nsIContentHandle* deepTreeSurrogateParent,
+    int32_t mode,
+    int32_t originalMode,
+    bool framesetOk,
+    bool needToDropLF,
+    bool quirks);
+  jArray<nsHtml5StackNode*, int32_t> getStack();
+  jArray<int32_t, int32_t> getTemplateModeStack();
+  jArray<nsHtml5StackNode*, int32_t> getListOfActiveFormattingElements();
+  nsIContentHandle* getFormPointer();
+  nsIContentHandle* getHeadPointer();
+  nsIContentHandle* getDeepTreeSurrogateParent();
+  int32_t getMode();
+  int32_t getOriginalMode();
+  bool isFramesetOk();
+  bool isNeedToDropLF();
+  bool isQuirks();
+  int32_t getListOfActiveFormattingElementsLength();
+  int32_t getStackLength();
+  int32_t getTemplateModeStackLength();
+  ~nsHtml5StateSnapshot();
+  static void initializeStatics();
+  static void releaseStatics();
 };
 
 #endif
-
--- a/parser/html/nsHtml5Tokenizer.cpp
+++ b/parser/html/nsHtml5Tokenizer.cpp
@@ -62,35 +62,70 @@ char16_t nsHtml5Tokenizer::LT_SOLIDUS[] 
 char16_t nsHtml5Tokenizer::RSQB_RSQB[] = { ']', ']' };
 char16_t nsHtml5Tokenizer::REPLACEMENT_CHARACTER[] = { 0xfffd };
 char16_t nsHtml5Tokenizer::LF[] = { '\n' };
 char16_t nsHtml5Tokenizer::CDATA_LSQB[] = { 'C', 'D', 'A', 'T', 'A', '[' };
 char16_t nsHtml5Tokenizer::OCTYPE[] = { 'o', 'c', 't', 'y', 'p', 'e' };
 char16_t nsHtml5Tokenizer::UBLIC[] = { 'u', 'b', 'l', 'i', 'c' };
 char16_t nsHtml5Tokenizer::YSTEM[] = { 'y', 's', 't', 'e', 'm' };
 static char16_t const TITLE_ARR_DATA[] = { 't', 'i', 't', 'l', 'e' };
-staticJArray<char16_t,int32_t> nsHtml5Tokenizer::TITLE_ARR = { TITLE_ARR_DATA, MOZ_ARRAY_LENGTH(TITLE_ARR_DATA) };
+staticJArray<char16_t, int32_t> nsHtml5Tokenizer::TITLE_ARR = {
+  TITLE_ARR_DATA,
+  MOZ_ARRAY_LENGTH(TITLE_ARR_DATA)
+};
 static char16_t const SCRIPT_ARR_DATA[] = { 's', 'c', 'r', 'i', 'p', 't' };
-staticJArray<char16_t,int32_t> nsHtml5Tokenizer::SCRIPT_ARR = { SCRIPT_ARR_DATA, MOZ_ARRAY_LENGTH(SCRIPT_ARR_DATA) };
+staticJArray<char16_t, int32_t> nsHtml5Tokenizer::SCRIPT_ARR = {
+  SCRIPT_ARR_DATA,
+  MOZ_ARRAY_LENGTH(SCRIPT_ARR_DATA)
+};
 static char16_t const STYLE_ARR_DATA[] = { 's', 't', 'y', 'l', 'e' };
-staticJArray<char16_t,int32_t> nsHtml5Tokenizer::STYLE_ARR = { STYLE_ARR_DATA, MOZ_ARRAY_LENGTH(STYLE_ARR_DATA) };
-static char16_t const PLAINTEXT_ARR_DATA[] = { 'p', 'l', 'a', 'i', 'n', 't', 'e', 'x', 't' };
-staticJArray<char16_t,int32_t> nsHtml5Tokenizer::PLAINTEXT_ARR = { PLAINTEXT_ARR_DATA, MOZ_ARRAY_LENGTH(PLAINTEXT_ARR_DATA) };
+staticJArray<char16_t, int32_t> nsHtml5Tokenizer::STYLE_ARR = {
+  STYLE_ARR_DATA,
+  MOZ_ARRAY_LENGTH(STYLE_ARR_DATA)
+};
+static char16_t const PLAINTEXT_ARR_DATA[] = { 'p', 'l', 'a', 'i', 'n',
+                                               't', 'e', 'x', 't' };
+staticJArray<char16_t, int32_t> nsHtml5Tokenizer::PLAINTEXT_ARR = {
+  PLAINTEXT_ARR_DATA,
+  MOZ_ARRAY_LENGTH(PLAINTEXT_ARR_DATA)
+};
 static char16_t const XMP_ARR_DATA[] = { 'x', 'm', 'p' };
-staticJArray<char16_t,int32_t> nsHtml5Tokenizer::XMP_ARR = { XMP_ARR_DATA, MOZ_ARRAY_LENGTH(XMP_ARR_DATA) };
-static char16_t const TEXTAREA_ARR_DATA[] = { 't', 'e', 'x', 't', 'a', 'r', 'e', 'a' };
-staticJArray<char16_t,int32_t> nsHtml5Tokenizer::TEXTAREA_ARR = { TEXTAREA_ARR_DATA, MOZ_ARRAY_LENGTH(TEXTAREA_ARR_DATA) };
+staticJArray<char16_t, int32_t> nsHtml5Tokenizer::XMP_ARR = { XMP_ARR_DATA,
+                                                              MOZ_ARRAY_LENGTH(
+                                                                XMP_ARR_DATA) };
+static char16_t const TEXTAREA_ARR_DATA[] = { 't', 'e', 'x', 't',
+                                              'a', 'r', 'e', 'a' };
+staticJArray<char16_t, int32_t> nsHtml5Tokenizer::TEXTAREA_ARR = {
+  TEXTAREA_ARR_DATA,
+  MOZ_ARRAY_LENGTH(TEXTAREA_ARR_DATA)
+};
 static char16_t const IFRAME_ARR_DATA[] = { 'i', 'f', 'r', 'a', 'm', 'e' };
-staticJArray<char16_t,int32_t> nsHtml5Tokenizer::IFRAME_ARR = { IFRAME_ARR_DATA, MOZ_ARRAY_LENGTH(IFRAME_ARR_DATA) };
-static char16_t const NOEMBED_ARR_DATA[] = { 'n', 'o', 'e', 'm', 'b', 'e', 'd' };
-staticJArray<char16_t,int32_t> nsHtml5Tokenizer::NOEMBED_ARR = { NOEMBED_ARR_DATA, MOZ_ARRAY_LENGTH(NOEMBED_ARR_DATA) };
-static char16_t const NOSCRIPT_ARR_DATA[] = { 'n', 'o', 's', 'c', 'r', 'i', 'p', 't' };
-staticJArray<char16_t,int32_t> nsHtml5Tokenizer::NOSCRIPT_ARR = { NOSCRIPT_ARR_DATA, MOZ_ARRAY_LENGTH(NOSCRIPT_ARR_DATA) };
-static char16_t const NOFRAMES_ARR_DATA[] = { 'n', 'o', 'f', 'r', 'a', 'm', 'e', 's' };
-staticJArray<char16_t,int32_t> nsHtml5Tokenizer::NOFRAMES_ARR = { NOFRAMES_ARR_DATA, MOZ_ARRAY_LENGTH(NOFRAMES_ARR_DATA) };
+staticJArray<char16_t, int32_t> nsHtml5Tokenizer::IFRAME_ARR = {
+  IFRAME_ARR_DATA,
+  MOZ_ARRAY_LENGTH(IFRAME_ARR_DATA)
+};
+static char16_t const NOEMBED_ARR_DATA[] = {
+  'n', 'o', 'e', 'm', 'b', 'e', 'd'
+};
+staticJArray<char16_t, int32_t> nsHtml5Tokenizer::NOEMBED_ARR = {
+  NOEMBED_ARR_DATA,
+  MOZ_ARRAY_LENGTH(NOEMBED_ARR_DATA)
+};
+static char16_t const NOSCRIPT_ARR_DATA[] = { 'n', 'o', 's', 'c',
+                                              'r', 'i', 'p', 't' };
+staticJArray<char16_t, int32_t> nsHtml5Tokenizer::NOSCRIPT_ARR = {
+  NOSCRIPT_ARR_DATA,
+  MOZ_ARRAY_LENGTH(NOSCRIPT_ARR_DATA)
+};
+static char16_t const NOFRAMES_ARR_DATA[] = { 'n', 'o', 'f', 'r',
+                                              'a', 'm', 'e', 's' };
+staticJArray<char16_t, int32_t> nsHtml5Tokenizer::NOFRAMES_ARR = {
+  NOFRAMES_ARR_DATA,
+  MOZ_ARRAY_LENGTH(NOFRAMES_ARR_DATA)
+};
 
 nsHtml5Tokenizer::nsHtml5Tokenizer(nsHtml5TreeBuilder* tokenHandler,
                                    bool viewingXmlSource)
   : tokenHandler(tokenHandler)
   , encodingDeclarationHandler(nullptr)
   , charRefBuf(jArray<char16_t, int32_t>::newJArray(32))
   , bmpChar(jArray<char16_t, int32_t>::newJArray(1))
   , astralChar(jArray<char16_t, int32_t>::newJArray(2))
@@ -105,61 +140,66 @@ nsHtml5Tokenizer::nsHtml5Tokenizer(nsHtm
   , attributes(tokenHandler->HasBuilder() ? new nsHtml5HtmlAttributes(0)
                                           : nullptr)
   , newAttributesEachTime(!tokenHandler->HasBuilder())
   , viewingXmlSource(viewingXmlSource)
 {
   MOZ_COUNT_CTOR(nsHtml5Tokenizer);
 }
 
-void 
+void
 nsHtml5Tokenizer::setInterner(nsHtml5AtomTable* interner)
 {
   this->interner = interner;
 }
 
 void
 nsHtml5Tokenizer::initLocation(nsHtml5String newPublicId,
                                nsHtml5String newSystemId)
 {
   this->systemId = newSystemId;
   this->publicId = newPublicId;
 }
 
-bool 
+bool
 nsHtml5Tokenizer::isViewingXmlSource()
 {
   return viewingXmlSource;
 }
 
-void 
-nsHtml5Tokenizer::setStateAndEndTagExpectation(int32_t specialTokenizerState, nsAtom* endTagExpectation)
+void
+nsHtml5Tokenizer::setStateAndEndTagExpectation(int32_t specialTokenizerState,
+                                               nsAtom* endTagExpectation)
 {
   this->stateSave = specialTokenizerState;
   if (specialTokenizerState == nsHtml5Tokenizer::DATA) {
     return;
   }
-  autoJArray<char16_t,int32_t> asArray = nsHtml5Portability::newCharArrayFromLocal(endTagExpectation);
-  this->endTagExpectation = nsHtml5ElementName::elementNameByBuffer(asArray, asArray.length, interner);
+  autoJArray<char16_t, int32_t> asArray =
+    nsHtml5Portability::newCharArrayFromLocal(endTagExpectation);
+  this->endTagExpectation =
+    nsHtml5ElementName::elementNameByBuffer(asArray, asArray.length, interner);
   MOZ_ASSERT(!!this->endTagExpectation);
   endTagExpectationToArray();
 }
 
-void 
-nsHtml5Tokenizer::setStateAndEndTagExpectation(int32_t specialTokenizerState, nsHtml5ElementName* endTagExpectation)
+void
+nsHtml5Tokenizer::setStateAndEndTagExpectation(
+  int32_t specialTokenizerState,
+  nsHtml5ElementName* endTagExpectation)
 {
   this->stateSave = specialTokenizerState;
   this->endTagExpectation = endTagExpectation;
   endTagExpectationToArray();
 }
 
-void 
+void
 nsHtml5Tokenizer::endTagExpectationToArray()
 {
-  switch(endTagExpectation->getGroup()) {
+  switch (endTagExpectation->getGroup()) {
     case nsHtml5TreeBuilder::TITLE: {
       endTagExpectationAsArray = TITLE_ARR;
       return;
     }
     case nsHtml5TreeBuilder::SCRIPT: {
       endTagExpectationAsArray = SCRIPT_ARR;
       return;
     }
@@ -197,30 +237,30 @@ nsHtml5Tokenizer::endTagExpectationToArr
     }
     default: {
       MOZ_ASSERT(false, "Bad end tag expectation.");
       return;
     }
   }
 }
 
-void 
+void
 nsHtml5Tokenizer::setLineNumber(int32_t line)
 {
   this->attributeLine = line;
   this->line = line;
 }
 
-nsHtml5HtmlAttributes* 
+nsHtml5HtmlAttributes*
 nsHtml5Tokenizer::emptyAttributes()
 {
   return nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES;
 }
 
-void 
+void
 nsHtml5Tokenizer::emitOrAppendCharRefBuf(int32_t returnState)
 {
   if ((returnState & DATA_AND_RCDATA_MASK)) {
     appendCharRefBufToStrBuf();
   } else {
     if (charRefBufLen > 0) {
       tokenHandler->characters(charRefBuf, 0, charRefBufLen);
       charRefBufLen = 0;
@@ -237,64 +277,65 @@ nsHtml5Tokenizer::strBufToString()
     strBufLen,
     tokenHandler,
     !newAttributesEachTime &&
       attributeName == nsHtml5AttributeName::ATTR_CLASS);
   clearStrBufAfterUse();
   return str;
 }
 
-void 
+void
 nsHtml5Tokenizer::strBufToDoctypeName()
 {
-  doctypeName = nsHtml5Portability::newLocalNameFromBuffer(strBuf, strBufLen, interner);
+  doctypeName =
+    nsHtml5Portability::newLocalNameFromBuffer(strBuf, strBufLen, interner);
   clearStrBufAfterUse();
 }
 
-void 
+void
 nsHtml5Tokenizer::emitStrBuf()
 {
   if (strBufLen > 0) {
     tokenHandler->characters(strBuf, 0, strBufLen);
     clearStrBufAfterUse();
   }
 }
 
-void 
+void
 nsHtml5Tokenizer::appendStrBuf(char16_t* buffer, int32_t offset, int32_t length)
 {
   int32_t newLen = strBufLen + length;
   MOZ_ASSERT(newLen <= strBuf.length, "Previous buffer length insufficient.");
   if (MOZ_UNLIKELY(strBuf.length < newLen)) {
     if (MOZ_UNLIKELY(!EnsureBufferSpace(length))) {
       MOZ_CRASH("Unable to recover from buffer reallocation failure");
     }
   }
   nsHtml5ArrayCopy::arraycopy(buffer, offset, strBuf, strBufLen, length);
   strBufLen = newLen;
 }
 
-void 
+void
 nsHtml5Tokenizer::emitComment(int32_t provisionalHyphens, int32_t pos)
 {
   tokenHandler->comment(strBuf, 0, strBufLen - provisionalHyphens);
   clearStrBufAfterUse();
   cstart = pos + 1;
 }
 
-void 
+void
 nsHtml5Tokenizer::flushChars(char16_t* buf, int32_t pos)
 {
   if (pos > cstart) {
     tokenHandler->characters(buf, cstart, pos - cstart);
   }
   cstart = INT32_MAX;
 }
 
-void 
+void
 nsHtml5Tokenizer::strBufToElementNameString()
 {
   if (containsHyphen) {
     nsAtom* annotationName = nsHtml5ElementName::ELT_ANNOTATION_XML->getName();
     if (nsHtml5Portability::localEqualsBuffer(
           annotationName, strBuf, strBufLen)) {
       tagName = nsHtml5ElementName::ELT_ANNOTATION_XML;
     } else {
@@ -312,23 +353,24 @@ nsHtml5Tokenizer::strBufToElementNameStr
         false);
       tagName = nonInternedTagName;
     }
   }
   containsHyphen = false;
   clearStrBufAfterUse();
 }
 
-int32_t 
+int32_t
 nsHtml5Tokenizer::emitCurrentTagToken(bool selfClosing, int32_t pos)
 {
   cstart = pos + 1;
   maybeErrSlashInEndTag(selfClosing);
   stateSave = nsHtml5Tokenizer::DATA;
-  nsHtml5HtmlAttributes* attrs = (!attributes ? nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES : attributes);
+  nsHtml5HtmlAttributes* attrs =
+    (!attributes ? nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES : attributes);
   if (endTag) {
     maybeErrAttributesOnEndTag(attrs);
     if (!viewingXmlSource) {
       tokenHandler->endTag(tagName);
     }
     if (newAttributesEachTime) {
       delete attributes;
       attributes = nullptr;
@@ -346,81 +388,83 @@ nsHtml5Tokenizer::emitCurrentTagToken(bo
   if (newAttributesEachTime) {
     attributes = nullptr;
   } else {
     attributes->clear(0);
   }
   return stateSave;
 }
 
-void 
+void
 nsHtml5Tokenizer::attributeNameComplete()
 {
-  attributeName = nsHtml5AttributeName::nameByBuffer(strBuf, strBufLen, interner);
+  attributeName =
+    nsHtml5AttributeName::nameByBuffer(strBuf, strBufLen, interner);
   if (!attributeName) {
     nonInternedAttributeName->setNameForNonInterned(
       nsHtml5Portability::newLocalNameFromBuffer(strBuf, strBufLen, interner));
     attributeName = nonInternedAttributeName;
   }
   clearStrBufAfterUse();
   if (!attributes) {
     attributes = new nsHtml5HtmlAttributes(0);
   }
   if (attributes->contains(attributeName)) {
     errDuplicateAttribute();
     attributeName = nullptr;
   }
 }
 
-void 
+void
 nsHtml5Tokenizer::addAttributeWithoutValue()
 {
 
   if (attributeName) {
-    attributes->addAttribute(attributeName, nsHtml5Portability::newEmptyString(), attributeLine);
+    attributes->addAttribute(
+      attributeName, nsHtml5Portability::newEmptyString(), attributeLine);
     attributeName = nullptr;
   } else {
     clearStrBufAfterUse();
   }
 }
 
-void 
+void
 nsHtml5Tokenizer::addAttributeWithValue()
 {
   if (attributeName) {
     nsHtml5String val = strBufToString();
     if (mViewSource) {
       mViewSource->MaybeLinkifyAttributeValue(attributeName, val);
     }
     attributes->addAttribute(attributeName, val, attributeLine);
     attributeName = nullptr;
   } else {
     clearStrBufAfterUse();
   }
 }
 
-void 
+void
 nsHtml5Tokenizer::start()
 {
   initializeWithoutStarting();
   tokenHandler->startTokenization(this);
 }
 
-bool 
+bool
 nsHtml5Tokenizer::tokenizeBuffer(nsHtml5UTF16Buffer* buffer)
 {
   int32_t state = stateSave;
   int32_t returnState = returnStateSave;
   char16_t c = '\0';
   shouldSuspend = false;
   lastCR = false;
   int32_t start = buffer->getStart();
   int32_t end = buffer->getEnd();
   int32_t pos = start - 1;
-  switch(state) {
+  switch (state) {
     case DATA:
     case RCDATA:
     case SCRIPT_DATA:
     case PLAINTEXT:
     case RAWTEXT:
     case CDATA_SECTION:
     case SCRIPT_DATA_ESCAPED:
     case SCRIPT_DATA_ESCAPE_START:
@@ -438,49 +482,59 @@ nsHtml5Tokenizer::tokenizeBuffer(nsHtml5
     }
     default: {
       cstart = INT32_MAX;
       break;
     }
   }
   if (mViewSource) {
     mViewSource->SetBuffer(buffer);
-    pos = stateLoop<nsHtml5ViewSourcePolicy>(state, c, pos, buffer->getBuffer(), false, returnState, buffer->getEnd());
+    pos = stateLoop<nsHtml5ViewSourcePolicy>(
+      state, c, pos, buffer->getBuffer(), false, returnState, buffer->getEnd());
     mViewSource->DropBuffer((pos == buffer->getEnd()) ? pos : pos + 1);
   } else {
-    pos = stateLoop<nsHtml5SilentPolicy>(state, c, pos, buffer->getBuffer(), false, returnState, buffer->getEnd());
+    pos = stateLoop<nsHtml5SilentPolicy>(
+      state, c, pos, buffer->getBuffer(), false, returnState, buffer->getEnd());
   }
   if (pos == end) {
     buffer->setStart(pos);
   } else {
     buffer->setStart(pos + 1);
   }
   return lastCR;
 }
 
 template<class P>
-int32_t 
-nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* buf, bool reconsume, int32_t returnState, int32_t endPos)
+int32_t
+nsHtml5Tokenizer::stateLoop(int32_t state,
+                            char16_t c,
+                            int32_t pos,
+                            char16_t* buf,
+                            bool reconsume,
+                            int32_t returnState,
+                            int32_t endPos)
 {
-  stateloop: for (; ; ) {
-    switch(state) {
+stateloop:
+  for (;;) {
+    switch (state) {
       case DATA: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '&': {
               flushChars(buf, pos);
-              MOZ_ASSERT(!charRefBufLen, "charRefBufLen not reset after previous use!");
+              MOZ_ASSERT(!charRefBufLen,
+                         "charRefBufLen not reset after previous use!");
               appendCharRefBuf(c);
               setAdditionalAndRememberAmpersandLocation('\0');
               returnState = state;
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::CONSUME_CHARACTER_REFERENCE,
                               reconsume,
                               pos);
@@ -503,42 +557,42 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             case '\n': {
               silentLineFeed();
             }
             default: {
               continue;
             }
           }
         }
-        dataloop_end: ;
+      dataloop_end:;
       }
       case TAG_OPEN: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (c >= 'A' && c <= 'Z') {
             endTag = false;
             clearStrBufBeforeUse();
-            appendStrBuf((char16_t) (c + 0x20));
+            appendStrBuf((char16_t)(c + 0x20));
             containsHyphen = false;
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::TAG_NAME, reconsume, pos);
             NS_HTML5_BREAK(tagopenloop);
           } else if (c >= 'a' && c <= 'z') {
             endTag = false;
             clearStrBufBeforeUse();
             appendStrBuf(c);
             containsHyphen = false;
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::TAG_NAME, reconsume, pos);
             NS_HTML5_BREAK(tagopenloop);
           }
-          switch(c) {
+          switch (c) {
             case '!': {
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::MARKUP_DECLARATION_OPEN,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '/': {
@@ -581,25 +635,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               cstart = pos;
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        tagopenloop_end: ;
+      tagopenloop_end:;
       }
       case TAG_NAME: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               strBufToElementNameString();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
@@ -622,17 +676,18 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SELF_CLOSING_START_TAG,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '>': {
               strBufToElementNameString();
-              state = P::transition(mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
+              state = P::transition(
+                mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
             }
@@ -642,29 +697,29 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               } else if (c == '-') {
                 containsHyphen = true;
               }
               appendStrBuf(c);
               continue;
             }
           }
         }
-        tagnameloop_end: ;
+      tagnameloop_end:;
       }
       case BEFORE_ATTRIBUTE_NAME: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
             }
             case ' ':
@@ -675,17 +730,18 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             case '/': {
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SELF_CLOSING_START_TAG,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '>': {
-              state = P::transition(mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
+              state = P::transition(
+                mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
             }
@@ -705,25 +761,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               clearStrBufBeforeUse();
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::ATTRIBUTE_NAME, reconsume, pos);
               NS_HTML5_BREAK(beforeattributenameloop);
             }
           }
         }
-        beforeattributenameloop_end: ;
+      beforeattributenameloop_end:;
       }
       case ATTRIBUTE_NAME: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               attributeNameComplete();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::AFTER_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
@@ -756,17 +812,18 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_VALUE,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(attributenameloop);
             }
             case '>': {
               attributeNameComplete();
               addAttributeWithoutValue();
-              state = P::transition(mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
+              state = P::transition(
+                mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
             }
@@ -781,25 +838,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               if (c >= 'A' && c <= 'Z') {
                 c += 0x20;
               }
               appendStrBuf(c);
               continue;
             }
           }
         }
-        attributenameloop_end: ;
+      attributenameloop_end:;
       }
       case BEFORE_ATTRIBUTE_VALUE: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
             }
             case ' ':
@@ -838,17 +895,18 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '>': {
               if (P::reportErrors) {
                 errAttributeValueMissing();
               }
               addAttributeWithoutValue();
-              state = P::transition(mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
+              state = P::transition(
+                mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
             }
@@ -867,40 +925,41 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                                     nsHtml5Tokenizer::ATTRIBUTE_VALUE_UNQUOTED,
                                     reconsume,
                                     pos);
 
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        beforeattributevalueloop_end: ;
+      beforeattributevalueloop_end:;
       }
       case ATTRIBUTE_VALUE_DOUBLE_QUOTED: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '\"': {
               addAttributeWithValue();
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::AFTER_ATTRIBUTE_VALUE_QUOTED,
                               reconsume,
                               pos);
               NS_HTML5_BREAK(attributevaluedoublequotedloop);
             }
             case '&': {
-              MOZ_ASSERT(!charRefBufLen, "charRefBufLen not reset after previous use!");
+              MOZ_ASSERT(!charRefBufLen,
+                         "charRefBufLen not reset after previous use!");
               appendCharRefBuf(c);
               setAdditionalAndRememberAmpersandLocation('\"');
               returnState = state;
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::CONSUME_CHARACTER_REFERENCE,
                               reconsume,
                               pos);
@@ -918,25 +977,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               c = 0xfffd;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
-        attributevaluedoublequotedloop_end: ;
+      attributevaluedoublequotedloop_end:;
       }
       case AFTER_ATTRIBUTE_VALUE_QUOTED: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
@@ -955,17 +1014,18 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             case '/': {
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SELF_CLOSING_START_TAG,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(afterattributevaluequotedloop);
             }
             case '>': {
-              state = P::transition(mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
+              state = P::transition(
+                mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             default: {
               if (P::reportErrors) {
                 errNoSpaceBetweenAttributes();
@@ -974,26 +1034,27 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        afterattributevaluequotedloop_end: ;
+      afterattributevaluequotedloop_end:;
       }
       case SELF_CLOSING_START_TAG: {
         if (++pos == endPos) {
           NS_HTML5_BREAK(stateloop);
         }
         c = checkChar(buf, pos);
-        switch(c) {
+        switch (c) {
           case '>': {
-            state = P::transition(mViewSource, emitCurrentTagToken(true, pos), reconsume, pos);
+            state = P::transition(
+              mViewSource, emitCurrentTagToken(true, pos), reconsume, pos);
             if (shouldSuspend) {
               NS_HTML5_BREAK(stateloop);
             }
             NS_HTML5_CONTINUE(stateloop);
           }
           default: {
             if (P::reportErrors) {
               errSlashNotFollowedByGt();
@@ -1003,26 +1064,26 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                                   nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                   reconsume,
                                   pos);
             NS_HTML5_CONTINUE(stateloop);
           }
         }
       }
       case ATTRIBUTE_VALUE_UNQUOTED: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               addAttributeWithValue();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
@@ -1036,30 +1097,32 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               addAttributeWithValue();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '&': {
-              MOZ_ASSERT(!charRefBufLen, "charRefBufLen not reset after previous use!");
+              MOZ_ASSERT(!charRefBufLen,
+                         "charRefBufLen not reset after previous use!");
               appendCharRefBuf(c);
               setAdditionalAndRememberAmpersandLocation('>');
               returnState = state;
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::CONSUME_CHARACTER_REFERENCE,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '>': {
               addAttributeWithValue();
-              state = P::transition(mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
+              state = P::transition(
+                mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
             }
@@ -1076,22 +1139,22 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
 
               appendStrBuf(c);
               continue;
             }
           }
         }
       }
       case AFTER_ATTRIBUTE_NAME: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
             }
             case ' ':
@@ -1111,17 +1174,18 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_ATTRIBUTE_VALUE,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '>': {
               addAttributeWithoutValue();
-              state = P::transition(mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
+              state = P::transition(
+                mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
               if (shouldSuspend) {
                 NS_HTML5_BREAK(stateloop);
               }
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
             }
@@ -1142,22 +1206,22 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::ATTRIBUTE_NAME, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       }
       case MARKUP_DECLARATION_OPEN: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '-': {
               clearStrBufBeforeUse();
               appendStrBuf(c);
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::MARKUP_DECLARATION_HYPHEN,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(markupdeclarationopenloop);
@@ -1190,25 +1254,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               clearStrBufBeforeUse();
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        markupdeclarationopenloop_end: ;
+      markupdeclarationopenloop_end:;
       }
       case MARKUP_DECLARATION_HYPHEN: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\0': {
               NS_HTML5_BREAK(stateloop);
             }
             case '-': {
               clearStrBufAfterOneHyphen();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::COMMENT_START, reconsume, pos);
               NS_HTML5_BREAK(markupdeclarationhyphenloop);
@@ -1219,25 +1283,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               }
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        markupdeclarationhyphenloop_end: ;
+      markupdeclarationhyphenloop_end:;
       }
       case COMMENT_START: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '-': {
               appendStrBuf(c);
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::COMMENT_START_DASH,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
@@ -1268,25 +1332,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
               NS_HTML5_BREAK(commentstartloop);
             }
           }
         }
-        commentstartloop_end: ;
+      commentstartloop_end:;
       }
       case COMMENT: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '-': {
               appendStrBuf(c);
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::COMMENT_END_DASH,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(commentloop);
             }
@@ -1302,25 +1366,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               c = 0xfffd;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
-        commentloop_end: ;
+      commentloop_end:;
       }
       case COMMENT_END_DASH: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '-': {
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::COMMENT_END, reconsume, pos);
               NS_HTML5_BREAK(commentenddashloop);
             }
             case '\r': {
               appendStrBufCarriageReturn();
@@ -1340,25 +1404,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        commentenddashloop_end: ;
+      commentenddashloop_end:;
       }
       case COMMENT_END: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '>': {
               emitComment(2, pos);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '-': {
               adjustDoubleHyphenAndAppendToStrBufAndErr(c);
@@ -1393,25 +1457,24 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               adjustDoubleHyphenAndAppendToStrBufAndErr(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-
       }
       case COMMENT_END_BANG: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '>': {
               emitComment(3, pos);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '-': {
               appendStrBuf(c);
@@ -1441,17 +1504,17 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
           }
         }
       }
       case COMMENT_START_DASH: {
         if (++pos == endPos) {
           NS_HTML5_BREAK(stateloop);
         }
         c = checkChar(buf, pos);
-        switch(c) {
+        switch (c) {
           case '-': {
             appendStrBuf(c);
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::COMMENT_END, reconsume, pos);
             NS_HTML5_CONTINUE(stateloop);
           }
           case '>': {
             if (P::reportErrors) {
@@ -1481,17 +1544,17 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             appendStrBuf(c);
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::COMMENT, reconsume, pos);
             NS_HTML5_CONTINUE(stateloop);
           }
         }
       }
       case CDATA_START: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (index < 6) {
             if (c == nsHtml5Tokenizer::CDATA_LSQB[index]) {
               appendStrBuf(c);
             } else {
@@ -1511,26 +1574,26 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             reconsume = true;
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::CDATA_SECTION, reconsume, pos);
             break;
           }
         }
       }
       case CDATA_SECTION: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case ']': {
               flushChars(buf, pos);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::CDATA_RSQB, reconsume, pos);
               NS_HTML5_BREAK(cdatasectionloop);
             }
             case '\0': {
               emitReplacementCharacter(buf, pos);
@@ -1543,49 +1606,49 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             case '\n': {
               silentLineFeed();
             }
             default: {
               continue;
             }
           }
         }
-        cdatasectionloop_end: ;
+      cdatasectionloop_end:;
       }
       case CDATA_RSQB: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case ']': {
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::CDATA_RSQB_RSQB, reconsume, pos);
               NS_HTML5_BREAK(cdatarsqb);
             }
             default: {
               tokenHandler->characters(nsHtml5Tokenizer::RSQB_RSQB, 0, 1);
               cstart = pos;
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::CDATA_SECTION, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        cdatarsqb_end: ;
+      cdatarsqb_end:;
       }
       case CDATA_RSQB_RSQB: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case ']': {
               tokenHandler->characters(nsHtml5Tokenizer::RSQB_RSQB, 0, 1);
               continue;
             }
             case '>': {
               cstart = pos + 1;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
@@ -1596,40 +1659,40 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               cstart = pos;
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::CDATA_SECTION, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-
       }
       case ATTRIBUTE_VALUE_SINGLE_QUOTED: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '\'': {
               addAttributeWithValue();
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::AFTER_ATTRIBUTE_VALUE_QUOTED,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '&': {
-              MOZ_ASSERT(!charRefBufLen, "charRefBufLen not reset after previous use!");
+              MOZ_ASSERT(!charRefBufLen,
+                         "charRefBufLen not reset after previous use!");
               appendCharRefBuf(c);
               setAdditionalAndRememberAmpersandLocation('\'');
               returnState = state;
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::CONSUME_CHARACTER_REFERENCE,
                               reconsume,
                               pos);
@@ -1647,27 +1710,27 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               c = 0xfffd;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
-        attributevaluesinglequotedloop_end: ;
+      attributevaluesinglequotedloop_end:;
       }
       case CONSUME_CHARACTER_REFERENCE: {
         if (++pos == endPos) {
           NS_HTML5_BREAK(stateloop);
         }
         c = checkChar(buf, pos);
         if (c == '\0') {
           NS_HTML5_BREAK(stateloop);
         }
-        switch(c) {
+        switch (c) {
           case ' ':
           case '\t':
           case '\n':
           case '\r':
           case '\f':
           case '<':
           case '&': {
             emitOrAppendCharRefBuf(returnState);
@@ -1752,94 +1815,97 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
           charRefBufMark = 0;
           state = P::transition(mViewSource,
                                 nsHtml5Tokenizer::CHARACTER_REFERENCE_TAIL,
                                 reconsume,
                                 pos);
         }
       }
       case CHARACTER_REFERENCE_TAIL: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (c == '\0') {
             NS_HTML5_BREAK(stateloop);
           }
           entCol++;
-          for (; ; ) {
+          for (;;) {
             if (hi < lo) {
               NS_HTML5_BREAK(outer);
             }
             if (entCol == nsHtml5NamedCharacters::NAMES[lo].length()) {
               candidate = lo;
               charRefBufMark = charRefBufLen;
               lo++;
             } else if (entCol > nsHtml5NamedCharacters::NAMES[lo].length()) {
               NS_HTML5_BREAK(outer);
             } else if (c > nsHtml5NamedCharacters::NAMES[lo].charAt(entCol)) {
               lo++;
             } else {
               NS_HTML5_BREAK(loloop);
             }
           }
-          loloop_end: ;
-          for (; ; ) {
+        loloop_end:;
+          for (;;) {
             if (hi < lo) {
               NS_HTML5_BREAK(outer);
             }
             if (entCol == nsHtml5NamedCharacters::NAMES[hi].length()) {
               NS_HTML5_BREAK(hiloop);
             }
             if (entCol > nsHtml5NamedCharacters::NAMES[hi].length()) {
               NS_HTML5_BREAK(outer);
             } else if (c < nsHtml5NamedCharacters::NAMES[hi].charAt(entCol)) {
               hi--;
             } else {
               NS_HTML5_BREAK(hiloop);
             }
           }
-          hiloop_end: ;
+        hiloop_end:;
           if (c == ';') {
             if (entCol + 1 == nsHtml5NamedCharacters::NAMES[lo].length()) {
               candidate = lo;
               charRefBufMark = charRefBufLen;
             }
             NS_HTML5_BREAK(outer);
           }
           if (hi < lo) {
             NS_HTML5_BREAK(outer);
           }
           appendCharRefBuf(c);
           continue;
         }
-        outer_end: ;
+      outer_end:;
         if (candidate == -1) {
           if (P::reportErrors) {
             errNoNamedCharacterMatch();
           }
           emitOrAppendCharRefBuf(returnState);
           if (!(returnState & DATA_AND_RCDATA_MASK)) {
             cstart = pos;
           }
           reconsume = true;
           state = P::transition(mViewSource, returnState, reconsume, pos);
           NS_HTML5_CONTINUE(stateloop);
         } else {
-          const nsHtml5CharacterName& candidateName = nsHtml5NamedCharacters::NAMES[candidate];
-          if (!candidateName.length() || candidateName.charAt(candidateName.length() - 1) != ';') {
+          const nsHtml5CharacterName& candidateName =
+            nsHtml5NamedCharacters::NAMES[candidate];
+          if (!candidateName.length() ||
+              candidateName.charAt(candidateName.length() - 1) != ';') {
             if ((returnState & DATA_AND_RCDATA_MASK)) {
               char16_t ch;
               if (charRefBufMark == charRefBufLen) {
                 ch = c;
               } else {
                 ch = charRefBuf[charRefBufMark];
               }
-              if (ch == '=' || (ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) {
+              if (ch == '=' || (ch >= '0' && ch <= '9') ||
+                  (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) {
                 if (P::reportErrors) {
                   errNoNamedCharacterMatch();
                 }
                 appendCharRefBufToStrBuf();
                 reconsume = true;
                 state = P::transition(mViewSource, returnState, reconsume, pos);
                 NS_HTML5_CONTINUE(stateloop);
               }
@@ -1858,19 +1924,21 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
           const char16_t* val = nsHtml5NamedCharacters::VALUES[candidate];
           if (!val[1]) {
             emitOrAppendOne(val, returnState);
           } else {
             emitOrAppendTwo(val, returnState);
           }
           if (charRefBufMark < charRefBufLen) {
             if ((returnState & DATA_AND_RCDATA_MASK)) {
-              appendStrBuf(charRefBuf, charRefBufMark, charRefBufLen - charRefBufMark);
+              appendStrBuf(
+                charRefBuf, charRefBufMark, charRefBufLen - charRefBufMark);
             } else {
-              tokenHandler->characters(charRefBuf, charRefBufMark, charRefBufLen - charRefBufMark);
+              tokenHandler->characters(
+                charRefBuf, charRefBufMark, charRefBufLen - charRefBufMark);
             }
           }
           bool earlyBreak = (c == ';' && charRefBufMark == charRefBufLen);
           charRefBufLen = 0;
           if (!(returnState & DATA_AND_RCDATA_MASK)) {
             cstart = earlyBreak ? pos + 1 : pos;
           }
           reconsume = !earlyBreak;
@@ -1880,33 +1948,33 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
       }
       case CONSUME_NCR: {
         if (++pos == endPos) {
           NS_HTML5_BREAK(stateloop);
         }
         c = checkChar(buf, pos);
         value = 0;
         seenDigits = false;
-        switch(c) {
+        switch (c) {
           case 'x':
           case 'X': {
             appendCharRefBuf(c);
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::HEX_NCR_LOOP, reconsume, pos);
             NS_HTML5_CONTINUE(stateloop);
           }
           default: {
             reconsume = true;
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::DECIMAL_NRC_LOOP, reconsume, pos);
           }
         }
       }
       case DECIMAL_NRC_LOOP: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
@@ -1963,26 +2031,26 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::HANDLE_NCR_VALUE,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(decimalloop);
             }
           }
         }
-        decimalloop_end: ;
+      decimalloop_end:;
       }
       case HANDLE_NCR_VALUE: {
         charRefBufLen = 0;
         handleNcrValue(returnState);
         state = P::transition(mViewSource, returnState, reconsume, pos);
         NS_HTML5_CONTINUE(stateloop);
       }
       case HEX_NCR_LOOP: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           MOZ_ASSERT(value >= 0, "value must not become negative.");
           if (c >= '0' && c <= '9') {
             seenDigits = true;
             if (value <= 0x10FFFF) {
@@ -2051,50 +2119,49 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       }
       case PLAINTEXT: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '\0': {
               emitPlaintextReplacementCharacter(buf, pos);
               continue;
             }
             case '\r': {
               emitCarriageReturn(buf, pos);
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
             }
             default: {
               continue;
             }
           }
         }
-
       }
       case CLOSE_TAG_OPEN: {
         if (++pos == endPos) {
           NS_HTML5_BREAK(stateloop);
         }
         c = checkChar(buf, pos);
-        switch(c) {
+        switch (c) {
           case '>': {
             if (P::reportErrors) {
               errLtSlashGt();
             }
             cstart = pos + 1;
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
             NS_HTML5_CONTINUE(stateloop);
@@ -2145,29 +2212,30 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
       }
       case RCDATA: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '&': {
               flushChars(buf, pos);
-              MOZ_ASSERT(!charRefBufLen, "charRefBufLen not reset after previous use!");
+              MOZ_ASSERT(!charRefBufLen,
+                         "charRefBufLen not reset after previous use!");
               appendCharRefBuf(c);
               setAdditionalAndRememberAmpersandLocation('\0');
               returnState = state;
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::CONSUME_CHARACTER_REFERENCE,
                               reconsume,
                               pos);
@@ -2194,29 +2262,28 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             case '\n': {
               silentLineFeed();
             }
             default: {
               continue;
             }
           }
         }
-
       }
       case RAWTEXT: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '<': {
               flushChars(buf, pos);
               returnState = state;
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::RAWTEXT_RCDATA_LESS_THAN_SIGN,
                               reconsume,
                               pos);
@@ -2233,25 +2300,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             case '\n': {
               silentLineFeed();
             }
             default: {
               continue;
             }
           }
         }
-        rawtextloop_end: ;
+      rawtextloop_end:;
       }
       case RAWTEXT_RCDATA_LESS_THAN_SIGN: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '/': {
               index = 0;
               clearStrBufBeforeUse();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::NON_DATA_END_TAG_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(rawtextrcdatalessthansignloop);
@@ -2260,20 +2327,20 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               tokenHandler->characters(nsHtml5Tokenizer::LT_GT, 0, 1);
               cstart = pos;
               reconsume = true;
               state = P::transition(mViewSource, returnState, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        rawtextrcdatalessthansignloop_end: ;
+      rawtextrcdatalessthansignloop_end:;
       }
       case NON_DATA_END_TAG_NAME: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (index < endTagExpectationAsArray.length) {
             char16_t e = endTagExpectationAsArray[index];
             char16_t folded = c;
             if (c >= 'A' && c <= 'Z') {
@@ -2288,17 +2355,17 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               NS_HTML5_CONTINUE(stateloop);
             }
             appendStrBuf(c);
             index++;
             continue;
           } else {
             endTag = true;
             tagName = endTagExpectation;
-            switch(c) {
+            switch (c) {
               case '\r': {
                 silentCarriageReturn();
                 clearStrBufAfterUse();
                 state = P::transition(mViewSource,
                                       nsHtml5Tokenizer::BEFORE_ATTRIBUTE_NAME,
                                       reconsume,
                                       pos);
                 NS_HTML5_BREAK(stateloop);
@@ -2321,17 +2388,18 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                 state = P::transition(mViewSource,
                                       nsHtml5Tokenizer::SELF_CLOSING_START_TAG,
                                       reconsume,
                                       pos);
                 NS_HTML5_CONTINUE(stateloop);
               }
               case '>': {
                 clearStrBufAfterUse();
-                state = P::transition(mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
+                state = P::transition(
+                  mViewSource, emitCurrentTagToken(false, pos), reconsume, pos);
                 if (shouldSuspend) {
                   NS_HTML5_BREAK(stateloop);
                 }
                 NS_HTML5_CONTINUE(stateloop);
               }
               default: {
                 tokenHandler->characters(nsHtml5Tokenizer::LT_SOLIDUS, 0, 2);
                 emitStrBuf();
@@ -2343,26 +2411,26 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                 state = P::transition(mViewSource, returnState, reconsume, pos);
                 NS_HTML5_CONTINUE(stateloop);
               }
             }
           }
         }
       }
       case BOGUS_COMMENT: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '>': {
               emitComment(0, pos);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '-': {
               appendStrBuf(c);
@@ -2384,26 +2452,26 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               c = 0xfffd;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
-        boguscommentloop_end: ;
+      boguscommentloop_end:;
       }
       case BOGUS_COMMENT_HYPHEN: {
       boguscommenthyphenloop:
         for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '>': {
               emitComment(0, pos);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '-': {
               appendSecondHyphenToBogusComment();
@@ -2427,29 +2495,28 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_COMMENT, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-
       }
       case SCRIPT_DATA: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '<': {
               flushChars(buf, pos);
               returnState = state;
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_LESS_THAN_SIGN,
                               reconsume,
                               pos);
@@ -2466,25 +2533,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             case '\n': {
               silentLineFeed();
             }
             default: {
               continue;
             }
           }
         }
-        scriptdataloop_end: ;
+      scriptdataloop_end:;
       }
       case SCRIPT_DATA_LESS_THAN_SIGN: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '/': {
               index = 0;
               clearStrBufBeforeUse();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::NON_DATA_END_TAG_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
@@ -2503,75 +2570,75 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               cstart = pos;
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::SCRIPT_DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        scriptdatalessthansignloop_end: ;
+      scriptdatalessthansignloop_end:;
       }
       case SCRIPT_DATA_ESCAPE_START: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '-': {
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_ESCAPE_START_DASH,
                               reconsume,
                               pos);
               NS_HTML5_BREAK(scriptdataescapestartloop);
             }
             default: {
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::SCRIPT_DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        scriptdataescapestartloop_end: ;
+      scriptdataescapestartloop_end:;
       }
       case SCRIPT_DATA_ESCAPE_START_DASH: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '-': {
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED_DASH_DASH,
                               reconsume,
                               pos);
               NS_HTML5_BREAK(scriptdataescapestartdashloop);
             }
             default: {
               reconsume = true;
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::SCRIPT_DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        scriptdataescapestartdashloop_end: ;
+      scriptdataescapestartdashloop_end:;
       }
       case SCRIPT_DATA_ESCAPED_DASH_DASH: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '-': {
               continue;
             }
             case '<': {
               flushChars(buf, pos);
               state = P::transition(
                 mViewSource,
                 nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN,
@@ -2607,29 +2674,29 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(scriptdataescapeddashdashloop);
             }
           }
         }
-        scriptdataescapeddashdashloop_end: ;
+      scriptdataescapeddashdashloop_end:;
       }
       case SCRIPT_DATA_ESCAPED: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '-': {
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED_DASH,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(scriptdataescapedloop);
             }
             case '<': {
@@ -2652,25 +2719,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             case '\n': {
               silentLineFeed();
             }
             default: {
               continue;
             }
           }
         }
-        scriptdataescapedloop_end: ;
+      scriptdataescapedloop_end:;
       }
       case SCRIPT_DATA_ESCAPED_DASH: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '-': {
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED_DASH_DASH,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
@@ -2706,25 +2773,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        scriptdataescapeddashloop_end: ;
+      scriptdataescapeddashloop_end:;
       }
       case SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '/': {
               index = 0;
               clearStrBufBeforeUse();
               returnState = nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED;
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::NON_DATA_END_TAG_NAME,
                                     reconsume,
                                     pos);
@@ -2749,20 +2816,20 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        scriptdataescapedlessthanloop_end: ;
+      scriptdataescapedlessthanloop_end:;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPE_START: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           MOZ_ASSERT(index > 0);
           if (index < 6) {
             char16_t folded = c;
             if (c >= 'A' && c <= 'Z') {
@@ -2774,17 +2841,17 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             index++;
             continue;
           }
-          switch(c) {
+          switch (c) {
             case '\r': {
               emitCarriageReturn(buf, pos);
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_BREAK(stateloop);
@@ -2809,29 +2876,29 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        scriptdatadoubleescapestartloop_end: ;
+      scriptdatadoubleescapestartloop_end:;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPED: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '-': {
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED_DASH,
                               reconsume,
                               pos);
               NS_HTML5_BREAK(scriptdatadoubleescapedloop);
             }
@@ -2854,25 +2921,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             case '\n': {
               silentLineFeed();
             }
             default: {
               continue;
             }
           }
         }
-        scriptdatadoubleescapedloop_end: ;
+      scriptdatadoubleescapedloop_end:;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPED_DASH: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '-': {
               state = P::transition(
                 mViewSource,
                 nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH,
                 reconsume,
                 pos);
               NS_HTML5_BREAK(scriptdatadoubleescapeddashloop);
             }
@@ -2910,25 +2977,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        scriptdatadoubleescapeddashloop_end: ;
+      scriptdatadoubleescapeddashloop_end:;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '-': {
               continue;
             }
             case '<': {
               state = P::transition(
                 mViewSource,
                 nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN,
                 reconsume,
@@ -2966,25 +3033,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        scriptdatadoubleescapeddashdashloop_end: ;
+      scriptdatadoubleescapeddashdashloop_end:;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '/': {
               index = 0;
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPE_END,
                               reconsume,
                               pos);
               NS_HTML5_BREAK(scriptdatadoubleescapedlessthanloop);
@@ -2995,20 +3062,20 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        scriptdatadoubleescapedlessthanloop_end: ;
+      scriptdatadoubleescapedlessthanloop_end:;
       }
       case SCRIPT_DATA_DOUBLE_ESCAPE_END: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (index < 6) {
             char16_t folded = c;
             if (c >= 'A' && c <= 'Z') {
               folded += 0x20;
@@ -3020,17 +3087,17 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             index++;
             continue;
           }
-          switch(c) {
+          switch (c) {
             case '\r': {
               emitCarriageReturn(buf, pos);
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::SCRIPT_DATA_ESCAPED,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
@@ -3054,20 +3121,19 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::SCRIPT_DATA_DOUBLE_ESCAPED,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-
       }
       case MARKUP_DECLARATION_OCTYPE: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (index < 6) {
             char16_t folded = c;
             if (c >= 'A' && c <= 'Z') {
               folded += 0x20;
@@ -3087,30 +3153,30 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             continue;
           } else {
             reconsume = true;
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::DOCTYPE, reconsume, pos);
             NS_HTML5_BREAK(markupdeclarationdoctypeloop);
           }
         }
-        markupdeclarationdoctypeloop_end: ;
+      markupdeclarationdoctypeloop_end:;
       }
       case DOCTYPE: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
           initDoctypeFields();
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_DOCTYPE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
             }
@@ -3134,29 +3200,29 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::BEFORE_DOCTYPE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(doctypeloop);
             }
           }
         }
-        doctypeloop_end: ;
+      doctypeloop_end:;
       }
       case BEFORE_DOCTYPE_NAME: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
             }
             case ' ':
@@ -3184,25 +3250,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               clearStrBufBeforeUse();
               appendStrBuf(c);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DOCTYPE_NAME, reconsume, pos);
               NS_HTML5_BREAK(beforedoctypenameloop);
             }
           }
         }
-        beforedoctypenameloop_end: ;
+      beforedoctypenameloop_end:;
       }
       case DOCTYPE_NAME: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               strBufToDoctypeName();
               state = P::transition(mViewSource,
                                     nsHtml5Tokenizer::AFTER_DOCTYPE_NAME,
                                     reconsume,
                                     pos);
               NS_HTML5_BREAK(stateloop);
@@ -3234,25 +3300,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               if (c >= 'A' && c <= 'Z') {
                 c += 0x0020;
               }
               appendStrBuf(c);
               continue;
             }
           }
         }
-        doctypenameloop_end: ;
+      doctypenameloop_end:;
       }
       case AFTER_DOCTYPE_NAME: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
             }
             case ' ':
@@ -3283,20 +3349,20 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        afterdoctypenameloop_end: ;
+      afterdoctypenameloop_end:;
       }
       case DOCTYPE_UBLIC: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (index < 5) {
             char16_t folded = c;
             if (c >= 'A' && c <= 'Z') {
               folded += 0x20;
@@ -3315,29 +3381,29 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             state =
               P::transition(mViewSource,
                             nsHtml5Tokenizer::AFTER_DOCTYPE_PUBLIC_KEYWORD,
                             reconsume,
                             pos);
             NS_HTML5_BREAK(doctypeublicloop);
           }
         }
-        doctypeublicloop_end: ;
+      doctypeublicloop_end:;
       }
       case AFTER_DOCTYPE_PUBLIC_KEYWORD: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               state = P::transition(
                 mViewSource,
                 nsHtml5Tokenizer::BEFORE_DOCTYPE_PUBLIC_IDENTIFIER,
                 reconsume,
                 pos);
               NS_HTML5_BREAK(stateloop);
@@ -3392,25 +3458,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        afterdoctypepublickeywordloop_end: ;
+      afterdoctypepublickeywordloop_end:;
       }
       case BEFORE_DOCTYPE_PUBLIC_IDENTIFIER: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
             }
             case ' ':
@@ -3449,25 +3515,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        beforedoctypepublicidentifierloop_end: ;
+      beforedoctypepublicidentifierloop_end:;
       }
       case DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\"': {
               publicIdentifier = strBufToString();
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::AFTER_DOCTYPE_PUBLIC_IDENTIFIER,
                               reconsume,
                               pos);
               NS_HTML5_BREAK(doctypepublicidentifierdoublequotedloop);
@@ -3495,25 +3561,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               c = 0xfffd;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
-        doctypepublicidentifierdoublequotedloop_end: ;
+      doctypepublicidentifierdoublequotedloop_end:;
       }
       case AFTER_DOCTYPE_PUBLIC_IDENTIFIER: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               state = P::transition(
                 mViewSource,
                 nsHtml5Tokenizer::BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS,
                 reconsume,
                 pos);
               NS_HTML5_BREAK(stateloop);
@@ -3564,25 +3630,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        afterdoctypepublicidentifierloop_end: ;
+      afterdoctypepublicidentifierloop_end:;
       }
       case BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
             }
             case ' ':
@@ -3617,25 +3683,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        betweendoctypepublicandsystemidentifiersloop_end: ;
+      betweendoctypepublicandsystemidentifiersloop_end:;
       }
       case DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\"': {
               systemIdentifier = strBufToString();
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::AFTER_DOCTYPE_SYSTEM_IDENTIFIER,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
@@ -3663,25 +3729,24 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               c = 0xfffd;
             }
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
-
       }
       case AFTER_DOCTYPE_SYSTEM_IDENTIFIER: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
             }
             case ' ':
@@ -3698,29 +3763,29 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               bogusDoctypeWithoutQuirks();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_BREAK(afterdoctypesystemidentifierloop);
             }
           }
         }
-        afterdoctypesystemidentifierloop_end: ;
+      afterdoctypesystemidentifierloop_end:;
       }
       case BOGUS_DOCTYPE: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '>': {
               emitDoctypeToken(pos);
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\r': {
               silentCarriageReturn();
@@ -3731,17 +3796,17 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             }
             default: {
               continue;
             }
           }
         }
       }
       case DOCTYPE_YSTEM: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (index < 5) {
             char16_t folded = c;
             if (c >= 'A' && c <= 'Z') {
               folded += 0x20;
@@ -3760,29 +3825,29 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             state =
               P::transition(mViewSource,
                             nsHtml5Tokenizer::AFTER_DOCTYPE_SYSTEM_KEYWORD,
                             reconsume,
                             pos);
             NS_HTML5_BREAK(doctypeystemloop);
           }
         }
-        doctypeystemloop_end: ;
+      doctypeystemloop_end:;
       }
       case AFTER_DOCTYPE_SYSTEM_KEYWORD: {
-        for (; ; ) {
+        for (;;) {
           if (reconsume) {
             reconsume = false;
           } else {
             if (++pos == endPos) {
               NS_HTML5_BREAK(stateloop);
             }
             c = checkChar(buf, pos);
           }
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               state = P::transition(
                 mViewSource,
                 nsHtml5Tokenizer::BEFORE_DOCTYPE_SYSTEM_IDENTIFIER,
                 reconsume,
                 pos);
               NS_HTML5_BREAK(stateloop);
@@ -3837,25 +3902,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        afterdoctypesystemkeywordloop_end: ;
+      afterdoctypesystemkeywordloop_end:;
       }
       case BEFORE_DOCTYPE_SYSTEM_IDENTIFIER: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\r': {
               silentCarriageReturn();
               NS_HTML5_BREAK(stateloop);
             }
             case '\n': {
               silentLineFeed();
             }
             case ' ':
@@ -3894,25 +3959,25 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               bogusDoctype();
               state = P::transition(
                 mViewSource, nsHtml5Tokenizer::BOGUS_DOCTYPE, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
           }
         }
-        beforedoctypesystemidentifierloop_end: ;
+      beforedoctypesystemidentifierloop_end:;
       }
       case DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\'': {
               systemIdentifier = strBufToString();
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::AFTER_DOCTYPE_SYSTEM_IDENTIFIER,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
@@ -3942,22 +4007,22 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
       }
       case DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\'': {
               publicIdentifier = strBufToString();
               state =
                 P::transition(mViewSource,
                               nsHtml5Tokenizer::AFTER_DOCTYPE_PUBLIC_IDENTIFIER,
                               reconsume,
                               pos);
               NS_HTML5_CONTINUE(stateloop);
@@ -3987,163 +4052,164 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
             default: {
               appendStrBuf(c);
               continue;
             }
           }
         }
       }
       case PROCESSING_INSTRUCTION: {
-        for (; ; ) {
+        for (;;) {
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
-          switch(c) {
+          switch (c) {
             case '\?': {
               state = P::transition(
                 mViewSource,
                 nsHtml5Tokenizer::PROCESSING_INSTRUCTION_QUESTION_MARK,
                 reconsume,
                 pos);
               NS_HTML5_BREAK(processinginstructionloop);
             }
             default: {
               continue;
             }
           }
         }
-        processinginstructionloop_end: ;
+      processinginstructionloop_end:;
       }
       case PROCESSING_INSTRUCTION_QUESTION_MARK: {
         if (++pos == endPos) {
           NS_HTML5_BREAK(stateloop);
         }
         c = checkChar(buf, pos);
-        switch(c) {
+        switch (c) {
           case '>': {
             state = P::transition(
               mViewSource, nsHtml5Tokenizer::DATA, reconsume, pos);
             NS_HTML5_CONTINUE(stateloop);
           }
           default: {
             state = P::transition(mViewSource,
                                   nsHtml5Tokenizer::PROCESSING_INSTRUCTION,
                                   reconsume,
                                   pos);
             NS_HTML5_CONTINUE(stateloop);
           }
         }
       }
     }
   }
-  stateloop_end: ;
+stateloop_end:;
   flushChars(buf, pos);
   stateSave = state;
   returnStateSave = returnState;
   return pos;
 }
 
-void 
+void
 nsHtml5Tokenizer::initDoctypeFields()
 {
   clearStrBufAfterUse();
   doctypeName = nsGkAtoms::_empty;
   if (systemIdentifier) {
     systemIdentifier.Release();
     systemIdentifier = nullptr;
   }
   if (publicIdentifier) {
     publicIdentifier.Release();
     publicIdentifier = nullptr;
   }
   forceQuirks = false;
 }
 
-void 
+void
 nsHtml5Tokenizer::emitCarriageReturn(char16_t* buf, int32_t pos)
 {
   silentCarriageReturn();
   flushChars(buf, pos);
   tokenHandler->characters(nsHtml5Tokenizer::LF, 0, 1);
   cstart = INT32_MAX;
 }
 
-void 
+void
 nsHtml5Tokenizer::emitReplacementCharacter(char16_t* buf, int32_t pos)
 {
   flushChars(buf, pos);
   tokenHandler->zeroOriginatingReplacementCharacter();
   cstart = pos + 1;
 }
 
-void 
+void
 nsHtml5Tokenizer::emitPlaintextReplacementCharacter(char16_t* buf, int32_t pos)
 {
   flushChars(buf, pos);
   tokenHandler->characters(REPLACEMENT_CHARACTER, 0, 1);
   cstart = pos + 1;
 }
 
-void 
+void
 nsHtml5Tokenizer::setAdditionalAndRememberAmpersandLocation(char16_t add)
 {
   additional = add;
 }
 
-void 
+void
 nsHtml5Tokenizer::bogusDoctype()
 {
   errBogusDoctype();
   forceQuirks = true;
 }
 
-void 
+void
 nsHtml5Tokenizer::bogusDoctypeWithoutQuirks()
 {
   errBogusDoctype();
   forceQuirks = false;
 }
 
-void 
+void
 nsHtml5Tokenizer::handleNcrValue(int32_t returnState)
 {
   if (value <= 0xFFFF) {
     if (value >= 0x80 && value <= 0x9f) {
       errNcrInC1Range();
       char16_t* val = nsHtml5NamedCharacters::WINDOWS_1252[value - 0x80];
       emitOrAppendOne(val, returnState);
     } else if (value == 0x0) {
       errNcrZero();
       emitOrAppendOne(nsHtml5Tokenizer::REPLACEMENT_CHARACTER, returnState);
     } else if ((value & 0xF800) == 0xD800) {
       errNcrSurrogate();
       emitOrAppendOne(nsHtml5Tokenizer::REPLACEMENT_CHARACTER, returnState);
     } else {
-      char16_t ch = (char16_t) value;
+      char16_t ch = (char16_t)value;
       bmpChar[0] = ch;
       emitOrAppendOne(bmpChar, returnState);
     }
   } else if (value <= 0x10FFFF) {
     astralChar[0] = (char16_t)(nsHtml5Tokenizer::LEAD_OFFSET + (value >> 10));
-    astralChar[1] = (char16_t) (0xDC00 + (value & 0x3FF));
+    astralChar[1] = (char16_t)(0xDC00 + (value & 0x3FF));
     emitOrAppendTwo(astralChar, returnState);
   } else {
     errNcrOutOfRange();
     emitOrAppendOne(nsHtml5Tokenizer::REPLACEMENT_CHARACTER, returnState);
   }
 }
 
-void 
+void
 nsHtml5Tokenizer::eof()
 {
   int32_t state = stateSave;
   int32_t returnState = returnStateSave;
-  eofloop: for (; ; ) {
-    switch(state) {
+eofloop:
+  for (;;) {
+    switch (state) {
       case SCRIPT_DATA_LESS_THAN_SIGN:
       case SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN: {
         tokenHandler->characters(nsHtml5Tokenizer::LT_GT, 0, 1);
         NS_HTML5_BREAK(eofloop);
       }
       case TAG_OPEN: {
         errEofAfterLt();
         tokenHandler->characters(nsHtml5Tokenizer::LT_GT, 0, 1);
@@ -4315,74 +4381,77 @@ nsHtml5Tokenizer::eof()
       }
       case CHARACTER_REFERENCE_HILO_LOOKUP: {
         errNoNamedCharacterMatch();
         emitOrAppendCharRefBuf(returnState);
         state = returnState;
         continue;
       }
       case CHARACTER_REFERENCE_TAIL: {
-        for (; ; ) {
+        for (;;) {
           char16_t c = '\0';
           entCol++;
-          for (; ; ) {
+          for (;;) {
             if (hi == -1) {
               NS_HTML5_BREAK(hiloop);
             }
             if (entCol == nsHtml5NamedCharacters::NAMES[hi].length()) {
               NS_HTML5_BREAK(hiloop);
             }
             if (entCol > nsHtml5NamedCharacters::NAMES[hi].length()) {
               NS_HTML5_BREAK(outer);
             } else if (c < nsHtml5NamedCharacters::NAMES[hi].charAt(entCol)) {
               hi--;
             } else {
               NS_HTML5_BREAK(hiloop);
             }
           }
-          hiloop_end: ;
-          for (; ; ) {
+        hiloop_end:;
+          for (;;) {
             if (hi < lo) {
               NS_HTML5_BREAK(outer);
             }
             if (entCol == nsHtml5NamedCharacters::NAMES[lo].length()) {
               candidate = lo;
               charRefBufMark = charRefBufLen;
               lo++;
             } else if (entCol > nsHtml5NamedCharacters::NAMES[lo].length()) {
               NS_HTML5_BREAK(outer);
             } else if (c > nsHtml5NamedCharacters::NAMES[lo].charAt(entCol)) {
               lo++;
             } else {
               NS_HTML5_BREAK(loloop);
             }
           }
-          loloop_end: ;
+        loloop_end:;
           if (hi < lo) {
             NS_HTML5_BREAK(outer);
           }
           continue;
         }
-        outer_end: ;
+      outer_end:;
         if (candidate == -1) {
           errNoNamedCharacterMatch();
           emitOrAppendCharRefBuf(returnState);
           state = returnState;
           NS_HTML5_CONTINUE(eofloop);
         } else {
-          const nsHtml5CharacterName& candidateName = nsHtml5NamedCharacters::NAMES[candidate];
-          if (!candidateName.length() || candidateName.charAt(candidateName.length() - 1) != ';') {
+          const nsHtml5CharacterName& candidateName =
+            nsHtml5NamedCharacters::NAMES[candidate];
+          if (!candidateName.length() ||
+              candidateName.charAt(candidateName.length() - 1) != ';') {
             if ((returnState & DATA_AND_RCDATA_MASK)) {
               char16_t ch;
               if (charRefBufMark == charRefBufLen) {
                 ch = '\0';
               } else {
                 ch = charRefBuf[charRefBufMark];
               }
-              if ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z') || (ch >= 'a' && ch <= 'z')) {
+              if ((ch >= '0' && ch <= '9') || (ch >= 'A' && ch <= 'Z') ||
+                  (ch >= 'a' && ch <= 'z')) {
                 errNoNamedCharacterMatch();
                 appendCharRefBufToStrBuf();
                 state = returnState;
                 NS_HTML5_CONTINUE(eofloop);
               }
             }
             if ((returnState & DATA_AND_RCDATA_MASK)) {
               errUnescapedAmpersandInterpretedAsCharacterReference();
@@ -4393,19 +4462,21 @@ nsHtml5Tokenizer::eof()
           const char16_t* val = nsHtml5NamedCharacters::VALUES[candidate];
           if (!val[1]) {
             emitOrAppendOne(val, returnState);
           } else {
             emitOrAppendTwo(val, returnState);
           }
           if (charRefBufMark < charRefBufLen) {
             if ((returnState & DATA_AND_RCDATA_MASK)) {
-              appendStrBuf(charRefBuf, charRefBufMark, charRefBufLen - charRefBufMark);
+              appendStrBuf(
+                charRefBuf, charRefBufMark, charRefBufLen - charRefBufMark);
             } else {
-              tokenHandler->characters(charRefBuf, charRefBufMark, charRefBufLen - charRefBufMark);
+              tokenHandler->characters(
+                charRefBuf, charRefBufMark, charRefBufLen - charRefBufMark);
             }
           }
           charRefBufLen = 0;
           state = returnState;
           NS_HTML5_CONTINUE(eofloop);
         }
       }
       case CONSUME_NCR:
@@ -4432,64 +4503,66 @@ nsHtml5Tokenizer::eof()
         NS_HTML5_BREAK(eofloop);
       }
       case DATA:
       default: {
         NS_HTML5_BREAK(eofloop);
       }
     }
   }
-  eofloop_end: ;
+eofloop_end:;
   tokenHandler->eof();
   return;
 }
 
-void 
+void
 nsHtml5Tokenizer::emitDoctypeToken(int32_t pos)
 {
   cstart = pos + 1;
-  tokenHandler->doctype(doctypeName, publicIdentifier, systemIdentifier, forceQuirks);
+  tokenHandler->doctype(
+    doctypeName, publicIdentifier, systemIdentifier, forceQuirks);
   doctypeName = nullptr;
   publicIdentifier.Release();
   publicIdentifier = nullptr;
   systemIdentifier.Release();
   systemIdentifier = nullptr;
 }
 
 bool
 nsHtml5Tokenizer::internalEncodingDeclaration(nsHtml5String internalCharset)
 {
   if (encodingDeclarationHandler) {
-    return encodingDeclarationHandler->internalEncodingDeclaration(internalCharset);
+    return encodingDeclarationHandler->internalEncodingDeclaration(
+      internalCharset);
   }
   return false;
 }
 
-void 
+void
 nsHtml5Tokenizer::emitOrAppendTwo(const char16_t* val, int32_t returnState)
 {
   if ((returnState & DATA_AND_RCDATA_MASK)) {
     appendStrBuf(val[0]);
     appendStrBuf(val[1]);
   } else {
     tokenHandler->characters(val, 0, 2);
   }
 }
 
-void 
+void
 nsHtml5Tokenizer::emitOrAppendOne(const char16_t* val, int32_t returnState)
 {
   if ((returnState & DATA_AND_RCDATA_MASK)) {
     appendStrBuf(val[0]);
   } else {
     tokenHandler->characters(val, 0, 1);
   }
 }
 
-void 
+void
 nsHtml5Tokenizer::end()
 {
   strBuf = nullptr;
   doctypeName = nullptr;
   if (systemIdentifier) {
     systemIdentifier.Release();
     systemIdentifier = nullptr;
   }
@@ -4502,29 +4575,29 @@ nsHtml5Tokenizer::end()
   attributeName = nullptr;
   nonInternedAttributeName->setNameForNonInterned(nullptr);
   tokenHandler->endTokenization();
   if (attributes) {
     attributes->clear(0);
   }
 }
 
-void 
+void
 nsHtml5Tokenizer::requestSuspension()
 {
   shouldSuspend = true;
 }
 
-bool 
+bool
 nsHtml5Tokenizer::isInDataState()
 {
   return (stateSave == DATA);
 }
 
-void 
+void
 nsHtml5Tokenizer::resetToDataState()
 {
   clearStrBufAfterUse();
   charRefBufLen = 0;
   stateSave = nsHtml5Tokenizer::DATA;
   lastCR = false;
   index = 0;
   forceQuirks = false;
@@ -4546,22 +4619,22 @@ nsHtml5Tokenizer::resetToDataState()
   if (newAttributesEachTime) {
     if (attributes) {
       delete attributes;
       attributes = nullptr;
     }
   }
 }
 
-void 
+void
 nsHtml5Tokenizer::loadState(nsHtml5Tokenizer* other)
 {
   strBufLen = other->strBufLen;
   if (strBufLen > strBuf.length) {
-    strBuf = jArray<char16_t,int32_t>::newJArray(strBufLen);
+    strBuf = jArray<char16_t, int32_t>::newJArray(strBufLen);
   }
   nsHtml5ArrayCopy::arraycopy(other->strBuf, strBuf, strBufLen);
   charRefBufLen = other->charRefBufLen;
   nsHtml5ArrayCopy::arraycopy(other->charRefBuf, charRefBuf, charRefBufLen);
   stateSave = other->stateSave;
   returnStateSave = other->returnStateSave;
   endTagExpectation = other->endTagExpectation;
   endTagExpectationAsArray = other->endTagExpectationAsArray;
@@ -4577,29 +4650,32 @@ nsHtml5Tokenizer::loadState(nsHtml5Token
   charRefBufMark = other->charRefBufMark;
   value = other->value;
   seenDigits = other->seenDigits;
   endTag = other->endTag;
   shouldSuspend = false;
   if (!other->doctypeName) {
     doctypeName = nullptr;
   } else {
-    doctypeName = nsHtml5Portability::newLocalFromLocal(other->doctypeName, interner);
+    doctypeName =
+      nsHtml5Portability::newLocalFromLocal(other->doctypeName, interner);
   }
   systemIdentifier.Release();
   if (!other->systemIdentifier) {
     systemIdentifier = nullptr;
   } else {
-    systemIdentifier = nsHtml5Portability::newStringFromString(other->systemIdentifier);
+    systemIdentifier =
+      nsHtml5Portability::newStringFromString(other->systemIdentifier);
   }
   publicIdentifier.Release();
   if (!other->publicIdentifier) {
     publicIdentifier = nullptr;
   } else {
-    publicIdentifier = nsHtml5Portability::newStringFromString(other->publicIdentifier);
+    publicIdentifier =
+      nsHtml5Portability::newStringFromString(other->publicIdentifier);
   }
   containsHyphen = other->containsHyphen;
   if (!other->tagName) {
     tagName = nullptr;
   } else if (other->tagName->isInterned()) {
     tagName = other->tagName;
   } else {
     nonInternedTagName->setNameForNonInterned(
@@ -4621,33 +4697,33 @@ nsHtml5Tokenizer::loadState(nsHtml5Token
   delete attributes;
   if (!other->attributes) {
     attributes = nullptr;
   } else {
     attributes = other->attributes->cloneAttributes(interner);
   }
 }
 
-void 
+void
 nsHtml5Tokenizer::initializeWithoutStarting()
 {
   confident = false;
   strBuf = nullptr;
   line = 1;
   attributeLine = 1;
   resetToDataState();
 }
 
-void 
-nsHtml5Tokenizer::setEncodingDeclarationHandler(nsHtml5StreamParser* encodingDeclarationHandler)
+void
+nsHtml5Tokenizer::setEncodingDeclarationHandler(
+  nsHtml5StreamParser* encodingDeclarationHandler)
 {
   this->encodingDeclarationHandler = encodingDeclarationHandler;
 }
 
-
 nsHtml5Tokenizer::~nsHtml5Tokenizer()
 {
   MOZ_COUNT_DTOR(nsHtml5Tokenizer);
   delete nonInternedTagName;
   delete nonInternedAttributeName;
   nonInternedTagName = nullptr;
   delete attributes;
   attributes = nullptr;
@@ -4658,11 +4734,9 @@ nsHtml5Tokenizer::initializeStatics()
 {
 }
 
 void
 nsHtml5Tokenizer::releaseStatics()
 {
 }
 
-
 #include "nsHtml5TokenizerCppSupplement.h"
-
--- a/parser/html/nsHtml5Tokenizer.h
+++ b/parser/html/nsHtml5Tokenizer.h
@@ -52,415 +52,440 @@ class nsHtml5StreamParser;
 class nsHtml5AttributeName;
 class nsHtml5ElementName;
 class nsHtml5TreeBuilder;
 class nsHtml5MetaScanner;
 class nsHtml5UTF16Buffer;
 class nsHtml5StateSnapshot;
 class nsHtml5Portability;
 
-
 class nsHtml5Tokenizer
 {
-  private:
-    static const int32_t DATA_AND_RCDATA_MASK = ~1;
+private:
+  static const int32_t DATA_AND_RCDATA_MASK = ~1;
+
+public:
+  static const int32_t DATA = 0;
 
-  public:
-    static const int32_t DATA = 0;
+  static const int32_t RCDATA = 1;
 
-    static const int32_t RCDATA = 1;
+  static const int32_t SCRIPT_DATA = 2;
+
+  static const int32_t RAWTEXT = 3;
 
-    static const int32_t SCRIPT_DATA = 2;
+  static const int32_t SCRIPT_DATA_ESCAPED = 4;
 
-    static const int32_t RAWTEXT = 3;
+  static const int32_t ATTRIBUTE_VALUE_DOUBLE_QUOTED = 5;
+
+  static const int32_t ATTRIBUTE_VALUE_SINGLE_QUOTED = 6;
 
-    static const int32_t SCRIPT_DATA_ESCAPED = 4;
+  static const int32_t ATTRIBUTE_VALUE_UNQUOTED = 7;
+
+  static const int32_t PLAINTEXT = 8;
 
-    static const int32_t ATTRIBUTE_VALUE_DOUBLE_QUOTED = 5;
+  static const int32_t TAG_OPEN = 9;
 
-    static const int32_t ATTRIBUTE_VALUE_SINGLE_QUOTED = 6;
+  static const int32_t CLOSE_TAG_OPEN = 10;
 
-    static const int32_t ATTRIBUTE_VALUE_UNQUOTED = 7;
+  static const int32_t TAG_NAME = 11;
 
-    static const int32_t PLAINTEXT = 8;
+  static const int32_t BEFORE_ATTRIBUTE_NAME = 12;
+
+  static const int32_t ATTRIBUTE_NAME = 13;
 
-    static const int32_t TAG_OPEN = 9;
+  static const int32_t AFTER_ATTRIBUTE_NAME = 14;
 
-    static const int32_t CLOSE_TAG_OPEN = 10;
+  static const int32_t BEFORE_ATTRIBUTE_VALUE = 15;
 
-    static const int32_t TAG_NAME = 11;
+  static const int32_t AFTER_ATTRIBUTE_VALUE_QUOTED = 16;
 
-    static const int32_t BEFORE_ATTRIBUTE_NAME = 12;
+  static const int32_t BOGUS_COMMENT = 17;
 
-    static const int32_t ATTRIBUTE_NAME = 13;
+  static const int32_t MARKUP_DECLARATION_OPEN = 18;
+
+  static const int32_t DOCTYPE = 19;
 
-    static const int32_t AFTER_ATTRIBUTE_NAME = 14;
+  static const int32_t BEFORE_DOCTYPE_NAME = 20;
+
+  static const int32_t DOCTYPE_NAME = 21;
 
-    static const int32_t BEFORE_ATTRIBUTE_VALUE = 15;
+  static const int32_t AFTER_DOCTYPE_NAME = 22;
 
-    static const int32_t AFTER_ATTRIBUTE_VALUE_QUOTED = 16;
+  static const int32_t BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 23;
 
-    static const int32_t BOGUS_COMMENT = 17;
+  static const int32_t DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 24;
 
-    static const int32_t MARKUP_DECLARATION_OPEN = 18;
+  static const int32_t DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 25;
+
+  static const int32_t AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 26;
 
-    static const int32_t DOCTYPE = 19;
+  static const int32_t BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 27;
 
-    static const int32_t BEFORE_DOCTYPE_NAME = 20;
+  static const int32_t DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 28;
 
-    static const int32_t DOCTYPE_NAME = 21;
+  static const int32_t DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 29;
 
-    static const int32_t AFTER_DOCTYPE_NAME = 22;
+  static const int32_t AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 30;
 
-    static const int32_t BEFORE_DOCTYPE_PUBLIC_IDENTIFIER = 23;
+  static const int32_t BOGUS_DOCTYPE = 31;
+
+  static const int32_t COMMENT_START = 32;
 
-    static const int32_t DOCTYPE_PUBLIC_IDENTIFIER_DOUBLE_QUOTED = 24;
+  static const int32_t COMMENT_START_DASH = 33;
+
+  static const int32_t COMMENT = 34;
 
-    static const int32_t DOCTYPE_PUBLIC_IDENTIFIER_SINGLE_QUOTED = 25;
+  static const int32_t COMMENT_END_DASH = 35;
 
-    static const int32_t AFTER_DOCTYPE_PUBLIC_IDENTIFIER = 26;
+  static const int32_t COMMENT_END = 36;
 
-    static const int32_t BEFORE_DOCTYPE_SYSTEM_IDENTIFIER = 27;
+  static const int32_t COMMENT_END_BANG = 37;
 
-    static const int32_t DOCTYPE_SYSTEM_IDENTIFIER_DOUBLE_QUOTED = 28;
+  static const int32_t NON_DATA_END_TAG_NAME = 38;
+
+  static const int32_t MARKUP_DECLARATION_HYPHEN = 39;
 
-    static const int32_t DOCTYPE_SYSTEM_IDENTIFIER_SINGLE_QUOTED = 29;
+  static const int32_t MARKUP_DECLARATION_OCTYPE = 40;
 
-    static const int32_t AFTER_DOCTYPE_SYSTEM_IDENTIFIER = 30;
+  static const int32_t DOCTYPE_UBLIC = 41;
 
-    static const int32_t BOGUS_DOCTYPE = 31;
+  static const int32_t DOCTYPE_YSTEM = 42;
 
-    static const int32_t COMMENT_START = 32;
+  static const int32_t AFTER_DOCTYPE_PUBLIC_KEYWORD = 43;
 
-    static const int32_t COMMENT_START_DASH = 33;
+  static const int32_t BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 44;
+
+  static const int32_t AFTER_DOCTYPE_SYSTEM_KEYWORD = 45;
 
-    static const int32_t COMMENT = 34;
+  static const int32_t CONSUME_CHARACTER_REFERENCE = 46;
+
+  static const int32_t CONSUME_NCR = 47;
 
-    static const int32_t COMMENT_END_DASH = 35;
+  static const int32_t CHARACTER_REFERENCE_TAIL = 48;
 
-    static const int32_t COMMENT_END = 36;
+  static const int32_t HEX_NCR_LOOP = 49;
 
-    static const int32_t COMMENT_END_BANG = 37;
+  static const int32_t DECIMAL_NRC_LOOP = 50;
 
-    static const int32_t NON_DATA_END_TAG_NAME = 38;
+  static const int32_t HANDLE_NCR_VALUE = 51;
+
+  static const int32_t HANDLE_NCR_VALUE_RECONSUME = 52;
 
-    static const int32_t MARKUP_DECLARATION_HYPHEN = 39;
+  static const int32_t CHARACTER_REFERENCE_HILO_LOOKUP = 53;
 
-    static const int32_t MARKUP_DECLARATION_OCTYPE = 40;
+  static const int32_t SELF_CLOSING_START_TAG = 54;
+
+  static const int32_t CDATA_START = 55;
 
-    static const int32_t DOCTYPE_UBLIC = 41;
+  static const int32_t CDATA_SECTION = 56;
 
-    static const int32_t DOCTYPE_YSTEM = 42;
+  static const int32_t CDATA_RSQB = 57;
+
+  static const int32_t CDATA_RSQB_RSQB = 58;
 
-    static const int32_t AFTER_DOCTYPE_PUBLIC_KEYWORD = 43;
+  static const int32_t SCRIPT_DATA_LESS_THAN_SIGN = 59;
 
-    static const int32_t BETWEEN_DOCTYPE_PUBLIC_AND_SYSTEM_IDENTIFIERS = 44;
+  static const int32_t SCRIPT_DATA_ESCAPE_START = 60;
 
-    static const int32_t AFTER_DOCTYPE_SYSTEM_KEYWORD = 45;
+  static const int32_t SCRIPT_DATA_ESCAPE_START_DASH = 61;
 
-    static const int32_t CONSUME_CHARACTER_REFERENCE = 46;
+  static const int32_t SCRIPT_DATA_ESCAPED_DASH = 62;
 
-    static const int32_t CONSUME_NCR = 47;
+  static const int32_t SCRIPT_DATA_ESCAPED_DASH_DASH = 63;
+
+  static const int32_t BOGUS_COMMENT_HYPHEN = 64;
 
-    static const int32_t CHARACTER_REFERENCE_TAIL = 48;
+  static const int32_t RAWTEXT_RCDATA_LESS_THAN_SIGN = 65;
 
-    static const int32_t HEX_NCR_LOOP = 49;
+  static const int32_t SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 66;
 
-    static const int32_t DECIMAL_NRC_LOOP = 50;
+  static const int32_t SCRIPT_DATA_DOUBLE_ESCAPE_START = 67;
 
-    static const int32_t HANDLE_NCR_VALUE = 51;
+  static const int32_t SCRIPT_DATA_DOUBLE_ESCAPED = 68;
 
-    static const int32_t HANDLE_NCR_VALUE_RECONSUME = 52;
+  static const int32_t SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 69;
+
+  static const int32_t SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 70;
 
-    static const int32_t CHARACTER_REFERENCE_HILO_LOOKUP = 53;
+  static const int32_t SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 71;
+
+  static const int32_t SCRIPT_DATA_DOUBLE_ESCAPE_END = 72;
 
-    static const int32_t SELF_CLOSING_START_TAG = 54;
+  static const int32_t PROCESSING_INSTRUCTION = 73;
 
-    static const int32_t CDATA_START = 55;
+  static const int32_t PROCESSING_INSTRUCTION_QUESTION_MARK = 74;
 
-    static const int32_t CDATA_SECTION = 56;
-
-    static const int32_t CDATA_RSQB = 57;
-
-    static const int32_t CDATA_RSQB_RSQB = 58;
-
-    static const int32_t SCRIPT_DATA_LESS_THAN_SIGN = 59;
-
-    static const int32_t SCRIPT_DATA_ESCAPE_START = 60;
+private:
+  static const int32_t LEAD_OFFSET = (0xD800 - (0x10000 >> 10));
 
-    static const int32_t SCRIPT_DATA_ESCAPE_START_DASH = 61;
-
-    static const int32_t SCRIPT_DATA_ESCAPED_DASH = 62;
-
-    static const int32_t SCRIPT_DATA_ESCAPED_DASH_DASH = 63;
-
-    static const int32_t BOGUS_COMMENT_HYPHEN = 64;
-
-    static const int32_t RAWTEXT_RCDATA_LESS_THAN_SIGN = 65;
+  static char16_t LT_GT[];
+  static char16_t LT_SOLIDUS[];
+  static char16_t RSQB_RSQB[];
+  static char16_t REPLACEMENT_CHARACTER[];
+  static char16_t LF[];
+  static char16_t CDATA_LSQB[];
+  static char16_t OCTYPE[];
+  static char16_t UBLIC[];
+  static char16_t YSTEM[];
+  static staticJArray<char16_t, int32_t> TITLE_ARR;
+  static staticJArray<char16_t, int32_t> SCRIPT_ARR;
+  static staticJArray<char16_t, int32_t> STYLE_ARR;
+  static staticJArray<char16_t, int32_t> PLAINTEXT_ARR;
+  static staticJArray<char16_t, int32_t> XMP_ARR;
+  static staticJArray<char16_t, int32_t> TEXTAREA_ARR;
+  static staticJArray<char16_t, int32_t> IFRAME_ARR;
+  static staticJArray<char16_t, int32_t> NOEMBED_ARR;
+  static staticJArray<char16_t, int32_t> NOSCRIPT_ARR;
+  static staticJArray<char16_t, int32_t> NOFRAMES_ARR;
 
-    static const int32_t SCRIPT_DATA_ESCAPED_LESS_THAN_SIGN = 66;
-
-    static const int32_t SCRIPT_DATA_DOUBLE_ESCAPE_START = 67;
+protected:
+  nsHtml5TreeBuilder* tokenHandler;
+  nsHtml5StreamParser* encodingDeclarationHandler;
+  bool lastCR;
+  int32_t stateSave;
 
-    static const int32_t SCRIPT_DATA_DOUBLE_ESCAPED = 68;
+private:
+  int32_t returnStateSave;
 
-    static const int32_t SCRIPT_DATA_DOUBLE_ESCAPED_LESS_THAN_SIGN = 69;
-
-    static const int32_t SCRIPT_DATA_DOUBLE_ESCAPED_DASH = 70;
+protected:
+  int32_t index;
 
-    static const int32_t SCRIPT_DATA_DOUBLE_ESCAPED_DASH_DASH = 71;
-
-    static const int32_t SCRIPT_DATA_DOUBLE_ESCAPE_END = 72;
+private:
+  bool forceQuirks;
+  char16_t additional;
+  int32_t entCol;
+  int32_t firstCharKey;
+  int32_t lo;
+  int32_t hi;
+  int32_t candidate;
+  int32_t charRefBufMark;
 
-    static const int32_t PROCESSING_INSTRUCTION = 73;
+protected:
+  int32_t value;
 
-    static const int32_t PROCESSING_INSTRUCTION_QUESTION_MARK = 74;
+private:
+  bool seenDigits;
 
-  private:
-    static const int32_t LEAD_OFFSET = (0xD800 - (0x10000 >> 10));
+protected:
+  int32_t cstart;
 
-    static char16_t LT_GT[];
-    static char16_t LT_SOLIDUS[];
-    static char16_t RSQB_RSQB[];
-    static char16_t REPLACEMENT_CHARACTER[];
-    static char16_t LF[];
-    static char16_t CDATA_LSQB[];
-    static char16_t OCTYPE[];
-    static char16_t UBLIC[];
-    static char16_t YSTEM[];
-    static staticJArray<char16_t,int32_t> TITLE_ARR;
-    static staticJArray<char16_t,int32_t> SCRIPT_ARR;
-    static staticJArray<char16_t,int32_t> STYLE_ARR;
-    static staticJArray<char16_t,int32_t> PLAINTEXT_ARR;
-    static staticJArray<char16_t,int32_t> XMP_ARR;
-    static staticJArray<char16_t,int32_t> TEXTAREA_ARR;
-    static staticJArray<char16_t,int32_t> IFRAME_ARR;
-    static staticJArray<char16_t,int32_t> NOEMBED_ARR;
-    static staticJArray<char16_t,int32_t> NOSCRIPT_ARR;
-    static staticJArray<char16_t,int32_t> NOFRAMES_ARR;
-  protected:
-    nsHtml5TreeBuilder* tokenHandler;
-    nsHtml5StreamParser* encodingDeclarationHandler;
-    bool lastCR;
-    int32_t stateSave;
-  private:
-    int32_t returnStateSave;
-  protected:
-    int32_t index;
-  private:
-    bool forceQuirks;
-    char16_t additional;
-    int32_t entCol;
-    int32_t firstCharKey;
-    int32_t lo;
-    int32_t hi;
-    int32_t candidate;
-    int32_t charRefBufMark;
-  protected:
-    int32_t value;
-  private:
-    bool seenDigits;
-  protected:
-    int32_t cstart;
-  private:
-    nsHtml5String publicId;
-    nsHtml5String systemId;
-    autoJArray<char16_t,int32_t> strBuf;
-    int32_t strBufLen;
-    autoJArray<char16_t,int32_t> charRefBuf;
-    int32_t charRefBufLen;
-    autoJArray<char16_t,int32_t> bmpChar;
-    autoJArray<char16_t,int32_t> astralChar;
-  protected:
-    nsHtml5ElementName* endTagExpectation;
-  private:
-    jArray<char16_t,int32_t> endTagExpectationAsArray;
-  protected:
-    bool endTag;
-  private:
-    bool containsHyphen;
-    nsHtml5ElementName* tagName;
-    nsHtml5ElementName* nonInternedTagName;
-  protected:
-    nsHtml5AttributeName* attributeName;
-  private:
-    nsHtml5AttributeName* nonInternedAttributeName;
-    nsAtom* doctypeName;
-    nsHtml5String publicIdentifier;
-    nsHtml5String systemIdentifier;
-    nsHtml5HtmlAttributes* attributes;
-    bool newAttributesEachTime;
-    bool shouldSuspend;
-  protected:
-    bool confident;
-  private:
-    int32_t line;
-    int32_t attributeLine;
-    nsHtml5AtomTable* interner;
-    bool viewingXmlSource;
-  public:
-    nsHtml5Tokenizer(nsHtml5TreeBuilder* tokenHandler, bool viewingXmlSource);
-    void setInterner(nsHtml5AtomTable* interner);
-    void initLocation(nsHtml5String newPublicId, nsHtml5String newSystemId);
-    bool isViewingXmlSource();
-    void setStateAndEndTagExpectation(int32_t specialTokenizerState, nsAtom* endTagExpectation);
-    void setStateAndEndTagExpectation(int32_t specialTokenizerState, nsHtml5ElementName* endTagExpectation);
-  private:
-    void endTagExpectationToArray();
-  public:
-    void setLineNumber(int32_t line);
-    inline int32_t getLineNumber()
-    {
-      return line;
-    }
+private:
+  nsHtml5String publicId;
+  nsHtml5String systemId;
+  autoJArray<char16_t, int32_t> strBuf;
+  int32_t strBufLen;
+  autoJArray<char16_t, int32_t> charRefBuf;
+  int32_t charRefBufLen;
+  autoJArray<char16_t, int32_t> bmpChar;
+  autoJArray<char16_t, int32_t> astralChar;
+
+protected:
+  nsHtml5ElementName* endTagExpectation;
+
+private:
+  jArray<char16_t, int32_t> endTagExpectationAsArray;
+
+protected:
+  bool endTag;
+
+private:
+  bool containsHyphen;
+  nsHtml5ElementName* tagName;
+  nsHtml5ElementName* nonInternedTagName;
+
+protected:
+  nsHtml5AttributeName* attributeName;
+
+private:
+  nsHtml5AttributeName* nonInternedAttributeName;
+  nsAtom* doctypeName;
+  nsHtml5String publicIdentifier;
+  nsHtml5String systemIdentifier;
+  nsHtml5HtmlAttributes* attributes;
+  bool newAttributesEachTime;
+  bool shouldSuspend;
+
+protected:
+  bool confident;
+
+private:
+  int32_t line;
+  int32_t attributeLine;
+  nsHtml5AtomTable* interner;
+  bool viewingXmlSource;
 
-    nsHtml5HtmlAttributes* emptyAttributes();
-  private:
-    inline void appendCharRefBuf(char16_t c)
-    {
-      MOZ_RELEASE_ASSERT(charRefBufLen < charRefBuf.length, "Attempted to overrun charRefBuf!");
-      charRefBuf[charRefBufLen++] = c;
-    }
+public:
+  nsHtml5Tokenizer(nsHtml5TreeBuilder* tokenHandler, bool viewingXmlSource);
+  void setInterner(nsHtml5AtomTable* interner);
+  void initLocation(nsHtml5String newPublicId, nsHtml5String newSystemId);
+  bool isViewingXmlSource();
+  void setStateAndEndTagExpectation(int32_t specialTokenizerState,
+                                    nsAtom* endTagExpectation);
+  void setStateAndEndTagExpectation(int32_t specialTokenizerState,
+                                    nsHtml5ElementName* endTagExpectation);
+
+private:
+  void endTagExpectationToArray();
+
+public:
+  void setLineNumber(int32_t line);
+  inline int32_t getLineNumber() { return line; }
+
+  nsHtml5HtmlAttributes* emptyAttributes();
 
-    void emitOrAppendCharRefBuf(int32_t returnState);
-    inline void clearStrBufAfterUse()
-    {
-      strBufLen = 0;
-    }
+private:
+  inline void appendCharRefBuf(char16_t c)
+  {
+    MOZ_RELEASE_ASSERT(charRefBufLen < charRefBuf.length,
+                       "Attempted to overrun charRefBuf!");
+    charRefBuf[charRefBufLen++] = c;
+  }
+
+  void emitOrAppendCharRefBuf(int32_t returnState);
+  inline void clearStrBufAfterUse() { strBufLen = 0; }
 
-    inline void clearStrBufBeforeUse()
-    {
-      MOZ_ASSERT(!strBufLen, "strBufLen not reset after previous use!");
-      strBufLen = 0;
-    }
+  inline void clearStrBufBeforeUse()
+  {
+    MOZ_ASSERT(!strBufLen, "strBufLen not reset after previous use!");
+    strBufLen = 0;
+  }
 
-    inline void clearStrBufAfterOneHyphen()
-    {
-      MOZ_ASSERT(strBufLen == 1, "strBufLen length not one!");
-      MOZ_ASSERT(strBuf[0] == '-', "strBuf does not start with a hyphen!");
-      strBufLen = 0;
+  inline void clearStrBufAfterOneHyphen()
+  {
+    MOZ_ASSERT(strBufLen == 1, "strBufLen length not one!");
+    MOZ_ASSERT(strBuf[0] == '-', "strBuf does not start with a hyphen!");
+    strBufLen = 0;
+  }
+
+  inline void appendStrBuf(char16_t c)
+  {
+    MOZ_ASSERT(strBufLen < strBuf.length,
+               "Previous buffer length insufficient.");
+    if (MOZ_UNLIKELY(strBufLen == strBuf.length)) {
+      if (MOZ_UNLIKELY(!EnsureBufferSpace(1))) {
+        MOZ_CRASH("Unable to recover from buffer reallocation failure");
+      }
     }
+    strBuf[strBufLen++] = c;
+  }
 
-    inline void appendStrBuf(char16_t c)
-    {
-      MOZ_ASSERT(strBufLen < strBuf.length, "Previous buffer length insufficient.");
-      if (MOZ_UNLIKELY(strBufLen == strBuf.length)) {
-        if (MOZ_UNLIKELY(!EnsureBufferSpace(1))) {
-          MOZ_CRASH("Unable to recover from buffer reallocation failure");
-        }
-      }
-      strBuf[strBufLen++] = c;
-    }
+protected:
+  nsHtml5String strBufToString();
+
+private:
+  void strBufToDoctypeName();
+  void emitStrBuf();
+  inline void appendSecondHyphenToBogusComment() { appendStrBuf('-'); }
 
-  protected:
-    nsHtml5String strBufToString();
-  private:
-    void strBufToDoctypeName();
-    void emitStrBuf();
-    inline void appendSecondHyphenToBogusComment()
-    {
-      appendStrBuf('-');
-    }
+  inline void adjustDoubleHyphenAndAppendToStrBufAndErr(char16_t c)
+  {
+    errConsecutiveHyphens();
+    appendStrBuf(c);
+  }
 
-    inline void adjustDoubleHyphenAndAppendToStrBufAndErr(char16_t c)
-    {
-      errConsecutiveHyphens();
-      appendStrBuf(c);
-    }
+  void appendStrBuf(char16_t* buffer, int32_t offset, int32_t length);
+  inline void appendCharRefBufToStrBuf()
+  {
+    appendStrBuf(charRefBuf, 0, charRefBufLen);
+    charRefBufLen = 0;
+  }
+
+  void emitComment(int32_t provisionalHyphens, int32_t pos);
 
-    void appendStrBuf(char16_t* buffer, int32_t offset, int32_t length);
-    inline void appendCharRefBufToStrBuf()
-    {
-      appendStrBuf(charRefBuf, 0, charRefBufLen);
-      charRefBufLen = 0;
-    }
+protected:
+  void flushChars(char16_t* buf, int32_t pos);
+
+private:
+  void strBufToElementNameString();
+  int32_t emitCurrentTagToken(bool selfClosing, int32_t pos);
+  void attributeNameComplete();
+  void addAttributeWithoutValue();
+  void addAttributeWithValue();
+
+public:
+  void start();
+  bool tokenizeBuffer(nsHtml5UTF16Buffer* buffer);
 
-    void emitComment(int32_t provisionalHyphens, int32_t pos);
-  protected:
-    void flushChars(char16_t* buf, int32_t pos);
-  private:
-    void strBufToElementNameString();
-    int32_t emitCurrentTagToken(bool selfClosing, int32_t pos);
-    void attributeNameComplete();
-    void addAttributeWithoutValue();
-    void addAttributeWithValue();
-  public:
-    void start();
-    bool tokenizeBuffer(nsHtml5UTF16Buffer* buffer);
-  private:
-    template<class P> int32_t stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* buf, bool reconsume, int32_t returnState, int32_t endPos);
-    void initDoctypeFields();
-    inline void adjustDoubleHyphenAndAppendToStrBufCarriageReturn()
-    {
-      silentCarriageReturn();
-      adjustDoubleHyphenAndAppendToStrBufAndErr('\n');
-    }
+private:
+  template<class P>
+  int32_t stateLoop(int32_t state,
+                    char16_t c,
+                    int32_t pos,
+                    char16_t* buf,
+                    bool reconsume,
+                    int32_t returnState,
+                    int32_t endPos);
+  void initDoctypeFields();
+  inline void adjustDoubleHyphenAndAppendToStrBufCarriageReturn()
+  {
+    silentCarriageReturn();
+    adjustDoubleHyphenAndAppendToStrBufAndErr('\n');
+  }
 
-    inline void adjustDoubleHyphenAndAppendToStrBufLineFeed()
-    {
-      silentLineFeed();
-      adjustDoubleHyphenAndAppendToStrBufAndErr('\n');
-    }
+  inline void adjustDoubleHyphenAndAppendToStrBufLineFeed()
+  {
+    silentLineFeed();
+    adjustDoubleHyphenAndAppendToStrBufAndErr('\n');
+  }
 
-    inline void appendStrBufLineFeed()
-    {
-      silentLineFeed();
-      appendStrBuf('\n');
-    }
+  inline void appendStrBufLineFeed()
+  {
+    silentLineFeed();
+    appendStrBuf('\n');
+  }
 
-    inline void appendStrBufCarriageReturn()
-    {
-      silentCarriageReturn();
-      appendStrBuf('\n');
-    }
+  inline void appendStrBufCarriageReturn()
+  {
+    silentCarriageReturn();
+    appendStrBuf('\n');
+  }
 
-  protected:
-    inline void silentCarriageReturn()
-    {
-      ++line;
-      lastCR = true;
-    }
+protected:
+  inline void silentCarriageReturn()
+  {
+    ++line;
+    lastCR = true;
+  }
 
-    inline void silentLineFeed()
-    {
-      ++line;
-    }
+  inline void silentLineFeed() { ++line; }
 
-  private:
-    void emitCarriageReturn(char16_t* buf, int32_t pos);
-    void emitReplacementCharacter(char16_t* buf, int32_t pos);
-    void emitPlaintextReplacementCharacter(char16_t* buf, int32_t pos);
-    void setAdditionalAndRememberAmpersandLocation(char16_t add);
-    void bogusDoctype();
-    void bogusDoctypeWithoutQuirks();
-    void handleNcrValue(int32_t returnState);
-  public:
-    void eof();
-  private:
-    void emitDoctypeToken(int32_t pos);
-  protected:
-    inline char16_t checkChar(char16_t* buf, int32_t pos)
-    {
-      return buf[pos];
-    }
+private:
+  void emitCarriageReturn(char16_t* buf, int32_t pos);
+  void emitReplacementCharacter(char16_t* buf, int32_t pos);
+  void emitPlaintextReplacementCharacter(char16_t* buf, int32_t pos);
+  void setAdditionalAndRememberAmpersandLocation(char16_t add);
+  void bogusDoctype();
+  void bogusDoctypeWithoutQuirks();
+  void handleNcrValue(int32_t returnState);
+
+public:
+  void eof();
+
+private:
+  void emitDoctypeToken(int32_t pos);
+
+protected:
+  inline char16_t checkChar(char16_t* buf, int32_t pos) { return buf[pos]; }
 
-  public:
-    bool internalEncodingDeclaration(nsHtml5String internalCharset);
-  private:
-    void emitOrAppendTwo(const char16_t* val, int32_t returnState);
-    void emitOrAppendOne(const char16_t* val, int32_t returnState);
-  public:
-    void end();
-    void requestSuspension();
-    bool isInDataState();
-    void resetToDataState();
-    void loadState(nsHtml5Tokenizer* other);
-    void initializeWithoutStarting();
-    void setEncodingDeclarationHandler(nsHtml5StreamParser* encodingDeclarationHandler);
-    ~nsHtml5Tokenizer();
-    static void initializeStatics();
-    static void releaseStatics();
+public:
+  bool internalEncodingDeclaration(nsHtml5String internalCharset);
+
+private:
+  void emitOrAppendTwo(const char16_t* val, int32_t returnState);
+  void emitOrAppendOne(const char16_t* val, int32_t returnState);
+
+public:
+  void end();
+  void requestSuspension();
+  bool isInDataState();
+  void resetToDataState();
+  void loadState(nsHtml5Tokenizer* other);
+  void initializeWithoutStarting();
+  void setEncodingDeclarationHandler(
+    nsHtml5StreamParser* encodingDeclarationHandler);
+  ~nsHtml5Tokenizer();
+  static void initializeStatics();
+  static void releaseStatics();
 
 #include "nsHtml5TokenizerHSupplement.h"
 };
 
 #endif
-
--- a/parser/html/nsHtml5TreeBuilder.cpp
+++ b/parser/html/nsHtml5TreeBuilder.cpp
@@ -63,26 +63,87 @@
 #include "nsHtml5StackNode.h"
 #include "nsHtml5UTF16Buffer.h"
 #include "nsHtml5StateSnapshot.h"
 #include "nsHtml5Portability.h"
 
 #include "nsHtml5TreeBuilder.h"
 
 char16_t nsHtml5TreeBuilder::REPLACEMENT_CHARACTER[] = { 0xfffd };
-static const char* const QUIRKY_PUBLIC_IDS_DATA[] = { "+//silmaril//dtd html pro v0r11 19970101//", "-//advasoft ltd//dtd html 3.0 aswedit + extensions//", "-//as//dtd html 3.0 aswedit + extensions//", "-//ietf//dtd html 2.0 level 1//", "-//ietf//dtd html 2.0 level 2//", "-//ietf//dtd html 2.0 strict level 1//", "-//ietf//dtd html 2.0 strict level 2//", "-//ietf//dtd html 2.0 strict//", "-//ietf//dtd html 2.0//", "-//ietf//dtd html 2.1e//", "-//ietf//dtd html 3.0//", "-//ietf//dtd html 3.2 final//", "-//ietf//dtd html 3.2//", "-//ietf//dtd html 3//", "-//ietf//dtd html level 0//", "-//ietf//dtd html level 1//", "-//ietf//dtd html level 2//", "-//ietf//dtd html level 3//", "-//ietf//dtd html strict level 0//", "-//ietf//dtd html strict level 1//", "-//ietf//dtd html strict level 2//", "-//ietf//dtd html strict level 3//", "-//ietf//dtd html strict//", "-//ietf//dtd html//", "-//metrius//dtd metrius presentational//", "-//microsoft//dtd internet explorer 2.0 html strict//", "-//microsoft//dtd internet explorer 2.0 html//", "-//microsoft//dtd internet explorer 2.0 tables//", "-//microsoft//dtd internet explorer 3.0 html strict//", "-//microsoft//dtd internet explorer 3.0 html//", "-//microsoft//dtd internet explorer 3.0 tables//", "-//netscape comm. corp.//dtd html//", "-//netscape comm. corp.//dtd strict html//", "-//o'reilly and associates//dtd html 2.0//", "-//o'reilly and associates//dtd html extended 1.0//", "-//o'reilly and associates//dtd html extended relaxed 1.0//", "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html 4.0//", "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//", "-//spyglass//dtd html 2.0 extended//", "-//sq//dtd html 2.0 hotmetal + extensions//", "-//sun microsystems corp.//dtd hotjava html//", "-//sun microsystems corp.//dtd hotjava strict html//", "-//w3c//dtd html 3 1995-03-24//", "-//w3c//dtd html 3.2 draft//", "-//w3c//dtd html 3.2 final//", "-//w3c//dtd html 3.2//", "-//w3c//dtd html 3.2s draft//", "-//w3c//dtd html 4.0 frameset//", "-//w3c//dtd html 4.0 transitional//", "-//w3c//dtd html experimental 19960712//", "-//w3c//dtd html experimental 970421//", "-//w3c//dtd w3 html//", "-//w3o//dtd w3 html 3.0//", "-//webtechs//dtd mozilla html 2.0//", "-//webtechs//dtd mozilla html//" };
-staticJArray<const char*,int32_t> nsHtml5TreeBuilder::QUIRKY_PUBLIC_IDS = { QUIRKY_PUBLIC_IDS_DATA, MOZ_ARRAY_LENGTH(QUIRKY_PUBLIC_IDS_DATA) };
-void 
+static const char* const QUIRKY_PUBLIC_IDS_DATA[] = {
+  "+//silmaril//dtd html pro v0r11 19970101//",
+  "-//advasoft ltd//dtd html 3.0 aswedit + extensions//",
+  "-//as//dtd html 3.0 aswedit + extensions//",
+  "-//ietf//dtd html 2.0 level 1//",
+  "-//ietf//dtd html 2.0 level 2//",
+  "-//ietf//dtd html 2.0 strict level 1//",
+  "-//ietf//dtd html 2.0 strict level 2//",
+  "-//ietf//dtd html 2.0 strict//",
+  "-//ietf//dtd html 2.0//",
+  "-//ietf//dtd html 2.1e//",
+  "-//ietf//dtd html 3.0//",
+  "-//ietf//dtd html 3.2 final//",
+  "-//ietf//dtd html 3.2//",
+  "-//ietf//dtd html 3//",
+  "-//ietf//dtd html level 0//",
+  "-//ietf//dtd html level 1//",
+  "-//ietf//dtd html level 2//",
+  "-//ietf//dtd html level 3//",
+  "-//ietf//dtd html strict level 0//",
+  "-//ietf//dtd html strict level 1//",
+  "-//ietf//dtd html strict level 2//",
+  "-//ietf//dtd html strict level 3//",
+  "-//ietf//dtd html strict//",
+  "-//ietf//dtd html//",
+  "-//metrius//dtd metrius presentational//",
+  "-//microsoft//dtd internet explorer 2.0 html strict//",
+  "-//microsoft//dtd internet explorer 2.0 html//",
+  "-//microsoft//dtd internet explorer 2.0 tables//",
+  "-//microsoft//dtd internet explorer 3.0 html strict//",
+  "-//microsoft//dtd internet explorer 3.0 html//",
+  "-//microsoft//dtd internet explorer 3.0 tables//",
+  "-//netscape comm. corp.//dtd html//",
+  "-//netscape comm. corp.//dtd strict html//",
+  "-//o'reilly and associates//dtd html 2.0//",
+  "-//o'reilly and associates//dtd html extended 1.0//",
+  "-//o'reilly and associates//dtd html extended relaxed 1.0//",
+  "-//softquad software//dtd hotmetal pro 6.0::19990601::extensions to html "
+  "4.0//",
+  "-//softquad//dtd hotmetal pro 4.0::19971010::extensions to html 4.0//",
+  "-//spyglass//dtd html 2.0 extended//",
+  "-//sq//dtd html 2.0 hotmetal + extensions//",
+  "-//sun microsystems corp.//dtd hotjava html//",
+  "-//sun microsystems corp.//dtd hotjava strict html//",
+  "-//w3c//dtd html 3 1995-03-24//",
+  "-//w3c//dtd html 3.2 draft//",
+  "-//w3c//dtd html 3.2 final//",
+  "-//w3c//dtd html 3.2//",
+  "-//w3c//dtd html 3.2s draft//",
+  "-//w3c//dtd html 4.0 frameset//",
+  "-//w3c//dtd html 4.0 transitional//",
+  "-//w3c//dtd html experimental 19960712//",
+  "-//w3c//dtd html experimental 970421//",
+  "-//w3c//dtd w3 html//",
+  "-//w3o//dtd w3 html 3.0//",
+  "-//webtechs//dtd mozilla html 2.0//",
+  "-//webtechs//dtd mozilla html//"
+};
+staticJArray<const char*, int32_t> nsHtml5TreeBuilder::QUIRKY_PUBLIC_IDS = {
+  QUIRKY_PUBLIC_IDS_DATA,
+  MOZ_ARRAY_LENGTH(QUIRKY_PUBLIC_IDS_DATA)
+};
+void
 nsHtml5TreeBuilder::startTokenization(nsHtml5Tokenizer* self)
 {
   tokenizer = self;
   stackNodes = jArray<nsHtml5StackNode*, int32_t>::newJArray(64);
-  stack = jArray<nsHtml5StackNode*,int32_t>::newJArray(64);
-  templateModeStack = jArray<int32_t,int32_t>::newJArray(64);
-  listOfActiveFormattingElements = jArray<nsHtml5StackNode*,int32_t>::newJArray(64);
+  stack = jArray<nsHtml5StackNode*, int32_t>::newJArray(64);
+  templateModeStack = jArray<int32_t, int32_t>::newJArray(64);
+  listOfActiveFormattingElements =
+    jArray<nsHtml5StackNode*, int32_t>::newJArray(64);
   needToDropLF = false;
   originalMode = INITIAL;
   templateModePtr = -1;
   stackNodesIdx = 0;
   numStackNodes = 0;
   currentPtr = -1;
   listPtr = -1;
   formPointer = nullptr;
@@ -189,36 +250,39 @@ nsHtml5TreeBuilder::doctype(nsAtom* name
   if (!isInForeign() && mode == INITIAL) {
     nsHtml5String emptyString = nsHtml5Portability::newEmptyString();
     appendDoctypeToDocument(!name ? nsGkAtoms::_empty : name,
                             !publicIdentifier ? emptyString : publicIdentifier,
                             !systemIdentifier ? emptyString : systemIdentifier);
     emptyString.Release();
     if (isQuirky(name, publicIdentifier, systemIdentifier, forceQuirks)) {
       errQuirkyDoctype();
-      documentModeInternal(QUIRKS_MODE, publicIdentifier, systemIdentifier, false);
+      documentModeInternal(
+        QUIRKS_MODE, publicIdentifier, systemIdentifier, false);
     } else if (isAlmostStandards(publicIdentifier, systemIdentifier)) {
       errAlmostStandardsDoctype();
-      documentModeInternal(ALMOST_STANDARDS_MODE, publicIdentifier, systemIdentifier, false);
+      documentModeInternal(
+        ALMOST_STANDARDS_MODE, publicIdentifier, systemIdentifier, false);
     } else {
-      documentModeInternal(STANDARDS_MODE, publicIdentifier, systemIdentifier, false);
+      documentModeInternal(
+        STANDARDS_MODE, publicIdentifier, systemIdentifier, false);
     }
     mode = BEFORE_HTML;
     return;
   }
   errStrayDoctype();
   return;
 }
 
-void 
+void
 nsHtml5TreeBuilder::comment(char16_t* buf, int32_t start, int32_t length)
 {
   needToDropLF = false;
   if (!isInForeign()) {
-    switch(mode) {
+    switch (mode) {
       case INITIAL:
       case BEFORE_HTML:
       case AFTER_AFTER_BODY:
       case AFTER_AFTER_FRAMESET: {
         appendCommentToDocument(buf, start, length);
         return;
       }
       case AFTER_BODY: {
@@ -231,33 +295,35 @@ nsHtml5TreeBuilder::comment(char16_t* bu
       }
     }
   }
   flushCharacters();
   appendComment(stack[currentPtr]->node, buf, start, length);
   return;
 }
 
-void 
-nsHtml5TreeBuilder::characters(const char16_t* buf, int32_t start, int32_t length)
+void
+nsHtml5TreeBuilder::characters(const char16_t* buf,
+                               int32_t start,
+                               int32_t length)
 {
   if (tokenizer->isViewingXmlSource()) {
     return;
   }
   if (needToDropLF) {
     needToDropLF = false;
     if (buf[start] == '\n') {
       start++;
       length--;
       if (!length) {
         return;
       }
     }
   }
-  switch(mode) {
+  switch (mode) {
     case IN_BODY:
     case IN_CELL:
     case IN_CAPTION: {
       if (!isInForeignButNotHtmlOrMathTextIntegrationPoint()) {
         reconstructTheActiveFormattingElements();
       }
     }
     case TEXT: {
@@ -268,23 +334,23 @@ nsHtml5TreeBuilder::characters(const cha
     case IN_TABLE_BODY:
     case IN_ROW: {
       accumulateCharactersForced(buf, start, length);
       return;
     }
     default: {
       int32_t end = start + length;
       for (int32_t i = start; i < end; i++) {
-        switch(buf[i]) {
+        switch (buf[i]) {
           case ' ':
           case '\t':
           case '\n':
           case '\r':
           case '\f': {
-            switch(mode) {
+            switch (mode) {
               case INITIAL:
               case BEFORE_HTML:
               case BEFORE_HEAD: {
                 start = i + 1;
                 continue;
               }
               case IN_HEAD:
               case IN_HEAD_NOSCRIPT:
@@ -329,17 +395,17 @@ nsHtml5TreeBuilder::characters(const cha
                 }
                 flushCharacters();
                 reconstructTheActiveFormattingElements();
                 continue;
               }
             }
           }
           default: {
-            switch(mode) {
+            switch (mode) {
               case INITIAL: {
                 documentModeInternal(QUIRKS_MODE, nullptr, nullptr, false);
                 mode = BEFORE_HTML;
                 i--;
                 continue;
               }
               case BEFORE_HTML: {
                 appendHtmlElementToDocumentAndPush();
@@ -348,17 +414,18 @@ nsHtml5TreeBuilder::characters(const cha
                 continue;
               }
               case BEFORE_HEAD: {
                 if (start < i) {
                   accumulateCharacters(buf, start, i - start);
                   start = i;
                 }
                 flushCharacters();
-                appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
+                appendToCurrentNodeAndPushHeadElement(
+                  nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
                 mode = IN_HEAD;
                 i--;
                 continue;
               }
               case IN_HEAD: {
                 if (start < i) {
                   accumulateCharacters(buf, start, i - start);
                   start = i;
@@ -476,57 +543,58 @@ nsHtml5TreeBuilder::characters(const cha
                 errNonSpaceInTrailer();
                 start = i + 1;
                 continue;
               }
             }
           }
         }
       }
-      charactersloop_end: ;
+    charactersloop_end:;
       if (start < end) {
         accumulateCharacters(buf, start, end - start);
       }
     }
   }
 }
 
-void 
+void
 nsHtml5TreeBuilder::zeroOriginatingReplacementCharacter()
 {
   if (mode == TEXT) {
     accumulateCharacters(REPLACEMENT_CHARACTER, 0, 1);
     return;
   }
   if (currentPtr >= 0) {
     if (isSpecialParentInForeign(stack[currentPtr])) {
       return;
     }
     accumulateCharacters(REPLACEMENT_CHARACTER, 0, 1);
   }
 }
 
-void 
+void
 nsHtml5TreeBuilder::eof()
 {
   flushCharacters();
-  for (; ; ) {
-    switch(mode) {
+  for (;;) {
+    switch (mode) {
       case INITIAL: {
         documentModeInternal(QUIRKS_MODE, nullptr, nullptr, false);
         mode = BEFORE_HTML;
         continue;
       }
       case BEFORE_HTML: {
         appendHtmlElementToDocumentAndPush();
         mode = BEFORE_HEAD;
         continue;
       }
       case BEFORE_HEAD: {
-        appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
+        appendToCurrentNodeAndPushHeadElement(
+          nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
         mode = IN_HEAD;
         continue;
       }
       case IN_HEAD: {
         while (currentPtr > 0) {
           popOnEof();
         }
         mode = AFTER_HEAD;
@@ -590,26 +658,26 @@ nsHtml5TreeBuilder::eof()
       case AFTER_FRAMESET:
       case AFTER_AFTER_BODY:
       case AFTER_AFTER_FRAMESET:
       default: {
         NS_HTML5_BREAK(eofloop);
       }
     }
   }
-  eofloop_end: ;
+eofloop_end:;
   while (currentPtr > 0) {
     popOnEof();
   }
   if (!fragment) {
     popOnEof();
   }
 }
 
-void 
+void
 nsHtml5TreeBuilder::endTokenization()
 {
   formPointer = nullptr;
   headPointer = nullptr;
   deepTreeSurrogateParent = nullptr;
   templateModeStack = nullptr;
   if (stack) {
     while (currentPtr > -1) {
@@ -635,34 +703,37 @@ nsHtml5TreeBuilder::endTokenization()
     numStackNodes = 0;
     stackNodesIdx = 0;
     stackNodes = nullptr;
   }
   charBuffer = nullptr;
   end();
 }
 
-void 
-nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes, bool selfClosing)
+void
+nsHtml5TreeBuilder::startTag(nsHtml5ElementName* elementName,
+                             nsHtml5HtmlAttributes* attributes,
+                             bool selfClosing)
 {
   flushCharacters();
   int32_t eltPos;
   needToDropLF = false;
-  starttagloop: for (; ; ) {
+starttagloop:
+  for (;;) {
     int32_t group = elementName->getGroup();
     nsAtom* name = elementName->getName();
     if (isInForeign()) {
       nsHtml5StackNode* currentNode = stack[currentPtr];
       int32_t currNs = currentNode->ns;
       if (!(currentNode->isHtmlIntegrationPoint() ||
             (currNs == kNameSpaceID_MathML &&
              ((currentNode->getGroup() == MI_MO_MN_MS_MTEXT &&
                group != MGLYPH_OR_MALIGNMARK) ||
               (currentNode->getGroup() == ANNOTATION_XML && group == SVG))))) {
-        switch(group) {
+        switch (group) {
           case B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U:
           case DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
           case BODY:
           case BR:
           case RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR:
           case DD_OR_DT:
           case UL_OR_OL_OR_DL:
           case EMBED:
@@ -692,38 +763,41 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
           }
           default: {
             if (kNameSpaceID_SVG == currNs) {
               attributes->adjustForSvg();
               if (selfClosing) {
                 appendVoidElementToCurrentMayFosterSVG(elementName, attributes);
                 selfClosing = false;
               } else {
-                appendToCurrentNodeAndPushElementMayFosterSVG(elementName, attributes);
+                appendToCurrentNodeAndPushElementMayFosterSVG(elementName,
+                                                              attributes);
               }
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             } else {
               attributes->adjustForMath();
               if (selfClosing) {
-                appendVoidElementToCurrentMayFosterMathML(elementName, attributes);
+                appendVoidElementToCurrentMayFosterMathML(elementName,
+                                                          attributes);
                 selfClosing = false;
               } else {
-                appendToCurrentNodeAndPushElementMayFosterMathML(elementName, attributes);
+                appendToCurrentNodeAndPushElementMayFosterMathML(elementName,
+                                                                 attributes);
               }
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
           }
         }
       }
     }
-    switch(mode) {
+    switch (mode) {
       case IN_TEMPLATE: {
-        switch(group) {
+        switch (group) {
           case COL: {
             popTemplateMode();
             pushTemplateMode(IN_COLUMN_GROUP);
             mode = IN_COLUMN_GROUP;
             continue;
           }
           case CAPTION:
           case COLGROUP:
@@ -784,17 +858,17 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
             popTemplateMode();
             pushTemplateMode(IN_BODY);
             mode = IN_BODY;
             continue;
           }
         }
       }
       case IN_ROW: {
-        switch(group) {
+        switch (group) {
           case TD_OR_TH: {
             clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TR));
             appendToCurrentNodeAndPushElement(elementName, attributes);
             mode = IN_CELL;
             insertMarker();
             attributes = nullptr;
             NS_HTML5_BREAK(starttagloop);
           }
@@ -809,33 +883,36 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
               errNoTableRowToClose();
               NS_HTML5_BREAK(starttagloop);
             }
             clearStackBackTo(eltPos);
             pop();
             mode = IN_TABLE_BODY;
             continue;
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case IN_TABLE_BODY: {
-        switch(group) {
+        switch (group) {
           case TR: {
-            clearStackBackTo(findLastInTableScopeOrRootTemplateTbodyTheadTfoot());
+            clearStackBackTo(
+              findLastInTableScopeOrRootTemplateTbodyTheadTfoot());
             appendToCurrentNodeAndPushElement(elementName, attributes);
             mode = IN_ROW;
             attributes = nullptr;
             NS_HTML5_BREAK(starttagloop);
           }
           case TD_OR_TH: {
             errStartTagInTableBody(name);
-            clearStackBackTo(findLastInTableScopeOrRootTemplateTbodyTheadTfoot());
-            appendToCurrentNodeAndPushElement(nsHtml5ElementName::ELT_TR, nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
+            clearStackBackTo(
+              findLastInTableScopeOrRootTemplateTbodyTheadTfoot());
+            appendToCurrentNodeAndPushElement(
+              nsHtml5ElementName::ELT_TR,
+              nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
             mode = IN_ROW;
             continue;
           }
           case CAPTION:
           case COL:
           case COLGROUP:
           case TBODY_OR_THEAD_OR_TFOOT: {
             eltPos = findLastInTableScopeOrRootTemplateTbodyTheadTfoot();
@@ -845,23 +922,22 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
               NS_HTML5_BREAK(starttagloop);
             } else {
               clearStackBackTo(eltPos);
               pop();
               mode = IN_TABLE;
               continue;
             }
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case IN_TABLE: {
-        for (; ; ) {
-          switch(group) {
+        for (;;) {
+          switch (group) {
             case CAPTION: {
               clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TABLE));
               insertMarker();
               appendToCurrentNodeAndPushElement(elementName, attributes);
               mode = IN_CAPTION;
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
@@ -869,31 +945,35 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
               clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TABLE));
               appendToCurrentNodeAndPushElement(elementName, attributes);
               mode = IN_COLUMN_GROUP;
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case COL: {
               clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TABLE));
-              appendToCurrentNodeAndPushElement(nsHtml5ElementName::ELT_COLGROUP, nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
+              appendToCurrentNodeAndPushElement(
+                nsHtml5ElementName::ELT_COLGROUP,
+                nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
               mode = IN_COLUMN_GROUP;
               NS_HTML5_CONTINUE(starttagloop);
             }
             case TBODY_OR_THEAD_OR_TFOOT: {
               clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TABLE));
               appendToCurrentNodeAndPushElement(elementName, attributes);
               mode = IN_TABLE_BODY;
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case TR:
             case TD_OR_TH: {
               clearStackBackTo(findLastOrRoot(nsHtml5TreeBuilder::TABLE));
-              appendToCurrentNodeAndPushElement(nsHtml5ElementName::ELT_TBODY, nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
+              appendToCurrentNodeAndPushElement(
+                nsHtml5ElementName::ELT_TBODY,
+                nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
               mode = IN_TABLE_BODY;
               NS_HTML5_CONTINUE(starttagloop);
             }
             case TEMPLATE: {
               NS_HTML5_BREAK(intableloop);
             }
             case TABLE: {
               errTableSeenWhileTableOpen();
@@ -927,17 +1007,20 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
               mode = TEXT;
               tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RAWTEXT,
                                                       elementName);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case INPUT: {
               errStartTagInTable(name);
-              if (!nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("hidden", attributes->getValue(nsHtml5AttributeName::ATTR_TYPE))) {
+              if (!nsHtml5Portability::
+                    lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+                      "hidden",
+                      attributes->getValue(nsHtml5AttributeName::ATTR_TYPE))) {
                 NS_HTML5_BREAK(intableloop);
               }
               appendVoidInputToCurrent(attributes, formPointer);
               selfClosing = false;
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case FORM: {
@@ -952,20 +1035,20 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
               }
             }
             default: {
               errStartTagInTable(name);
               NS_HTML5_BREAK(intableloop);
             }
           }
         }
-        intableloop_end: ;
+      intableloop_end:;
       }
       case IN_CAPTION: {
-        switch(group) {
+        switch (group) {
           case CAPTION:
           case COL:
           case COLGROUP:
           case TBODY_OR_THEAD_OR_TFOOT:
           case TR:
           case TD_OR_TH: {
             errStrayStartTag(name);
             eltPos = findLastInTableScope(nsGkAtoms::caption);
@@ -978,43 +1061,41 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
             }
             while (currentPtr >= eltPos) {
               pop();
             }
             clearTheListOfActiveFormattingElementsUpToTheLastMarker();
             mode = IN_TABLE;
             continue;
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case IN_CELL: {
-        switch(group) {
+        switch (group) {
           case CAPTION:
           case COL:
           case COLGROUP:
           case TBODY_OR_THEAD_OR_TFOOT:
           case TR:
           case TD_OR_TH: {
             eltPos = findLastInTableScopeTdTh();
             if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
               errNoCellToClose();
               NS_HTML5_BREAK(starttagloop);
             } else {
               closeTheCell(eltPos);
               continue;
             }
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case FRAMESET_OK: {
-        switch(group) {
+        switch (group) {
           case FRAMESET: {
             if (mode == FRAMESET_OK) {
               if (!currentPtr || stack[1]->getGroup() != BODY) {
                 MOZ_ASSERT(fragment || isTemplateContents());
                 errStrayStartTag(name);
                 NS_HTML5_BREAK(starttagloop);
               } else {
                 errFramesetStart();
@@ -1055,23 +1136,22 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
                   nsHtml5Portability::
                     lowerCaseLiteralEqualsIgnoreAsciiCaseString(
                       "hidden",
                       attributes->getValue(nsHtml5AttributeName::ATTR_TYPE)))) {
               framesetOk = false;
               mode = IN_BODY;
             }
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case IN_BODY: {
-        for (; ; ) {
-          switch(group) {
+        for (;;) {
+          switch (group) {
             case HTML: {
               errStrayStartTag(name);
               if (!fragment && !isTemplateContents()) {
                 addAttributesToHtml(attributes);
                 attributes = nullptr;
               }
               NS_HTML5_BREAK(starttagloop);
             }
@@ -1101,40 +1181,44 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
               }
               NS_HTML5_BREAK(starttagloop);
             }
             case P:
             case DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
             case UL_OR_OL_OR_DL:
             case ADDRESS_OR_ARTICLE_OR_ASIDE_OR_DETAILS_OR_DIALOG_OR_DIR_OR_FIGCAPTION_OR_FIGURE_OR_FOOTER_OR_HEADER_OR_HGROUP_OR_MAIN_OR_NAV_OR_SECTION_OR_SUMMARY: {
               implicitlyCloseP();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6: {
               implicitlyCloseP();
               if (stack[currentPtr]->getGroup() ==
                   H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6) {
                 errHeadingWhenHeadingOpen();
                 pop();
               }
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case FIELDSET: {
               implicitlyCloseP();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes, formPointer);
+              appendToCurrentNodeAndPushElementMayFoster(
+                elementName, attributes, formPointer);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case PRE_OR_LISTING: {
               implicitlyCloseP();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               needToDropLF = true;
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case FORM: {
               if (!!formPointer && !isTemplateContents()) {
                 errFormWhenFormOpen();
                 NS_HTML5_BREAK(starttagloop);
@@ -1143,17 +1227,17 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
                 appendToCurrentNodeAndPushFormElementMayFoster(attributes);
                 attributes = nullptr;
                 NS_HTML5_BREAK(starttagloop);
               }
             }
             case LI:
             case DD_OR_DT: {
               eltPos = currentPtr;
-              for (; ; ) {
+              for (;;) {
                 nsHtml5StackNode* node = stack[eltPos];
                 if (node->getGroup() == group) {
                   generateImpliedEndTagsExceptFor(node->name);
                   if (!!MOZ_UNLIKELY(mViewSource) && eltPos != currentPtr) {
                     errUnclosedElementsImplied(eltPos, name);
                   }
                   while (currentPtr >= eltPos) {
                     pop();
@@ -1164,67 +1248,73 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
                                         (node->name != nsGkAtoms::p &&
                                          node->name != nsGkAtoms::address &&
                                          node->name != nsGkAtoms::div)))) {
                   break;
                 }
                 eltPos--;
               }
               implicitlyCloseP();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case PLAINTEXT: {
               implicitlyCloseP();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               tokenizer->setStateAndEndTagExpectation(
                 nsHtml5Tokenizer::PLAINTEXT, elementName);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case A: {
               int32_t activeAPos =
                 findInListOfActiveFormattingElementsContainsBetweenEndAndLastMarker(
                   nsGkAtoms::a);
               if (activeAPos != -1) {
                 errFooSeenWhenFooOpen(name);
-                nsHtml5StackNode* activeA = listOfActiveFormattingElements[activeAPos];
+                nsHtml5StackNode* activeA =
+                  listOfActiveFormattingElements[activeAPos];
                 activeA->retain();
                 adoptionAgencyEndTag(nsGkAtoms::a);
                 removeFromStack(activeA);
                 activeAPos = findInListOfActiveFormattingElements(activeA);
                 if (activeAPos != -1) {
                   removeFromListOfActiveFormattingElements(activeAPos);
                 }
                 activeA->release(this);
               }
               reconstructTheActiveFormattingElements();
-              appendToCurrentNodeAndPushFormattingElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushFormattingElementMayFoster(elementName,
+                                                                   attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U:
             case FONT: {
               reconstructTheActiveFormattingElements();
               maybeForgetEarlierDuplicateFormattingElement(
                 elementName->getName(), attributes);
-              appendToCurrentNodeAndPushFormattingElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushFormattingElementMayFoster(elementName,
+                                                                   attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case NOBR: {
               reconstructTheActiveFormattingElements();
               if (nsHtml5TreeBuilder::NOT_FOUND_ON_STACK !=
                   findLastInScope(nsGkAtoms::nobr)) {
                 errFooSeenWhenFooOpen(name);
                 adoptionAgencyEndTag(nsGkAtoms::nobr);
                 reconstructTheActiveFormattingElements();
               }
-              appendToCurrentNodeAndPushFormattingElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushFormattingElementMayFoster(elementName,
+                                                                   attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case BUTTON: {
               eltPos = findLastInScope(name);
               if (eltPos != nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
                 errFooSeenWhenFooOpen(name);
                 generateImpliedEndTags();
@@ -1232,40 +1322,44 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
                   errUnclosedElementsImplied(eltPos, name);
                 }
                 while (currentPtr >= eltPos) {
                   pop();
                 }
                 NS_HTML5_CONTINUE(starttagloop);
               } else {
                 reconstructTheActiveFormattingElements();
-                appendToCurrentNodeAndPushElementMayFoster(elementName, attributes, formPointer);
+                appendToCurrentNodeAndPushElementMayFoster(
+                  elementName, attributes, formPointer);
                 attributes = nullptr;
                 NS_HTML5_BREAK(starttagloop);
               }
             }
             case OBJECT: {
               reconstructTheActiveFormattingElements();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes, formPointer);
+              appendToCurrentNodeAndPushElementMayFoster(
+                elementName, attributes, formPointer);
               insertMarker();
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case MARQUEE_OR_APPLET: {
               reconstructTheActiveFormattingElements();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               insertMarker();
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case TABLE: {
               if (!quirks) {
                 implicitlyCloseP();
               }
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               mode = IN_TABLE;
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case BR:
             case EMBED:
             case AREA_OR_WBR: {
               reconstructTheActiveFormattingElements();
@@ -1297,56 +1391,60 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
               reconstructTheActiveFormattingElements();
               appendVoidElementToCurrentMayFoster(
                 elementName, attributes, formPointer);
               selfClosing = false;
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case TEXTAREA: {
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes, formPointer);
+              appendToCurrentNodeAndPushElementMayFoster(
+                elementName, attributes, formPointer);
               tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RCDATA,
                                                       elementName);
               originalMode = mode;
               mode = TEXT;
               needToDropLF = true;
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case XMP: {
               implicitlyCloseP();
               reconstructTheActiveFormattingElements();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               originalMode = mode;
               mode = TEXT;
               tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RAWTEXT,
                                                       elementName);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case NOSCRIPT: {
               if (!scriptingEnabled) {
                 reconstructTheActiveFormattingElements();
-                appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+                appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                           attributes);
                 attributes = nullptr;
                 NS_HTML5_BREAK(starttagloop);
               } else {
               }
             }
             case NOFRAMES:
             case IFRAME:
             case NOEMBED: {
               startTagGenericRawText(elementName, attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case SELECT: {
               reconstructTheActiveFormattingElements();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes, formPointer);
-              switch(mode) {
+              appendToCurrentNodeAndPushElementMayFoster(
+                elementName, attributes, formPointer);
+              switch (mode) {
                 case IN_TABLE:
                 case IN_CAPTION:
                 case IN_COLUMN_GROUP:
                 case IN_TABLE_BODY:
                 case IN_ROW:
                 case IN_CELL: {
                   mode = IN_SELECT_IN_TABLE;
                   break;
@@ -1360,33 +1458,35 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
               NS_HTML5_BREAK(starttagloop);
             }
             case OPTGROUP:
             case OPTION: {
               if (isCurrent(nsGkAtoms::option)) {
                 pop();
               }
               reconstructTheActiveFormattingElements();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case RB_OR_RTC: {
               eltPos = findLastInScope(nsGkAtoms::ruby);
               if (eltPos != NOT_FOUND_ON_STACK) {
                 generateImpliedEndTags();
               }
               if (eltPos != currentPtr) {
                 if (eltPos == NOT_FOUND_ON_STACK) {
                   errStartTagSeenWithoutRuby(name);
                 } else {
                   errUnclosedChildrenInRuby();
                 }
               }
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case RT_OR_RP: {
               eltPos = findLastInScope(nsGkAtoms::ruby);
               if (eltPos != NOT_FOUND_ON_STACK) {
                 generateImpliedEndTagsExceptFor(nsGkAtoms::rtc);
               }
@@ -1394,40 +1494,44 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
                 if (!isCurrent(nsGkAtoms::rtc)) {
                   if (eltPos == NOT_FOUND_ON_STACK) {
                     errStartTagSeenWithoutRuby(name);
                   } else {
                     errUnclosedChildrenInRuby();
                   }
                 }
               }
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case MATH: {
               reconstructTheActiveFormattingElements();
               attributes->adjustForMath();
               if (selfClosing) {
-                appendVoidElementToCurrentMayFosterMathML(elementName, attributes);
+                appendVoidElementToCurrentMayFosterMathML(elementName,
+                                                          attributes);
                 selfClosing = false;
               } else {
-                appendToCurrentNodeAndPushElementMayFosterMathML(elementName, attributes);
+                appendToCurrentNodeAndPushElementMayFosterMathML(elementName,
+                                                                 attributes);
               }
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case SVG: {
               reconstructTheActiveFormattingElements();
               attributes->adjustForSvg();
               if (selfClosing) {
                 appendVoidElementToCurrentMayFosterSVG(elementName, attributes);
                 selfClosing = false;
               } else {
-                appendToCurrentNodeAndPushElementMayFosterSVG(elementName, attributes);
+                appendToCurrentNodeAndPushElementMayFosterSVG(elementName,
+                                                              attributes);
               }
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case CAPTION:
             case COL:
             case COLGROUP:
             case TBODY_OR_THEAD_OR_TFOOT:
@@ -1436,33 +1540,35 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
             case FRAME:
             case FRAMESET:
             case HEAD: {
               errStrayStartTag(name);
               NS_HTML5_BREAK(starttagloop);
             }
             case OUTPUT: {
               reconstructTheActiveFormattingElements();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes, formPointer);
+              appendToCurrentNodeAndPushElementMayFoster(
+                elementName, attributes, formPointer);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             default: {
               reconstructTheActiveFormattingElements();
-              appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+              appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                         attributes);
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
           }
         }
-        inbodyloop_end: ;
+      inbodyloop_end:;
       }
       case IN_HEAD: {
-        for (; ; ) {
-          switch(group) {
+        for (;;) {
+          switch (group) {
             case HTML: {
               errStrayStartTag(name);
               if (!fragment && !isTemplateContents()) {
                 addAttributesToHtml(attributes);
                 attributes = nullptr;
               }
               NS_HTML5_BREAK(starttagloop);
             }
@@ -1484,17 +1590,18 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
             case NOSCRIPT: {
               if (scriptingEnabled) {
                 appendToCurrentNodeAndPushElement(elementName, attributes);
                 originalMode = mode;
                 mode = TEXT;
                 tokenizer->setStateAndEndTagExpectation(
                   nsHtml5Tokenizer::RAWTEXT, elementName);
               } else {
-                appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
+                appendToCurrentNodeAndPushElementMayFoster(elementName,
+                                                           attributes);
                 mode = IN_HEAD_NOSCRIPT;
               }
               attributes = nullptr;
               NS_HTML5_BREAK(starttagloop);
             }
             case SCRIPT: {
               startTagScriptInHead(elementName, attributes);
               attributes = nullptr;
@@ -1517,20 +1624,20 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
             }
             default: {
               pop();
               mode = AFTER_HEAD;
               NS_HTML5_CONTINUE(starttagloop);
             }
           }
         }
-        inheadloop_end: ;
+      inheadloop_end:;
       }
       case IN_HEAD_NOSCRIPT: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment && !isTemplateContents()) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
             }
             NS_HTML5_BREAK(starttagloop);
           }
@@ -1569,17 +1676,17 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
             errBadStartTagInHead(name);
             pop();
             mode = IN_HEAD;
             continue;
           }
         }
       }
       case IN_COLUMN_GROUP: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment && !isTemplateContents()) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
             }
             NS_HTML5_BREAK(starttagloop);
           }
@@ -1602,17 +1709,17 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
             }
             pop();
             mode = IN_TABLE;
             continue;
           }
         }
       }
       case IN_SELECT_IN_TABLE: {
-        switch(group) {
+        switch (group) {
           case CAPTION:
           case TBODY_OR_THEAD_OR_TFOOT:
           case TR:
           case TD_OR_TH:
           case TABLE: {
             errStartTagWithSelectOpen(name);
             eltPos = findLastInTableScope(nsGkAtoms::select);
             if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
@@ -1620,22 +1727,21 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
               NS_HTML5_BREAK(starttagloop);
             }
             while (currentPtr >= eltPos) {
               pop();
             }
             resetTheInsertionMode();
             continue;
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case IN_SELECT: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
             }
             NS_HTML5_BREAK(starttagloop);
           }
@@ -1700,51 +1806,50 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
           }
           default: {
             errStrayStartTag(name);
             NS_HTML5_BREAK(starttagloop);
           }
         }
       }
       case AFTER_BODY: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment && !isTemplateContents()) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
             }
             NS_HTML5_BREAK(starttagloop);
           }
           default: {
             errStrayStartTag(name);
             mode = framesetOk ? FRAMESET_OK : IN_BODY;
             continue;
           }
         }
       }
       case IN_FRAMESET: {
-        switch(group) {
+        switch (group) {
           case FRAMESET: {
             appendToCurrentNodeAndPushElement(elementName, attributes);
             attributes = nullptr;
             NS_HTML5_BREAK(starttagloop);
           }
           case FRAME: {
             appendVoidElementToCurrentMayFoster(elementName, attributes);
             selfClosing = false;
             attributes = nullptr;
             NS_HTML5_BREAK(starttagloop);
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case AFTER_FRAMESET: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment && !isTemplateContents()) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
             }
             NS_HTML5_BREAK(starttagloop);
           }
@@ -1765,17 +1870,17 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
       }
       case INITIAL: {
         errStartTagWithoutDoctype();
         documentModeInternal(QUIRKS_MODE, nullptr, nullptr, false);
         mode = BEFORE_HTML;
         continue;
       }
       case BEFORE_HTML: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             if (attributes == nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES) {
               appendHtmlElementToDocumentAndPush();
             } else {
               appendHtmlElementToDocumentAndPush(attributes);
             }
             mode = BEFORE_HEAD;
             attributes = nullptr;
@@ -1784,40 +1889,41 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
           default: {
             appendHtmlElementToDocumentAndPush();
             mode = BEFORE_HEAD;
             continue;
           }
         }
       }
       case BEFORE_HEAD: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment && !isTemplateContents()) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
             }
             NS_HTML5_BREAK(starttagloop);
           }
           case HEAD: {
             appendToCurrentNodeAndPushHeadElement(attributes);
             mode = IN_HEAD;
             attributes = nullptr;
             NS_HTML5_BREAK(starttagloop);
           }
           default: {
-            appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
+            appendToCurrentNodeAndPushHeadElement(
+              nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
             mode = IN_HEAD;
             continue;
           }
         }
       }
       case AFTER_HEAD: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment && !isTemplateContents()) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
             }
             NS_HTML5_BREAK(starttagloop);
           }
@@ -1908,17 +2014,17 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
           default: {
             appendToCurrentNodeAndPushBodyElement();
             mode = FRAMESET_OK;
             continue;
           }
         }
       }
       case AFTER_AFTER_BODY: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment && !isTemplateContents()) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
             }
             NS_HTML5_BREAK(starttagloop);
           }
@@ -1926,17 +2032,17 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
             errStrayStartTag(name);
 
             mode = framesetOk ? FRAMESET_OK : IN_BODY;
             continue;
           }
         }
       }
       case AFTER_AFTER_FRAMESET: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             errStrayStartTag(name);
             if (!fragment && !isTemplateContents()) {
               addAttributesToHtml(attributes);
               attributes = nullptr;
             }
             NS_HTML5_BREAK(starttagloop);
           }
@@ -1952,191 +2058,196 @@ nsHtml5TreeBuilder::startTag(nsHtml5Elem
         }
       }
       case TEXT: {
         MOZ_ASSERT(false);
         NS_HTML5_BREAK(starttagloop);
       }
     }
   }
-  starttagloop_end: ;
+starttagloop_end:;
   if (selfClosing) {
     errSelfClosing();
   }
   if (!mBuilder && attributes != nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES) {
     delete attributes;
   }
 }
 
-void 
-nsHtml5TreeBuilder::startTagTitleInHead(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::startTagTitleInHead(nsHtml5ElementName* elementName,
+                                        nsHtml5HtmlAttributes* attributes)
 {
   appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
   originalMode = mode;
   mode = TEXT;
   tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RCDATA,
                                           elementName);
 }
 
-void 
-nsHtml5TreeBuilder::startTagGenericRawText(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::startTagGenericRawText(nsHtml5ElementName* elementName,
+                                           nsHtml5HtmlAttributes* attributes)
 {
   appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
   originalMode = mode;
   mode = TEXT;
   tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::RAWTEXT,
                                           elementName);
 }
 
-void 
-nsHtml5TreeBuilder::startTagScriptInHead(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::startTagScriptInHead(nsHtml5ElementName* elementName,
+                                         nsHtml5HtmlAttributes* attributes)
 {
   appendToCurrentNodeAndPushElementMayFoster(elementName, attributes);
   originalMode = mode;
   mode = TEXT;
   tokenizer->setStateAndEndTagExpectation(nsHtml5Tokenizer::SCRIPT_DATA,
                                           elementName);
 }
 
-void 
-nsHtml5TreeBuilder::startTagTemplateInHead(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::startTagTemplateInHead(nsHtml5ElementName* elementName,
+                                           nsHtml5HtmlAttributes* attributes)
 {
   appendToCurrentNodeAndPushElement(elementName, attributes);
   insertMarker();
   framesetOk = false;
   originalMode = mode;
   mode = IN_TEMPLATE;
   pushTemplateMode(IN_TEMPLATE);
 }
 
-bool 
+bool
 nsHtml5TreeBuilder::isTemplateContents()
 {
   return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK !=
          findLast(nsGkAtoms::_template);
 }
 
-bool 
+bool
 nsHtml5TreeBuilder::isTemplateModeStackEmpty()
 {
   return templateModePtr == -1;
 }
 
-bool 
+bool
 nsHtml5TreeBuilder::isSpecialParentInForeign(nsHtml5StackNode* stackNode)
 {
   int32_t ns = stackNode->ns;
   return (kNameSpaceID_XHTML == ns) || (stackNode->isHtmlIntegrationPoint()) ||
          ((kNameSpaceID_MathML == ns) &&
           (stackNode->getGroup() == MI_MO_MN_MS_MTEXT));
 }
 
 nsHtml5String
 nsHtml5TreeBuilder::extractCharsetFromContent(nsHtml5String attributeValue,
                                               nsHtml5TreeBuilder* tb)
 {
   int32_t charsetState = CHARSET_INITIAL;
   int32_t start = -1;
   int32_t end = -1;
-  autoJArray<char16_t,int32_t> buffer = nsHtml5Portability::newCharArrayFromString(attributeValue);
+  autoJArray<char16_t, int32_t> buffer =
+    nsHtml5Portability::newCharArrayFromString(attributeValue);
   for (int32_t i = 0; i < buffer.length; i++) {
     char16_t c = buffer[i];
-    switch(charsetState) {
+    switch (charsetState) {
       case CHARSET_INITIAL: {
-        switch(c) {
+        switch (c) {
           case 'c':
           case 'C': {
             charsetState = CHARSET_C;
             continue;
           }
           default: {
             continue;
           }
         }
       }
       case CHARSET_C: {
-        switch(c) {
+        switch (c) {
           case 'h':
           case 'H': {
             charsetState = CHARSET_H;
             continue;
           }
           default: {
             charsetState = CHARSET_INITIAL;
             continue;
           }
         }
       }
       case CHARSET_H: {
-        switch(c) {
+        switch (c) {
           case 'a':
           case 'A': {
             charsetState = CHARSET_A;
             continue;
           }
           default: {
             charsetState = CHARSET_INITIAL;
             continue;
           }
         }
       }
       case CHARSET_A: {
-        switch(c) {
+        switch (c) {
           case 'r':
           case 'R': {
             charsetState = CHARSET_R;
             continue;
           }
           default: {
             charsetState = CHARSET_INITIAL;
             continue;
           }
         }
       }
       case CHARSET_R: {
-        switch(c) {
+        switch (c) {
           case 's':
           case 'S': {
             charsetState = CHARSET_S;
             continue;
           }
           default: {
             charsetState = CHARSET_INITIAL;
             continue;
           }
         }
       }
       case CHARSET_S: {
-        switch(c) {
+        switch (c) {
           case 'e':
           case 'E': {
             charsetState = CHARSET_E;
             continue;
           }
           default: {
             charsetState = CHARSET_INITIAL;
             continue;
           }
         }
       }
       case CHARSET_E: {
-        switch(c) {
+        switch (c) {
           case 't':
           case 'T': {
             charsetState = CHARSET_T;
             continue;
           }
           default: {
             charsetState = CHARSET_INITIAL;
             continue;
           }
         }
       }
       case CHARSET_T: {
-        switch(c) {
+        switch (c) {
           case '\t':
           case '\n':
           case '\f':
           case '\r':
           case ' ': {
             continue;
           }
           case '=': {
@@ -2144,17 +2255,17 @@ nsHtml5TreeBuilder::extractCharsetFromCo
             continue;
           }
           default: {
             return nullptr;
           }
         }
       }
       case CHARSET_EQUALS: {
-        switch(c) {
+        switch (c) {
           case '\t':
           case '\n':
           case '\f':
           case '\r':
           case ' ': {
             continue;
           }
           case '\'': {
@@ -2170,144 +2281,149 @@ nsHtml5TreeBuilder::extractCharsetFromCo
           default: {
             start = i;
             charsetState = CHARSET_UNQUOTED;
             continue;
           }
         }
       }
       case CHARSET_SINGLE_QUOTED: {
-        switch(c) {
+        switch (c) {
           case '\'': {
             end = i;
             NS_HTML5_BREAK(charsetloop);
           }
           default: {
             continue;
           }
         }
       }
       case CHARSET_DOUBLE_QUOTED: {
-        switch(c) {
+        switch (c) {
           case '\"': {
             end = i;
             NS_HTML5_BREAK(charsetloop);
           }
           default: {
             continue;
           }
         }
       }
       case CHARSET_UNQUOTED: {
-        switch(c) {
+        switch (c) {
           case '\t':
           case '\n':
           case '\f':
           case '\r':
           case ' ':
           case ';': {
             end = i;
             NS_HTML5_BREAK(charsetloop);
           }
           default: {
             continue;
           }
         }
       }
     }
   }
-  charsetloop_end: ;
-    nsHtml5String charset = nullptr;
-    if (start != -1) {
-      if (end == -1) {
-        end = buffer.length;
-      }
-      charset = nsHtml5Portability::newStringFromBuffer(
-        buffer, start, end - start, tb, false);
+charsetloop_end:;
+  nsHtml5String charset = nullptr;
+  if (start != -1) {
+    if (end == -1) {
+      end = buffer.length;
+    }
+    charset = nsHtml5Portability::newStringFromBuffer(
+      buffer, start, end - start, tb, false);
   }
   return charset;
 }
 
-void 
+void
 nsHtml5TreeBuilder::checkMetaCharset(nsHtml5HtmlAttributes* attributes)
 {
   nsHtml5String charset =
     attributes->getValue(nsHtml5AttributeName::ATTR_CHARSET);
   if (charset) {
     if (tokenizer->internalEncodingDeclaration(charset)) {
       requestSuspension();
       return;
     }
     return;
   }
-  if (!nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("content-type", attributes->getValue(nsHtml5AttributeName::ATTR_HTTP_EQUIV))) {
+  if (!nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+        "content-type",
+        attributes->getValue(nsHtml5AttributeName::ATTR_HTTP_EQUIV))) {
     return;
   }
   nsHtml5String content =
     attributes->getValue(nsHtml5AttributeName::ATTR_CONTENT);
   if (content) {
     nsHtml5String extract =
       nsHtml5TreeBuilder::extractCharsetFromContent(content, this);
     if (extract) {
       if (tokenizer->internalEncodingDeclaration(extract)) {
         requestSuspension();
       }
     }
     extract.Release();
   }
 }
 
-void 
+void
 nsHtml5TreeBuilder::endTag(nsHtml5ElementName* elementName)
 {
   flushCharacters();
   needToDropLF = false;
   int32_t eltPos;
   int32_t group = elementName->getGroup();
   nsAtom* name = elementName->getName();
-  for (; ; ) {
+  for (;;) {
     if (isInForeign()) {
       if (stack[currentPtr]->name != name) {
         if (!currentPtr) {
           errStrayEndTag(name);
         } else {
-          errEndTagDidNotMatchCurrentOpenElement(name, stack[currentPtr]->popName);
+          errEndTagDidNotMatchCurrentOpenElement(name,
+                                                 stack[currentPtr]->popName);
         }
       }
       eltPos = currentPtr;
-      for (; ; ) {
+      for (;;) {
         if (!eltPos) {
-          MOZ_ASSERT(fragment, "We can get this close to the root of the stack in foreign content only in the fragment case.");
+          MOZ_ASSERT(fragment,
+                     "We can get this close to the root of the stack in "
+                     "foreign content only in the fragment case.");
           NS_HTML5_BREAK(endtagloop);
         }
         if (stack[eltPos]->name == name) {
           while (currentPtr >= eltPos) {
             pop();
           }
           NS_HTML5_BREAK(endtagloop);
         }
         if (stack[--eltPos]->ns == kNameSpaceID_XHTML) {
           break;
         }
       }
     }
-    switch(mode) {
+    switch (mode) {
       case IN_TEMPLATE: {
-        switch(group) {
+        switch (group) {
           case TEMPLATE: {
             break;
           }
           default: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
         }
       }
       case IN_ROW: {
-        switch(group) {
+        switch (group) {
           case TR: {
             eltPos = findLastOrRoot(nsHtml5TreeBuilder::TR);
             if (!eltPos) {
               MOZ_ASSERT(fragment || isTemplateContents());
               errNoTableRowToClose();
               NS_HTML5_BREAK(endtagloop);
             }
             clearStackBackTo(eltPos);
@@ -2348,22 +2464,21 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           case CAPTION:
           case COL:
           case COLGROUP:
           case HTML:
           case TD_OR_TH: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case IN_TABLE_BODY: {
-        switch(group) {
+        switch (group) {
           case TBODY_OR_THEAD_OR_TFOOT: {
             eltPos = findLastOrRoot(name);
             if (!eltPos) {
               errStrayEndTag(name);
               NS_HTML5_BREAK(endtagloop);
             }
             clearStackBackTo(eltPos);
             pop();
@@ -2387,22 +2502,21 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           case COL:
           case COLGROUP:
           case HTML:
           case TD_OR_TH:
           case TR: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case IN_TABLE: {
-        switch(group) {
+        switch (group) {
           case TABLE: {
             eltPos = findLast(nsGkAtoms::table);
             if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
               MOZ_ASSERT(fragment || isTemplateContents());
               errStrayEndTag(name);
               NS_HTML5_BREAK(endtagloop);
             }
             while (currentPtr >= eltPos) {
@@ -2426,17 +2540,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
             break;
           }
           default: {
             errStrayEndTag(name);
           }
         }
       }
       case IN_CAPTION: {
-        switch(group) {
+        switch (group) {
           case CAPTION: {
             eltPos = findLastInTableScope(nsGkAtoms::caption);
             if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
               NS_HTML5_BREAK(endtagloop);
             }
             generateImpliedEndTags();
             if (!!MOZ_UNLIKELY(mViewSource) && currentPtr != eltPos) {
               errUnclosedElements(eltPos, name);
@@ -2470,22 +2584,21 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           case COLGROUP:
           case HTML:
           case TBODY_OR_THEAD_OR_TFOOT:
           case TD_OR_TH:
           case TR: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case IN_CELL: {
-        switch(group) {
+        switch (group) {
           case TD_OR_TH: {
             eltPos = findLastInTableScope(name);
             if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
               errStrayEndTag(name);
               NS_HTML5_BREAK(endtagloop);
             }
             generateImpliedEndTags();
             if (!!MOZ_UNLIKELY(mViewSource) && !isCurrent(name)) {
@@ -2515,33 +2628,32 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           case BODY:
           case CAPTION:
           case COL:
           case COLGROUP:
           case HTML: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case FRAMESET_OK:
       case IN_BODY: {
-        switch(group) {
+        switch (group) {
           case BODY: {
             if (!isSecondOnStackBody()) {
               MOZ_ASSERT(fragment || isTemplateContents());
               errStrayEndTag(name);
               NS_HTML5_BREAK(endtagloop);
             }
             MOZ_ASSERT(currentPtr >= 1);
             if (MOZ_UNLIKELY(mViewSource)) {
               for (int32_t i = 2; i <= currentPtr; i++) {
-                switch(stack[i]->getGroup()) {
+                switch (stack[i]->getGroup()) {
                   case DD_OR_DT:
                   case LI:
                   case OPTGROUP:
                   case OPTION:
                   case P:
                   case RB_OR_RTC:
                   case RT_OR_RP:
                   case TD_OR_TH:
@@ -2549,30 +2661,30 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
                     break;
                   }
                   default: {
                     errEndWithUnclosedElements(name);
                     NS_HTML5_BREAK(uncloseloop1);
                   }
                 }
               }
-              uncloseloop1_end: ;
+            uncloseloop1_end:;
             }
             mode = AFTER_BODY;
             NS_HTML5_BREAK(endtagloop);
           }
           case HTML: {
             if (!isSecondOnStackBody()) {
               MOZ_ASSERT(fragment || isTemplateContents());
               errStrayEndTag(name);
               NS_HTML5_BREAK(endtagloop);
             }
             if (MOZ_UNLIKELY(mViewSource)) {
               for (int32_t i = 0; i <= currentPtr; i++) {
-                switch(stack[i]->getGroup()) {
+                switch (stack[i]->getGroup()) {
                   case DD_OR_DT:
                   case LI:
                   case P:
                   case RB_OR_RTC:
                   case RT_OR_RP:
                   case TBODY_OR_THEAD_OR_TFOOT:
                   case TD_OR_TH:
                   case BODY:
@@ -2580,17 +2692,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
                     break;
                   }
                   default: {
                     errEndWithUnclosedElements(name);
                     NS_HTML5_BREAK(uncloseloop2);
                   }
                 }
               }
-              uncloseloop2_end: ;
+            uncloseloop2_end:;
             }
             mode = AFTER_BODY;
             continue;
           }
           case DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU:
           case UL_OR_OL_OR_DL:
           case PRE_OR_LISTING:
           case FIELDSET:
@@ -2645,21 +2757,23 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
             }
           }
           case P: {
             eltPos = findLastInButtonScope(nsGkAtoms::p);
             if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
               errNoElementToCloseButEndTagSeen(nsGkAtoms::p);
               if (isInForeign()) {
                 errHtmlStartTagInForeignContext(name);
-                while (currentPtr >= 0 && stack[currentPtr]->ns != kNameSpaceID_XHTML) {
+                while (currentPtr >= 0 &&
+                       stack[currentPtr]->ns != kNameSpaceID_XHTML) {
                   pop();
                 }
               }
-              appendVoidElementToCurrentMayFoster(elementName, nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
+              appendVoidElementToCurrentMayFoster(
+                elementName, nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
               NS_HTML5_BREAK(endtagloop);
             }
             generateImpliedEndTagsExceptFor(nsGkAtoms::p);
             MOZ_ASSERT(eltPos != nsHtml5TreeBuilder::NOT_FOUND_ON_STACK);
             if (!!MOZ_UNLIKELY(mViewSource) && eltPos != currentPtr) {
               errUnclosedElements(eltPos, name);
             }
             while (currentPtr >= eltPos) {
@@ -2728,22 +2842,24 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
               clearTheListOfActiveFormattingElementsUpToTheLastMarker();
             }
             NS_HTML5_BREAK(endtagloop);
           }
           case BR: {
             errEndTagBr();
             if (isInForeign()) {
               errHtmlStartTagInForeignContext(name);
-              while (currentPtr >= 0 && stack[currentPtr]->ns != kNameSpaceID_XHTML) {
+              while (currentPtr >= 0 &&
+                     stack[currentPtr]->ns != kNameSpaceID_XHTML) {
                 pop();
               }
             }
             reconstructTheActiveFormattingElements();
-            appendVoidElementToCurrentMayFoster(elementName, nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
+            appendVoidElementToCurrentMayFoster(
+              elementName, nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
             NS_HTML5_BREAK(endtagloop);
           }
           case TEMPLATE: {
             break;
           }
           case AREA_OR_WBR:
 #ifdef ENABLE_VOID_MENUITEM
           case MENUITEM:
@@ -2780,17 +2896,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
             }
           }
           default: {
             if (isCurrent(name)) {
               pop();
               NS_HTML5_BREAK(endtagloop);
             }
             eltPos = currentPtr;
-            for (; ; ) {
+            for (;;) {
               nsHtml5StackNode* node = stack[eltPos];
               if (node->ns == kNameSpaceID_XHTML && node->name == name) {
                 generateImpliedEndTags();
                 if (!!MOZ_UNLIKELY(mViewSource) && !isCurrent(name)) {
                   errUnclosedElements(eltPos, name);
                 }
                 while (currentPtr >= eltPos) {
                   pop();
@@ -2801,17 +2917,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
                 NS_HTML5_BREAK(endtagloop);
               }
               eltPos--;
             }
           }
         }
       }
       case IN_HEAD: {
-        switch(group) {
+        switch (group) {
           case HEAD: {
             pop();
             mode = AFTER_HEAD;
             NS_HTML5_BREAK(endtagloop);
           }
           case BR:
           case HTML:
           case BODY: {
@@ -2825,17 +2941,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           }
           default: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
         }
       }
       case IN_HEAD_NOSCRIPT: {
-        switch(group) {
+        switch (group) {
           case NOSCRIPT: {
             pop();
             mode = IN_HEAD;
             NS_HTML5_BREAK(endtagloop);
           }
           case BR: {
             errStrayEndTag(name);
             pop();
@@ -2844,17 +2960,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           }
           default: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
         }
       }
       case IN_COLUMN_GROUP: {
-        switch(group) {
+        switch (group) {
           case COLGROUP: {
             if (!currentPtr ||
                 stack[currentPtr]->getGroup() == nsHtml5TreeBuilder::TEMPLATE) {
               MOZ_ASSERT(fragment || isTemplateContents());
               errGarbageInColgroup();
               NS_HTML5_BREAK(endtagloop);
             }
             pop();
@@ -2878,17 +2994,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
             }
             pop();
             mode = IN_TABLE;
             continue;
           }
         }
       }
       case IN_SELECT_IN_TABLE: {
-        switch(group) {
+        switch (group) {
           case CAPTION:
           case TABLE:
           case TBODY_OR_THEAD_OR_TFOOT:
           case TR:
           case TD_OR_TH: {
             errEndTagSeenWithSelectOpen(name);
             if (findLastInTableScope(name) !=
                 nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
@@ -2901,22 +3017,21 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
                 pop();
               }
               resetTheInsertionMode();
               continue;
             } else {
               NS_HTML5_BREAK(endtagloop);
             }
           }
-          default:
-            ; // fall through
+          default:; // fall through
         }
       }
       case IN_SELECT: {
-        switch(group) {
+        switch (group) {
           case OPTION: {
             if (isCurrent(nsGkAtoms::option)) {
               pop();
               NS_HTML5_BREAK(endtagloop);
             } else {
               errStrayEndTag(name);
               NS_HTML5_BREAK(endtagloop);
             }
@@ -2952,17 +3067,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           }
           default: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
         }
       }
       case AFTER_BODY: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             if (fragment) {
               errStrayEndTag(name);
               NS_HTML5_BREAK(endtagloop);
             } else {
               mode = AFTER_AFTER_BODY;
               NS_HTML5_BREAK(endtagloop);
             }
@@ -2970,17 +3085,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           default: {
             errEndTagAfterBody();
             mode = framesetOk ? FRAMESET_OK : IN_BODY;
             continue;
           }
         }
       }
       case IN_FRAMESET: {
-        switch(group) {
+        switch (group) {
           case FRAMESET: {
             if (!currentPtr) {
               MOZ_ASSERT(fragment);
               errStrayEndTag(name);
               NS_HTML5_BREAK(endtagloop);
             }
             pop();
             if ((!fragment) && !isCurrent(nsGkAtoms::frameset)) {
@@ -2990,17 +3105,17 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
           }
           default: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
         }
       }
       case AFTER_FRAMESET: {
-        switch(group) {
+        switch (group) {
           case HTML: {
             mode = AFTER_AFTER_FRAMESET;
             NS_HTML5_BREAK(endtagloop);
           }
           default: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
@@ -3008,49 +3123,50 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
       }
       case INITIAL: {
         errEndTagSeenWithoutDoctype();
         documentModeInternal(QUIRKS_MODE, nullptr, nullptr, false);
         mode = BEFORE_HTML;
         continue;
       }
       case BEFORE_HTML: {
-        switch(group) {
+        switch (group) {
           case HEAD:
           case BR:
           case HTML:
           case BODY: {
             appendHtmlElementToDocumentAndPush();
             mode = BEFORE_HEAD;
             continue;
           }
           default: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
         }
       }
       case BEFORE_HEAD: {
-        switch(group) {
+        switch (group) {
           case HEAD:
           case BR:
           case HTML:
           case BODY: {
-            appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
+            appendToCurrentNodeAndPushHeadElement(
+              nsHtml5HtmlAttributes::EMPTY_ATTRIBUTES);
             mode = IN_HEAD;
             continue;
           }
           default: {
             errStrayEndTag(name);
             NS_HTML5_BREAK(endtagloop);
           }
         }
       }
       case AFTER_HEAD: {
-        switch(group) {
+        switch (group) {
           case TEMPLATE: {
             endTagTemplateInHead();
             NS_HTML5_BREAK(endtagloop);
           }
           case HTML:
           case BODY:
           case BR: {
             appendToCurrentNodeAndPushBodyElement();
@@ -3077,20 +3193,20 @@ nsHtml5TreeBuilder::endTag(nsHtml5Elemen
         if (originalMode == AFTER_HEAD) {
           silentPop();
         }
         mode = originalMode;
         NS_HTML5_BREAK(endtagloop);
       }
     }
   }
-  endtagloop_end: ;
+endtagloop_end:;
 }
 
-void 
+void
 nsHtml5TreeBuilder::endTagTemplateInHead()
 {
   int32_t eltPos = findLast(nsGkAtoms::_template);
   if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
     errStrayEndTag(nsGkAtoms::_template);
     return;
   }
   generateImpliedEndTags();
@@ -3100,56 +3216,56 @@ nsHtml5TreeBuilder::endTagTemplateInHead
   while (currentPtr >= eltPos) {
     pop();
   }
   clearTheListOfActiveFormattingElementsUpToTheLastMarker();
   popTemplateMode();
   resetTheInsertionMode();
 }
 
-int32_t 
+int32_t
 nsHtml5TreeBuilder::findLastInTableScopeOrRootTemplateTbodyTheadTfoot()
 {
   for (int32_t i = currentPtr; i > 0; i--) {
     if (stack[i]->getGroup() == nsHtml5TreeBuilder::TBODY_OR_THEAD_OR_TFOOT ||
         stack[i]->getGroup() == nsHtml5TreeBuilder::TEMPLATE) {
       return i;
     }
   }
   return 0;
 }
 
-int32_t 
+int32_t
 nsHtml5TreeBuilder::findLast(nsAtom* name)
 {
   for (int32_t i = currentPtr; i > 0; i--) {
     if (stack[i]->ns == kNameSpaceID_XHTML && stack[i]->name == name) {
       return i;
     }
   }
   return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
 }
 
-int32_t 
+int32_t
 nsHtml5TreeBuilder::findLastInTableScope(nsAtom* name)
 {
   for (int32_t i = currentPtr; i > 0; i--) {
     if (stack[i]->ns == kNameSpaceID_XHTML) {
       if (stack[i]->name == name) {
         return i;
       } else if (stack[i]->name == nsGkAtoms::table ||
                  stack[i]->name == nsGkAtoms::_template) {
         return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
       }
     }
   }
   return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
 }
 
-int32_t 
+int32_t
 nsHtml5TreeBuilder::findLastInButtonScope(nsAtom* name)
 {
   for (int32_t i = currentPtr; i > 0; i--) {
     if (stack[i]->ns == kNameSpaceID_XHTML) {
       if (stack[i]->name == name) {
         return i;
       } else if (stack[i]->name == nsGkAtoms::button) {
         return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
@@ -3157,30 +3273,30 @@ nsHtml5TreeBuilder::findLastInButtonScop
     }
     if (stack[i]->isScoping()) {
       return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
     }
   }
   return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
 }
 
-int32_t 
+int32_t
 nsHtml5TreeBuilder::findLastInScope(nsAtom* name)
 {
   for (int32_t i = currentPtr; i > 0; i--) {
     if (stack[i]->ns == kNameSpaceID_XHTML && stack[i]->name == name) {
       return i;
     } else if (stack[i]->isScoping()) {
       return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
     }
   }
   return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
 }
 
-int32_t 
+int32_t
 nsHtml5TreeBuilder::findLastInListScope(nsAtom* name)
 {
   for (int32_t i = currentPtr; i > 0; i--) {
     if (stack[i]->ns == kNameSpaceID_XHTML) {
       if (stack[i]->name == name) {
         return i;
       } else if (stack[i]->name == nsGkAtoms::ul ||
                  stack[i]->name == nsGkAtoms::ol) {
@@ -3189,36 +3305,36 @@ nsHtml5TreeBuilder::findLastInListScope(
     }
     if (stack[i]->isScoping()) {
       return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
     }
   }
   return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
 }
 
-int32_t 
+int32_t
 nsHtml5TreeBuilder::findLastInScopeHn()
 {
   for (int32_t i = currentPtr; i > 0; i--) {
     if (stack[i]->getGroup() ==
         nsHtml5TreeBuilder::H1_OR_H2_OR_H3_OR_H4_OR_H5_OR_H6) {
       return i;
     } else if (stack[i]->isScoping()) {
       return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
     }
   }
   return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
 }
 
-void 
+void
 nsHtml5TreeBuilder::generateImpliedEndTagsExceptFor(nsAtom* name)
 {
-  for (; ; ) {
+  for (;;) {
     nsHtml5StackNode* node = stack[currentPtr];
-    switch(node->getGroup()) {
+    switch (node->getGroup()) {
       case P:
       case LI:
       case DD_OR_DT:
       case OPTION:
       case OPTGROUP:
       case RB_OR_RTC:
       case RT_OR_RP: {
         if (node->ns == kNameSpaceID_XHTML && node->name == name) {
@@ -3229,21 +3345,21 @@ nsHtml5TreeBuilder::generateImpliedEndTa
       }
       default: {
         return;
       }
     }
   }
 }
 
-void 
+void
 nsHtml5TreeBuilder::generateImpliedEndTags()
 {
-  for (; ; ) {
-    switch(stack[currentPtr]->getGroup()) {
+  for (;;) {
+    switch (stack[currentPtr]->getGroup()) {
       case P:
       case LI:
       case DD_OR_DT:
       case OPTION:
       case OPTGROUP:
       case RB_OR_RTC:
       case RT_OR_RP: {
         pop();
@@ -3251,17 +3367,17 @@ nsHtml5TreeBuilder::generateImpliedEndTa
       }
       default: {
         return;
       }
     }
   }
 }
 
-bool 
+bool
 nsHtml5TreeBuilder::isSecondOnStackBody()
 {
   return currentPtr >= 1 && stack[1]->getGroup() == nsHtml5TreeBuilder::BODY;
 }
 
 void
 nsHtml5TreeBuilder::documentModeInternal(
   nsHtml5DocumentMode m,
@@ -3277,27 +3393,31 @@ nsHtml5TreeBuilder::documentModeInternal
   quirks = (m == QUIRKS_MODE);
   this->documentMode(m);
 }
 
 bool
 nsHtml5TreeBuilder::isAlmostStandards(nsHtml5String publicIdentifier,
                                       nsHtml5String systemIdentifier)
 {
-  if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("-//w3c//dtd xhtml 1.0 transitional//en", publicIdentifier)) {
+  if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+        "-//w3c//dtd xhtml 1.0 transitional//en", publicIdentifier)) {
     return true;
   }
-  if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("-//w3c//dtd xhtml 1.0 frameset//en", publicIdentifier)) {
+  if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+        "-//w3c//dtd xhtml 1.0 frameset//en", publicIdentifier)) {
     return true;
   }
   if (systemIdentifier) {
-    if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("-//w3c//dtd html 4.01 transitional//en", publicIdentifier)) {
+    if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+          "-//w3c//dtd html 4.01 transitional//en", publicIdentifier)) {
       return true;
     }
-    if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("-//w3c//dtd html 4.01 frameset//en", publicIdentifier)) {
+    if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+          "-//w3c//dtd html 4.01 frameset//en", publicIdentifier)) {
       return true;
     }
   }
   return false;
 }
 
 bool
 nsHtml5TreeBuilder::isQuirky(nsAtom* name,
@@ -3308,83 +3428,93 @@ nsHtml5TreeBuilder::isQuirky(nsAtom* nam
   if (forceQuirks) {
     return true;
   }
   if (name != nsGkAtoms::html) {
     return true;
   }
   if (publicIdentifier) {
     for (int32_t i = 0; i < nsHtml5TreeBuilder::QUIRKY_PUBLIC_IDS.length; i++) {
-      if (nsHtml5Portability::lowerCaseLiteralIsPrefixOfIgnoreAsciiCaseString(nsHtml5TreeBuilder::QUIRKY_PUBLIC_IDS[i], publicIdentifier)) {
+      if (nsHtml5Portability::lowerCaseLiteralIsPrefixOfIgnoreAsciiCaseString(
+            nsHtml5TreeBuilder::QUIRKY_PUBLIC_IDS[i], publicIdentifier)) {
         return true;
       }
     }
-    if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("-//w3o//dtd w3 html strict 3.0//en//", publicIdentifier) || nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("-/w3c/dtd html 4.0 transitional/en", publicIdentifier) || nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("html", publicIdentifier)) {
+    if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+          "-//w3o//dtd w3 html strict 3.0//en//", publicIdentifier) ||
+        nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+          "-/w3c/dtd html 4.0 transitional/en", publicIdentifier) ||
+        nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+          "html", publicIdentifier)) {
       return true;
     }
   }
   if (!systemIdentifier) {
-    if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("-//w3c//dtd html 4.01 transitional//en", publicIdentifier)) {
+    if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+          "-//w3c//dtd html 4.01 transitional//en", publicIdentifier)) {
       return true;
-    } else if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("-//w3c//dtd html 4.01 frameset//en", publicIdentifier)) {
+    } else if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+                 "-//w3c//dtd html 4.01 frameset//en", publicIdentifier)) {
       return true;
     }
-  } else if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd", systemIdentifier)) {
+  } else if (nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+               "http://www.ibm.com/data/dtd/v11/ibmxhtml1-transitional.dtd",
+               systemIdentifier)) {
     return true;
   }
   return false;
 }
 
-void 
+void
 nsHtml5TreeBuilder::closeTheCell(int32_t eltPos)
 {
   generateImpliedEndTags();
   if (!!MOZ_UNLIKELY(mViewSource) && eltPos != currentPtr) {
     errUnclosedElementsCell(eltPos);
   }
   while (currentPtr >= eltPos) {
     pop();
   }
   clearTheListOfActiveFormattingElementsUpToTheLastMarker();
   mode = IN_ROW;
   return;
 }
 
-int32_t 
+int32_t
 nsHtml5TreeBuilder::findLastInTableScopeTdTh()
 {
   for (int32_t i = currentPtr; i > 0; i--) {
     nsAtom* name = stack[i]->name;
     if (stack[i]->ns == kNameSpaceID_XHTML) {
       if (nsGkAtoms::td == name || nsGkAtoms::th == name) {
         return i;
       } else if (name == nsGkAtoms::table || name == nsGkAtoms::_template) {
         return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
       }
     }
   }
   return nsHtml5TreeBuilder::NOT_FOUND_ON_STACK;
 }
 
-void 
+void
 nsHtml5TreeBuilder::clearStackBackTo(int32_t eltPos)
 {
   int32_t eltGroup = stack[eltPos]->getGroup();
   while (currentPtr > eltPos) {
     if (stack[currentPtr]->ns == kNameSpaceID_XHTML &&
         stack[currentPtr]->getGroup() == TEMPLATE &&
         (eltGroup == TABLE || eltGroup == TBODY_OR_THEAD_OR_TFOOT ||
          eltGroup == TR || !eltPos)) {
       return;
     }
     pop();
   }
 }
 
-void 
+void
 nsHtml5TreeBuilder::resetTheInsertionMode()
 {
   nsHtml5StackNode* node;
   nsAtom* name;
   int32_t ns;
   for (int32_t i = currentPtr; i >= 0; i--) {
     node = stack[i];
     name = node->name;
@@ -3465,123 +3595,131 @@ nsHtml5TreeBuilder::resetTheInsertionMod
       return;
     } else if (!i) {
       mode = framesetOk ? FRAMESET_OK : IN_BODY;
       return;
     }
   }
 }
 
-void 
+void
 nsHtml5TreeBuilder::implicitlyCloseP()
 {
   int32_t eltPos = findLastInButtonScope(nsGkAtoms::p);
   if (eltPos == nsHtml5TreeBuilder::NOT_FOUND_ON_STACK) {
     return;
   }
   generateImpliedEndTagsExceptFor(nsGkAtoms::p);
   if (!!MOZ_UNLIKELY(mViewSource) && eltPos != currentPtr) {
     errUnclosedElementsImplied(eltPos, nsGkAtoms::p);
   }
   while (currentPtr >= eltPos) {
     pop();
   }
 }
 
-bool 
+bool
 nsHtml5TreeBuilder::debugOnlyClearLastStackSlot()
 {
   stack[currentPtr] = nullptr;
   return true;
 }
 
-bool 
+bool
 nsHtml5TreeBuilder::debugOnlyClearLastListSlot()
 {
   listOfActiveFormattingElements[listPtr] = nullptr;
   return true;
 }
 
-void 
+void
 nsHtml5TreeBuilder::pushTemplateMode(int32_t mode)
 {
   templateModePtr++;
   if (templateModePtr == templateModeStack.length) {
-    jArray<int32_t,int32_t> newStack = jArray<int32_t,int32_t>::newJArray(templateModeStack.length + 64);
-    nsHtml5ArrayCopy::arraycopy(templateModeStack, newStack, templateModeStack.length);
+    jArray<int32_t, int32_t> newStack =
+      jArray<int32_t, int32_t>::newJArray(templateModeStack.length + 64);
+    nsHtml5ArrayCopy::arraycopy(
+      templateModeStack, newStack, templateModeStack.length);
     templateModeStack = newStack;
   }
   templateModeStack[templateModePtr] = mode;
 }
 
-void 
+void
 nsHtml5TreeBuilder::push(nsHtml5StackNode* node)
 {
   currentPtr++;
   if (currentPtr == stack.length) {
-    jArray<nsHtml5StackNode*,int32_t> newStack = jArray<nsHtml5StackNode*,int32_t>::newJArray(stack.length + 64);
+    jArray<nsHtml5StackNode*, int32_t> newStack =
+      jArray<nsHtml5StackNode*, int32_t>::newJArray(stack.length + 64);
     nsHtml5ArrayCopy::arraycopy(stack, newStack, stack.length);
     stack = newStack;
   }
   stack[currentPtr] = node;
   elementPushed(node->ns, node->popName, node->node);
 }
 
-void 
+void
 nsHtml5TreeBuilder::silentPush(nsHtml5StackNode* node)
 {
   currentPtr++;
   if (currentPtr == stack.length) {
-    jArray<nsHtml5StackNode*,int32_t> newStack = jArray<nsHtml5StackNode*,int32_t>::newJArray(stack.length + 64);
+    jArray<nsHtml5StackNode*, int32_t> newStack =
+      jArray<nsHtml5StackNode*, int32_t>::newJArray(stack.length + 64);
     nsHtml5ArrayCopy::arraycopy(stack, newStack, stack.length);
     stack = newStack;
   }
   stack[currentPtr] = node;
 }
 
-void 
+void
 nsHtml5TreeBuilder::append(nsHtml5StackNode* node)
 {
   listPtr++;
   if (listPtr == listOfActiveFormattingElements.length) {
-    jArray<nsHtml5StackNode*,int32_t> newList = jArray<nsHtml5StackNode*,int32_t>::newJArray(listOfActiveFormattingElements.length + 64);
-    nsHtml5ArrayCopy::arraycopy(listOfActiveFormattingElements, newList, listOfActiveFormattingElements.length);
+    jArray<nsHtml5StackNode*, int32_t> newList =
+      jArray<nsHtml5StackNode*, int32_t>::newJArray(
+        listOfActiveFormattingElements.length + 64);
+    nsHtml5ArrayCopy::arraycopy(listOfActiveFormattingElements,
+                                newList,
+                                listOfActiveFormattingElements.length);
     listOfActiveFormattingElements = newList;
   }
   listOfActiveFormattingElements[listPtr] = node;
 }
 
-void 
+void
 nsHtml5TreeBuilder::clearTheListOfActiveFormattingElementsUpToTheLastMarker()
 {
   while (listPtr > -1) {
     if (!listOfActiveFormattingElements[listPtr]) {
       --listPtr;
       return;
     }
     listOfActiveFormattingElements[listPtr]->release(this);
     --listPtr;
   }
 }
 
-void 
+void
 nsHtml5TreeBuilder::removeFromStack(int32_t pos)
 {
   if (currentPtr == pos) {
     pop();
   } else {
 
     stack[pos]->release(this);
     nsHtml5ArrayCopy::arraycopy(stack, pos + 1, pos, currentPtr - pos);
     MOZ_ASSERT(debugOnlyClearLastStackSlot());
     currentPtr--;
   }
 }
 
-void 
+void
 nsHtml5TreeBuilder::removeFromStack(nsHtml5StackNode* node)
 {
   if (stack[currentPtr] == node) {
     pop();
   } else {
     int32_t pos = currentPtr - 1;
     while (pos >= 0 && stack[pos] != node) {
       pos--;
@@ -3591,55 +3729,60 @@ nsHtml5TreeBuilder::removeFromStack(nsHt
     }
 
     node->release(this);
     nsHtml5ArrayCopy::arraycopy(stack, pos + 1, pos, currentPtr - pos);
     currentPtr--;
   }
 }
 
-void 
+void
 nsHtml5TreeBuilder::removeFromListOfActiveFormattingElements(int32_t pos)
 {
   MOZ_ASSERT(!!listOfActiveFormattingElements[pos]);
   listOfActiveFormattingElements[pos]->release(this);
   if (pos == listPtr) {
     MOZ_ASSERT(debugOnlyClearLastListSlot());
     listPtr--;
     return;
   }
   MOZ_ASSERT(pos < listPtr);
-  nsHtml5ArrayCopy::arraycopy(listOfActiveFormattingElements, pos + 1, pos, listPtr - pos);
+  nsHtml5ArrayCopy::arraycopy(
+    listOfActiveFormattingElements, pos + 1, pos, listPtr - pos);
   MOZ_ASSERT(debugOnlyClearLastListSlot());
   listPtr--;
 }
 
-bool 
+bool
 nsHtml5TreeBuilder::adoptionAgencyEndTag(nsAtom* name)
 {
-  if (stack[currentPtr]->ns == kNameSpaceID_XHTML && stack[currentPtr]->name == name && findInListOfActiveFormattingElements(stack[currentPtr]) == -1) {
+  if (stack[currentPtr]->ns == kNameSpaceID_XHTML &&
+      stack[currentPtr]->name == name &&
+      findInListOfActiveFormattingElements(stack[currentPtr]) == -1) {
     pop();
     return true;
   }
   for (int32_t i = 0; i < 8; ++i) {
     int32_t formattingEltListPos = listPtr;
     while (formattingEltListPos > -1) {
-      nsHtml5StackNode* listNode = listOfActiveFormattingElements[formattingEltListPos];
+      nsHtml5StackNode* listNode =
+        listOfActiveFormattingElements[formattingEltListPos];
       if (!listNode) {
         formattingEltListPos = -1;
         break;
       } else if (listNode->name == name) {
         break;
       }
       formattingEltListPos--;
     }
     if (formattingEltListPos == -1) {
       return false;
     }
-    nsHtml5StackNode* formattingElt = listOfActiveFormattingElements[formattingEltListPos];
+    nsHtml5StackNode* formattingElt =
+      listOfActiveFormattingElements[formattingEltListPos];
     int32_t formattingEltStackPos = currentPtr;
     bool inScope = true;
     while (formattingEltStackPos > -1) {
       nsHtml5StackNode* node = stack[formattingEltStackPos];
       if (node == formattingElt) {
         break;
       } else if (node->isScoping()) {
         inScope = false;
@@ -3656,17 +3799,18 @@ nsHtml5TreeBuilder::adoptionAgencyEndTag
       return true;
     }
     if (formattingEltStackPos != currentPtr) {
       errEndTagViolatesNestingRules(name);
     }
     int32_t furthestBlockPos = formattingEltStackPos + 1;
     while (furthestBlockPos <= currentPtr) {
       nsHtml5StackNode* node = stack[furthestBlockPos];
-      MOZ_ASSERT(furthestBlockPos > 0, "How is formattingEltStackPos + 1 not > 0?");
+      MOZ_ASSERT(furthestBlockPos > 0,
+                 "How is formattingEltStackPos + 1 not > 0?");
       if (node->isSpecial()) {
         break;
       }
       furthestBlockPos++;
     }
     if (furthestBlockPos > currentPtr) {
       while (currentPtr >= formattingEltStackPos) {
         pop();
@@ -3675,17 +3819,17 @@ nsHtml5TreeBuilder::adoptionAgencyEndTag
       return true;
     }
     nsHtml5StackNode* commonAncestor = stack[formattingEltStackPos - 1];
     nsHtml5StackNode* furthestBlock = stack[furthestBlockPos];
     int32_t bookmark = formattingEltListPos;
     int32_t nodePos = furthestBlockPos;
     nsHtml5StackNode* lastNode = furthestBlock;
     int32_t j = 0;
-    for (; ; ) {
+    for (;;) {
       ++j;
       nodePos--;
       if (nodePos == formattingEltStackPos) {
         break;
       }
       nsHtml5StackNode* node = stack[nodePos];
       int32_t nodeListPos = findInListOfActiveFormattingElements(node);
       if (j > 3 && nodeListPos != -1) {
@@ -3764,69 +3908,79 @@ nsHtml5TreeBuilder::adoptionAgencyEndTag
     insertIntoListOfActiveFormattingElements(formattingClone, bookmark);
     MOZ_ASSERT(formattingEltStackPos < furthestBlockPos);
     removeFromStack(formattingEltStackPos);
     insertIntoStack(formattingClone, furthestBlockPos);
   }
   return true;
 }
 
-void 
+void
 nsHtml5TreeBuilder::insertIntoStack(nsHtml5StackNode* node, int32_t position)
 {
   MOZ_ASSERT(currentPtr + 1 < stack.length);
   MOZ_ASSERT(position <= currentPtr + 1);
   if (position == currentPtr + 1) {
     push(node);
   } else {
-    nsHtml5ArrayCopy::arraycopy(stack, position, position + 1, (currentPtr - position) + 1);
+    nsHtml5ArrayCopy::arraycopy(
+      stack, position, position + 1, (currentPtr - position) + 1);
     currentPtr++;
     stack[position] = node;
   }
 }
 
-void 
-nsHtml5TreeBuilder::insertIntoListOfActiveFormattingElements(nsHtml5StackNode* formattingClone, int32_t bookmark)
+void
+nsHtml5TreeBuilder::insertIntoListOfActiveFormattingElements(
+  nsHtml5StackNode* formattingClone,
+  int32_t bookmark)
 {
   formattingClone->retain();
   MOZ_ASSERT(listPtr + 1 < listOfActiveFormattingElements.length);
   if (bookmark <= listPtr) {
-    nsHtml5ArrayCopy::arraycopy(listOfActiveFormattingElements, bookmark, bookmark + 1, (listPtr - bookmark) + 1);
+    nsHtml5ArrayCopy::arraycopy(listOfActiveFormattingElements,
+                                bookmark,
+                                bookmark + 1,
+                                (listPtr - bookmark) + 1);
   }
   listPtr++;
   listOfActiveFormattingElements[bookmark] = formattingClone;
 }
 
-int32_t 
+int32_t
 nsHtml5TreeBuilder::findInListOfActiveFormattingElements(nsHtml5StackNode* node)
 {
   for (int32_t i = listPtr; i >= 0; i--) {
     if (node == listOfActiveFormattingElements[i]) {
       return i;
     }
   }
   return -1;
 }
 
-int32_t 
-nsHtml5TreeBuilder::findInListOfActiveFormattingElementsContainsBetweenEndAndLastMarker(nsAtom* name)
+int32_t
+nsHtml5TreeBuilder::
+  findInListOfActiveFormattingElementsContainsBetweenEndAndLastMarker(
+    nsAtom* name)
 {
   for (int32_t i = listPtr; i >= 0; i--) {
     nsHtml5StackNode* node = listOfActiveFormattingElements[i];
     if (!node) {
       return -1;
     } else if (node->name == name) {
       return i;
     }
   }
   return -1;
 }
 
-void 
-nsHtml5TreeBuilder::maybeForgetEarlierDuplicateFormattingElement(nsAtom* name, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::maybeForgetEarlierDuplicateFormattingElement(
+  nsAtom* name,
+  nsHtml5HtmlAttributes* attributes)
 {
   int32_t candidate = -1;
   int32_t count = 0;
   for (int32_t i = listPtr; i >= 0; i--) {
     nsHtml5StackNode* node = listOfActiveFormattingElements[i];
     if (!node) {
       break;
     }
@@ -3835,78 +3989,78 @@ nsHtml5TreeBuilder::maybeForgetEarlierDu
       ++count;
     }
   }
   if (count >= 3) {
     removeFromListOfActiveFormattingElements(candidate);
   }
 }
 
-int32_t 
+int32_t
 nsHtml5TreeBuilder::findLastOrRoot(nsAtom* name)
 {
   for (int32_t i = currentPtr; i > 0; i--) {
     if (stack[i]->ns == kNameSpaceID_XHTML && stack[i]->name == name) {
       return i;
     }
   }
   return 0;
 }
 
-int32_t 
+int32_t
 nsHtml5TreeBuilder::findLastOrRoot(int32_t group)
 {
   for (int32_t i = currentPtr; i > 0; i--) {
     if (stack[i]->getGroup() == group) {
       return i;
     }
   }
   return 0;
 }
 
-bool 
+bool
 nsHtml5TreeBuilder::addAttributesToBody(nsHtml5HtmlAttributes* attributes)
 {
   if (currentPtr >= 1) {
     nsHtml5StackNode* body = stack[1];
     if (body->getGroup() == nsHtml5TreeBuilder::BODY) {
       addAttributesToElement(body->node, attributes);
       return true;
     }
   }
   return false;
 }
 
-void 
+void
 nsHtml5TreeBuilder::addAttributesToHtml(nsHtml5HtmlAttributes* attributes)
 {
   addAttributesToElement(stack[0]->node, attributes);
 }
 
-void 
+void
 nsHtml5TreeBuilder::pushHeadPointerOntoStack()
 {
   MOZ_ASSERT(!!headPointer);
   MOZ_ASSERT(mode == AFTER_HEAD);
 
   silentPush(createStackNode(nsHtml5ElementName::ELT_HEAD, headPointer));
 }
 
-void 
+void
 nsHtml5TreeBuilder::reconstructTheActiveFormattingElements()
 {
   if (listPtr == -1) {
     return;
   }
   nsHtml5StackNode* mostRecent = listOfActiveFormattingElements[listPtr];
   if (!mostRecent || isInStack(mostRecent)) {
     return;
   }
   int32_t entryPos = listPtr;
-  for (; ; ) {
+  for (;;) {
     entryPos--;
     if (entryPos == -1) {
       break;
     }
     if (!listOfActiveFormattingElements[entryPos]) {
       break;
     }
     if (isInStack(listOfActiveFormattingElements[entryPos])) {
@@ -4083,106 +4237,110 @@ nsHtml5TreeBuilder::createAndInsertFoste
     appendElement(child, stack[templatePos]->node);
     return child;
   }
   nsHtml5StackNode* node = stack[tablePos];
   return createAndInsertFosterParentedElement(
     ns, name, attributes, form, node->node, stack[tablePos - 1]->node, creator);
 }
 
-bool 
+bool
 nsHtml5TreeBuilder::isInStack(nsHtml5StackNode* node)
 {
   for (int32_t i = currentPtr; i >= 0; i--) {
     if (stack[i] == node) {
       return true;
     }
   }
   return false;
 }
 
-void 
+void
 nsHtml5TreeBuilder::popTemplateMode()
 {
   templateModePtr--;
 }
 
-void 
+void
 nsHtml5TreeBuilder::pop()
 {
   nsHtml5StackNode* node = stack[currentPtr];
   MOZ_ASSERT(debugOnlyClearLastStackSlot());
   currentPtr--;
   elementPopped(node->ns, node->popName, node->node);
   node->release(this);
 }
 
-void 
+void
 nsHtml5TreeBuilder::silentPop()
 {
   nsHtml5StackNode* node = stack[currentPtr];
   MOZ_ASSERT(debugOnlyClearLastStackSlot());
   currentPtr--;
   node->release(this);
 }
 
-void 
+void
 nsHtml5TreeBuilder::popOnEof()
 {
   nsHtml5StackNode* node = stack[currentPtr];
   MOZ_ASSERT(debugOnlyClearLastStackSlot());
   currentPtr--;
   markMalformedIfScript(node->node);
   elementPopped(node->ns, node->popName, node->node);
   node->release(this);
 }
 
-void 
-nsHtml5TreeBuilder::appendHtmlElementToDocumentAndPush(nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendHtmlElementToDocumentAndPush(
+  nsHtml5HtmlAttributes* attributes)
 {
   nsIContentHandle* elt = createHtmlElementSetAsRoot(attributes);
   nsHtml5StackNode* node = createStackNode(nsHtml5ElementName::ELT_HTML, elt);
   push(node);
 }
 
-void 
+void
 nsHtml5TreeBuilder::appendHtmlElementToDocumentAndPush()
 {
   appendHtmlElementToDocumentAndPush(tokenizer->emptyAttributes());
 }
 
-void 
-nsHtml5TreeBuilder::appendToCurrentNodeAndPushHeadElement(nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendToCurrentNodeAndPushHeadElement(
+  nsHtml5HtmlAttributes* attributes)
 {
   nsIContentHandle* currentNode = stack[currentPtr]->node;
   nsIContentHandle* elt = createElement(kNameSpaceID_XHTML,
                                         nsGkAtoms::head,
                                         attributes,
                                         currentNode,
                                         htmlCreator(NS_NewHTMLSharedElement));
   appendElement(elt, currentNode);
   headPointer = elt;
   nsHtml5StackNode* node = createStackNode(nsHtml5ElementName::ELT_HEAD, elt);
   push(node);
 }
 
-void 
-nsHtml5TreeBuilder::appendToCurrentNodeAndPushBodyElement(nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendToCurrentNodeAndPushBodyElement(
+  nsHtml5HtmlAttributes* attributes)
 {
   appendToCurrentNodeAndPushElement(nsHtml5ElementName::ELT_BODY, attributes);
 }
 
-void 
+void
 nsHtml5TreeBuilder::appendToCurrentNodeAndPushBodyElement()
 {
   appendToCurrentNodeAndPushBodyElement(tokenizer->emptyAttributes());
 }
 
-void 
-nsHtml5TreeBuilder::appendToCurrentNodeAndPushFormElementMayFoster(nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendToCurrentNodeAndPushFormElementMayFoster(
+  nsHtml5HtmlAttributes* attributes)
 {
   nsIContentHandle* elt;
   nsHtml5StackNode* current = stack[currentPtr];
   if (current->isFosterParenting()) {
 
     elt =
       createAndInsertFosterParentedElement(kNameSpaceID_XHTML,
                                            nsGkAtoms::form,
@@ -4198,18 +4356,20 @@ nsHtml5TreeBuilder::appendToCurrentNodeA
   }
   if (!isTemplateContents()) {
     formPointer = elt;
   }
   nsHtml5StackNode* node = createStackNode(nsHtml5ElementName::ELT_FORM, elt);
   push(node);
 }
 
-void 
-nsHtml5TreeBuilder::appendToCurrentNodeAndPushFormattingElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendToCurrentNodeAndPushFormattingElementMayFoster(
+  nsHtml5ElementName* elementName,
+  nsHtml5HtmlAttributes* attributes)
 {
   nsHtml5HtmlAttributes* clone = attributes->cloneAttributes(nullptr);
   nsIContentHandle* elt;
   nsHtml5StackNode* current = stack[currentPtr];
   if (current->isFosterParenting()) {
 
     elt = createAndInsertFosterParentedElement(
       kNameSpaceID_XHTML,
@@ -4225,36 +4385,40 @@ nsHtml5TreeBuilder::appendToCurrentNodeA
     appendElement(elt, current->node);
   }
   nsHtml5StackNode* node = createStackNode(elementName, elt, clone);
   push(node);
   append(node);
   node->retain();
 }
 
-void 
-nsHtml5TreeBuilder::appendToCurrentNodeAndPushElement(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendToCurrentNodeAndPushElement(
+  nsHtml5ElementName* elementName,
+  nsHtml5HtmlAttributes* attributes)
 {
   nsIContentHandle* currentNode = stack[currentPtr]->node;
   nsIContentHandle* elt =
     createElement(kNameSpaceID_XHTML,
                   elementName->getName(),
                   attributes,
                   currentNode,
                   htmlCreator(elementName->getHtmlCreator()));
   appendElement(elt, currentNode);
   if (nsHtml5ElementName::ELT_TEMPLATE == elementName) {
     elt = getDocumentFragmentForTemplate(elt);
   }
   nsHtml5StackNode* node = createStackNode(elementName, elt);
   push(node);
 }
 
-void 
-nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(
+  nsHtml5ElementName* elementName,
+  nsHtml5HtmlAttributes* attributes)
 {
   nsAtom* popName = elementName->getName();
   nsIContentHandle* elt;
   nsHtml5StackNode* current = stack[currentPtr];
   if (current->isFosterParenting()) {
 
     elt = createAndInsertFosterParentedElement(
       kNameSpaceID_XHTML,
@@ -4268,22 +4432,25 @@ nsHtml5TreeBuilder::appendToCurrentNodeA
                         current->node,
                         htmlCreator(elementName->getHtmlCreator()));
     appendElement(elt, current->node);
   }
   nsHtml5StackNode* node = createStackNode(elementName, elt, popName);
   push(node);
 }
 
-void 
-nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterMathML(
+  nsHtml5ElementName* elementName,
+  nsHtml5HtmlAttributes* attributes)
 {
   nsAtom* popName = elementName->getName();
   bool markAsHtmlIntegrationPoint = false;
-  if (nsHtml5ElementName::ELT_ANNOTATION_XML == elementName && annotationXmlEncodingPermitsHtml(attributes)) {
+  if (nsHtml5ElementName::ELT_ANNOTATION_XML == elementName &&
+      annotationXmlEncodingPermitsHtml(attributes)) {
     markAsHtmlIntegrationPoint = true;
   }
   nsIContentHandle* elt;
   nsHtml5StackNode* current = stack[currentPtr];
   if (current->isFosterParenting()) {
 
     elt = createAndInsertFosterParentedElement(
       kNameSpaceID_MathML, popName, attributes, htmlCreator(nullptr));
@@ -4295,29 +4462,35 @@ nsHtml5TreeBuilder::appendToCurrentNodeA
                         htmlCreator(nullptr));
     appendElement(elt, current->node);
   }
   nsHtml5StackNode* node =
     createStackNode(elementName, elt, popName, markAsHtmlIntegrationPoint);
   push(node);
 }
 
-bool 
-nsHtml5TreeBuilder::annotationXmlEncodingPermitsHtml(nsHtml5HtmlAttributes* attributes)
+bool
+nsHtml5TreeBuilder::annotationXmlEncodingPermitsHtml(
+  nsHtml5HtmlAttributes* attributes)
 {
   nsHtml5String encoding =
     attributes->getValue(nsHtml5AttributeName::ATTR_ENCODING);
   if (!encoding) {
     return false;
   }
-  return nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("application/xhtml+xml", encoding) || nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString("text/html", encoding);
+  return nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+           "application/xhtml+xml", encoding) ||
+         nsHtml5Portability::lowerCaseLiteralEqualsIgnoreAsciiCaseString(
+           "text/html", encoding);
 }
 
-void 
-nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFosterSVG(
+  nsHtml5ElementName* elementName,
+  nsHtml5HtmlAttributes* attributes)
 {
   nsAtom* popName = elementName->getCamelCaseName();
   nsIContentHandle* elt;
   nsHtml5StackNode* current = stack[currentPtr];
   if (current->isFosterParenting()) {
 
     elt = createAndInsertFosterParentedElement(
       kNameSpaceID_SVG,
@@ -4331,21 +4504,25 @@ nsHtml5TreeBuilder::appendToCurrentNodeA
                         current->node,
                         svgCreator(elementName->getSvgCreator()));
     appendElement(elt, current->node);
   }
   nsHtml5StackNode* node = createStackNode(elementName, popName, elt);
   push(node);
 }
 
-void 
-nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes, nsIContentHandle* form)
+void
+nsHtml5TreeBuilder::appendToCurrentNodeAndPushElementMayFoster(
+  nsHtml5ElementName* elementName,
+  nsHtml5HtmlAttributes* attributes,
+  nsIContentHandle* form)
 {
   nsIContentHandle* elt;
-  nsIContentHandle* formOwner = !form || fragment || isTemplateContents() ? nullptr : form;
+  nsIContentHandle* formOwner =
+    !form || fragment || isTemplateContents() ? nullptr : form;
   nsHtml5StackNode* current = stack[currentPtr];
   if (current->isFosterParenting()) {
 
     elt = createAndInsertFosterParentedElement(
       kNameSpaceID_XHTML,
       elementName->getName(),
       attributes,
       formOwner,
@@ -4366,17 +4543,18 @@ nsHtml5TreeBuilder::appendToCurrentNodeA
 void
 nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(
   nsHtml5ElementName* elementName,
   nsHtml5HtmlAttributes* attributes,
   nsIContentHandle* form)
 {
   nsAtom* name = elementName->getName();
   nsIContentHandle* elt;
-  nsIContentHandle* formOwner = !form || fragment || isTemplateContents() ? nullptr : form;
+  nsIContentHandle* formOwner =
+    !form || fragment || isTemplateContents() ? nullptr : form;
   nsHtml5StackNode* current = stack[currentPtr];
   if (current->isFosterParenting()) {
 
     elt = createAndInsertFosterParentedElement(
       kNameSpaceID_XHTML,
       name,
       attributes,
       formOwner,
@@ -4389,18 +4567,20 @@ nsHtml5TreeBuilder::appendVoidElementToC
                         current->node,
                         htmlCreator(elementName->getHtmlCreator()));
     appendElement(elt, current->node);
   }
   elementPushed(kNameSpaceID_XHTML, name, elt);
   elementPopped(kNameSpaceID_XHTML, name, elt);
 }
 
-void 
-nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendVoidElementToCurrentMayFoster(
+  nsHtml5ElementName* elementName,
+  nsHtml5HtmlAttributes* attributes)
 {
   nsAtom* popName = elementName->getName();
   nsIContentHandle* elt;
   nsHtml5StackNode* current = stack[currentPtr];
   if (current->isFosterParenting()) {
 
     elt = createAndInsertFosterParentedElement(
       kNameSpaceID_XHTML,
@@ -4414,18 +4594,20 @@ nsHtml5TreeBuilder::appendVoidElementToC
                         current->node,
                         htmlCreator(elementName->getHtmlCreator()));
     appendElement(elt, current->node);
   }
   elementPushed(kNameSpaceID_XHTML, popName, elt);
   elementPopped(kNameSpaceID_XHTML, popName, elt);
 }
 
-void 
-nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterSVG(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterSVG(
+  nsHtml5ElementName* elementName,
+  nsHtml5HtmlAttributes* attributes)
 {
   nsAtom* popName = elementName->getCamelCaseName();
   nsIContentHandle* elt;
   nsHtml5StackNode* current = stack[currentPtr];
   if (current->isFosterParenting()) {
 
     elt = createAndInsertFosterParentedElement(
       kNameSpaceID_SVG,
@@ -4439,18 +4621,20 @@ nsHtml5TreeBuilder::appendVoidElementToC
                         current->node,
                         svgCreator(elementName->getSvgCreator()));
     appendElement(elt, current->node);
   }
   elementPushed(kNameSpaceID_SVG, popName, elt);
   elementPopped(kNameSpaceID_SVG, popName, elt);
 }
 
-void 
-nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterMathML(nsHtml5ElementName* elementName, nsHtml5HtmlAttributes* attributes)
+void
+nsHtml5TreeBuilder::appendVoidElementToCurrentMayFosterMathML(
+  nsHtml5ElementName* elementName,
+  nsHtml5HtmlAttributes* attributes)
 {
   nsAtom* popName = elementName->getName();
   nsIContentHandle* elt;
   nsHtml5StackNode* current = stack[currentPtr];
   if (current->isFosterParenting()) {
 
     elt = createAndInsertFosterParentedElement(
       kNameSpaceID_MathML, popName, attributes, htmlCreator(nullptr));
@@ -4478,157 +4662,168 @@ nsHtml5TreeBuilder::appendVoidInputToCur
                   !form || fragment || isTemplateContents() ? nullptr : form,