Bug 1355779 - Skip interned nsHtml5ElementName lookup for Custom Elements (ones with hyphen). r=wchen
authorHenri Sivonen <hsivonen@hsivonen.fi>
Wed, 12 Apr 2017 14:28:49 +0300
changeset 401927 64a25d9841b0e9918fe1de0768b00e3696efc615
parent 401926 f3c0e8300aef4a0f701b0618b070383b865fb1e2
child 401928 5c5f3b4dd3f493ef565950eacafd05d682b2db68
push id7391
push usermtabara@mozilla.com
push dateMon, 12 Jun 2017 13:08:53 +0000
treeherdermozilla-beta@2191d7f87e2e [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerswchen
bugs1355779
milestone55.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 1355779 - Skip interned nsHtml5ElementName lookup for Custom Elements (ones with hyphen). r=wchen MozReview-Commit-ID: 4xQlhExyo7d
parser/html/javasrc/ElementName.java
parser/html/javasrc/Tokenizer.java
parser/html/nsHtml5ElementName.cpp
parser/html/nsHtml5ElementName.h
parser/html/nsHtml5Tokenizer.cpp
parser/html/nsHtml5Tokenizer.h
--- a/parser/html/javasrc/ElementName.java
+++ b/parser/html/javasrc/ElementName.java
@@ -185,16 +185,18 @@ public final class ElementName
     public void setNameForNonInterned(@Local String name) {
         // No need to worry about refcounting the local name, because in the
         // C++ case the scoped atom table remembers its own atoms.
         this.name = name;
         this.camelCaseName = name;
         assert this.flags == (TreeBuilder.OTHER | NOT_INTERNED);
     }
 
+    public static final ElementName ANNOTATION_XML = new ElementName("annotation-xml", "annotation-xml", TreeBuilder.ANNOTATION_XML | SCOPING_AS_MATHML);
+
     // START CODE ONLY USED FOR GENERATING CODE uncomment and run to regenerate
 
 //    /**
 //     * @see java.lang.Object#toString()
 //     */
 //    @Override public String toString() {
 //        return "(\"" + name + "\", \"" + camelCaseName + "\", " + decomposedFlags() + ")";
 //    }
@@ -223,16 +225,19 @@ public final class ElementName
 //        return buf.toString();
 //    }
 //
 //    private String constName() {
 //        char[] buf = new char[name.length()];
 //        for (int i = 0; i < name.length(); i++) {
 //            char c = name.charAt(i);
 //            if (c == '-') {
+//                if (!"annotation-xml".equals(name)) {
+//                    throw new RuntimeException("Non-annotation-xml element name with hyphen: " + name);
+//                }
 //                buf[i] = '_';
 //            } else if (c >= '0' && c <= '9') {
 //                buf[i] = c;
 //            } else {
 //                buf[i] = (char) (c - 0x20);
 //            }
 //        }
 //        return new String(buf);
@@ -542,17 +547,16 @@ public final class ElementName
     public static final ElementName LI = new ElementName("li", "li", TreeBuilder.LI | SPECIAL | OPTIONAL_END_TAG);
     public static final ElementName MI = new ElementName("mi", "mi", TreeBuilder.MI_MO_MN_MS_MTEXT | SCOPING_AS_MATHML);
     public static final ElementName LINK = new ElementName("link", "link", TreeBuilder.LINK_OR_BASEFONT_OR_BGSOUND | SPECIAL);
     public static final ElementName MARK = new ElementName("mark", "mark", TreeBuilder.OTHER);
     public static final ElementName MALIGNMARK = new ElementName("malignmark", "malignmark", TreeBuilder.MGLYPH_OR_MALIGNMARK);
     public static final ElementName MASK = new ElementName("mask", "mask", TreeBuilder.OTHER);
     public static final ElementName TRACK = new ElementName("track", "track", TreeBuilder.PARAM_OR_SOURCE_OR_TRACK | SPECIAL);
     public static final ElementName DL = new ElementName("dl", "dl", TreeBuilder.UL_OR_OL_OR_DL | SPECIAL);
-    public static final ElementName ANNOTATION_XML = new ElementName("annotation-xml", "annotation-xml", TreeBuilder.ANNOTATION_XML | SCOPING_AS_MATHML);
     public static final ElementName HTML = new ElementName("html", "html", TreeBuilder.HTML | SPECIAL | SCOPING | OPTIONAL_END_TAG);
     public static final ElementName OL = new ElementName("ol", "ol", TreeBuilder.UL_OR_OL_OR_DL | SPECIAL);
     public static final ElementName LABEL = new ElementName("label", "label", TreeBuilder.OTHER);
     public static final ElementName UL = new ElementName("ul", "ul", TreeBuilder.UL_OR_OL_OR_DL | SPECIAL);
     public static final ElementName SMALL = new ElementName("small", "small", TreeBuilder.B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U);
     public static final ElementName SYMBOL = new ElementName("symbol", "symbol", TreeBuilder.OTHER);
     public static final ElementName ALTGLYPHITEM = new ElementName("altglyphitem", "altGlyphItem", TreeBuilder.OTHER);
     public static final ElementName ANIMATETRANSFORM = new ElementName("animatetransform", "animateTransform", TreeBuilder.OTHER);
@@ -748,17 +752,16 @@ public final class ElementName
     LI,
     MI,
     LINK,
     MARK,
     MALIGNMARK,
     MASK,
     TRACK,
     DL,
-    ANNOTATION_XML,
     HTML,
     OL,
     LABEL,
     UL,
     SMALL,
     SYMBOL,
     ALTGLYPHITEM,
     ANIMATETRANSFORM,
@@ -955,17 +958,16 @@ public final class ElementName
     1818230786,
     1818755074,
     1853642948,
     1854228692,
     1854228698,
     1854245076,
     1857653029,
     1864368130,
-    1864643294,
     1868312196,
     1870135298,
     1870268949,
     1873281026,
     1874053333,
     1874102998,
     1881288348,
     1881498736,
--- a/parser/html/javasrc/Tokenizer.java
+++ b/parser/html/javasrc/Tokenizer.java
@@ -410,16 +410,22 @@ public class Tokenizer implements Locato
     private char[] endTagExpectationAsArray; // not @Auto!
 
     /**
      * <code>true</code> if tokenizing an end tag
      */
     protected boolean endTag;
 
     /**
+     * <code>true</code> iff the current element/attribute name contains
+     * a hyphen.
+     */
+    private boolean containsHyphen;
+
+    /**
      * The current tag token name. One of
      * 1) null,
      * 2) non-owning reference to nonInternedTagName
      * 3) non-owning reference to a pre-interned ElementName
      */
     private ElementName tagName = null;
 
     /**
@@ -520,16 +526,17 @@ public class Tokenizer implements Locato
         this.tokenHandler = tokenHandler;
         this.encodingDeclarationHandler = null;
         this.newAttributesEachTime = newAttributesEachTime;
         // &CounterClockwiseContourIntegral; is the longest valid char ref and
         // the semicolon never gets appended to the buffer.
         this.charRefBuf = new char[32];
         this.bmpChar = new char[1];
         this.astralChar = new char[2];
+        this.containsHyphen = false;
         this.tagName = null;
         this.nonInternedTagName = new ElementName();
         this.attributeName = null;
         this.doctypeName = null;
         this.publicIdentifier = null;
         this.systemIdentifier = null;
         this.attributes = null;
     }
@@ -550,16 +557,17 @@ public class Tokenizer implements Locato
         // [NOCPP[
         this.newAttributesEachTime = false;
         // ]NOCPP]
         // &CounterClockwiseContourIntegral; is the longest valid char ref and
         // the semicolon never gets appended to the buffer.
         this.charRefBuf = new char[32];
         this.bmpChar = new char[1];
         this.astralChar = new char[2];
+        this.containsHyphen = false;
         this.tagName = null;
         this.nonInternedTagName = new ElementName();
         this.attributeName = null;
         this.doctypeName = null;
         this.publicIdentifier = null;
         this.systemIdentifier = null;
         // [NOCPP[
         this.attributes = null;
@@ -1096,23 +1104,36 @@ public class Tokenizer implements Locato
         if (errorHandler == null) {
             return;
         }
         SAXParseException spe = new SAXParseException(message, this);
         errorHandler.warning(spe);
     }
 
     private void strBufToElementNameString() {
-        tagName = ElementName.elementNameByBuffer(strBuf, 0, strBufLen,
-                interner);
-        if (tagName == null) {
-            nonInternedTagName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, 0, strBufLen,
-                interner));
-            tagName = nonInternedTagName;
+        if (containsHyphen) {
+            // We've got a custom element or annotation-xml.
+            @Local String annotationName = ElementName.ANNOTATION_XML.getName();
+            if (Portability.localEqualsBuffer(annotationName, strBuf, 0, strBufLen)) {
+                tagName = ElementName.ANNOTATION_XML;
+            } else {
+                nonInternedTagName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, 0, strBufLen,
+                        interner));
+                tagName = nonInternedTagName;
+            }
+        } else {
+            tagName = ElementName.elementNameByBuffer(strBuf, 0, strBufLen,
+                    interner);
+            if (tagName == null) {
+                nonInternedTagName.setNameForNonInterned(Portability.newLocalNameFromBuffer(strBuf, 0, strBufLen,
+                    interner));
+                tagName = nonInternedTagName;
+            }
         }
+        containsHyphen = false;
         clearStrBufAfterUse();
     }
 
     private int emitCurrentTagToken(boolean selfClosing, int pos)
             throws SAXException {
         cstart = pos + 1;
         maybeErrSlashInEndTag(selfClosing);
         stateSave = Tokenizer.DATA;
@@ -1553,16 +1574,17 @@ public class Tokenizer implements Locato
                             endTag = false;
                             /*
                              * set its tag name to the lowercase version of the
                              * input character (add 0x0020 to the character's
                              * code point),
                              */
                             clearStrBufBeforeUse();
                             appendStrBuf((char) (c + 0x20));
+                            containsHyphen = false;
                             /* then switch to the tag name state. */
                             state = transition(state, Tokenizer.TAG_NAME, reconsume, pos);
                             /*
                              * (Don't emit the token yet; further details will
                              * be filled in before it is emitted.)
                              */
                             break tagopenloop;
                             // continue stateloop;
@@ -1573,16 +1595,17 @@ public class Tokenizer implements Locato
                              * token,
                              */
                             endTag = false;
                             /*
                              * set its tag name to the input character,
                              */
                             clearStrBufBeforeUse();
                             appendStrBuf(c);
+                            containsHyphen = false;
                             /* then switch to the tag name state. */
                             state = transition(state, Tokenizer.TAG_NAME, reconsume, pos);
                             /*
                              * (Don't emit the token yet; further details will
                              * be filled in before it is emitted.)
                              */
                             break tagopenloop;
                             // continue stateloop;
@@ -1716,16 +1739,18 @@ public class Tokenizer implements Locato
                                      * U+0041 LATIN CAPITAL LETTER A through to
                                      * U+005A LATIN CAPITAL LETTER Z Append the
                                      * lowercase version of the current input
                                      * character (add 0x0020 to the character's
                                      * code point) to the current tag token's
                                      * tag name.
                                      */
                                     c += 0x20;
+                                } else if (c == '-') {
+                                    containsHyphen = true;
                                 }
                                 /*
                                  * Anything else Append the current input
                                  * character to the current tag token's tag
                                  * name.
                                  */
                                 appendStrBuf(c);
                                 /*
@@ -3617,16 +3642,17 @@ public class Tokenizer implements Locato
                                  * token,
                                  */
                                 endTag = true;
                                 /*
                                  * set its tag name to the input character,
                                  */
                                 clearStrBufBeforeUse();
                                 appendStrBuf(c);
