Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Mozilla bug 1372276 - Remove menuitem. #70

Merged
merged 3 commits into from
Jun 23, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
152 changes: 72 additions & 80 deletions src/nu/validator/htmlparser/impl/ElementName.java
Original file line number Diff line number Diff line change
Expand Up @@ -557,8 +557,6 @@ public void destructor() {
// return "ANNOTATION_XML";
// case TreeBuilder.FOREIGNOBJECT_OR_DESC:
// return "FOREIGNOBJECT_OR_DESC";
// case TreeBuilder.MENUITEM:
// return "MENUITEM";
// }
// return null;
// }
Expand Down Expand Up @@ -1143,10 +1141,6 @@ public void destructor() {
// CPPONLY: NS_NewHTMLFormElement,
// CPPONLY: NS_NewSVGUnknownElement,
TreeBuilder.FORM | SPECIAL);
public static final ElementName MENUITEM = new ElementName("menuitem", "menuitem",
// CPPONLY: NS_NewHTMLMenuItemElement,
// CPPONLY: NS_NewSVGUnknownElement,
TreeBuilder.MENUITEM);
public static final ElementName PARAM = new ElementName("param", "param",
// CPPONLY: NS_NewHTMLSharedElement,
// CPPONLY: NS_NewSVGUnknownElement,
Expand Down Expand Up @@ -1484,7 +1478,7 @@ public void destructor() {
// CPPONLY: NS_NewSVGUnknownElement,
TreeBuilder.TBODY_OR_THEAD_OR_TFOOT | SPECIAL | FOSTER_PARENTING | OPTIONAL_END_TAG);
private final static @NoLength ElementName[] ELEMENT_NAMES = {
FIGCAPTION,
MN,
CITE,
FRAMESET,
H1,
Expand All @@ -1495,7 +1489,7 @@ public void destructor() {
BGSOUND,
SOURCE,
HTML,
RP,
OPTGROUP,
NOFRAMES,
MTEXT,
VIEW,
Expand All @@ -1507,8 +1501,8 @@ public void destructor() {
GLYPHREF,
LI,
ACRONYM,
SECTION,
HR,
TSPAN,
FEFUNCR,
CANVAS,
BASEFONT,
FEDISTANTLIGHT,
Expand All @@ -1530,11 +1524,11 @@ public void destructor() {
PATH,
MALIGNMARK,
SMALL,
PARAM,
OPTION,
VIDEO,
BR,
FOOTER,
ANIMATEMOTION,
POLYGON,
COLGROUP,
ABBR,
FEGAUSSIANBLUR,
TR,
DETAILS,
DT,
Expand Down Expand Up @@ -1578,15 +1572,15 @@ public void destructor() {
LABEL,
ALTGLYPHITEM,
FORM,
BUTTON,
KEYGEN,
PATTERN,
AUDIO,
FEDISPLACEMENTMAP,
SAMP,
ANIMATECOLOR,
FECOMPONENTTRANSFER,
HEADER,
CAPTION,
MAIN,
SPAN,
MO,
HGROUP,
STOP,
CENTER,
FILTER,
MARKER,
NOBR,
ADDRESS,
DEFS,
Expand Down Expand Up @@ -1672,28 +1666,27 @@ public void destructor() {
SYMBOL,
ANIMATETRANSFORM,
EM,
MENUITEM,
ANIMATEMOTION,
CAPTION,
MN,
MAIN,
POLYGON,
SPAN,
TSPAN,
MO,
COLGROUP,
HGROUP,
OPTGROUP,
STOP,
ABBR,
CENTER,
FEFUNCR,
FILTER,
FEGAUSSIANBLUR,
MARKER,
PARAM,
BUTTON,
FIGCAPTION,
KEYGEN,
OPTION,
PATTERN,
SECTION,
AUDIO,
VIDEO,
FEDISPLACEMENTMAP,
RP,
SAMP,
BR,
ANIMATECOLOR,
HR,
FECOMPONENTTRANSFER,
FOOTER,
HEADER,
};
private final static int[] ELEMENT_HASHES = {
1900845386,
1902641154,
1748359220,
2001349720,
876609538,
Expand All @@ -1704,7 +1697,7 @@ public void destructor() {
1730965751,
1756474198,
1868312196,
1938817026,
1939219752,
1988763672,
2005324101,
2060065124,
Expand All @@ -1716,8 +1709,8 @@ public void destructor() {
1766992520,
1818230786,
1881613047,
1907661127,
1967128578,
1907959605,
1967760215,
1982935782,
1999397992,
2001392798,
Expand All @@ -1739,11 +1732,11 @@ public void destructor() {
1805502724,
1854228698,
1874053333,
1889085973,
1905563974,
1925844629,
1963982850,
1967795958,
1898223949,
1906087319,
1932928296,
1965115924,
1968053806,
1973420034,
1983633431,
1998585858,
Expand Down Expand Up @@ -1787,15 +1780,15 @@ public void destructor() {
1870268949,
1881288348,
1884120164,
1898753862,
1903302038,
1906135367,
1914900309,
1934172497,
1941178676,
1965334268,
1967788867,
1968836118,
1899272519,
1904412884,
1907435316,
1919418370,
1935549734,
1941221172,
1966223078,
1967795910,
1971461414,
1971938532,
1982173479,
1983533124,
Expand Down Expand Up @@ -1881,24 +1874,23 @@ public void destructor() {
1874102998,
1881498736,
1881669634,
1887579800,
1898223949,
1899272519,
1902641154,
1904412884,
1906087319,
1907435316,
1907959605,
1919418370,
1932928296,
1935549734,
1939219752,
1941221172,
1965115924,
1966223078,
1967760215,
1967795910,
1968053806,
1971461414,
1889085973,
1898753862,
1900845386,
1903302038,
1905563974,
1906135367,
1907661127,
1914900309,
1925844629,
1934172497,
1938817026,
1941178676,
1963982850,
1965334268,
1967128578,
1967788867,
1967795958,
1968836118,
};
}
8 changes: 2 additions & 6 deletions src/nu/validator/htmlparser/impl/TreeBuilder.java
Original file line number Diff line number Diff line change
Expand Up @@ -196,11 +196,9 @@ public abstract class TreeBuilder<T> implements TokenHandler,

final static int KEYGEN = 65;

final static int MENUITEM = 66;
final static int TEMPLATE = 66;

final static int TEMPLATE = 67;

final static int IMG = 68;
final static int IMG = 67;

// start insertion modes

Expand Down Expand Up @@ -2121,7 +2119,6 @@ public final void startTag(ElementName elementName,
reconstructTheActiveFormattingElements();
// FALL THROUGH to PARAM_OR_SOURCE_OR_TRACK
// CPPONLY: MOZ_FALLTHROUGH;
// CPPONLY: case MENUITEM:
case PARAM_OR_SOURCE_OR_TRACK:
appendVoidElementToCurrentMayFoster(
elementName,
Expand Down Expand Up @@ -3570,7 +3567,6 @@ public final void endTag(ElementName elementName) throws SAXException {
break;
case AREA_OR_WBR:
case KEYGEN: // XXX??
// CPPONLY: case MENUITEM:
case PARAM_OR_SOURCE_OR_TRACK:
case EMBED:
case IMG:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1961,16 +1961,9 @@ public void visit(SwitchStmt n, LocalSymbolTable arg) {

public void visit(SwitchEntryStmt n, LocalSymbolTable arg) {
if (n.getLabel() != null) {
boolean isMenuitem = n.getLabel().toString().equals("MENUITEM");
if (isMenuitem) {
printer.printWithoutIndent("#ifdef ENABLE_VOID_MENUITEM\n");
}
printer.print("case ");
n.getLabel().accept(this, arg);
printer.print(":");
if (isMenuitem) {
printer.printWithoutIndent("\n#endif");
}
} else {
printer.print("default:");
}
Expand Down