Skip to content

Commit 18ccfd1

Browse files
emiliohsivonen
andauthored
Mozilla bug 1372276 - Remove menuitem. (#70)
See Mozilla bug 1775477. Co-authored-by: Henri Sivonen <hsivonen@hsivonen.fi>
1 parent 4c64d06 commit 18ccfd1

3 files changed

Lines changed: 74 additions & 93 deletions

File tree

src/nu/validator/htmlparser/impl/ElementName.java

Lines changed: 72 additions & 80 deletions
Original file line numberDiff line numberDiff line change
@@ -557,8 +557,6 @@ public void destructor() {
557557
// return "ANNOTATION_XML";
558558
// case TreeBuilder.FOREIGNOBJECT_OR_DESC:
559559
// return "FOREIGNOBJECT_OR_DESC";
560-
// case TreeBuilder.MENUITEM:
561-
// return "MENUITEM";
562560
// }
563561
// return null;
564562
// }
@@ -1143,10 +1141,6 @@ public void destructor() {
11431141
// CPPONLY: NS_NewHTMLFormElement,
11441142
// CPPONLY: NS_NewSVGUnknownElement,
11451143
TreeBuilder.FORM | SPECIAL);
1146-
public static final ElementName MENUITEM = new ElementName("menuitem", "menuitem",
1147-
// CPPONLY: NS_NewHTMLMenuItemElement,
1148-
// CPPONLY: NS_NewSVGUnknownElement,
1149-
TreeBuilder.MENUITEM);
11501144
public static final ElementName PARAM = new ElementName("param", "param",
11511145
// CPPONLY: NS_NewHTMLSharedElement,
11521146
// CPPONLY: NS_NewSVGUnknownElement,
@@ -1484,7 +1478,7 @@ public void destructor() {
14841478
// CPPONLY: NS_NewSVGUnknownElement,
14851479
TreeBuilder.TBODY_OR_THEAD_OR_TFOOT | SPECIAL | FOSTER_PARENTING | OPTIONAL_END_TAG);
14861480
private final static @NoLength ElementName[] ELEMENT_NAMES = {
1487-
FIGCAPTION,
1481+
MN,
14881482
CITE,
14891483
FRAMESET,
14901484
H1,
@@ -1495,7 +1489,7 @@ public void destructor() {
14951489
BGSOUND,
14961490
SOURCE,
14971491
HTML,
1498-
RP,
1492+
OPTGROUP,
14991493
NOFRAMES,
15001494
MTEXT,
15011495
VIEW,
@@ -1507,8 +1501,8 @@ public void destructor() {
15071501
GLYPHREF,
15081502
LI,
15091503
ACRONYM,
1510-
SECTION,
1511-
HR,
1504+
TSPAN,
1505+
FEFUNCR,
15121506
CANVAS,
15131507
BASEFONT,
15141508
FEDISTANTLIGHT,
@@ -1530,11 +1524,11 @@ public void destructor() {
15301524
PATH,
15311525
MALIGNMARK,
15321526
SMALL,
1533-
PARAM,
1534-
OPTION,
1535-
VIDEO,
1536-
BR,
1537-
FOOTER,
1527+
ANIMATEMOTION,
1528+
POLYGON,
1529+
COLGROUP,
1530+
ABBR,
1531+
FEGAUSSIANBLUR,
15381532
TR,
15391533
DETAILS,
15401534
DT,
@@ -1578,15 +1572,15 @@ public void destructor() {
15781572
LABEL,
15791573
ALTGLYPHITEM,
15801574
FORM,
1581-
BUTTON,
1582-
KEYGEN,
1583-
PATTERN,
1584-
AUDIO,
1585-
FEDISPLACEMENTMAP,
1586-
SAMP,
1587-
ANIMATECOLOR,
1588-
FECOMPONENTTRANSFER,
1589-
HEADER,
1575+
CAPTION,
1576+
MAIN,
1577+
SPAN,
1578+
MO,
1579+
HGROUP,
1580+
STOP,
1581+
CENTER,
1582+
FILTER,
1583+
MARKER,
15901584
NOBR,
15911585
ADDRESS,
15921586
DEFS,
@@ -1672,28 +1666,27 @@ public void destructor() {
16721666
SYMBOL,
16731667
ANIMATETRANSFORM,
16741668
EM,
1675-
MENUITEM,
1676-
ANIMATEMOTION,
1677-
CAPTION,
1678-
MN,
1679-
MAIN,
1680-
POLYGON,
1681-
SPAN,
1682-
TSPAN,
1683-
MO,
1684-
COLGROUP,
1685-
HGROUP,
1686-
OPTGROUP,
1687-
STOP,
1688-
ABBR,
1689-
CENTER,
1690-
FEFUNCR,
1691-
FILTER,
1692-
FEGAUSSIANBLUR,
1693-
MARKER,
1669+
PARAM,
1670+
BUTTON,
1671+
FIGCAPTION,
1672+
KEYGEN,
1673+
OPTION,
1674+
PATTERN,
1675+
SECTION,
1676+
AUDIO,
1677+
VIDEO,
1678+
FEDISPLACEMENTMAP,
1679+
RP,
1680+
SAMP,
1681+
BR,
1682+
ANIMATECOLOR,
1683+
HR,
1684+
FECOMPONENTTRANSFER,
1685+
FOOTER,
1686+
HEADER,
16941687
};
16951688
private final static int[] ELEMENT_HASHES = {
1696-
1900845386,
1689+
1902641154,
16971690
1748359220,
16981691
2001349720,
16991692
876609538,
@@ -1704,7 +1697,7 @@ public void destructor() {
17041697
1730965751,
17051698
1756474198,
17061699
1868312196,
1707-
1938817026,
1700+
1939219752,
17081701
1988763672,
17091702
2005324101,
17101703
2060065124,
@@ -1716,8 +1709,8 @@ public void destructor() {
17161709
1766992520,
17171710
1818230786,
17181711
1881613047,
1719-
1907661127,
1720-
1967128578,
1712+
1907959605,
1713+
1967760215,
17211714
1982935782,
17221715
1999397992,
17231716
2001392798,
@@ -1739,11 +1732,11 @@ public void destructor() {
17391732
1805502724,
17401733
1854228698,
17411734
1874053333,
1742-
1889085973,
1743-
1905563974,
1744-
1925844629,
1745-
1963982850,
1746-
1967795958,
1735+
1898223949,
1736+
1906087319,
1737+
1932928296,
1738+
1965115924,
1739+
1968053806,
17471740
1973420034,
17481741
1983633431,
17491742
1998585858,
@@ -1787,15 +1780,15 @@ public void destructor() {
17871780
1870268949,
17881781
1881288348,
17891782
1884120164,
1790-
1898753862,
1791-
1903302038,
1792-
1906135367,
1793-
1914900309,
1794-
1934172497,
1795-
1941178676,
1796-
1965334268,
1797-
1967788867,
1798-
1968836118,
1783+
1899272519,
1784+
1904412884,
1785+
1907435316,
1786+
1919418370,
1787+
1935549734,
1788+
1941221172,
1789+
1966223078,
1790+
1967795910,
1791+
1971461414,
17991792
1971938532,
18001793
1982173479,
18011794
1983533124,
@@ -1881,24 +1874,23 @@ public void destructor() {
18811874
1874102998,
18821875
1881498736,
18831876
1881669634,
1884-
1887579800,
1885-
1898223949,
1886-
1899272519,
1887-
1902641154,
1888-
1904412884,
1889-
1906087319,
1890-
1907435316,
1891-
1907959605,
1892-
1919418370,
1893-
1932928296,
1894-
1935549734,
1895-
1939219752,
1896-
1941221172,
1897-
1965115924,
1898-
1966223078,
1899-
1967760215,
1900-
1967795910,
1901-
1968053806,
1902-
1971461414,
1877+
1889085973,
1878+
1898753862,
1879+
1900845386,
1880+
1903302038,
1881+
1905563974,
1882+
1906135367,
1883+
1907661127,
1884+
1914900309,
1885+
1925844629,
1886+
1934172497,
1887+
1938817026,
1888+
1941178676,
1889+
1963982850,
1890+
1965334268,
1891+
1967128578,
1892+
1967788867,
1893+
1967795958,
1894+
1968836118,
19031895
};
19041896
}

src/nu/validator/htmlparser/impl/TreeBuilder.java

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -196,11 +196,9 @@ public abstract class TreeBuilder<T> implements TokenHandler,
196196

197197
final static int KEYGEN = 65;
198198

199-
final static int MENUITEM = 66;
199+
final static int TEMPLATE = 66;
200200

201-
final static int TEMPLATE = 67;
202-
203-
final static int IMG = 68;
201+
final static int IMG = 67;
204202

205203
// start insertion modes
206204

@@ -2121,7 +2119,6 @@ public final void startTag(ElementName elementName,
21212119
reconstructTheActiveFormattingElements();
21222120
// FALL THROUGH to PARAM_OR_SOURCE_OR_TRACK
21232121
// CPPONLY: MOZ_FALLTHROUGH;
2124-
// CPPONLY: case MENUITEM:
21252122
case PARAM_OR_SOURCE_OR_TRACK:
21262123
appendVoidElementToCurrentMayFoster(
21272124
elementName,
@@ -3570,7 +3567,6 @@ public final void endTag(ElementName elementName) throws SAXException {
35703567
break;
35713568
case AREA_OR_WBR:
35723569
case KEYGEN: // XXX??
3573-
// CPPONLY: case MENUITEM:
35743570
case PARAM_OR_SOURCE_OR_TRACK:
35753571
case EMBED:
35763572
case IMG:

translator-src/nu/validator/htmlparser/cpptranslate/CppVisitor.java

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1961,16 +1961,9 @@ public void visit(SwitchStmt n, LocalSymbolTable arg) {
19611961

19621962
public void visit(SwitchEntryStmt n, LocalSymbolTable arg) {
19631963
if (n.getLabel() != null) {
1964-
boolean isMenuitem = n.getLabel().toString().equals("MENUITEM");
1965-
if (isMenuitem) {
1966-
printer.printWithoutIndent("#ifdef ENABLE_VOID_MENUITEM\n");
1967-
}
19681964
printer.print("case ");
19691965
n.getLabel().accept(this, arg);
19701966
printer.print(":");
1971-
if (isMenuitem) {
1972-
printer.printWithoutIndent("\n#endif");
1973-
}
19741967
} else {
19751968
printer.print("default:");
19761969
}

0 commit comments

Comments
 (0)