+                                containsHyphen = false;
                                 /*
                                  * then switch to the tag name state. (Don't
                                  * emit the token yet; further details will be
                                  * filled in before it is emitted.)
                                  */
                                 state = transition(state, Tokenizer.TAG_NAME, reconsume, pos);
                                 continue stateloop;
                             } else {
@@ -6729,16 +6755,17 @@ public class Tokenizer implements Locato
         hi = 0; // will always be overwritten before use anyway
         candidate = -1;
         charRefBufMark = 0;
         value = 0;
         seenDigits = false;
         endTag = false;
         shouldSuspend = false;
         initDoctypeFields();
+        containsHyphen = false;
         if (tagName != null) {
             tagName = null;
         }
         if (attributeName != null) {
             attributeName.release();
             attributeName = null;
         }
         if (newAttributesEachTime) {
@@ -6795,16 +6822,17 @@ public class Tokenizer implements Locato
 
         Portability.releaseString(publicIdentifier);
         if (other.publicIdentifier == null) {
             publicIdentifier = null;
         } else {
             publicIdentifier = Portability.newStringFromString(other.publicIdentifier);
         }
 
+        containsHyphen = other.containsHyphen;
         if (other.tagName == null) {
             tagName = null;
         } else if (other.tagName.isInterned()) {
             tagName = other.tagName;
         } else {
             // In the C++ case, We might be loading state from another
             // tokenizer that has atoms from a different tokenizer-scoped
             // atom table. Therefore, we have to obtain the correspoding
--- a/parser/html/nsHtml5ElementName.cpp
+++ b/parser/html/nsHtml5ElementName.cpp
@@ -110,16 +110,17 @@ void
 nsHtml5ElementName::setNameForNonInterned(nsIAtom* name)
 {
   this->name = name;
   this->camelCaseName = name;
   MOZ_ASSERT(this->flags ==
              (NS_HTML5TREE_BUILDER_OTHER | NS_HTML5ELEMENT_NAME_NOT_INTERNED));
 }
 
+nsHtml5ElementName* nsHtml5ElementName::ELT_ANNOTATION_XML = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_BIG = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_BDO = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_COL = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_DEL = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_DFN = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_DIR = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_DIV = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_IMG = nullptr;
@@ -219,17 +220,16 @@ nsHtml5ElementName* nsHtml5ElementName::
 nsHtml5ElementName* nsHtml5ElementName::ELT_LI = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_MI = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_LINK = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_MARK = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_MALIGNMARK = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_MASK = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_TRACK = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_DL = nullptr;
-nsHtml5ElementName* nsHtml5ElementName::ELT_ANNOTATION_XML = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_HTML = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_OL = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_LABEL = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_UL = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_SMALL = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_SYMBOL = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_ALTGLYPHITEM = nullptr;
 nsHtml5ElementName* nsHtml5ElementName::ELT_ANIMATETRANSFORM = nullptr;
@@ -335,38 +335,42 @@ static int32_t const ELEMENT_HASHES_DATA
   1748225318, 1748359220, 1749395095, 1749656156, 1749673195, 1749715159,
   1749723735, 1749801286, 1749813541, 1749905526, 1749932347, 1751288021,
   1751386406, 1752979652, 1753362711, 1755076808, 1755148615, 1756474198,
   1756600614, 1756625221, 1757137429, 1757146773, 1757157700, 1757268168,
   1763839627, 1766992520, 1782357526, 1783210839, 1783388497, 1783388498,
   1786534215, 1790207270, 1797585096, 1798686984, 1803876550, 1803929812,
   1803929861, 1805502724, 1805647874, 1806806678, 1807599880, 1818230786,
   1818755074, 1853642948, 1854228692, 1854228698, 1854245076, 1857653029,
-  1864368130, 1864643294, 1868312196, 1870135298, 1870268949, 1873281026,
-  1874053333, 1874102998, 1881288348, 1881498736, 1881613047, 1881669634,
-  1884120164, 1887579800, 1889085973, 1898223949, 1898753862, 1899272519,
-  1900845386, 1902641154, 1903302038, 1904412884, 1905563974, 1906087319,
-  1906135367, 1907435316, 1907661127, 1907959605, 1914900309, 1919418370,
-  1925844629, 1932928296, 1934172497, 1935549734, 1938817026, 1939219752,
-  1941178676, 1941221172, 1963982850, 1965115924, 1965334268, 1966223078,
-  1967128578, 1967760215, 1967788867, 1967795910, 1967795958, 1968053806,
-  1968836118, 1971461414, 1971465813, 1971938532, 1973420034, 1982173479,
-  1982935782, 1983533124, 1983633431, 1986527234, 1988763672, 1990037800,
-  1998585858, 1998724870, 1999397992, 2001309869, 2001349704, 2001349720,
-  2001349736, 2001392795, 2001392796, 2001392798, 2001495140, 2003183333,
-  2004635806, 2005324101, 2005719336, 2005925890, 2006028454, 2006329158,
-  2006896969, 2006974466, 2007601444, 2007781534, 2008125638, 2008340774,
-  2008851557, 2008994116, 2021937364, 2051837468, 2060065124, 2068523853,
-  2068523856, 2070023911, 2083120164, 2085266636, 2091479332, 2092255447,
-  2092557349
+  1864368130, 1868312196, 1870135298, 1870268949, 1873281026, 1874053333,
+  1874102998, 1881288348, 1881498736, 1881613047, 1881669634, 1884120164,
+  1887579800, 1889085973, 1898223949, 1898753862, 1899272519, 1900845386,
+  1902641154, 1903302038, 1904412884, 1905563974, 1906087319, 1906135367,
+  1907435316, 1907661127, 1907959605, 1914900309, 1919418370, 1925844629,
+  1932928296, 1934172497, 1935549734, 1938817026, 1939219752, 1941178676,
+  1941221172, 1963982850, 1965115924, 1965334268, 1966223078, 1967128578,
+  1967760215, 1967788867, 1967795910, 1967795958, 1968053806, 1968836118,
+  1971461414, 1971465813, 1971938532, 1973420034, 1982173479, 1982935782,
+  1983533124, 1983633431, 1986527234, 1988763672, 1990037800, 1998585858,
+  1998724870, 1999397992, 2001309869, 2001349704, 2001349720, 2001349736,
+  2001392795, 2001392796, 2001392798, 2001495140, 2003183333, 2004635806,
+  2005324101, 2005719336, 2005925890, 2006028454, 2006329158, 2006896969,
+  2006974466, 2007601444, 2007781534, 2008125638, 2008340774, 2008851557,
+  2008994116, 2021937364, 2051837468, 2060065124, 2068523853, 2068523856,
+  2070023911, 2083120164, 2085266636, 2091479332, 2092255447, 2092557349
 };
 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(nsHtml5Atoms::annotation_xml,
+                           nsHtml5Atoms::annotation_xml,
+                           NS_HTML5TREE_BUILDER_ANNOTATION_XML |
+                             NS_HTML5ELEMENT_NAME_SCOPING_AS_MATHML);
   ELT_BIG = new nsHtml5ElementName(nsHtml5Atoms::big, nsHtml5Atoms::big, NS_HTML5TREE_BUILDER_B_OR_BIG_OR_CODE_OR_EM_OR_I_OR_S_OR_SMALL_OR_STRIKE_OR_STRONG_OR_TT_OR_U);
   ELT_BDO = new nsHtml5ElementName(nsHtml5Atoms::bdo, nsHtml5Atoms::bdo, NS_HTML5TREE_BUILDER_OTHER);
   ELT_COL = new nsHtml5ElementName(nsHtml5Atoms::col, nsHtml5Atoms::col, NS_HTML5TREE_BUILDER_COL | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_DEL = new nsHtml5ElementName(nsHtml5Atoms::del, nsHtml5Atoms::del, NS_HTML5TREE_BUILDER_OTHER);
   ELT_DFN = new nsHtml5ElementName(nsHtml5Atoms::dfn, nsHtml5Atoms::dfn, NS_HTML5TREE_BUILDER_OTHER);
   ELT_DIR = new nsHtml5ElementName(nsHtml5Atoms::dir, nsHtml5Atoms::dir, NS_HTML5TREE_BUILDER_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 | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_DIV = new nsHtml5ElementName(nsHtml5Atoms::div, nsHtml5Atoms::div, NS_HTML5TREE_BUILDER_DIV_OR_BLOCKQUOTE_OR_CENTER_OR_MENU | NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_IMG = new nsHtml5ElementName(nsHtml5Atoms::img, nsHtml5Atoms::img, NS_HTML5TREE_BUILDER_IMG | NS_HTML5ELEMENT_NAME_SPECIAL);
@@ -652,21 +656,16 @@ nsHtml5ElementName::initializeStatics()
     new nsHtml5ElementName(nsHtml5Atoms::track,
                            nsHtml5Atoms::track,
                            NS_HTML5TREE_BUILDER_PARAM_OR_SOURCE_OR_TRACK |
                              NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_DL = new nsHtml5ElementName(nsHtml5Atoms::dl,
                                   nsHtml5Atoms::dl,
                                   NS_HTML5TREE_BUILDER_UL_OR_OL_OR_DL |
                                     NS_HTML5ELEMENT_NAME_SPECIAL);
-  ELT_ANNOTATION_XML =
-    new nsHtml5ElementName(nsHtml5Atoms::annotation_xml,
-                           nsHtml5Atoms::annotation_xml,
-                           NS_HTML5TREE_BUILDER_ANNOTATION_XML |
-                             NS_HTML5ELEMENT_NAME_SCOPING_AS_MATHML);
   ELT_HTML = new nsHtml5ElementName(
     nsHtml5Atoms::html,
     nsHtml5Atoms::html,
     NS_HTML5TREE_BUILDER_HTML | NS_HTML5ELEMENT_NAME_SPECIAL |
       NS_HTML5ELEMENT_NAME_SCOPING | NS_HTML5ELEMENT_NAME_OPTIONAL_END_TAG);
   ELT_OL = new nsHtml5ElementName(nsHtml5Atoms::ol,
                                   nsHtml5Atoms::ol,
                                   NS_HTML5TREE_BUILDER_UL_OR_OL_OR_DL |
@@ -962,17 +961,17 @@ nsHtml5ElementName::initializeStatics()
     NS_HTML5TREE_BUILDER_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 |
       NS_HTML5ELEMENT_NAME_SPECIAL);
   ELT_TBODY = new nsHtml5ElementName(
     nsHtml5Atoms::tbody,
     nsHtml5Atoms::tbody,
     NS_HTML5TREE_BUILDER_TBODY_OR_THEAD_OR_TFOOT |
       NS_HTML5ELEMENT_NAME_SPECIAL | NS_HTML5ELEMENT_NAME_FOSTER_PARENTING |
       NS_HTML5ELEMENT_NAME_OPTIONAL_END_TAG);
-  ELEMENT_NAMES = new nsHtml5ElementName*[205];
+  ELEMENT_NAMES = new nsHtml5ElementName*[204];
   ELEMENT_NAMES[0] = ELT_BIG;
   ELEMENT_NAMES[1] = ELT_BDO;
   ELEMENT_NAMES[2] = ELT_COL;
   ELEMENT_NAMES[3] = ELT_DEL;
   ELEMENT_NAMES[4] = ELT_DFN;
   ELEMENT_NAMES[5] = ELT_DIR;
   ELEMENT_NAMES[6] = ELT_DIV;
   ELEMENT_NAMES[7] = ELT_IMG;
@@ -1072,117 +1071,117 @@ nsHtml5ElementName::initializeStatics()
   ELEMENT_NAMES[101] = ELT_LI;
   ELEMENT_NAMES[102] = ELT_MI;
   ELEMENT_NAMES[103] = ELT_LINK;
   ELEMENT_NAMES[104] = ELT_MARK;
   ELEMENT_NAMES[105] = ELT_MALIGNMARK;
   ELEMENT_NAMES[106] = ELT_MASK;
   ELEMENT_NAMES[107] = ELT_TRACK;
   ELEMENT_NAMES[108] = ELT_DL;
-  ELEMENT_NAMES[109] = ELT_ANNOTATION_XML;
-  ELEMENT_NAMES[110] = ELT_HTML;
-  ELEMENT_NAMES[111] = ELT_OL;
-  ELEMENT_NAMES[112] = ELT_LABEL;
-  ELEMENT_NAMES[113] = ELT_UL;
-  ELEMENT_NAMES[114] = ELT_SMALL;
-  ELEMENT_NAMES[115] = ELT_SYMBOL;
-  ELEMENT_NAMES[116] = ELT_ALTGLYPHITEM;
-  ELEMENT_NAMES[117] = ELT_ANIMATETRANSFORM;
-  ELEMENT_NAMES[118] = ELT_ACRONYM;
-  ELEMENT_NAMES[119] = ELT_EM;
-  ELEMENT_NAMES[120] = ELT_FORM;
-  ELEMENT_NAMES[121] = ELT_MENUITEM;
-  ELEMENT_NAMES[122] = ELT_PARAM;
-  ELEMENT_NAMES[123] = ELT_ANIMATEMOTION;
-  ELEMENT_NAMES[124] = ELT_BUTTON;
-  ELEMENT_NAMES[125] = ELT_CAPTION;
-  ELEMENT_NAMES[126] = ELT_FIGCAPTION;
-  ELEMENT_NAMES[127] = ELT_MN;
-  ELEMENT_NAMES[128] = ELT_KEYGEN;
-  ELEMENT_NAMES[129] = ELT_MAIN;
-  ELEMENT_NAMES[130] = ELT_OPTION;
-  ELEMENT_NAMES[131] = ELT_POLYGON;
-  ELEMENT_NAMES[132] = ELT_PATTERN;
-  ELEMENT_NAMES[133] = ELT_SPAN;
-  ELEMENT_NAMES[134] = ELT_SECTION;
-  ELEMENT_NAMES[135] = ELT_TSPAN;
-  ELEMENT_NAMES[136] = ELT_AUDIO;
-  ELEMENT_NAMES[137] = ELT_MO;
-  ELEMENT_NAMES[138] = ELT_VIDEO;
-  ELEMENT_NAMES[139] = ELT_COLGROUP;
-  ELEMENT_NAMES[140] = ELT_FEDISPLACEMENTMAP;
-  ELEMENT_NAMES[141] = ELT_HGROUP;
-  ELEMENT_NAMES[142] = ELT_RP;
-  ELEMENT_NAMES[143] = ELT_OPTGROUP;
-  ELEMENT_NAMES[144] = ELT_SAMP;
-  ELEMENT_NAMES[145] = ELT_STOP;
-  ELEMENT_NAMES[146] = ELT_BR;
-  ELEMENT_NAMES[147] = ELT_ABBR;
-  ELEMENT_NAMES[148] = ELT_ANIMATECOLOR;
-  ELEMENT_NAMES[149] = ELT_CENTER;
-  ELEMENT_NAMES[150] = ELT_HR;
-  ELEMENT_NAMES[151] = ELT_FEFUNCR;
-  ELEMENT_NAMES[152] = ELT_FECOMPONENTTRANSFER;
-  ELEMENT_NAMES[153] = ELT_FILTER;
-  ELEMENT_NAMES[154] = ELT_FOOTER;
-  ELEMENT_NAMES[155] = ELT_FEGAUSSIANBLUR;
-  ELEMENT_NAMES[156] = ELT_HEADER;
-  ELEMENT_NAMES[157] = ELT_MARKER;
-  ELEMENT_NAMES[158] = ELT_METER;
-  ELEMENT_NAMES[159] = ELT_NOBR;
-  ELEMENT_NAMES[160] = ELT_TR;
-  ELEMENT_NAMES[161] = ELT_ADDRESS;
-  ELEMENT_NAMES[162] = ELT_CANVAS;
-  ELEMENT_NAMES[163] = ELT_DEFS;
-  ELEMENT_NAMES[164] = ELT_DETAILS;
-  ELEMENT_NAMES[165] = ELT_MS;
-  ELEMENT_NAMES[166] = ELT_NOFRAMES;
-  ELEMENT_NAMES[167] = ELT_PROGRESS;
-  ELEMENT_NAMES[168] = ELT_DT;
-  ELEMENT_NAMES[169] = ELT_APPLET;
-  ELEMENT_NAMES[170] = ELT_BASEFONT;
-  ELEMENT_NAMES[171] = ELT_FOREIGNOBJECT;
-  ELEMENT_NAMES[172] = ELT_FIELDSET;
-  ELEMENT_NAMES[173] = ELT_FRAMESET;
-  ELEMENT_NAMES[174] = ELT_FEOFFSET;
-  ELEMENT_NAMES[175] = ELT_FESPOTLIGHT;
-  ELEMENT_NAMES[176] = ELT_FEPOINTLIGHT;
-  ELEMENT_NAMES[177] = ELT_FEDISTANTLIGHT;
-  ELEMENT_NAMES[178] = ELT_FONT;
-  ELEMENT_NAMES[179] = ELT_INPUT;
-  ELEMENT_NAMES[180] = ELT_LINEARGRADIENT;
-  ELEMENT_NAMES[181] = ELT_MTEXT;
-  ELEMENT_NAMES[182] = ELT_NOSCRIPT;
-  ELEMENT_NAMES[183] = ELT_RT;
-  ELEMENT_NAMES[184] = ELT_OBJECT;
-  ELEMENT_NAMES[185] = ELT_OUTPUT;
-  ELEMENT_NAMES[186] = ELT_PLAINTEXT;
-  ELEMENT_NAMES[187] = ELT_TT;
-  ELEMENT_NAMES[188] = ELT_RECT;
-  ELEMENT_NAMES[189] = ELT_RADIALGRADIENT;
-  ELEMENT_NAMES[190] = ELT_SELECT;
-  ELEMENT_NAMES[191] = ELT_SCRIPT;
-  ELEMENT_NAMES[192] = ELT_TFOOT;
-  ELEMENT_NAMES[193] = ELT_TEXT;
-  ELEMENT_NAMES[194] = ELT_MENU;
-  ELEMENT_NAMES[195] = ELT_FEDROPSHADOW;
-  ELEMENT_NAMES[196] = ELT_VIEW;
-  ELEMENT_NAMES[197] = ELT_FECOLORMATRIX;
-  ELEMENT_NAMES[198] = ELT_FECONVOLVEMATRIX;
-  ELEMENT_NAMES[199] = ELT_ISINDEX;
-  ELEMENT_NAMES[200] = ELT_BODY;
-  ELEMENT_NAMES[201] = ELT_FEMORPHOLOGY;
-  ELEMENT_NAMES[202] = ELT_RUBY;
-  ELEMENT_NAMES[203] = ELT_SUMMARY;
-  ELEMENT_NAMES[204] = ELT_TBODY;
+  ELEMENT_NAMES[109] = ELT_HTML;
+  ELEMENT_NAMES[110] = ELT_OL;
+  ELEMENT_NAMES[111] = ELT_LABEL;
+  ELEMENT_NAMES[112] = ELT_UL;
+  ELEMENT_NAMES[113] = ELT_SMALL;
+  ELEMENT_NAMES[114] = ELT_SYMBOL;
+  ELEMENT_NAMES[115] = ELT_ALTGLYPHITEM;
+  ELEMENT_NAMES[116] = ELT_ANIMATETRANSFORM;
+  ELEMENT_NAMES[117] = ELT_ACRONYM;
+  ELEMENT_NAMES[118] = ELT_EM;
+  ELEMENT_NAMES[119] = ELT_FORM;
+  ELEMENT_NAMES[120] = ELT_MENUITEM;
+  ELEMENT_NAMES[121] = ELT_PARAM;
+  ELEMENT_NAMES[122] = ELT_ANIMATEMOTION;
+  ELEMENT_NAMES[123] = ELT_BUTTON;
+  ELEMENT_NAMES[124] = ELT_CAPTION;
+  ELEMENT_NAMES[125] = ELT_FIGCAPTION;
+  ELEMENT_NAMES[126] = ELT_MN;
+  ELEMENT_NAMES[127] = ELT_KEYGEN;
+  ELEMENT_NAMES[128] = ELT_MAIN;
+  ELEMENT_NAMES[129] = ELT_OPTION;
+  ELEMENT_NAMES[130] = ELT_POLYGON;
+  ELEMENT_NAMES[131] = ELT_PATTERN;
+  ELEMENT_NAMES[132] = ELT_SPAN;
+  ELEMENT_NAMES[133] = ELT_SECTION;
+  ELEMENT_NAMES[134] = ELT_TSPAN;
+  ELEMENT_NAMES[135] = ELT_AUDIO;
+  ELEMENT_NAMES[136] = ELT_MO;
+  ELEMENT_NAMES[137] = ELT_VIDEO;
+  ELEMENT_NAMES[138] = ELT_COLGROUP;
+  ELEMENT_NAMES[139] = ELT_FEDISPLACEMENTMAP;
+  ELEMENT_NAMES[140] = ELT_HGROUP;
+  ELEMENT_NAMES[141] = ELT_RP;
+  ELEMENT_NAMES[142] = ELT_OPTGROUP;
+  ELEMENT_NAMES[143] = ELT_SAMP;
+  ELEMENT_NAMES[144] = ELT_STOP;
+  ELEMENT_NAMES[145] = ELT_BR;
+  ELEMENT_NAMES[146] = ELT_ABBR;
+  ELEMENT_NAMES[147] = ELT_ANIMATECOLOR;
+  ELEMENT_NAMES[148] = ELT_CENTER;
+  ELEMENT_NAMES[149] = ELT_HR;
+  ELEMENT_NAMES[150] = ELT_FEFUNCR;
+  ELEMENT_NAMES[151] = ELT_FECOMPONENTTRANSFER;
+  ELEMENT_NAMES[152] = ELT_FILTER;
+  ELEMENT_NAMES[153] = ELT_FOOTER;
+  ELEMENT_NAMES[154] = ELT_FEGAUSSIANBLUR;
+  ELEMENT_NAMES[155] = ELT_HEADER;
+  ELEMENT_NAMES[156] = ELT_MARKER;
+  ELEMENT_NAMES[157] = ELT_METER;
+  ELEMENT_NAMES[158] = ELT_NOBR;
+  ELEMENT_NAMES[159] = ELT_TR;
+  ELEMENT_NAMES[160] = ELT_ADDRESS;
+  ELEMENT_NAMES[161] = ELT_CANVAS;
+  ELEMENT_NAMES[162] = ELT_DEFS;
+  ELEMENT_NAMES[163] = ELT_DETAILS;
+  ELEMENT_NAMES[164] = ELT_MS;
+  ELEMENT_NAMES[165] = ELT_NOFRAMES;
+  ELEMENT_NAMES[166] = ELT_PROGRESS;
+  ELEMENT_NAMES[167] = ELT_DT;
+  ELEMENT_NAMES[168] = ELT_APPLET;
+  ELEMENT_NAMES[169] = ELT_BASEFONT;
+  ELEMENT_NAMES[170] = ELT_FOREIGNOBJECT;
+  ELEMENT_NAMES[171] = ELT_FIELDSET;
+  ELEMENT_NAMES[172] = ELT_FRAMESET;
+  ELEMENT_NAMES[173] = ELT_FEOFFSET;
+  ELEMENT_NAMES[174] = ELT_FESPOTLIGHT;
+  ELEMENT_NAMES[175] = ELT_FEPOINTLIGHT;
+  ELEMENT_NAMES[176] = ELT_FEDISTANTLIGHT;
+  ELEMENT_NAMES[177] = ELT_FONT;
+  ELEMENT_NAMES[178] = ELT_INPUT;
+  ELEMENT_NAMES[179] = ELT_LINEARGRADIENT;
+  ELEMENT_NAMES[180] = ELT_MTEXT;
+  ELEMENT_NAMES[181] = ELT_NOSCRIPT;
+  ELEMENT_NAMES[182] = ELT_RT;
+  ELEMENT_NAMES[183] = ELT_OBJECT;
+  ELEMENT_NAMES[184] = ELT_OUTPUT;
+  ELEMENT_NAMES[185] = ELT_PLAINTEXT;
+  ELEMENT_NAMES[186] = ELT_TT;
+  ELEMENT_NAMES[187] = ELT_RECT;
+  ELEMENT_NAMES[188] = ELT_RADIALGRADIENT;
+  ELEMENT_NAMES[189] = ELT_SELECT;
+  ELEMENT_NAMES[190] = ELT_SCRIPT;
+  ELEMENT_NAMES[191] = ELT_TFOOT;
+  ELEMENT_NAMES[192] = ELT_TEXT;
+  ELEMENT_NAMES[193] = ELT_MENU;
+  ELEMENT_NAMES[194] = ELT_FEDROPSHADOW;
+  ELEMENT_NAMES[195] = ELT_VIEW;
+  ELEMENT_NAMES[196] = ELT_FECOLORMATRIX;
+  ELEMENT_NAMES[197] = ELT_FECONVOLVEMATRIX;
+  ELEMENT_NAMES[198] = ELT_ISINDEX;
+  ELEMENT_NAMES[199] = ELT_BODY;
+  ELEMENT_NAMES[200] = ELT_FEMORPHOLOGY;
+  ELEMENT_NAMES[201] = ELT_RUBY;
+  ELEMENT_NAMES[202] = ELT_SUMMARY;
+  ELEMENT_NAMES[203] = ELT_TBODY;
 }
 
 void
 nsHtml5ElementName::releaseStatics()
 {
+  delete ELT_ANNOTATION_XML;
   delete ELT_BIG;
   delete ELT_BDO;
   delete ELT_COL;
   delete ELT_DEL;
   delete ELT_DFN;
   delete ELT_DIR;
   delete ELT_DIV;
   delete ELT_IMG;
@@ -1282,17 +1281,16 @@ nsHtml5ElementName::releaseStatics()
   delete ELT_LI;
   delete ELT_MI;
   delete ELT_LINK;
   delete ELT_MARK;
   delete ELT_MALIGNMARK;
   delete ELT_MASK;
   delete ELT_TRACK;
   delete ELT_DL;
-  delete ELT_ANNOTATION_XML;
   delete ELT_HTML;
   delete ELT_OL;
   delete ELT_LABEL;
   delete ELT_UL;
   delete ELT_SMALL;
   delete ELT_SYMBOL;
   delete ELT_ALTGLYPHITEM;
   delete ELT_ANIMATETRANSFORM;
--- a/parser/html/nsHtml5ElementName.h
+++ b/parser/html/nsHtml5ElementName.h
@@ -107,16 +107,17 @@ private:
     return len + first + second + third + fourth + fifth;
     }
 
     nsHtml5ElementName(nsIAtom* name, nsIAtom* camelCaseName, int32_t flags);
   public:
     nsHtml5ElementName();
     ~nsHtml5ElementName();
     void setNameForNonInterned(nsIAtom* name);
+    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;
@@ -216,17 +217,16 @@ private:
     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_ANNOTATION_XML;
     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;
--- a/parser/html/nsHtml5Tokenizer.cpp
+++ b/parser/html/nsHtml5Tokenizer.cpp
@@ -90,16 +90,17 @@ staticJArray<char16_t,int32_t> nsHtml5To
 
 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))
+  , containsHyphen(false)
   , tagName(nullptr)
   , nonInternedTagName(new nsHtml5ElementName())
   , attributeName(nullptr)
   , doctypeName(nullptr)
   , publicIdentifier(nullptr)
   , systemIdentifier(nullptr)
   , attributes(tokenHandler->HasBuilder() ? new nsHtml5HtmlAttributes(0)
                                           : nullptr)
@@ -281,23 +282,38 @@ nsHtml5Tokenizer::flushChars(char16_t* b
     tokenHandler->characters(buf, cstart, pos - cstart);
   }
   cstart = INT32_MAX;
 }
 
 void 
 nsHtml5Tokenizer::strBufToElementNameString()
 {
-  tagName = nsHtml5ElementName::elementNameByBuffer(strBuf, 0, strBufLen, interner);
-  if (!tagName) {
-    nonInternedTagName->setNameForNonInterned(
-      nsHtml5Portability::newLocalNameFromBuffer(
-        strBuf, 0, strBufLen, interner));
-    tagName = nonInternedTagName;
+  if (containsHyphen) {
+    nsIAtom* annotationName = nsHtml5ElementName::ELT_ANNOTATION_XML->getName();
+    if (nsHtml5Portability::localEqualsBuffer(
+          annotationName, strBuf, 0, strBufLen)) {
+      tagName = nsHtml5ElementName::ELT_ANNOTATION_XML;
+    } else {
+      nonInternedTagName->setNameForNonInterned(
+        nsHtml5Portability::newLocalNameFromBuffer(
+          strBuf, 0, strBufLen, interner));
+      tagName = nonInternedTagName;
+    }
+  } else {
+    tagName =
+      nsHtml5ElementName::elementNameByBuffer(strBuf, 0, strBufLen, interner);
+    if (!tagName) {
+      nonInternedTagName->setNameForNonInterned(
+        nsHtml5Portability::newLocalNameFromBuffer(
+          strBuf, 0, strBufLen, interner));
+      tagName = nonInternedTagName;
+    }
   }
+  containsHyphen = false;
   clearStrBufAfterUse();
 }
 
 int32_t 
 nsHtml5Tokenizer::emitCurrentTagToken(bool selfClosing, int32_t pos)
 {
   cstart = pos + 1;
   maybeErrSlashInEndTag(selfClosing);
@@ -485,22 +501,24 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
           if (++pos == endPos) {
             NS_HTML5_BREAK(stateloop);
           }
           c = checkChar(buf, pos);
           if (c >= 'A' && c <= 'Z') {
             endTag = false;
             clearStrBufBeforeUse();
             appendStrBuf((char16_t) (c + 0x20));
+            containsHyphen = false;
             state = P::transition(mViewSource, NS_HTML5TOKENIZER_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, NS_HTML5TOKENIZER_TAG_NAME, reconsume, pos);
             NS_HTML5_BREAK(tagopenloop);
           }
           switch(c) {
             case '!': {
               state = P::transition(mViewSource, NS_HTML5TOKENIZER_MARKUP_DECLARATION_OPEN, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             }
@@ -581,16 +599,18 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
               NS_HTML5_CONTINUE(stateloop);
             }
             case '\0': {
               c = 0xfffd;
             }
             default: {
               if (c >= 'A' && c <= 'Z') {
                 c += 0x20;
+              } else if (c == '-') {
+                containsHyphen = true;
               }
               appendStrBuf(c);
               continue;
             }
           }
         }
         tagnameloop_end: ;
       }
@@ -1921,16 +1941,17 @@ nsHtml5Tokenizer::stateLoop(int32_t stat
           default: {
             if (c >= 'A' && c <= 'Z') {
               c += 0x20;
             }
             if (c >= 'a' && c <= 'z') {
               endTag = true;
               clearStrBufBeforeUse();
               appendStrBuf(c);
+              containsHyphen = false;
               state = P::transition(mViewSource, NS_HTML5TOKENIZER_TAG_NAME, reconsume, pos);
               NS_HTML5_CONTINUE(stateloop);
             } else {
               if (P::reportErrors) {
                 errGarbageAfterLtSlash();
               }
               clearStrBufBeforeUse();
               appendStrBuf(c);
@@ -3996,16 +4017,17 @@ nsHtml5Tokenizer::resetToDataState()
   hi = 0;
   candidate = -1;
   charRefBufMark = 0;
   value = 0;
   seenDigits = false;
   endTag = false;
   shouldSuspend = false;
   initDoctypeFields();
+  containsHyphen = false;
   if (tagName) {
     tagName = nullptr;
   }
   if (attributeName) {
     attributeName->release();
     attributeName = nullptr;
   }
   if (newAttributesEachTime) {
@@ -4056,16 +4078,17 @@ nsHtml5Tokenizer::loadState(nsHtml5Token
     systemIdentifier = nsHtml5Portability::newStringFromString(other->systemIdentifier);
   }
   publicIdentifier.Release();
   if (!other->publicIdentifier) {
     publicIdentifier = nullptr;
   } else {
     publicIdentifier = nsHtml5Portability::newStringFromString(other->publicIdentifier);
   }
+  containsHyphen = other->containsHyphen;
   if (!other->tagName) {
     tagName = nullptr;
   } else if (other->tagName->isInterned()) {
     tagName = other->tagName;
   } else {
     nonInternedTagName->setNameForNonInterned(
       nsHtml5Portability::newLocalFromLocal(other->tagName->getName(),
                                             interner));
--- a/parser/html/nsHtml5Tokenizer.h
+++ b/parser/html/nsHtml5Tokenizer.h
@@ -116,19 +116,19 @@ class nsHtml5Tokenizer
     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:
     nsIAtom* doctypeName;
     nsHtml5String publicIdentifier;
     nsHtml5String systemIdentifier;
     nsHtml5HtmlAttributes* attributes;
     bool newAttributesEachTime;