8220087: Remove remnants of HTML4 support
Reviewed-by: jjg
This commit is contained in:
parent
0b082fcc1d
commit
e5f0f8d005
@ -41,8 +41,6 @@ import com.sun.tools.doclint.DocLint;
|
|||||||
|
|
||||||
import jdk.javadoc.doclet.Doclet;
|
import jdk.javadoc.doclet.Doclet;
|
||||||
import jdk.javadoc.doclet.DocletEnvironment;
|
import jdk.javadoc.doclet.DocletEnvironment;
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
|
|
||||||
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlVersion;
|
|
||||||
import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
|
import jdk.javadoc.internal.doclets.toolkit.BaseConfiguration;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.DocletException;
|
import jdk.javadoc.internal.doclets.toolkit.DocletException;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.Messages;
|
import jdk.javadoc.internal.doclets.toolkit.Messages;
|
||||||
@ -51,7 +49,6 @@ import jdk.javadoc.internal.doclets.toolkit.WriterFactory;
|
|||||||
import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
|
import jdk.javadoc.internal.doclets.toolkit.util.DocFile;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
|
import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
|
import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
|
||||||
import jdk.javadoc.internal.doclets.toolkit.util.Utils;
|
|
||||||
|
|
||||||
import static javax.tools.Diagnostic.Kind.*;
|
import static javax.tools.Diagnostic.Kind.*;
|
||||||
|
|
||||||
@ -359,8 +356,7 @@ public class HtmlConfiguration extends BaseConfiguration {
|
|||||||
docPaths = new DocPaths(utils, useModuleDirectories);
|
docPaths = new DocPaths(utils, useModuleDirectories);
|
||||||
setCreateOverview();
|
setCreateOverview();
|
||||||
setTopFile(docEnv);
|
setTopFile(docEnv);
|
||||||
workArounds.initDocLint(doclintOpts.values(), tagletManager.getAllTagletNames(),
|
workArounds.initDocLint(doclintOpts.values(), tagletManager.getAllTagletNames());
|
||||||
Utils.toLowerCase(HtmlVersion.HTML5.name()));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -36,8 +36,6 @@ package jdk.javadoc.internal.doclets.formats.html.markup;
|
|||||||
* @author Bhavesh Patel
|
* @author Bhavesh Patel
|
||||||
*/
|
*/
|
||||||
public enum DocType {
|
public enum DocType {
|
||||||
HTML4_TRANSITIONAL("<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" "
|
|
||||||
+ "\"http://www.w3.org/TR/html4/loose.dtd\">"),
|
|
||||||
HTML5("<!DOCTYPE HTML>");
|
HTML5("<!DOCTYPE HTML>");
|
||||||
|
|
||||||
public final String text;
|
public final String text;
|
||||||
|
@ -44,16 +44,13 @@ public enum HtmlTag {
|
|||||||
BODY(BlockType.OTHER, EndTag.END),
|
BODY(BlockType.OTHER, EndTag.END),
|
||||||
BR(BlockType.INLINE, EndTag.NOEND),
|
BR(BlockType.INLINE, EndTag.NOEND),
|
||||||
CAPTION,
|
CAPTION,
|
||||||
CENTER(HtmlVersion.HTML4),
|
|
||||||
CODE(BlockType.INLINE, EndTag.END),
|
CODE(BlockType.INLINE, EndTag.END),
|
||||||
DD,
|
DD,
|
||||||
DIR(HtmlVersion.HTML4),
|
|
||||||
DIV,
|
DIV,
|
||||||
DL,
|
DL,
|
||||||
DT,
|
DT,
|
||||||
EM(BlockType.INLINE, EndTag.END),
|
EM(BlockType.INLINE, EndTag.END),
|
||||||
FONT(HtmlVersion.HTML4, BlockType.INLINE, EndTag.END),
|
FOOTER,
|
||||||
FOOTER(HtmlVersion.HTML5),
|
|
||||||
H1,
|
H1,
|
||||||
H2,
|
H2,
|
||||||
H3,
|
H3,
|
||||||
@ -61,7 +58,7 @@ public enum HtmlTag {
|
|||||||
H5,
|
H5,
|
||||||
H6,
|
H6,
|
||||||
HEAD(BlockType.OTHER, EndTag.END),
|
HEAD(BlockType.OTHER, EndTag.END),
|
||||||
HEADER(HtmlVersion.HTML5),
|
HEADER,
|
||||||
HR(BlockType.BLOCK, EndTag.NOEND),
|
HR(BlockType.BLOCK, EndTag.NOEND),
|
||||||
HTML(BlockType.OTHER, EndTag.END),
|
HTML(BlockType.OTHER, EndTag.END),
|
||||||
I(BlockType.INLINE, EndTag.END),
|
I(BlockType.INLINE, EndTag.END),
|
||||||
@ -72,16 +69,16 @@ public enum HtmlTag {
|
|||||||
LI,
|
LI,
|
||||||
LISTING,
|
LISTING,
|
||||||
LINK(BlockType.OTHER, EndTag.NOEND),
|
LINK(BlockType.OTHER, EndTag.NOEND),
|
||||||
MAIN(HtmlVersion.HTML5),
|
MAIN,
|
||||||
MENU,
|
MENU,
|
||||||
META(BlockType.OTHER, EndTag.NOEND),
|
META(BlockType.OTHER, EndTag.NOEND),
|
||||||
NAV(HtmlVersion.HTML5),
|
NAV,
|
||||||
NOSCRIPT(BlockType.OTHER, EndTag.END),
|
NOSCRIPT(BlockType.OTHER, EndTag.END),
|
||||||
OL,
|
OL,
|
||||||
P,
|
P,
|
||||||
PRE,
|
PRE,
|
||||||
SCRIPT(BlockType.OTHER, EndTag.END),
|
SCRIPT(BlockType.OTHER, EndTag.END),
|
||||||
SECTION(HtmlVersion.HTML5),
|
SECTION,
|
||||||
SMALL(BlockType.INLINE, EndTag.END),
|
SMALL(BlockType.INLINE, EndTag.END),
|
||||||
SPAN(BlockType.INLINE, EndTag.END),
|
SPAN(BlockType.INLINE, EndTag.END),
|
||||||
STRONG(BlockType.INLINE, EndTag.END),
|
STRONG(BlockType.INLINE, EndTag.END),
|
||||||
@ -92,13 +89,11 @@ public enum HtmlTag {
|
|||||||
TH,
|
TH,
|
||||||
TITLE(BlockType.OTHER, EndTag.END),
|
TITLE(BlockType.OTHER, EndTag.END),
|
||||||
TR,
|
TR,
|
||||||
TT(HtmlVersion.HTML4, BlockType.INLINE, EndTag.END),
|
|
||||||
UL;
|
UL;
|
||||||
|
|
||||||
public final BlockType blockType;
|
public final BlockType blockType;
|
||||||
public final EndTag endTag;
|
public final EndTag endTag;
|
||||||
public final String value;
|
public final String value;
|
||||||
public final HtmlVersion htmlVersion;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Enum representing the type of HTML element.
|
* Enum representing the type of HTML element.
|
||||||
@ -118,19 +113,10 @@ public enum HtmlTag {
|
|||||||
}
|
}
|
||||||
|
|
||||||
HtmlTag() {
|
HtmlTag() {
|
||||||
this(HtmlVersion.ALL, BlockType.BLOCK, EndTag.END);
|
this(BlockType.BLOCK, EndTag.END);
|
||||||
}
|
}
|
||||||
|
|
||||||
HtmlTag(HtmlVersion htmlVersion) {
|
HtmlTag(BlockType blockType, EndTag endTag) {
|
||||||
this(htmlVersion, BlockType.BLOCK, EndTag.END);
|
|
||||||
}
|
|
||||||
|
|
||||||
HtmlTag(BlockType blockType, EndTag endTag ) {
|
|
||||||
this(HtmlVersion.ALL, blockType, endTag);
|
|
||||||
}
|
|
||||||
|
|
||||||
HtmlTag(HtmlVersion htmlVersion, BlockType blockType, EndTag endTag ) {
|
|
||||||
this.htmlVersion = htmlVersion;
|
|
||||||
this.blockType = blockType;
|
this.blockType = blockType;
|
||||||
this.endTag = endTag;
|
this.endTag = endTag;
|
||||||
this.value = Utils.toLowerCase(name());
|
this.value = Utils.toLowerCase(name());
|
||||||
@ -146,16 +132,6 @@ public enum HtmlTag {
|
|||||||
return (endTag == EndTag.END);
|
return (endTag == EndTag.END);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Returns true if the tag is allowed in the output HTML version of this javadoc run.
|
|
||||||
*
|
|
||||||
* @param htmlVer the output HTML version for this javadoc run
|
|
||||||
* @return true if the tag is allowed
|
|
||||||
*/
|
|
||||||
public boolean allowTag(HtmlVersion htmlVer) {
|
|
||||||
return (this.htmlVersion == HtmlVersion.ALL || this.htmlVersion == htmlVer);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return value;
|
return value;
|
||||||
}
|
}
|
||||||
|
@ -1,37 +0,0 @@
|
|||||||
/*
|
|
||||||
* Copyright (c) 2015, Oracle and/or its affiliates. All rights reserved.
|
|
||||||
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
|
|
||||||
*
|
|
||||||
* This code is free software; you can redistribute it and/or modify it
|
|
||||||
* under the terms of the GNU General Public License version 2 only, as
|
|
||||||
* published by the Free Software Foundation. Oracle designates this
|
|
||||||
* particular file as subject to the "Classpath" exception as provided
|
|
||||||
* by Oracle in the LICENSE file that accompanied this code.
|
|
||||||
*
|
|
||||||
* This code is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
* version 2 for more details (a copy is included in the LICENSE file that
|
|
||||||
* accompanied this code).
|
|
||||||
*
|
|
||||||
* You should have received a copy of the GNU General Public License version
|
|
||||||
* 2 along with this work; if not, write to the Free Software Foundation,
|
|
||||||
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
|
|
||||||
*
|
|
||||||
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
|
|
||||||
* or visit www.oracle.com if you need additional information or have any
|
|
||||||
* questions.
|
|
||||||
*/
|
|
||||||
|
|
||||||
package jdk.javadoc.internal.doclets.formats.html.markup;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Enum representing the version of HTML generated by javadoc.
|
|
||||||
*
|
|
||||||
* @author Bhavesh Patel
|
|
||||||
*/
|
|
||||||
public enum HtmlVersion {
|
|
||||||
HTML4,
|
|
||||||
HTML5,
|
|
||||||
ALL
|
|
||||||
}
|
|
@ -62,7 +62,6 @@ public class Links {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an anchor of the form {@code <a id="name"><!-- --></a>}.
|
* Creates an anchor of the form {@code <a id="name"><!-- --></a>}.
|
||||||
* In HTML4, a {@code name} attribute will be generated instead of an {@code id} attribute.
|
|
||||||
*
|
*
|
||||||
* @param name the value for the {@code id} or {@code name} attribute
|
* @param name the value for the {@code id} or {@code name} attribute
|
||||||
* @return a content tree for the anchor
|
* @return a content tree for the anchor
|
||||||
@ -73,7 +72,6 @@ public class Links {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an anchor of the form {@code <a id="sectionName"><!-- --></a>}.
|
* Creates an anchor of the form {@code <a id="sectionName"><!-- --></a>}.
|
||||||
* In HTML4, a {@code name} attribute will be generated instead of an {@code id} attribute.
|
|
||||||
*
|
*
|
||||||
* @param sectionName the value for the {@code id} or {@code name} attribute
|
* @param sectionName the value for the {@code id} or {@code name} attribute
|
||||||
* @return a content tree for the anchor
|
* @return a content tree for the anchor
|
||||||
@ -84,7 +82,6 @@ public class Links {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an anchor of the form {@code <a id="sectionNameName"><!-- --></a>}.
|
* Creates an anchor of the form {@code <a id="sectionNameName"><!-- --></a>}.
|
||||||
* In HTML4, a {@code name} attribute will be generated instead of an {@code id} attribute.
|
|
||||||
*
|
*
|
||||||
* @param sectionName the first part of the value for the {@code id} or {@code name} attribute
|
* @param sectionName the first part of the value for the {@code id} or {@code name} attribute
|
||||||
* @param name the second part of the value for the {@code id} or {@code name} attribute
|
* @param name the second part of the value for the {@code id} or {@code name} attribute
|
||||||
@ -96,7 +93,6 @@ public class Links {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Creates an anchor of the form {@code <a id="anchorName">content</a>}.
|
* Creates an anchor of the form {@code <a id="anchorName">content</a>}.
|
||||||
* In HTML4, a {@code name} attribute will be generated instead of an {@code id} attribute.
|
|
||||||
*
|
*
|
||||||
* @param name the value for the {@code id} or {@code name} attribute
|
* @param name the value for the {@code id} or {@code name} attribute
|
||||||
* @param content the content that should be added to the anchor,
|
* @param content the content that should be added to the anchor,
|
||||||
|
@ -112,7 +112,7 @@ public class WorkArounds {
|
|||||||
}
|
}
|
||||||
|
|
||||||
// TODO: fix this up correctly
|
// TODO: fix this up correctly
|
||||||
public void initDocLint(Collection<String> opts, Collection<String> customTagNames, String htmlVersion) {
|
public void initDocLint(Collection<String> opts, Collection<String> customTagNames) {
|
||||||
ArrayList<String> doclintOpts = new ArrayList<>();
|
ArrayList<String> doclintOpts = new ArrayList<>();
|
||||||
boolean msgOptionSeen = false;
|
boolean msgOptionSeen = false;
|
||||||
|
|
||||||
@ -137,7 +137,7 @@ public class WorkArounds {
|
|||||||
sep = DocLint.SEPARATOR;
|
sep = DocLint.SEPARATOR;
|
||||||
}
|
}
|
||||||
doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());
|
doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());
|
||||||
doclintOpts.add(DocLint.XHTML_VERSION_PREFIX + htmlVersion);
|
doclintOpts.add(DocLint.XHTML_VERSION_PREFIX + "html5");
|
||||||
|
|
||||||
JavacTask t = BasicJavacTask.instance(toolEnv.context);
|
JavacTask t = BasicJavacTask.instance(toolEnv.context);
|
||||||
doclint = new DocLint();
|
doclint = new DocLint();
|
||||||
|
@ -144,7 +144,7 @@ public class TestNavigation extends JavadocTester {
|
|||||||
+ "</nav>");
|
+ "</nav>");
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML4.
|
// Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified.
|
||||||
@Test
|
@Test
|
||||||
public void test2(Path ignore) {
|
public void test2(Path ignore) {
|
||||||
javadoc("-d", "out-2",
|
javadoc("-d", "out-2",
|
||||||
@ -155,39 +155,6 @@ public class TestNavigation extends JavadocTester {
|
|||||||
checkExit(Exit.OK);
|
checkExit(Exit.OK);
|
||||||
checkSubNav();
|
checkSubNav();
|
||||||
|
|
||||||
checkOutput("pkg/A.html", false,
|
|
||||||
"<!-- ========= END OF TOP NAVBAR ========= -->\n"
|
|
||||||
+ "</div>\n"
|
|
||||||
+ "<div class=\"navPadding\"> </div>\n"
|
|
||||||
+ "<script type=\"text/javascript\"><!--\n"
|
|
||||||
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
|
|
||||||
+ "//-->\n"
|
|
||||||
+ "</script>\n"
|
|
||||||
+ "<!-- ======== START OF CLASS DATA ======== -->");
|
|
||||||
|
|
||||||
checkOutput("pkg/package-summary.html", false,
|
|
||||||
"<!-- ========= END OF TOP NAVBAR ========= -->\n"
|
|
||||||
+ "</div>\n"
|
|
||||||
+ "<div class=\"navPadding\"> </div>\n"
|
|
||||||
+ "<script type=\"text/javascript\"><!--\n"
|
|
||||||
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
|
|
||||||
+ "//-->\n"
|
|
||||||
+ "</script>\n"
|
|
||||||
+ "<div class=\"header\">");
|
|
||||||
}
|
|
||||||
|
|
||||||
// Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML5.
|
|
||||||
@Test
|
|
||||||
public void test3(Path ignore) {
|
|
||||||
javadoc("-d", "out-3",
|
|
||||||
"-html5",
|
|
||||||
"-nonavbar",
|
|
||||||
"--frames",
|
|
||||||
"-sourcepath", testSrc,
|
|
||||||
"pkg");
|
|
||||||
checkExit(Exit.OK);
|
|
||||||
checkSubNav();
|
|
||||||
|
|
||||||
checkOutput("pkg/A.html", false,
|
checkOutput("pkg/A.html", false,
|
||||||
"<!-- ========= END OF TOP NAVBAR ========= -->\n"
|
"<!-- ========= END OF TOP NAVBAR ========= -->\n"
|
||||||
+ "</div>\n"
|
+ "</div>\n"
|
||||||
@ -212,7 +179,7 @@ public class TestNavigation extends JavadocTester {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void test4(Path base) throws IOException {
|
public void test3(Path base) throws IOException {
|
||||||
Path src = base.resolve("src");
|
Path src = base.resolve("src");
|
||||||
tb.writeJavaFiles(src,
|
tb.writeJavaFiles(src,
|
||||||
"package pkg1; public class A {\n"
|
"package pkg1; public class A {\n"
|
||||||
@ -255,7 +222,7 @@ public class TestNavigation extends JavadocTester {
|
|||||||
"package pkg1; public interface InterfaceWithNoMembers {\n"
|
"package pkg1; public interface InterfaceWithNoMembers {\n"
|
||||||
+ "}");
|
+ "}");
|
||||||
|
|
||||||
javadoc("-d", "out-4",
|
javadoc("-d", "out-3",
|
||||||
"-sourcepath", src.toString(),
|
"-sourcepath", src.toString(),
|
||||||
"pkg1");
|
"pkg1");
|
||||||
checkExit(Exit.OK);
|
checkExit(Exit.OK);
|
||||||
|
Loading…
Reference in New Issue
Block a user