diff options
Diffstat (limited to 'parser')
-rw-r--r-- | parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java | 333 | ||||
-rw-r--r-- | parser/html/nsHtml5AtomList.h | 2 | ||||
-rw-r--r-- | parser/html/nsHtml5ElementName.cpp | 177 | ||||
-rw-r--r-- | parser/html/nsHtml5ElementName.h | 2 | ||||
-rw-r--r-- | parser/html/nsHtml5Tokenizer.cpp | 27 | ||||
-rw-r--r-- | parser/html/nsHtml5Tokenizer.h | 1 |
6 files changed, 280 insertions, 262 deletions
diff --git a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java index e772e7e70..ebfd8294b 100644 --- a/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java +++ b/parser/html/java/htmlparser/src/nu/validator/htmlparser/impl/ElementName.java @@ -903,7 +903,7 @@ public final class ElementName public static final ElementName SUMMARY = new ElementName("summary", "summary", TreeBuilder.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 | SPECIAL); public static final ElementName TBODY = new ElementName("tbody", "tbody", TreeBuilder.TBODY_OR_THEAD_OR_TFOOT | SPECIAL | FOSTER_PARENTING | OPTIONAL_END_TAG); private final static @NoLength ElementName[] ELEMENT_NAMES = { - VKERN, + AUDIO, MSPACE, FOREIGNOBJECT, EULERGAMMA, @@ -913,7 +913,7 @@ public final class ElementName PRE, ANIMATE, FEFUNCG, - ARCTAN, + ARCSIN, OR, PROGRESS, MOMENT, @@ -924,9 +924,9 @@ public final class ElementName FONT_FACE, TABLE, GLYPH, - INTERVAL, - MN, - BR, + OL, + KEYGEN, + ABBR, MLABELEDTR, INTEGERS, ARCCOT, @@ -947,11 +947,11 @@ public final class ElementName ARCSINH, SECH, TRACK, - ANIMATETRANSFORM, - CAPTION, - OPTION, - MALIGNGROUP, - FECOMPONENTTRANSFER, + ACRONYM, + CONDITION, + POLYGON, + MSUBSUP, + FILTER, METER, TR, DEFS, @@ -991,17 +991,17 @@ public final class ElementName MPATH, TEXTPATH, MARK, - CURL, - REAL, - MENUITEM, - ANIMATEMOTION, - IN, - MEDIAN, - SPAN, - VIDEO, - OPTGROUP, - CENTER, - FEGAUSSIANBLUR, + FACTORIAL, + SMALL, + MPHANTOM, + BUTTON, + FIGCAPTION, + MAIN, + SECTION, + COLGROUP, + SAMP, + CURSOR, + HEADER, MUNDER, MUNDEROVER, NOTANUMBER, @@ -1080,26 +1080,27 @@ public final class ElementName FONT_FACE_URI, PI, MASK, - FORALL, - LABEL, - SYMBOL, - EM, - PARAM, - ANIMATION, - FN, - DOMAIN, - HKERN, - LAPLACIAN, - MACTION, - PATTERN, - TSPAN, - MO, - FEDISPLACEMENTMAP, - MSUP, - STOP, - ANIMATECOLOR, - HR, - FOOTER, + CSYMBOL, + HTML, + UL, + ALTGLYPHITEM, + FORM, + CN, + ANNOTATION, + CODOMAIN, + DOMAINOFAPPLICATION, + LN, + MEAN, + NOTIN, + RELN, + UNION, + TENDSTO, + HGROUP, + RP, + EQ, + BVAR, + FEFUNCR, + FLOOR, HANDLER, LISTENER, MARKER, @@ -1258,51 +1259,50 @@ public final class ElementName MALIGNMARK, TBREAK, DL, - CSYMBOL, - FACTORIAL, - HTML, - OL, - UL, - SMALL, - ALTGLYPHITEM, - ACRONYM, - FORM, - MPHANTOM, - CN, - ARCSIN, - ANNOTATION, - BUTTON, - CODOMAIN, - CONDITION, - DOMAINOFAPPLICATION, - FIGCAPTION, - LN, - KEYGEN, - MEAN, - MAIN, - NOTIN, - POLYGON, - RELN, - SECTION, - UNION, - AUDIO, - TENDSTO, - COLGROUP, - HGROUP, - MSUBSUP, - RP, - SAMP, - EQ, - ABBR, - BVAR, - CURSOR, - FEFUNCR, - FILTER, - FLOOR, - HEADER, + CURL, + FORALL, + INTERVAL, + LABEL, + REAL, + SYMBOL, + ANIMATETRANSFORM, + EM, + MENUITEM, + PARAM, + ARCTAN, + ANIMATION, + ANIMATEMOTION, + FN, + CAPTION, + DOMAIN, + IN, + HKERN, + MN, + LAPLACIAN, + MEDIAN, + MACTION, + OPTION, + PATTERN, + SPAN, + TSPAN, + VKERN, + MO, + VIDEO, + FEDISPLACEMENTMAP, + MALIGNGROUP, + MSUP, + OPTGROUP, + STOP, + BR, + ANIMATECOLOR, + CENTER, + HR, + FECOMPONENTTRANSFER, + FOOTER, + FEGAUSSIANBLUR, }; private final static int[] ELEMENT_HASHES = { - 1909280949, + 1914900309, 1753319686, 2001309869, 1682186266, @@ -1312,7 +1312,7 @@ public final class ElementName 58773795, 1747306711, 1783210839, - 1897999926, + 1898130486, 1970798594, 1990037800, 2005160150, @@ -1323,9 +1323,9 @@ public final class ElementName 1749649513, 1757137429, 1800730821, - 1868641064, - 1902641154, - 1963982850, + 1870135298, + 1903302038, + 1965115924, 1971703386, 1986351224, 1998883894, @@ -1346,11 +1346,11 @@ public final class ElementName 1797544247, 1806799156, 1857653029, - 1881498736, - 1899272519, - 1905563974, - 1938171179, - 1967788867, + 1881613047, + 1899272521, + 1906087319, + 1938172967, + 1967795910, 1971465813, 1973420034, 1983533124, @@ -1390,17 +1390,17 @@ public final class ElementName 1803929861, 1807599880, 1854228692, - 1865773108, - 1873350948, - 1887579800, - 1898223949, - 1900544002, - 1904285766, - 1907435316, - 1925844629, - 1939219752, - 1966223078, - 1968053806, + 1867061545, + 1874053333, + 1887743720, + 1898753862, + 1900845386, + 1904412884, + 1907661127, + 1932928296, + 1941178676, + 1966386470, + 1968836118, 1971457766, 1971467002, 1971981018, @@ -1479,27 +1479,27 @@ public final class ElementName 1817013469, 1820327938, 1854245076, - 1864643294, - 1867237670, - 1870268949, - 1874102998, - 1881669634, - 1889085973, - 1898223945, - 1898971138, - 1899694294, - 1901940917, - 1903761465, - 1904515399, - 1906135367, - 1907959605, - 1919418370, - 1934172497, - 1938173140, - 1941221172, - 1965334268, - 1967128578, - 1967795958, + 1865714391, + 1868312196, + 1873281026, + 1881288348, + 1884120164, + 1897398274, + 1898223946, + 1899170008, + 1899796819, + 1902116866, + 1904283860, + 1904946933, + 1907085604, + 1908709605, + 1925049415, + 1935549734, + 1938817026, + 1948778498, + 1965634084, + 1967760215, + 1967957189, 1968840263, 1970938456, 1971461414, @@ -1658,47 +1658,46 @@ public final class ElementName 1854228698, 1857622310, 1864368130, - 1865714391, - 1867061545, - 1868312196, - 1870135298, - 1873281026, - 1874053333, - 1881288348, - 1881613047, - 1884120164, - 1887743720, - 1897398274, - 1898130486, - 1898223946, - 1898753862, - 1899170008, - 1899272521, - 1899796819, - 1900845386, - 1902116866, - 1903302038, - 1904283860, - 1904412884, - 1904946933, - 1906087319, - 1907085604, - 1907661127, - 1908709605, - 1914900309, - 1925049415, - 1932928296, - 1935549734, - 1938172967, - 1938817026, - 1941178676, - 1948778498, - 1965115924, - 1965634084, - 1966386470, - 1967760215, - 1967795910, - 1967957189, - 1968836118, + 1865773108, + 1867237670, + 1868641064, + 1870268949, + 1873350948, + 1874102998, + 1881498736, + 1881669634, + 1887579800, + 1889085973, + 1897999926, + 1898223945, + 1898223949, + 1898971138, + 1899272519, + 1899694294, + 1900544002, + 1901940917, + 1902641154, + 1903761465, + 1904285766, + 1904515399, + 1905563974, + 1906135367, + 1907435316, + 1907959605, + 1909280949, + 1919418370, + 1925844629, + 1934172497, + 1938171179, + 1938173140, + 1939219752, + 1941221172, + 1963982850, + 1965334268, + 1966223078, + 1967128578, + 1967788867, + 1967795958, + 1968053806, }; } diff --git a/parser/html/nsHtml5AtomList.h b/parser/html/nsHtml5AtomList.h index 1ea9c4392..75615a7b5 100644 --- a/parser/html/nsHtml5AtomList.h +++ b/parser/html/nsHtml5AtomList.h @@ -670,6 +670,7 @@ HTML5_ATOM(verythickmathspace, "verythickmathspace") HTML5_ATOM(veryverythinmathspace, "veryverythinmathspace") HTML5_ATOM(veryverythickmathspace, "veryverythickmathspace") HTML5_ATOM(isindex, "isindex") +HTML5_ATOM(annotation_xml, "annotation-xml") HTML5_ATOM(and_, "and") HTML5_ATOM(arg, "arg") HTML5_ATOM(abs, "abs") @@ -871,7 +872,6 @@ HTML5_ATOM(malignmark, "malignmark") HTML5_ATOM(tbreak, "tbreak") HTML5_ATOM(track, "track") HTML5_ATOM(dl, "dl") -HTML5_ATOM(annotation_xml, "annotation-xml") HTML5_ATOM(csymbol, "csymbol") HTML5_ATOM(curl, "curl") HTML5_ATOM(factorial, "factorial") diff --git a/parser/html/nsHtml5ElementName.cpp b/parser/html/nsHtml5ElementName.cpp index f538804dd..a138c6e71 100644 --- a/parser/html/nsHtml5ElementName.cpp +++ b/parser/html/nsHtml5ElementName.cpp @@ -81,6 +81,7 @@ nsHtml5ElementName::~nsHtml5ElementName() } nsHtml5ElementName* nsHtml5ElementName::ELT_ISINDEX = nullptr; +nsHtml5ElementName* nsHtml5ElementName::ELT_ANNOTATION_XML = nullptr; nsHtml5ElementName* nsHtml5ElementName::ELT_AND = nullptr; nsHtml5ElementName* nsHtml5ElementName::ELT_ARG = nullptr; nsHtml5ElementName* nsHtml5ElementName::ELT_ABS = nullptr; @@ -282,7 +283,6 @@ nsHtml5ElementName* nsHtml5ElementName::ELT_MASK = nullptr; nsHtml5ElementName* nsHtml5ElementName::ELT_TBREAK = nullptr; nsHtml5ElementName* nsHtml5ElementName::ELT_TRACK = nullptr; nsHtml5ElementName* nsHtml5ElementName::ELT_DL = nullptr; -nsHtml5ElementName* nsHtml5ElementName::ELT_ANNOTATION_XML = nullptr; nsHtml5ElementName* nsHtml5ElementName::ELT_CSYMBOL = nullptr; nsHtml5ElementName* nsHtml5ElementName::ELT_CURL = nullptr; nsHtml5ElementName* nsHtml5ElementName::ELT_FACTORIAL = nullptr; @@ -479,12 +479,13 @@ nsHtml5ElementName* nsHtml5ElementName::ELT_RUBY = nullptr; nsHtml5ElementName* nsHtml5ElementName::ELT_SUMMARY = nullptr; nsHtml5ElementName* nsHtml5ElementName::ELT_TBODY = nullptr; nsHtml5ElementName** nsHtml5ElementName::ELEMENT_NAMES = 0; -static int32_t const ELEMENT_HASHES_DATA[] = { 1909280949, 1753319686, 2001309869, 1682186266, 1818700314, 1982106678, 2006974466, 58773795, 1747306711, 1783210839, 1897999926, 1970798594, 1990037800, 2005160150, 2055514836, 54061139, 62390273, 1730965751, 1749649513, 1757137429, 1800730821, 1868641064, 1902641154, 1963982850, 1971703386, 1986351224, 1998883894, 2002780162, 2005766372, 2008340774, 2082727685, 51965171, 57200451, 60350803, 69730305, 1703936002, 1736200310, 1748359220, 1749905526, 1754894485, 1765431364, 1797544247, 1806799156, 1857653029, 1881498736, 1899272519, 1905563974, 1938171179, 1967788867, 1971465813, 1973420034, 1983533124, 1988502165, 1991350601, 2000439531, 2001392795, 2004557973, 2005324101, 2006329158, 2007803172, 2009706573, 2068523853, 2087049448, 51434643, 52488851, 56151587, 57210387, 59826259, 60354131, 63438849, 926941186, 1686491348, 1715310660, 1733054663, 1738539010, 1748225318, 1748846791, 1749723735, 1751386406, 1753479494, 1756098852, 1757268168, 1773295687, 1790207270, 1798417460, 1803929861, 1807599880, 1854228692, 1865773108, 1873350948, 1887579800, 1898223949, 1900544002, 1904285766, 1907435316, 1925844629, 1939219752, 1966223078, 1968053806, 1971457766, 1971467002, 1971981018, 1974775352, 1982935782, 1984294038, 1988486811, 1988972590, 1990969429, 1998585858, 1999745104, 2000965834, 2001349720, 2001392798, 2003062853, 2004635806, 2005231925, 2005543979, 2006028454, 2006592552, 2007601444, 2008133709, 2008994116, 2041712436, 2060065124, 2070023911, 2085266636, 2092255447, 50910499, 51957043, 52485715, 53012355, 55110883, 56680499, 57206291, 57732851, 59768833, 60345427, 60352083, 61395251, 62973651, 67633153, 893386754, 960495618, 1685703382, 1699324759, 1713736758, 1719741029, 1732069431, 1733372532, 1736576583, 1747048757, 1747838298, 1748346119, 1748621670, 1749272732, 1749673195, 1749813486, 1749932347, 1752979652, 1753362711, 1754031332, 1755148615, 1756600614, 1757157700, 1758044696, 1766992520, 1781815495, 1783388498, 1797368887, 1797628983, 1798686984, 1803876557, 1805502724, 1806981428, 1817013469, 1820327938, 1854245076, 1864643294, 1867237670, 1870268949, 1874102998, 1881669634, 1889085973, 1898223945, 1898971138, 1899694294, 1901940917, 1903761465, 1904515399, 1906135367, 1907959605, 1919418370, 1934172497, 1938173140, 1941221172, 1965334268, 1967128578, 1967795958, 1968840263, 1970938456, 1971461414, 1971466997, 1971628838, 1971938532, 1973040373, 1974771450, 1976348214, 1982173479, 1983002201, 1983633431, 1986140359, 1986527234, 1988486813, 1988763672, 1989812374, 1990074116, 1990969577, 1991909525, 1998724870, 1999397992, 2000158722, 2000825752, 2001281328, 2001349704, 2001349736, 2001392796, 2001495140, 2002882873, 2003183333, 2004557976, 2004719812, 2005181733, 2005279787, 2005543977, 2005719336, 2005925890, 2006036556, 2006560839, 2006896969, 2007257240, 2007781534, 2008125638, 2008165414, 2008851557, 2009276567, 2021937364, 2051837468, 2055515017, 2066000646, 2068523856, 2072193862, 2083120164, 2087012585, 2091479332, 2092557349, 50908899, 50916387, 51438659, 51961587, 51965683, 52486755, 52490899, 54054451, 55104723, 55111395, 56677619, 56682579, 57205395, 57207619, 57731155, 57733651, 59244545, 59821379, 60345171, 60347747, 60351123, 60352339, 60875283, 61925907, 62450211, 62974707, 67108865, 68681729, 876609538, 910163970, 943718402, 1679960596, 1682547543, 1686489160, 1689922072, 1703292116, 1713515574, 1715300574, 1716349149, 1730150402, 1731545140, 1732381397, 1733076167, 1733890180, 1736576231, 1737099991, 1740181637, 1747176599, 1747814436, 1748100148, 1748228205, 1748355193, 1748607578, 1748642422, 1748879564, 1749395095, 1749656156, 1749715159, 1749801286, 1749813541, 1749917205, 1751288021, 1751493207, 1753057319, 1753343188, 1753467414, 1753588936, 1754634617, 1755076808, 1755158905, 1756474198, 1756625221, 1757146773, 1757259017, 1757293380, 1763839627, 1766632184, 1771722827, 1773808452, 1782357526, 1783388497, 1786534215, 1797361975, 1797540167, 1797585096, 1797645367, 1798677556, 1798693940, 1803876550, 1803929812, 1805233752, 1805647874, 1806806678, 1807501636, 1813512194, 1818230786, 1818755074, 1853642948, 1854228698, 1857622310, 1864368130, 1865714391, 1867061545, 1868312196, 1870135298, 1873281026, 1874053333, 1881288348, 1881613047, 1884120164, 1887743720, 1897398274, 1898130486, 1898223946, 1898753862, 1899170008, 1899272521, 1899796819, 1900845386, 1902116866, 1903302038, 1904283860, 1904412884, 1904946933, 1906087319, 1907085604, 1907661127, 1908709605, 1914900309, 1925049415, 1932928296, 1935549734, 1938172967, 1938817026, 1941178676, 1948778498, 1965115924, 1965634084, 1966386470, 1967760215, 1967795910, 1967957189, 1968836118 }; +static int32_t const ELEMENT_HASHES_DATA[] = { 1914900309, 1753319686, 2001309869, 1682186266, 1818700314, 1982106678, 2006974466, 58773795, 1747306711, 1783210839, 1898130486, 1970798594, 1990037800, 2005160150, 2055514836, 54061139, 62390273, 1730965751, 1749649513, 1757137429, 1800730821, 1870135298, 1903302038, 1965115924, 1971703386, 1986351224, 1998883894, 2002780162, 2005766372, 2008340774, 2082727685, 51965171, 57200451, 60350803, 69730305, 1703936002, 1736200310, 1748359220, 1749905526, 1754894485, 1765431364, 1797544247, 1806799156, 1857653029, 1881613047, 1899272521, 1906087319, 1938172967, 1967795910, 1971465813, 1973420034, 1983533124, 1988502165, 1991350601, 2000439531, 2001392795, 2004557973, 2005324101, 2006329158, 2007803172, 2009706573, 2068523853, 2087049448, 51434643, 52488851, 56151587, 57210387, 59826259, 60354131, 63438849, 926941186, 1686491348, 1715310660, 1733054663, 1738539010, 1748225318, 1748846791, 1749723735, 1751386406, 1753479494, 1756098852, 1757268168, 1773295687, 1790207270, 1798417460, 1803929861, 1807599880, 1854228692, 1867061545, 1874053333, 1887743720, 1898753862, 1900845386, 1904412884, 1907661127, 1932928296, 1941178676, 1966386470, 1968836118, 1971457766, 1971467002, 1971981018, 1974775352, 1982935782, 1984294038, 1988486811, 1988972590, 1990969429, 1998585858, 1999745104, 2000965834, 2001349720, 2001392798, 2003062853, 2004635806, 2005231925, 2005543979, 2006028454, 2006592552, 2007601444, 2008133709, 2008994116, 2041712436, 2060065124, 2070023911, 2085266636, 2092255447, 50910499, 51957043, 52485715, 53012355, 55110883, 56680499, 57206291, 57732851, 59768833, 60345427, 60352083, 61395251, 62973651, 67633153, 893386754, 960495618, 1685703382, 1699324759, 1713736758, 1719741029, 1732069431, 1733372532, 1736576583, 1747048757, 1747838298, 1748346119, 1748621670, 1749272732, 1749673195, 1749813486, 1749932347, 1752979652, 1753362711, 1754031332, 1755148615, 1756600614, 1757157700, 1758044696, 1766992520, 1781815495, 1783388498, 1797368887, 1797628983, 1798686984, 1803876557, 1805502724, 1806981428, 1817013469, 1820327938, 1854245076, 1865714391, 1868312196, 1873281026, 1881288348, 1884120164, 1897398274, 1898223946, 1899170008, 1899796819, 1902116866, 1904283860, 1904946933, 1907085604, 1908709605, 1925049415, 1935549734, 1938817026, 1948778498, 1965634084, 1967760215, 1967957189, 1968840263, 1970938456, 1971461414, 1971466997, 1971628838, 1971938532, 1973040373, 1974771450, 1976348214, 1982173479, 1983002201, 1983633431, 1986140359, 1986527234, 1988486813, 1988763672, 1989812374, 1990074116, 1990969577, 1991909525, 1998724870, 1999397992, 2000158722, 2000825752, 2001281328, 2001349704, 2001349736, 2001392796, 2001495140, 2002882873, 2003183333, 2004557976, 2004719812, 2005181733, 2005279787, 2005543977, 2005719336, 2005925890, 2006036556, 2006560839, 2006896969, 2007257240, 2007781534, 2008125638, 2008165414, 2008851557, 2009276567, 2021937364, 2051837468, 2055515017, 2066000646, 2068523856, 2072193862, 2083120164, 2087012585, 2091479332, 2092557349, 50908899, 50916387, 51438659, 51961587, 51965683, 52486755, 52490899, 54054451, 55104723, 55111395, 56677619, 56682579, 57205395, 57207619, 57731155, 57733651, 59244545, 59821379, 60345171, 60347747, 60351123, 60352339, 60875283, 61925907, 62450211, 62974707, 67108865, 68681729, 876609538, 910163970, 943718402, 1679960596, 1682547543, 1686489160, 1689922072, 1703292116, 1713515574, 1715300574, 1716349149, 1730150402, 1731545140, 1732381397, 1733076167, 1733890180, 1736576231, 1737099991, 1740181637, 1747176599, 1747814436, 1748100148, 1748228205, 1748355193, 1748607578, 1748642422, 1748879564, 1749395095, 1749656156, 1749715159, 1749801286, 1749813541, 1749917205, 1751288021, 1751493207, 1753057319, 1753343188, 1753467414, 1753588936, 1754634617, 1755076808, 1755158905, 1756474198, 1756625221, 1757146773, 1757259017, 1757293380, 1763839627, 1766632184, 1771722827, 1773808452, 1782357526, 1783388497, 1786534215, 1797361975, 1797540167, 1797585096, 1797645367, 1798677556, 1798693940, 1803876550, 1803929812, 1805233752, 1805647874, 1806806678, 1807501636, 1813512194, 1818230786, 1818755074, 1853642948, 1854228698, 1857622310, 1864368130, 1865773108, 1867237670, 1868641064, 1870268949, 1873350948, 1874102998, 1881498736, 1881669634, 1887579800, 1889085973, 1897999926, 1898223945, 1898223949, 1898971138, 1899272519, 1899694294, 1900544002, 1901940917, 1902641154, 1903761465, 1904285766, 1904515399, 1905563974, 1906135367, 1907435316, 1907959605, 1909280949, 1919418370, 1925844629, 1934172497, 1938171179, 1938173140, 1939219752, 1941221172, 1963982850, 1965334268, 1966223078, 1967128578, 1967788867, 1967795958, 1968053806 }; staticJArray<int32_t,int32_t> nsHtml5ElementName::ELEMENT_HASHES = { ELEMENT_HASHES_DATA, MOZ_ARRAY_LENGTH(ELEMENT_HASHES_DATA) }; void nsHtml5ElementName::initializeStatics() { ELT_ISINDEX = new nsHtml5ElementName(nsHtml5Atoms::isindex, nsHtml5Atoms::isindex, nsHtml5TreeBuilder::ISINDEX | SPECIAL); + ELT_ANNOTATION_XML = new nsHtml5ElementName(nsHtml5Atoms::annotation_xml, nsHtml5Atoms::annotation_xml, nsHtml5TreeBuilder::ANNOTATION_XML | SCOPING_AS_MATHML); ELT_AND = new nsHtml5ElementName(nsHtml5Atoms::and_, nsHtml5Atoms::and_, nsHtml5TreeBuilder::OTHER); ELT_ARG = new nsHtml5ElementName(nsHtml5Atoms::arg, nsHtml5Atoms::arg, nsHtml5TreeBuilder::OTHER); ELT_ABS = new nsHtml5ElementName(nsHtml5Atoms::abs, nsHtml5Atoms::abs, nsHtml5TreeBuilder::OTHER); @@ -686,7 +687,6 @@ nsHtml5ElementName::initializeStatics() ELT_TBREAK = new nsHtml5ElementName(nsHtml5Atoms::tbreak, nsHtml5Atoms::tbreak, nsHtml5TreeBuilder::OTHER); ELT_TRACK = new nsHtml5ElementName(nsHtml5Atoms::track, nsHtml5Atoms::track, nsHtml5TreeBuilder::PARAM_OR_SOURCE_OR_TRACK | SPECIAL); ELT_DL = new nsHtml5ElementName(nsHtml5Atoms::dl, nsHtml5Atoms::dl, nsHtml5TreeBuilder::UL_OR_OL_OR_DL | SPECIAL); - ELT_ANNOTATION_XML = new nsHtml5ElementName(nsHtml5Atoms::annotation_xml, nsHtml5Atoms::annotation_xml, nsHtml5TreeBuilder::ANNOTATION_XML | SCOPING_AS_MATHML); ELT_CSYMBOL = new nsHtml5ElementName(nsHtml5Atoms::csymbol, nsHtml5Atoms::csymbol, nsHtml5TreeBuilder::OTHER); ELT_CURL = new nsHtml5ElementName(nsHtml5Atoms::curl, nsHtml5Atoms::curl, nsHtml5TreeBuilder::OTHER); ELT_FACTORIAL = new nsHtml5ElementName(nsHtml5Atoms::factorial, nsHtml5Atoms::factorial, nsHtml5TreeBuilder::OTHER); @@ -882,8 +882,8 @@ nsHtml5ElementName::initializeStatics() ELT_RUBY = new nsHtml5ElementName(nsHtml5Atoms::ruby, nsHtml5Atoms::ruby, nsHtml5TreeBuilder::RUBY_OR_SPAN_OR_SUB_OR_SUP_OR_VAR); ELT_SUMMARY = new nsHtml5ElementName(nsHtml5Atoms::summary, nsHtml5Atoms::summary, nsHtml5TreeBuilder::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 | SPECIAL); ELT_TBODY = new nsHtml5ElementName(nsHtml5Atoms::tbody, nsHtml5Atoms::tbody, nsHtml5TreeBuilder::TBODY_OR_THEAD_OR_TFOOT | SPECIAL | FOSTER_PARENTING | OPTIONAL_END_TAG); - ELEMENT_NAMES = new nsHtml5ElementName*[398]; - ELEMENT_NAMES[0] = ELT_VKERN; + ELEMENT_NAMES = new nsHtml5ElementName*[397]; + ELEMENT_NAMES[0] = ELT_AUDIO; ELEMENT_NAMES[1] = ELT_MSPACE; ELEMENT_NAMES[2] = ELT_FOREIGNOBJECT; ELEMENT_NAMES[3] = ELT_EULERGAMMA; @@ -893,7 +893,7 @@ nsHtml5ElementName::initializeStatics() ELEMENT_NAMES[7] = ELT_PRE; ELEMENT_NAMES[8] = ELT_ANIMATE; ELEMENT_NAMES[9] = ELT_FEFUNCG; - ELEMENT_NAMES[10] = ELT_ARCTAN; + ELEMENT_NAMES[10] = ELT_ARCSIN; ELEMENT_NAMES[11] = ELT_OR; ELEMENT_NAMES[12] = ELT_PROGRESS; ELEMENT_NAMES[13] = ELT_MOMENT; @@ -904,9 +904,9 @@ nsHtml5ElementName::initializeStatics() ELEMENT_NAMES[18] = ELT_FONT_FACE; ELEMENT_NAMES[19] = ELT_TABLE; ELEMENT_NAMES[20] = ELT_GLYPH; - ELEMENT_NAMES[21] = ELT_INTERVAL; - ELEMENT_NAMES[22] = ELT_MN; - ELEMENT_NAMES[23] = ELT_BR; + ELEMENT_NAMES[21] = ELT_OL; + ELEMENT_NAMES[22] = ELT_KEYGEN; + ELEMENT_NAMES[23] = ELT_ABBR; ELEMENT_NAMES[24] = ELT_MLABELEDTR; ELEMENT_NAMES[25] = ELT_INTEGERS; ELEMENT_NAMES[26] = ELT_ARCCOT; @@ -927,11 +927,11 @@ nsHtml5ElementName::initializeStatics() ELEMENT_NAMES[41] = ELT_ARCSINH; ELEMENT_NAMES[42] = ELT_SECH; ELEMENT_NAMES[43] = ELT_TRACK; - ELEMENT_NAMES[44] = ELT_ANIMATETRANSFORM; - ELEMENT_NAMES[45] = ELT_CAPTION; - ELEMENT_NAMES[46] = ELT_OPTION; - ELEMENT_NAMES[47] = ELT_MALIGNGROUP; - ELEMENT_NAMES[48] = ELT_FECOMPONENTTRANSFER; + ELEMENT_NAMES[44] = ELT_ACRONYM; + ELEMENT_NAMES[45] = ELT_CONDITION; + ELEMENT_NAMES[46] = ELT_POLYGON; + ELEMENT_NAMES[47] = ELT_MSUBSUP; + ELEMENT_NAMES[48] = ELT_FILTER; ELEMENT_NAMES[49] = ELT_METER; ELEMENT_NAMES[50] = ELT_TR; ELEMENT_NAMES[51] = ELT_DEFS; @@ -971,17 +971,17 @@ nsHtml5ElementName::initializeStatics() ELEMENT_NAMES[85] = ELT_MPATH; ELEMENT_NAMES[86] = ELT_TEXTPATH; ELEMENT_NAMES[87] = ELT_MARK; - ELEMENT_NAMES[88] = ELT_CURL; - ELEMENT_NAMES[89] = ELT_REAL; - ELEMENT_NAMES[90] = ELT_MENUITEM; - ELEMENT_NAMES[91] = ELT_ANIMATEMOTION; - ELEMENT_NAMES[92] = ELT_IN; - ELEMENT_NAMES[93] = ELT_MEDIAN; - ELEMENT_NAMES[94] = ELT_SPAN; - ELEMENT_NAMES[95] = ELT_VIDEO; - ELEMENT_NAMES[96] = ELT_OPTGROUP; - ELEMENT_NAMES[97] = ELT_CENTER; - ELEMENT_NAMES[98] = ELT_FEGAUSSIANBLUR; + ELEMENT_NAMES[88] = ELT_FACTORIAL; + ELEMENT_NAMES[89] = ELT_SMALL; + ELEMENT_NAMES[90] = ELT_MPHANTOM; + ELEMENT_NAMES[91] = ELT_BUTTON; + ELEMENT_NAMES[92] = ELT_FIGCAPTION; + ELEMENT_NAMES[93] = ELT_MAIN; + ELEMENT_NAMES[94] = ELT_SECTION; + ELEMENT_NAMES[95] = ELT_COLGROUP; + ELEMENT_NAMES[96] = ELT_SAMP; + ELEMENT_NAMES[97] = ELT_CURSOR; + ELEMENT_NAMES[98] = ELT_HEADER; ELEMENT_NAMES[99] = ELT_MUNDER; ELEMENT_NAMES[100] = ELT_MUNDEROVER; ELEMENT_NAMES[101] = ELT_NOTANUMBER; @@ -1060,27 +1060,27 @@ nsHtml5ElementName::initializeStatics() ELEMENT_NAMES[174] = ELT_FONT_FACE_URI; ELEMENT_NAMES[175] = ELT_PI; ELEMENT_NAMES[176] = ELT_MASK; - ELEMENT_NAMES[177] = ELT_ANNOTATION_XML; - ELEMENT_NAMES[178] = ELT_FORALL; - ELEMENT_NAMES[179] = ELT_LABEL; - ELEMENT_NAMES[180] = ELT_SYMBOL; - ELEMENT_NAMES[181] = ELT_EM; - ELEMENT_NAMES[182] = ELT_PARAM; - ELEMENT_NAMES[183] = ELT_ANIMATION; - ELEMENT_NAMES[184] = ELT_FN; - ELEMENT_NAMES[185] = ELT_DOMAIN; - ELEMENT_NAMES[186] = ELT_HKERN; - ELEMENT_NAMES[187] = ELT_LAPLACIAN; - ELEMENT_NAMES[188] = ELT_MACTION; - ELEMENT_NAMES[189] = ELT_PATTERN; - ELEMENT_NAMES[190] = ELT_TSPAN; - ELEMENT_NAMES[191] = ELT_MO; - ELEMENT_NAMES[192] = ELT_FEDISPLACEMENTMAP; - ELEMENT_NAMES[193] = ELT_MSUP; - ELEMENT_NAMES[194] = ELT_STOP; - ELEMENT_NAMES[195] = ELT_ANIMATECOLOR; - ELEMENT_NAMES[196] = ELT_HR; - ELEMENT_NAMES[197] = ELT_FOOTER; + ELEMENT_NAMES[177] = ELT_CSYMBOL; + ELEMENT_NAMES[178] = ELT_HTML; + ELEMENT_NAMES[179] = ELT_UL; + ELEMENT_NAMES[180] = ELT_ALTGLYPHITEM; + ELEMENT_NAMES[181] = ELT_FORM; + ELEMENT_NAMES[182] = ELT_CN; + ELEMENT_NAMES[183] = ELT_ANNOTATION; + ELEMENT_NAMES[184] = ELT_CODOMAIN; + ELEMENT_NAMES[185] = ELT_DOMAINOFAPPLICATION; + ELEMENT_NAMES[186] = ELT_LN; + ELEMENT_NAMES[187] = ELT_MEAN; + ELEMENT_NAMES[188] = ELT_NOTIN; + ELEMENT_NAMES[189] = ELT_RELN; + ELEMENT_NAMES[190] = ELT_UNION; + ELEMENT_NAMES[191] = ELT_TENDSTO; + ELEMENT_NAMES[192] = ELT_HGROUP; + ELEMENT_NAMES[193] = ELT_RP; + ELEMENT_NAMES[194] = ELT_EQ; + ELEMENT_NAMES[195] = ELT_BVAR; + ELEMENT_NAMES[196] = ELT_FEFUNCR; + ELEMENT_NAMES[197] = ELT_FLOOR; ELEMENT_NAMES[198] = ELT_HANDLER; ELEMENT_NAMES[199] = ELT_LISTENER; ELEMENT_NAMES[200] = ELT_MARKER; @@ -1239,54 +1239,54 @@ nsHtml5ElementName::initializeStatics() ELEMENT_NAMES[353] = ELT_MALIGNMARK; ELEMENT_NAMES[354] = ELT_TBREAK; ELEMENT_NAMES[355] = ELT_DL; - ELEMENT_NAMES[356] = ELT_CSYMBOL; - ELEMENT_NAMES[357] = ELT_FACTORIAL; - ELEMENT_NAMES[358] = ELT_HTML; - ELEMENT_NAMES[359] = ELT_OL; - ELEMENT_NAMES[360] = ELT_UL; - ELEMENT_NAMES[361] = ELT_SMALL; - ELEMENT_NAMES[362] = ELT_ALTGLYPHITEM; - ELEMENT_NAMES[363] = ELT_ACRONYM; - ELEMENT_NAMES[364] = ELT_FORM; - ELEMENT_NAMES[365] = ELT_MPHANTOM; - ELEMENT_NAMES[366] = ELT_CN; - ELEMENT_NAMES[367] = ELT_ARCSIN; - ELEMENT_NAMES[368] = ELT_ANNOTATION; - ELEMENT_NAMES[369] = ELT_BUTTON; - ELEMENT_NAMES[370] = ELT_CODOMAIN; - ELEMENT_NAMES[371] = ELT_CONDITION; - ELEMENT_NAMES[372] = ELT_DOMAINOFAPPLICATION; - ELEMENT_NAMES[373] = ELT_FIGCAPTION; - ELEMENT_NAMES[374] = ELT_LN; - ELEMENT_NAMES[375] = ELT_KEYGEN; - ELEMENT_NAMES[376] = ELT_MEAN; - ELEMENT_NAMES[377] = ELT_MAIN; - ELEMENT_NAMES[378] = ELT_NOTIN; - ELEMENT_NAMES[379] = ELT_POLYGON; - ELEMENT_NAMES[380] = ELT_RELN; - ELEMENT_NAMES[381] = ELT_SECTION; - ELEMENT_NAMES[382] = ELT_UNION; - ELEMENT_NAMES[383] = ELT_AUDIO; - ELEMENT_NAMES[384] = ELT_TENDSTO; - ELEMENT_NAMES[385] = ELT_COLGROUP; - ELEMENT_NAMES[386] = ELT_HGROUP; - ELEMENT_NAMES[387] = ELT_MSUBSUP; - ELEMENT_NAMES[388] = ELT_RP; - ELEMENT_NAMES[389] = ELT_SAMP; - ELEMENT_NAMES[390] = ELT_EQ; - ELEMENT_NAMES[391] = ELT_ABBR; - ELEMENT_NAMES[392] = ELT_BVAR; - ELEMENT_NAMES[393] = ELT_CURSOR; - ELEMENT_NAMES[394] = ELT_FEFUNCR; - ELEMENT_NAMES[395] = ELT_FILTER; - ELEMENT_NAMES[396] = ELT_FLOOR; - ELEMENT_NAMES[397] = ELT_HEADER; + ELEMENT_NAMES[356] = ELT_CURL; + ELEMENT_NAMES[357] = ELT_FORALL; + ELEMENT_NAMES[358] = ELT_INTERVAL; + ELEMENT_NAMES[359] = ELT_LABEL; + ELEMENT_NAMES[360] = ELT_REAL; + ELEMENT_NAMES[361] = ELT_SYMBOL; + ELEMENT_NAMES[362] = ELT_ANIMATETRANSFORM; + ELEMENT_NAMES[363] = ELT_EM; + ELEMENT_NAMES[364] = ELT_MENUITEM; + ELEMENT_NAMES[365] = ELT_PARAM; + ELEMENT_NAMES[366] = ELT_ARCTAN; + ELEMENT_NAMES[367] = ELT_ANIMATION; + ELEMENT_NAMES[368] = ELT_ANIMATEMOTION; + ELEMENT_NAMES[369] = ELT_FN; + ELEMENT_NAMES[370] = ELT_CAPTION; + ELEMENT_NAMES[371] = ELT_DOMAIN; + ELEMENT_NAMES[372] = ELT_IN; + ELEMENT_NAMES[373] = ELT_HKERN; + ELEMENT_NAMES[374] = ELT_MN; + ELEMENT_NAMES[375] = ELT_LAPLACIAN; + ELEMENT_NAMES[376] = ELT_MEDIAN; + ELEMENT_NAMES[377] = ELT_MACTION; + ELEMENT_NAMES[378] = ELT_OPTION; + ELEMENT_NAMES[379] = ELT_PATTERN; + ELEMENT_NAMES[380] = ELT_SPAN; + ELEMENT_NAMES[381] = ELT_TSPAN; + ELEMENT_NAMES[382] = ELT_VKERN; + ELEMENT_NAMES[383] = ELT_MO; + ELEMENT_NAMES[384] = ELT_VIDEO; + ELEMENT_NAMES[385] = ELT_FEDISPLACEMENTMAP; + ELEMENT_NAMES[386] = ELT_MALIGNGROUP; + ELEMENT_NAMES[387] = ELT_MSUP; + ELEMENT_NAMES[388] = ELT_OPTGROUP; + ELEMENT_NAMES[389] = ELT_STOP; + ELEMENT_NAMES[390] = ELT_BR; + ELEMENT_NAMES[391] = ELT_ANIMATECOLOR; + ELEMENT_NAMES[392] = ELT_CENTER; + ELEMENT_NAMES[393] = ELT_HR; + ELEMENT_NAMES[394] = ELT_FECOMPONENTTRANSFER; + ELEMENT_NAMES[395] = ELT_FOOTER; + ELEMENT_NAMES[396] = ELT_FEGAUSSIANBLUR; } void nsHtml5ElementName::releaseStatics() { delete ELT_ISINDEX; + delete ELT_ANNOTATION_XML; delete ELT_AND; delete ELT_ARG; delete ELT_ABS; @@ -1488,7 +1488,6 @@ nsHtml5ElementName::releaseStatics() delete ELT_TBREAK; delete ELT_TRACK; delete ELT_DL; - delete ELT_ANNOTATION_XML; delete ELT_CSYMBOL; delete ELT_CURL; delete ELT_FACTORIAL; diff --git a/parser/html/nsHtml5ElementName.h b/parser/html/nsHtml5ElementName.h index 737ac6b18..89ca549c5 100644 --- a/parser/html/nsHtml5ElementName.h +++ b/parser/html/nsHtml5ElementName.h @@ -186,6 +186,7 @@ class nsHtml5ElementName } static nsHtml5ElementName* ELT_ISINDEX; + static nsHtml5ElementName* ELT_ANNOTATION_XML; static nsHtml5ElementName* ELT_AND; static nsHtml5ElementName* ELT_ARG; static nsHtml5ElementName* ELT_ABS; @@ -387,7 +388,6 @@ class nsHtml5ElementName static nsHtml5ElementName* ELT_TBREAK; static nsHtml5ElementName* ELT_TRACK; static nsHtml5ElementName* ELT_DL; - static nsHtml5ElementName* ELT_ANNOTATION_XML; static nsHtml5ElementName* ELT_CSYMBOL; static nsHtml5ElementName* ELT_CURL; static nsHtml5ElementName* ELT_FACTORIAL; diff --git a/parser/html/nsHtml5Tokenizer.cpp b/parser/html/nsHtml5Tokenizer.cpp index bb8d950d5..aadbca899 100644 --- a/parser/html/nsHtml5Tokenizer.cpp +++ b/parser/html/nsHtml5Tokenizer.cpp @@ -95,6 +95,7 @@ nsHtml5Tokenizer::nsHtml5Tokenizer(nsHtml5TreeBuilder* tokenHandler, bool viewin 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), @@ -279,11 +280,22 @@ nsHtml5Tokenizer::flushChars(char16_t* buf, int32_t pos) 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(); } @@ -484,12 +496,14 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu endTag = false; clearStrBufBeforeUse(); 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); } @@ -580,8 +594,11 @@ nsHtml5Tokenizer::stateLoop(int32_t state, char16_t c, int32_t pos, char16_t* bu default: { if (c >= 'A' && c <= 'Z') { c += 0x20; + } else if (c == '-') { + containsHyphen = true; } appendStrBuf(c); + containsHyphen = false; continue; } } @@ -3985,6 +4002,7 @@ nsHtml5Tokenizer::resetToDataState() endTag = false; shouldSuspend = false; initDoctypeFields(); + containsHyphen = false; tagName = nullptr; attributeName = nullptr; if (newAttributesEachTime) { @@ -4040,6 +4058,7 @@ nsHtml5Tokenizer::loadState(nsHtml5Tokenizer* other) } else { publicIdentifier = nsHtml5Portability::newStringFromString(other->publicIdentifier); } + containsHyphen = other->containsHyphen; if (!other->tagName) { tagName = nullptr; } else if (other->tagName->isInterned()) { diff --git a/parser/html/nsHtml5Tokenizer.h b/parser/html/nsHtml5Tokenizer.h index c93271dcb..4572cc847 100644 --- a/parser/html/nsHtml5Tokenizer.h +++ b/parser/html/nsHtml5Tokenizer.h @@ -278,6 +278,7 @@ class nsHtml5Tokenizer protected: bool endTag; private: + bool containsHyphen; nsHtml5ElementName* tagName; nsHtml5ElementName* nonInternedTagName; protected: |