8223378: CSS solution for navbar problem with <a> elements is not ideal

Reviewed-by: jjg
This commit is contained in:
Hannes Wallnöfer 2019-11-27 13:08:16 +01:00
parent 4266daf9c9
commit 725449932b
48 changed files with 575 additions and 683 deletions

View file

@ -92,7 +92,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
IndexBuilder indexbuilder) { IndexBuilder indexbuilder) {
super(configuration, path); super(configuration, path);
this.indexbuilder = indexbuilder; this.indexbuilder = indexbuilder;
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.INDEX, path); this.navBar = new Navigation(null, configuration, PageMode.INDEX, path);
} }
/** /**
@ -419,7 +419,7 @@ public class AbstractIndexWriter extends HtmlDocletWriter {
* @return a content tree for the marker anchor * @return a content tree for the marker anchor
*/ */
public Content getMarkerAnchorForIndex(String anchorNameForIndex) { public Content getMarkerAnchorForIndex(String anchorNameForIndex) {
return links.createAnchor(getNameForIndex(anchorNameForIndex), null); return links.createAnchor(getNameForIndex(anchorNameForIndex));
} }
/** /**

View file

@ -25,6 +25,8 @@
package jdk.javadoc.internal.doclets.formats.html; package jdk.javadoc.internal.doclets.formats.html;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -57,12 +59,12 @@ public abstract class AbstractOverviewIndexWriter extends HtmlDocletWriter {
public AbstractOverviewIndexWriter(HtmlConfiguration configuration, public AbstractOverviewIndexWriter(HtmlConfiguration configuration,
DocPath filename) { DocPath filename) {
super(configuration, filename); super(configuration, filename);
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.OVERVIEW, path); this.navBar = new Navigation(null, configuration, PageMode.OVERVIEW, path);
} }
/** /**
* Adds the top text (from the -top option), the upper * Adds the top text (from the -top option), the upper
* navigation bar, and then the title (from the"-title" * navigation bar, and then the title (from the"-header"
* option), at the top of page. * option), at the top of page.
* *
* @param header the documentation tree to which the navigation bar header will be added * @param header the documentation tree to which the navigation bar header will be added
@ -126,16 +128,18 @@ public abstract class AbstractOverviewIndexWriter extends HtmlDocletWriter {
throws DocFileIOException { throws DocFileIOException {
String windowOverview = resources.getText(title); String windowOverview = resources.getText(title);
Content body = getBody(getWindowTitle(windowOverview)); Content body = getBody(getWindowTitle(windowOverview));
Content header = HtmlTree.HEADER(); Content header = new ContentBuilder();
addNavigationBarHeader(header); addNavigationBarHeader(header);
Content main = HtmlTree.MAIN(); Content main = new ContentBuilder();
addOverviewHeader(main); addOverviewHeader(main);
addIndex(main); addIndex(main);
Content footer = HtmlTree.FOOTER(); Content footer = HtmlTree.FOOTER();
addNavigationBarFooter(footer); addNavigationBarFooter(footer);
body.add(header); body.add(new BodyContents()
body.add(main); .setHeader(header)
body.add(footer); .addMainContent(main)
.setFooter(footer)
.toContent());
printHtmlDocument( printHtmlDocument(
configuration.metakeywords.getOverviewMetaKeywords(title, configuration.doctitle), configuration.metakeywords.getOverviewMetaKeywords(title, configuration.doctitle),
description, body); description, body);

View file

@ -31,6 +31,7 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import com.sun.source.doctree.DocTree; import com.sun.source.doctree.DocTree;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@ -55,13 +56,6 @@ public class AllClassesIndexWriter extends HtmlDocletWriter {
*/ */
protected IndexBuilder indexbuilder; protected IndexBuilder indexbuilder;
/**
* The HTML tree for main tag.
*/
protected HtmlTree mainTree = HtmlTree.MAIN();
private final Navigation navBar;
/** /**
* Construct AllClassesIndexWriter object. Also initializes the indexbuilder variable in this * Construct AllClassesIndexWriter object. Also initializes the indexbuilder variable in this
* class. * class.
@ -74,7 +68,6 @@ public class AllClassesIndexWriter extends HtmlDocletWriter {
DocPath filename, IndexBuilder indexbuilder) { DocPath filename, IndexBuilder indexbuilder) {
super(configuration, filename); super(configuration, filename);
this.indexbuilder = indexbuilder; this.indexbuilder = indexbuilder;
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.ALLCLASSES, path);
} }
/** /**
@ -101,21 +94,25 @@ public class AllClassesIndexWriter extends HtmlDocletWriter {
*/ */
protected void buildAllClassesFile() throws DocFileIOException { protected void buildAllClassesFile() throws DocFileIOException {
String label = resources.getText("doclet.All_Classes"); String label = resources.getText("doclet.All_Classes");
HtmlTree bodyTree = getBody(getWindowTitle(label)); Content header = new ContentBuilder();
HtmlTree header = HtmlTree.HEADER();
addTop(header); addTop(header);
Navigation navBar = new Navigation(null, configuration, PageMode.ALLCLASSES, path);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
header.add(navBar.getContent(true)); header.add(navBar.getContent(true));
bodyTree.add(header);
Content allClassesContent = new ContentBuilder(); Content allClassesContent = new ContentBuilder();
addContents(allClassesContent); addContents(allClassesContent);
mainTree.add(allClassesContent); Content mainContent = new ContentBuilder();
bodyTree.add(mainTree); mainContent.add(allClassesContent);
Content footer = HtmlTree.FOOTER(); Content footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.add(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
bodyTree.add(footer); HtmlTree bodyTree = getBody(getWindowTitle(label));
bodyTree.add(new BodyContents()
.setHeader(header)
.addMainContent(mainContent)
.setFooter(footer)
.toContent());
printHtmlDocument(null, "class index", bodyTree); printHtmlDocument(null, "class index", bodyTree);
} }

View file

@ -26,6 +26,7 @@ package jdk.javadoc.internal.doclets.formats.html;
import javax.lang.model.element.PackageElement; import javax.lang.model.element.PackageElement;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@ -45,13 +46,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
*/ */
public class AllPackagesIndexWriter extends HtmlDocletWriter { public class AllPackagesIndexWriter extends HtmlDocletWriter {
/**
* The HTML tree for main tag.
*/
protected HtmlTree mainTree = HtmlTree.MAIN();
private final Navigation navBar;
/** /**
* Construct AllPackagesIndexWriter object. * Construct AllPackagesIndexWriter object.
* *
@ -60,7 +54,6 @@ public class AllPackagesIndexWriter extends HtmlDocletWriter {
*/ */
public AllPackagesIndexWriter(HtmlConfiguration configuration, DocPath filename) { public AllPackagesIndexWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename); super(configuration, filename);
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.ALLPACKAGES, path);
} }
/** /**
@ -83,12 +76,11 @@ public class AllPackagesIndexWriter extends HtmlDocletWriter {
*/ */
protected void buildAllPackagesFile() throws DocFileIOException { protected void buildAllPackagesFile() throws DocFileIOException {
String label = resources.getText("doclet.All_Packages"); String label = resources.getText("doclet.All_Packages");
HtmlTree bodyTree = getBody(getWindowTitle(label)); Content headerContent = new ContentBuilder();
HtmlTree header = HtmlTree.HEADER(); Navigation navBar = new Navigation(null, configuration, PageMode.ALLPACKAGES, path);
addTop(header); addTop(headerContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
header.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(header);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.allPackagesContainer); div.setStyle(HtmlStyle.allPackagesContainer);
addPackages(div); addPackages(div);
@ -96,14 +88,17 @@ public class AllPackagesIndexWriter extends HtmlDocletWriter {
Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, titleContent); HtmlStyle.title, titleContent);
Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading); Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
mainTree.add(headerDiv);
mainTree.add(div);
bodyTree.add(mainTree);
Content footer = HtmlTree.FOOTER(); Content footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.add(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
bodyTree.add(footer); HtmlTree bodyTree = getBody(getWindowTitle(label));
bodyTree.add(new BodyContents()
.setHeader(headerContent)
.addMainContent(headerDiv)
.addMainContent(div)
.setFooter(footer)
.toContent());
printHtmlDocument(null, "package index", bodyTree); printHtmlDocument(null, "package index", bodyTree);
} }

View file

@ -32,6 +32,7 @@ import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import com.sun.source.doctree.DocTree; import com.sun.source.doctree.DocTree;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.Entity; import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@ -78,7 +79,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
super(configuration, configuration.docPaths.forClass(annotationType)); super(configuration, configuration.docPaths.forClass(annotationType));
this.annotationType = annotationType; this.annotationType = annotationType;
configuration.currentTypeElement = annotationType; configuration.currentTypeElement = annotationType;
this.navBar = new Navigation(annotationType, configuration, fixedNavDiv, PageMode.CLASS, path); this.navBar = new Navigation(annotationType, configuration, PageMode.CLASS, path);
} }
/** /**
@ -86,17 +87,15 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
*/ */
@Override @Override
public Content getHeader(String header) { public Content getHeader(String header) {
HtmlTree bodyTree = getBody(getWindowTitle(utils.getSimpleName(annotationType))); Content headerContent = new ContentBuilder();
HtmlTree htmlTree = HtmlTree.HEADER(); addTop(headerContent);
addTop(htmlTree);
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(annotationType), Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(annotationType),
contents.moduleLabel); contents.moduleLabel);
navBar.setNavLinkModule(linkContent); navBar.setNavLinkModule(linkContent);
navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this)); navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this));
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(htmlTree);
bodyTree.add(MarkerComments.START_OF_CLASS_DATA);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header); div.setStyle(HtmlStyle.header);
if (configuration.showModules) { if (configuration.showModules) {
@ -118,13 +117,14 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
} }
LinkInfoImpl linkInfo = new LinkInfoImpl(configuration, LinkInfoImpl linkInfo = new LinkInfoImpl(configuration,
LinkInfoImpl.Kind.CLASS_HEADER, annotationType); LinkInfoImpl.Kind.CLASS_HEADER, annotationType);
Content headerContent = new StringContent(header);
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headerContent); HtmlStyle.title, new StringContent(header));
heading.add(getTypeParameterLinks(linkInfo)); heading.add(getTypeParameterLinks(linkInfo));
div.add(heading); div.add(heading);
mainTree.add(div); bodyContents.setHeader(headerContent)
return bodyTree; .addMainContent(MarkerComments.START_OF_CLASS_DATA)
.addMainContent(div);
return getBody(getWindowTitle(utils.getSimpleName(annotationType)));
} }
/** /**
@ -139,13 +139,13 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public void addFooter(Content contentTree) { public void addFooter() {
contentTree.add(MarkerComments.END_OF_CLASS_DATA);
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.add(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
contentTree.add(htmlTree); bodyContents.addMainContent(MarkerComments.END_OF_CLASS_DATA)
.setFooter(htmlTree);
} }
/** /**
@ -156,6 +156,7 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter
String description = getDescription("declaration", annotationType); String description = getDescription("declaration", annotationType);
PackageElement pkg = utils.containingPackage(this.annotationType); PackageElement pkg = utils.containingPackage(this.annotationType);
List<DocPath> localStylesheets = getLocalStylesheets(pkg); List<DocPath> localStylesheets = getLocalStylesheets(pkg);
contentTree.add(bodyContents.toContent());
printHtmlDocument(configuration.metakeywords.getMetaKeywords(annotationType), printHtmlDocument(configuration.metakeywords.getMetaKeywords(annotationType),
description, localStylesheets, contentTree); description, localStylesheets, contentTree);
} }

View file

@ -99,11 +99,6 @@ public class ClassUseWriter extends SubWriterHolderWriter {
final NestedClassWriterImpl classSubWriter; final NestedClassWriterImpl classSubWriter;
private final Navigation navBar; private final Navigation navBar;
/**
* The HTML tree for main tag.
*/
protected HtmlTree mainTree = HtmlTree.MAIN();
/** /**
* Constructor. * Constructor.
* *
@ -154,7 +149,7 @@ public class ClassUseWriter extends SubWriterHolderWriter {
constrSubWriter = new ConstructorWriterImpl(this); constrSubWriter = new ConstructorWriterImpl(this);
fieldSubWriter = new FieldWriterImpl(this); fieldSubWriter = new FieldWriterImpl(this);
classSubWriter = new NestedClassWriterImpl(this); classSubWriter = new NestedClassWriterImpl(this);
this.navBar = new Navigation(typeElement, configuration, fixedNavDiv, PageMode.USE, path); this.navBar = new Navigation(typeElement, configuration, PageMode.USE, path);
} }
/** /**
@ -232,13 +227,13 @@ public class ClassUseWriter extends SubWriterHolderWriter {
div.add(contents.getContent("doclet.ClassUse_No.usage.of.0", div.add(contents.getContent("doclet.ClassUse_No.usage.of.0",
utils.getFullyQualifiedName(typeElement))); utils.getFullyQualifiedName(typeElement)));
} }
mainTree.add(div); bodyContents.addMainContent(div);
body.add(mainTree);
HtmlTree footer = HtmlTree.FOOTER(); HtmlTree footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.add(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
body.add(footer); bodyContents.setFooter(footer);
body.add(bodyContents.toContent());
String description = getDescription("use", typeElement); String description = getDescription("use", typeElement);
printHtmlDocument(null, description, body); printHtmlDocument(null, description, body);
} }
@ -432,8 +427,8 @@ public class ClassUseWriter extends SubWriterHolderWriter {
String title = resources.getText("doclet.Window_ClassUse_Header", String title = resources.getText("doclet.Window_ClassUse_Header",
cltype, clname); cltype, clname);
HtmlTree bodyTree = getBody(getWindowTitle(title)); HtmlTree bodyTree = getBody(getWindowTitle(title));
HtmlTree htmlTree = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(htmlTree); addTop(headerContent);
Content mdleLinkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement), Content mdleLinkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement),
contents.moduleLabel); contents.moduleLabel);
navBar.setNavLinkModule(mdleLinkContent); navBar.setNavLinkModule(mdleLinkContent);
@ -442,16 +437,15 @@ public class ClassUseWriter extends SubWriterHolderWriter {
.label(resources.getText("doclet.Class"))); .label(resources.getText("doclet.Class")));
navBar.setNavLinkClass(classLinkContent); navBar.setNavLinkClass(classLinkContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(htmlTree); ContentBuilder headingContent = new ContentBuilder();
ContentBuilder headContent = new ContentBuilder(); headingContent.add(contents.getContent("doclet.ClassUse_Title", cltype));
headContent.add(contents.getContent("doclet.ClassUse_Title", cltype)); headingContent.add(new HtmlTree(HtmlTag.BR));
headContent.add(new HtmlTree(HtmlTag.BR)); headingContent.add(clname);
headContent.add(clname);
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
true, HtmlStyle.title, headContent); true, HtmlStyle.title, headingContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.add(div); bodyContents.setHeader(headerContent).addMainContent(div);
return bodyTree; return bodyTree;
} }
} }

View file

@ -105,7 +105,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
this.typeElement = typeElement; this.typeElement = typeElement;
configuration.currentTypeElement = typeElement; configuration.currentTypeElement = typeElement;
this.classtree = classTree; this.classtree = classTree;
this.navBar = new Navigation(typeElement, configuration, fixedNavDiv, PageMode.CLASS, path); this.navBar = new Navigation(typeElement, configuration, PageMode.CLASS, path);
} }
/** /**
@ -114,16 +114,14 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
@Override @Override
public Content getHeader(String header) { public Content getHeader(String header) {
HtmlTree bodyTree = getBody(getWindowTitle(utils.getSimpleName(typeElement))); HtmlTree bodyTree = getBody(getWindowTitle(utils.getSimpleName(typeElement)));
HtmlTree htmlTree = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(htmlTree); addTop(headerContent);
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement), Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(typeElement),
contents.moduleLabel); contents.moduleLabel);
navBar.setNavLinkModule(linkContent); navBar.setNavLinkModule(linkContent);
navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this)); navBar.setMemberSummaryBuilder(configuration.getBuilderFactory().getMemberSummaryBuilder(this));
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(htmlTree);
bodyTree.add(MarkerComments.START_OF_CLASS_DATA);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header); div.setStyle(HtmlStyle.header);
if (configuration.showModules) { if (configuration.showModules) {
@ -149,12 +147,13 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
LinkInfoImpl.Kind.CLASS_HEADER, typeElement); LinkInfoImpl.Kind.CLASS_HEADER, typeElement);
//Let's not link to ourselves in the header. //Let's not link to ourselves in the header.
linkInfo.linkToSelf = false; linkInfo.linkToSelf = false;
Content headerContent = new StringContent(header);
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headerContent); HtmlStyle.title, new StringContent(header));
heading.add(getTypeParameterLinks(linkInfo)); heading.add(getTypeParameterLinks(linkInfo));
div.add(heading); div.add(heading);
mainTree.add(div); bodyContents.setHeader(headerContent)
.addMainContent(MarkerComments.START_OF_CLASS_DATA)
.addMainContent(div);
return bodyTree; return bodyTree;
} }
@ -170,13 +169,13 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public void addFooter(Content contentTree) { public void addFooter() {
contentTree.add(MarkerComments.END_OF_CLASS_DATA); bodyContents.addMainContent(MarkerComments.END_OF_CLASS_DATA);
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.add(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
contentTree.add(htmlTree); bodyContents.setFooter(htmlTree);
} }
/** /**
@ -187,6 +186,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
String description = getDescription("declaration", typeElement); String description = getDescription("declaration", typeElement);
PackageElement pkg = utils.containingPackage(typeElement); PackageElement pkg = utils.containingPackage(typeElement);
List<DocPath> localStylesheets = getLocalStylesheets(pkg); List<DocPath> localStylesheets = getLocalStylesheets(pkg);
contentTree.add(bodyContents.toContent());
printHtmlDocument(configuration.metakeywords.getMetaKeywords(typeElement), printHtmlDocument(configuration.metakeywords.getMetaKeywords(typeElement),
description, localStylesheets, contentTree); description, localStylesheets, contentTree);
} }

View file

@ -33,6 +33,7 @@ import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import javax.lang.model.element.VariableElement; import javax.lang.model.element.VariableElement;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.Entity; import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
@ -75,11 +76,6 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
private final TableHeader constantsTableHeader; private final TableHeader constantsTableHeader;
/**
* The HTML tree for main tag.
*/
private final HtmlTree mainTree = HtmlTree.MAIN();
/** /**
* The HTML tree for constant values summary. * The HTML tree for constant values summary.
*/ */
@ -87,6 +83,8 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
private final Navigation navBar; private final Navigation navBar;
private final BodyContents bodyContents = new BodyContents();
/** /**
* Construct a ConstantsSummaryWriter. * Construct a ConstantsSummaryWriter.
* @param configuration the configuration used in this run * @param configuration the configuration used in this run
@ -97,7 +95,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
this.configuration = configuration; this.configuration = configuration;
constantsTableHeader = new TableHeader( constantsTableHeader = new TableHeader(
contents.modifierAndTypeLabel, contents.constantFieldLabel, contents.valueLabel); contents.modifierAndTypeLabel, contents.constantFieldLabel, contents.valueLabel);
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.CONSTANTVALUES, path); this.navBar = new Navigation(null, configuration, PageMode.CONSTANTVALUES, path);
} }
/** /**
@ -107,11 +105,11 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
public Content getHeader() { public Content getHeader() {
String label = resources.getText("doclet.Constants_Summary"); String label = resources.getText("doclet.Constants_Summary");
HtmlTree bodyTree = getBody(getWindowTitle(label)); HtmlTree bodyTree = getBody(getWindowTitle(label));
HtmlTree htmlTree = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(htmlTree); addTop(headerContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(htmlTree); bodyContents.setHeader(headerContent);
return bodyTree; return bodyTree;
} }
@ -150,7 +148,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public void addContentsList(Content contentTree, Content contentListTree) { public void addContentsList(Content contentListTree) {
Content titleContent = contents.constantsSummaryTitle; Content titleContent = contents.constantsSummaryTitle;
Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content pHeading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, titleContent); HtmlStyle.title, titleContent);
@ -161,7 +159,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
HtmlTree section = HtmlTree.SECTION(HtmlStyle.packages, heading); HtmlTree section = HtmlTree.SECTION(HtmlStyle.packages, heading);
section.add(contentListTree); section.add(contentListTree);
div.add(section); div.add(section);
mainTree.add(div); bodyContents.addMainContent(div);
} }
/** /**
@ -303,24 +301,23 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public void addConstantSummaries(Content contentTree, Content summariesTree) { public void addConstantSummaries(Content summariesTree) {
if (summaryTree != null) { if (summaryTree != null) {
summariesTree.add(summaryTree); summariesTree.add(summaryTree);
} }
mainTree.add(summariesTree); bodyContents.addMainContent(summariesTree);
contentTree.add(mainTree);
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public void addFooter(Content contentTree) { public void addFooter() {
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.add(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
contentTree.add(htmlTree); bodyContents.setFooter(htmlTree);
} }
/** /**
@ -328,6 +325,7 @@ public class ConstantsSummaryWriterImpl extends HtmlDocletWriter implements Cons
*/ */
@Override @Override
public void printDocument(Content contentTree) throws DocFileIOException { public void printDocument(Content contentTree) throws DocFileIOException {
contentTree.add(bodyContents.toContent());
printHtmlDocument(null, "summary of constants", contentTree); printHtmlDocument(null, "summary of constants", contentTree);
} }
} }

View file

@ -222,7 +222,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
public DeprecatedListWriter(HtmlConfiguration configuration, DocPath filename) { public DeprecatedListWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename); super(configuration, filename);
this.configuration = configuration; this.configuration = configuration;
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.DEPRECATED, path); this.navBar = new Navigation(null, configuration, PageMode.DEPRECATED, path);
NestedClassWriterImpl classW = new NestedClassWriterImpl(this); NestedClassWriterImpl classW = new NestedClassWriterImpl(this);
writerMap = new EnumMap<>(DeprElementKind.class); writerMap = new EnumMap<>(DeprElementKind.class);
for (DeprElementKind kind : DeprElementKind.values()) { for (DeprElementKind kind : DeprElementKind.values()) {
@ -283,8 +283,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi) protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi)
throws DocFileIOException { throws DocFileIOException {
HtmlTree body = getHeader(); HtmlTree body = getHeader();
HtmlTree htmlTree = HtmlTree.MAIN(); bodyContents.addMainContent(getContentsList(deprapi));
htmlTree.add(getContentsList(deprapi));
String memberTableSummary; String memberTableSummary;
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.contentContainer); div.setStyle(HtmlStyle.contentContainer);
@ -300,14 +299,14 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
getHeadingKey(kind), memberTableSummary, memberTableHeader, div); getHeadingKey(kind), memberTableSummary, memberTableHeader, div);
} }
} }
htmlTree.add(div); bodyContents.addMainContent(div);
body.add(htmlTree); HtmlTree htmlTree = HtmlTree.FOOTER();
htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.add(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
body.add(htmlTree); bodyContents.setFooter(htmlTree);
String description = "deprecated elements"; String description = "deprecated elements";
body.add(bodyContents.toContent());
printHtmlDocument(null, description, body); printHtmlDocument(null, description, body);
} }
@ -315,7 +314,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
* Add the index link. * Add the index link.
* *
* @param builder the deprecated list builder * @param builder the deprecated list builder
* @param type the type of list being documented * @param kind the kind of list being documented
* @param contentTree the content tree to which the index link will be added * @param contentTree the content tree to which the index link will be added
*/ */
private void addIndexLink(DeprecatedAPIListBuilder builder, private void addIndexLink(DeprecatedAPIListBuilder builder,
@ -353,7 +352,7 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
* Add the anchor. * Add the anchor.
* *
* @param builder the deprecated list builder * @param builder the deprecated list builder
* @param type the type of list being documented * @param kind the kind of list being documented
* @param htmlTree the content tree to which the anchor will be added * @param htmlTree the content tree to which the anchor will be added
*/ */
private void addAnchor(DeprecatedAPIListBuilder builder, DeprElementKind kind, Content htmlTree) { private void addAnchor(DeprecatedAPIListBuilder builder, DeprElementKind kind, Content htmlTree) {
@ -370,11 +369,11 @@ public class DeprecatedListWriter extends SubWriterHolderWriter {
public HtmlTree getHeader() { public HtmlTree getHeader() {
String title = resources.getText("doclet.Window_Deprecated_List"); String title = resources.getText("doclet.Window_Deprecated_List");
HtmlTree bodyTree = getBody(getWindowTitle(title)); HtmlTree bodyTree = getBody(getWindowTitle(title));
HtmlTree htmlTree = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(htmlTree); addTop(headerContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(htmlTree); bodyContents.setHeader(headerContent);
return bodyTree; return bodyTree;
} }

View file

@ -31,6 +31,9 @@ import com.sun.source.doctree.StartElementTree;
import com.sun.source.doctree.TextTree; import com.sun.source.doctree.TextTree;
import com.sun.source.util.DocTreeFactory; import com.sun.source.util.DocTreeFactory;
import com.sun.tools.doclint.HtmlTag; import com.sun.tools.doclint.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
import jdk.javadoc.internal.doclets.formats.html.markup.Navigation; import jdk.javadoc.internal.doclets.formats.html.markup.Navigation;
import jdk.javadoc.internal.doclets.toolkit.Content; import jdk.javadoc.internal.doclets.toolkit.Content;
@ -180,32 +183,31 @@ public class DocFilesHandlerImpl implements DocFilesHandler {
String title = getWindowTitle(docletWriter, dfElement).trim(); String title = getWindowTitle(docletWriter, dfElement).trim();
HtmlTree htmlContent = docletWriter.getBody(title); HtmlTree htmlContent = docletWriter.getBody(title);
docletWriter.addTop(htmlContent);
PackageElement pkg = dfElement.getPackageElement(); PackageElement pkg = dfElement.getPackageElement();
this.navBar = new Navigation(element, configuration, docletWriter.fixedNavDiv, this.navBar = new Navigation(element, configuration, PageMode.DOCFILE, docletWriter.path);
PageMode.DOCFILE, docletWriter.path); Content headerContent = new ContentBuilder();
docletWriter.addTop(headerContent);
Content mdleLinkContent = docletWriter.getModuleLink(utils.elementUtils.getModuleOf(pkg), Content mdleLinkContent = docletWriter.getModuleLink(utils.elementUtils.getModuleOf(pkg),
docletWriter.contents.moduleLabel); docletWriter.contents.moduleLabel);
navBar.setNavLinkModule(mdleLinkContent); navBar.setNavLinkModule(mdleLinkContent);
Content pkgLinkContent = docletWriter.getPackageLink(pkg, docletWriter.contents.packageLabel); Content pkgLinkContent = docletWriter.getPackageLink(pkg, docletWriter.contents.packageLabel);
navBar.setNavLinkPackage(pkgLinkContent); navBar.setNavLinkPackage(pkgLinkContent);
navBar.setUserHeader(docletWriter.getUserHeaderFooter(true)); navBar.setUserHeader(docletWriter.getUserHeaderFooter(true));
Content header = HtmlTree.HEADER(); headerContent.add(navBar.getContent(true));
header.add(navBar.getContent(true));
htmlContent.add(header);
List<? extends DocTree> fullBody = utils.getFullBody(dfElement); List<? extends DocTree> fullBody = utils.getFullBody(dfElement);
Content bodyContent = docletWriter.commentTagsToContent(null, dfElement, fullBody, false); Content pageContent = docletWriter.commentTagsToContent(null, dfElement, fullBody, false);
docletWriter.addTagsInfo(dfElement, bodyContent); docletWriter.addTagsInfo(dfElement, pageContent);
Content main = HtmlTree.MAIN();
main.add(bodyContent);
htmlContent.add(main);
navBar.setUserFooter(docletWriter.getUserHeaderFooter(false)); navBar.setUserFooter(docletWriter.getUserHeaderFooter(false));
Content footer = HtmlTree.FOOTER(); Content footer = HtmlTree.FOOTER();
footer.add(navBar.getContent(false)); footer.add(navBar.getContent(false));
docletWriter.addBottom(footer); docletWriter.addBottom(footer);
htmlContent.add(footer); htmlContent.add(new BodyContents()
.setHeader(headerContent)
.addMainContent(HtmlTree.DIV(HtmlStyle.contentContainer, pageContent))
.setFooter(footer)
.toContent());
docletWriter.printHtmlDocument(Collections.emptyList(), null, localTagsContent, Collections.emptyList(), htmlContent); docletWriter.printHtmlDocument(Collections.emptyList(), null, localTagsContent, Collections.emptyList(), htmlContent);
} }

View file

@ -25,6 +25,8 @@
package jdk.javadoc.internal.doclets.formats.html; package jdk.javadoc.internal.doclets.formats.html;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -50,8 +52,6 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocPaths;
*/ */
public class HelpWriter extends HtmlDocletWriter { public class HelpWriter extends HtmlDocletWriter {
HtmlTree mainTree = HtmlTree.MAIN();
private final Navigation navBar; private final Navigation navBar;
/** /**
@ -62,7 +62,7 @@ public class HelpWriter extends HtmlDocletWriter {
public HelpWriter(HtmlConfiguration configuration, public HelpWriter(HtmlConfiguration configuration,
DocPath filename) { DocPath filename) {
super(configuration, filename); super(configuration, filename);
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.HELP, path); this.navBar = new Navigation(null, configuration, PageMode.HELP, path);
} }
/** /**
@ -88,17 +88,21 @@ public class HelpWriter extends HtmlDocletWriter {
protected void generateHelpFile() throws DocFileIOException { protected void generateHelpFile() throws DocFileIOException {
String title = resources.getText("doclet.Window_Help_title"); String title = resources.getText("doclet.Window_Help_title");
HtmlTree body = getBody(getWindowTitle(title)); HtmlTree body = getBody(getWindowTitle(title));
HtmlTree htmlTree = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(htmlTree); addTop(headerContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
body.add(htmlTree); ContentBuilder helpFileContent = new ContentBuilder();
addHelpFileContents(body); addHelpFileContents(helpFileContent);
htmlTree = HtmlTree.FOOTER(); HtmlTree footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.add(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(footer);
body.add(htmlTree); body.add(new BodyContents()
.setHeader(headerContent)
.addMainContent(helpFileContent)
.setFooter(footer)
.toContent());
printHtmlDocument(null, "help", body); printHtmlDocument(null, "help", body);
} }
@ -118,7 +122,7 @@ public class HelpWriter extends HtmlDocletWriter {
Content intro = HtmlTree.DIV(HtmlStyle.subTitle, Content intro = HtmlTree.DIV(HtmlStyle.subTitle,
contents.getContent("doclet.help.intro")); contents.getContent("doclet.help.intro"));
div.add(intro); div.add(intro);
mainTree.add(div); contentTree.add(div);
HtmlTree htmlTree; HtmlTree htmlTree;
HtmlTree ul = new HtmlTree(HtmlTag.UL); HtmlTree ul = new HtmlTree(HtmlTag.UL);
ul.setStyle(HtmlStyle.blockList); ul.setStyle(HtmlStyle.blockList);
@ -332,7 +336,6 @@ public class HelpWriter extends HtmlDocletWriter {
Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, Content footnote = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase,
contents.getContent("doclet.help.footnote")); contents.getContent("doclet.help.footnote"));
divContent.add(footnote); divContent.add(footnote);
mainTree.add(divContent); contentTree.add(divContent);
contentTree.add(mainTree);
} }
} }

View file

@ -188,8 +188,6 @@ public class HtmlDocletWriter {
*/ */
private boolean isContainerDocumented = false; private boolean isContainerDocumented = false;
HtmlTree fixedNavDiv = new HtmlTree(HtmlTag.DIV);
/** /**
* The window title of this file. * The window title of this file.
*/ */
@ -509,7 +507,7 @@ public class HtmlDocletWriter {
*/ */
public void addTop(Content htmlTree) { public void addTop(Content htmlTree) {
Content top = new RawHtml(replaceDocRootDir(configuration.top)); Content top = new RawHtml(replaceDocRootDir(configuration.top));
fixedNavDiv.add(top); htmlTree.add(top);
} }
/** /**
@ -2111,29 +2109,6 @@ public class HtmlDocletWriter {
return "javadoc/" + clazz.getSimpleName(); return "javadoc/" + clazz.getSimpleName();
} }
/**
* Returns an HtmlTree for the SCRIPT tag.
*
* @return an HtmlTree for the SCRIPT tag
*/
protected Script getWinTitleScript() {
Script script = new Script();
if (winTitle != null && winTitle.length() > 0) {
script.append("<!--\n" +
" try {\n" +
" if (location.href.indexOf('is-external=true') == -1) {\n" +
" parent.document.title=")
.appendStringLiteral(winTitle)
.append(";\n" +
" }\n" +
" }\n" +
" catch(err) {\n" +
" }\n" +
"//-->\n");
}
return script;
}
/** /**
* Returns an HtmlTree for the BODY tag. * Returns an HtmlTree for the BODY tag.
* *

View file

@ -42,6 +42,7 @@ import javax.lang.model.util.ElementFilter;
import com.sun.source.doctree.DocTree; import com.sun.source.doctree.DocTree;
import jdk.javadoc.doclet.DocletEnvironment.ModuleMode; import jdk.javadoc.doclet.DocletEnvironment.ModuleMode;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.Entity; import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
@ -161,13 +162,10 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
private final Map<TypeElement, Content> providesTrees private final Map<TypeElement, Content> providesTrees
= new TreeMap<>(utils.makeAllClassesComparator()); = new TreeMap<>(utils.makeAllClassesComparator());
/**
* The HTML tree for main tag.
*/
protected HtmlTree mainTree = HtmlTree.MAIN();
private final Navigation navBar; private final Navigation navBar;
private final BodyContents bodyContents = new BodyContents();
/** /**
* Constructor to construct ModuleWriter object and to generate "moduleName-summary.html" file. * Constructor to construct ModuleWriter object and to generate "moduleName-summary.html" file.
* *
@ -178,7 +176,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
super(configuration, configuration.docPaths.moduleSummary(mdle)); super(configuration, configuration.docPaths.moduleSummary(mdle));
this.mdle = mdle; this.mdle = mdle;
this.moduleMode = configuration.docEnv.getModuleMode(); this.moduleMode = configuration.docEnv.getModuleMode();
this.navBar = new Navigation(mdle, configuration, fixedNavDiv, PageMode.MODULE, path); this.navBar = new Navigation(mdle, configuration, PageMode.MODULE, path);
computeModulesData(); computeModulesData();
} }
@ -190,16 +188,15 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
@Override @Override
public Content getModuleHeader(String heading) { public Content getModuleHeader(String heading) {
HtmlTree bodyTree = getBody(getWindowTitle(mdle.getQualifiedName().toString())); HtmlTree bodyTree = getBody(getWindowTitle(mdle.getQualifiedName().toString()));
HtmlTree htmlTree = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(htmlTree); addTop(headerContent);
navBar.setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment); navBar.setDisplaySummaryModuleDescLink(!utils.getFullBody(mdle).isEmpty() && !configuration.nocomment);
navBar.setDisplaySummaryModulesLink(display(requires) || display(indirectModules)); navBar.setDisplaySummaryModulesLink(display(requires) || display(indirectModules));
navBar.setDisplaySummaryPackagesLink(display(packages) || display(indirectPackages) navBar.setDisplaySummaryPackagesLink(display(packages) || display(indirectPackages)
|| display(indirectOpenPackages)); || display(indirectOpenPackages));
navBar.setDisplaySummaryServicesLink(displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees)); navBar.setDisplaySummaryServicesLink(displayServices(uses, usesTrees) || displayServices(provides.keySet(), providesTrees));
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(htmlTree);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header); div.setStyle(HtmlStyle.header);
Content annotationContent = new HtmlTree(HtmlTag.P); Content annotationContent = new HtmlTree(HtmlTag.P);
@ -213,7 +210,8 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
Content moduleHead = new RawHtml(heading); Content moduleHead = new RawHtml(heading);
tHeading.add(moduleHead); tHeading.add(moduleHead);
div.add(tHeading); div.add(tHeading);
mainTree.add(div); bodyContents.setHeader(headerContent)
.addMainContent(div);
return bodyTree; return bodyTree;
} }
@ -877,21 +875,20 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public void addModuleContent(Content contentTree, Content moduleContentTree) { public void addModuleContent(Content moduleContentTree) {
mainTree.add(moduleContentTree); bodyContents.addMainContent(moduleContentTree);
contentTree.add(mainTree);
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public void addModuleFooter(Content contentTree) { public void addModuleFooter() {
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.add(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
contentTree.add(htmlTree); bodyContents.setFooter(htmlTree);
} }
/** /**
@ -901,6 +898,7 @@ public class ModuleWriterImpl extends HtmlDocletWriter implements ModuleSummaryW
*/ */
@Override @Override
public void printDocument(Content contentTree) throws DocFileIOException { public void printDocument(Content contentTree) throws DocFileIOException {
contentTree.add(bodyContents.toContent());
printHtmlDocument(configuration.metakeywords.getMetaKeywordsForModule(mdle), printHtmlDocument(configuration.metakeywords.getMetaKeywordsForModule(mdle),
getDescription("declaration", mdle), getLocalStylesheets(mdle), contentTree); getDescription("declaration", mdle), getLocalStylesheets(mdle), contentTree);
} }

View file

@ -27,6 +27,8 @@ package jdk.javadoc.internal.doclets.formats.html;
import javax.lang.model.element.PackageElement; import javax.lang.model.element.PackageElement;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -60,6 +62,8 @@ public class PackageTreeWriter extends AbstractTreeWriter {
private final Navigation navBar; private final Navigation navBar;
private final BodyContents bodyContents = new BodyContents();
/** /**
* Constructor. * Constructor.
* @param configuration the configuration * @param configuration the configuration
@ -70,7 +74,7 @@ public class PackageTreeWriter extends AbstractTreeWriter {
super(configuration, path, super(configuration, path,
new ClassTree(configuration.typeElementCatalog.allClasses(packageElement), configuration)); new ClassTree(configuration.typeElementCatalog.allClasses(packageElement), configuration));
this.packageElement = packageElement; this.packageElement = packageElement;
this.navBar = new Navigation(packageElement, configuration, fixedNavDiv, PageMode.TREE, path); this.navBar = new Navigation(packageElement, configuration, PageMode.TREE, path);
} }
/** /**
@ -97,7 +101,7 @@ public class PackageTreeWriter extends AbstractTreeWriter {
*/ */
protected void generatePackageTreeFile() throws DocFileIOException { protected void generatePackageTreeFile() throws DocFileIOException {
HtmlTree body = getPackageTreeHeader(); HtmlTree body = getPackageTreeHeader();
HtmlTree mainTree = HtmlTree.MAIN(); Content mainContent = new ContentBuilder();
Content headContent = contents.getContent("doclet.Hierarchy_For_Package", Content headContent = contents.getContent("doclet.Hierarchy_For_Package",
utils.getPackageName(packageElement)); utils.getPackageName(packageElement));
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, false, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, false,
@ -106,20 +110,21 @@ public class PackageTreeWriter extends AbstractTreeWriter {
if (configuration.packages.size() > 1) { if (configuration.packages.size() > 1) {
addLinkToMainTree(div); addLinkToMainTree(div);
} }
mainTree.add(div); mainContent.add(div);
HtmlTree divTree = new HtmlTree(HtmlTag.DIV); HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
divTree.setStyle(HtmlStyle.contentContainer); divTree.setStyle(HtmlStyle.contentContainer);
addTree(classtree.baseClasses(), "doclet.Class_Hierarchy", divTree); addTree(classtree.baseClasses(), "doclet.Class_Hierarchy", divTree);
addTree(classtree.baseInterfaces(), "doclet.Interface_Hierarchy", divTree); addTree(classtree.baseInterfaces(), "doclet.Interface_Hierarchy", divTree);
addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree); addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree);
addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true); addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true);
mainTree.add(divTree); mainContent.add(divTree);
body.add(mainTree); bodyContents.addMainContent(mainContent);
HtmlTree footer = HtmlTree.FOOTER(); HtmlTree footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.add(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
body.add(footer); bodyContents.setFooter(footer);
body.add(bodyContents.toContent());
printHtmlDocument(null, getDescription("tree", packageElement), body); printHtmlDocument(null, getDescription("tree", packageElement), body);
} }
@ -132,14 +137,14 @@ public class PackageTreeWriter extends AbstractTreeWriter {
String packageName = packageElement.isUnnamed() ? "" : utils.getPackageName(packageElement); String packageName = packageElement.isUnnamed() ? "" : utils.getPackageName(packageElement);
String title = packageName + " " + resources.getText("doclet.Window_Class_Hierarchy"); String title = packageName + " " + resources.getText("doclet.Window_Class_Hierarchy");
HtmlTree bodyTree = getBody(getWindowTitle(title)); HtmlTree bodyTree = getBody(getWindowTitle(title));
HtmlTree htmlTree = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(htmlTree); addTop(headerContent);
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement), Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
contents.moduleLabel); contents.moduleLabel);
navBar.setNavLinkModule(linkContent); navBar.setNavLinkModule(linkContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(htmlTree); bodyContents.setHeader(headerContent);
return bodyTree; return bodyTree;
} }

View file

@ -64,7 +64,6 @@ public class PackageUseWriter extends SubWriterHolderWriter {
final PackageElement packageElement; final PackageElement packageElement;
final SortedMap<String, Set<TypeElement>> usingPackageToUsedClasses = new TreeMap<>(); final SortedMap<String, Set<TypeElement>> usingPackageToUsedClasses = new TreeMap<>();
protected HtmlTree mainTree = HtmlTree.MAIN();
final String packageUseTableSummary; final String packageUseTableSummary;
private final Navigation navBar; private final Navigation navBar;
@ -104,7 +103,7 @@ public class PackageUseWriter extends SubWriterHolderWriter {
packageUseTableSummary = resources.getText("doclet.Use_Table_Summary", packageUseTableSummary = resources.getText("doclet.Use_Table_Summary",
resources.getText("doclet.packages")); resources.getText("doclet.packages"));
this.navBar = new Navigation(packageElement, configuration, fixedNavDiv, PageMode.USE, path); this.navBar = new Navigation(packageElement, configuration, PageMode.USE, path);
} }
/** /**
@ -136,13 +135,13 @@ public class PackageUseWriter extends SubWriterHolderWriter {
} else { } else {
addPackageUse(div); addPackageUse(div);
} }
mainTree.add(div); bodyContents.addMainContent(div);
body.add(mainTree);
HtmlTree footer = HtmlTree.FOOTER(); HtmlTree footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.add(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
body.add(footer); bodyContents.setFooter(footer);
body.add(bodyContents.toContent());
printHtmlDocument(null, printHtmlDocument(null,
getDescription("use", packageElement), getDescription("use", packageElement),
body); body);
@ -242,22 +241,22 @@ public class PackageUseWriter extends SubWriterHolderWriter {
String name = packageElement.isUnnamed() ? "" : utils.getPackageName(packageElement); String name = packageElement.isUnnamed() ? "" : utils.getPackageName(packageElement);
String title = resources.getText("doclet.Window_ClassUse_Header", packageText, name); String title = resources.getText("doclet.Window_ClassUse_Header", packageText, name);
HtmlTree bodyTree = getBody(getWindowTitle(title)); HtmlTree bodyTree = getBody(getWindowTitle(title));
HtmlTree htmlTree = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(htmlTree); addTop(headerContent);
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement), Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
contents.moduleLabel); contents.moduleLabel);
navBar.setNavLinkModule(linkContent); navBar.setNavLinkModule(linkContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(htmlTree); ContentBuilder headingContent = new ContentBuilder();
ContentBuilder headContent = new ContentBuilder(); headingContent.add(contents.getContent("doclet.ClassUse_Title", packageText));
headContent.add(contents.getContent("doclet.ClassUse_Title", packageText)); headingContent.add(new HtmlTree(HtmlTag.BR));
headContent.add(new HtmlTree(HtmlTag.BR)); headingContent.add(name);
headContent.add(name);
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, headContent); HtmlStyle.title, headingContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.add(div); bodyContents.setHeader(headerContent)
.addMainContent(div);
return bodyTree; return bodyTree;
} }
} }

View file

@ -33,6 +33,7 @@ import javax.lang.model.element.PackageElement;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import com.sun.source.doctree.DocTree; import com.sun.source.doctree.DocTree;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder; import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.Entity; import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
@ -71,11 +72,6 @@ public class PackageWriterImpl extends HtmlDocletWriter
*/ */
protected PackageElement packageElement; protected PackageElement packageElement;
/**
* The HTML tree for main tag.
*/
protected HtmlTree mainTree = HtmlTree.MAIN();
/** /**
* The HTML tree for section tag. * The HTML tree for section tag.
*/ */
@ -83,6 +79,8 @@ public class PackageWriterImpl extends HtmlDocletWriter
private final Navigation navBar; private final Navigation navBar;
private final BodyContents bodyContents = new BodyContents();
/** /**
* Constructor to construct PackageWriter object and to generate * Constructor to construct PackageWriter object and to generate
* "package-summary.html" file in the respective package directory. * "package-summary.html" file in the respective package directory.
@ -99,7 +97,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
configuration.docPaths.forPackage(packageElement) configuration.docPaths.forPackage(packageElement)
.resolve(DocPaths.PACKAGE_SUMMARY)); .resolve(DocPaths.PACKAGE_SUMMARY));
this.packageElement = packageElement; this.packageElement = packageElement;
this.navBar = new Navigation(packageElement, configuration, fixedNavDiv, PageMode.PACKAGE, path); this.navBar = new Navigation(packageElement, configuration, PageMode.PACKAGE, path);
} }
/** /**
@ -108,14 +106,13 @@ public class PackageWriterImpl extends HtmlDocletWriter
@Override @Override
public Content getPackageHeader(String heading) { public Content getPackageHeader(String heading) {
HtmlTree bodyTree = getBody(getWindowTitle(utils.getPackageName(packageElement))); HtmlTree bodyTree = getBody(getWindowTitle(utils.getPackageName(packageElement)));
HtmlTree htmlTree = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(htmlTree); addTop(headerContent);
Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement), Content linkContent = getModuleLink(utils.elementUtils.getModuleOf(packageElement),
contents.moduleLabel); contents.moduleLabel);
navBar.setNavLinkModule(linkContent); navBar.setNavLinkModule(linkContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(htmlTree);
HtmlTree div = new HtmlTree(HtmlTag.DIV); HtmlTree div = new HtmlTree(HtmlTag.DIV);
div.setStyle(HtmlStyle.header); div.setStyle(HtmlStyle.header);
if (configuration.showModules) { if (configuration.showModules) {
@ -136,7 +133,8 @@ public class PackageWriterImpl extends HtmlDocletWriter
Content packageHead = new StringContent(heading); Content packageHead = new StringContent(heading);
tHeading.add(packageHead); tHeading.add(packageHead);
div.add(tHeading); div.add(tHeading);
mainTree.add(div); bodyContents.setHeader(headerContent)
.addMainContent(div);
return bodyTree; return bodyTree;
} }
@ -295,21 +293,20 @@ public class PackageWriterImpl extends HtmlDocletWriter
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public void addPackageContent(Content contentTree, Content packageContentTree) { public void addPackageContent(Content packageContentTree) {
mainTree.add(packageContentTree); bodyContents.addMainContent(packageContentTree);
contentTree.add(mainTree);
} }
/** /**
* {@inheritDoc} * {@inheritDoc}
*/ */
@Override @Override
public void addPackageFooter(Content contentTree) { public void addPackageFooter() {
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.add(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
contentTree.add(htmlTree); bodyContents.setFooter(htmlTree);
} }
/** /**
@ -319,6 +316,7 @@ public class PackageWriterImpl extends HtmlDocletWriter
public void printDocument(Content contentTree) throws DocFileIOException { public void printDocument(Content contentTree) throws DocFileIOException {
String description = getDescription("declaration", packageElement); String description = getDescription("declaration", packageElement);
List<DocPath> localStylesheets = getLocalStylesheets(packageElement); List<DocPath> localStylesheets = getLocalStylesheets(packageElement);
contentTree.add(bodyContents.toContent());
printHtmlDocument(configuration.metakeywords.getMetaKeywords(packageElement), printHtmlDocument(configuration.metakeywords.getMetaKeywords(packageElement),
description, localStylesheets, contentTree); description, localStylesheets, contentTree);
} }

View file

@ -29,6 +29,7 @@ import java.util.Set;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.Entity; import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@ -56,11 +57,6 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
Set<TypeElement> visibleClasses; Set<TypeElement> visibleClasses;
/**
* HTML tree for main tag.
*/
private HtmlTree mainTree = HtmlTree.MAIN();
private final Navigation navBar; private final Navigation navBar;
/** /**
@ -69,7 +65,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
public SerializedFormWriterImpl(HtmlConfiguration configuration) { public SerializedFormWriterImpl(HtmlConfiguration configuration) {
super(configuration, DocPaths.SERIALIZED_FORM); super(configuration, DocPaths.SERIALIZED_FORM);
visibleClasses = configuration.getIncludedTypeElements(); visibleClasses = configuration.getIncludedTypeElements();
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.SERIALIZEDFORM, path); this.navBar = new Navigation(null, configuration, PageMode.SERIALIZEDFORM, path);
} }
/** /**
@ -80,16 +76,16 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
*/ */
public Content getHeader(String header) { public Content getHeader(String header) {
HtmlTree bodyTree = getBody(getWindowTitle(header)); HtmlTree bodyTree = getBody(getWindowTitle(header));
HtmlTree htmlTree = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(htmlTree); addTop(headerContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(htmlTree);
Content h1Content = new StringContent(header); Content h1Content = new StringContent(header);
Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true, Content heading = HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, true,
HtmlStyle.title, h1Content); HtmlStyle.title, h1Content);
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
mainTree.add(div); bodyContents.setHeader(headerContent)
.addMainContent(div);
return bodyTree; return bodyTree;
} }
@ -216,16 +212,14 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
} }
/** /**
* Get the serialized content tree section. * Add the serialized content tree section.
* *
* @param serializedTreeContent the serialized content tree to be added * @param serializedTreeContent the serialized content tree to be added
* @return a div content tree
*/ */
public Content getSerializedContent(Content serializedTreeContent) { public void addSerializedContent(Content serializedTreeContent) {
HtmlTree divContent = HtmlTree.DIV(HtmlStyle.serializedFormContainer, HtmlTree divContent = HtmlTree.DIV(HtmlStyle.serializedFormContainer,
serializedTreeContent); serializedTreeContent);
mainTree.add(divContent); bodyContents.addMainContent(divContent);
return mainTree;
} }
/** /**
@ -238,15 +232,13 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
/** /**
* Add the footer. * Add the footer.
*
* @param serializedTree the serialized tree to be added
*/ */
public void addFooter(Content serializedTree) { public void addFooter() {
Content htmlTree = HtmlTree.FOOTER(); Content htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.add(navBar.getContent(false)); htmlTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(htmlTree);
serializedTree.add(htmlTree); bodyContents.setFooter(htmlTree);
} }
/** /**
@ -254,6 +246,7 @@ public class SerializedFormWriterImpl extends SubWriterHolderWriter
*/ */
@Override @Override
public void printDocument(Content serializedTree) throws DocFileIOException { public void printDocument(Content serializedTree) throws DocFileIOException {
serializedTree.add(bodyContents.toContent());
printHtmlDocument(null, "serialized forms", serializedTree); printHtmlDocument(null, "serialized forms", serializedTree);
} }

View file

@ -28,6 +28,8 @@ package jdk.javadoc.internal.doclets.formats.html;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.Entity; import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@ -95,15 +97,10 @@ public class SingleIndexWriter extends AbstractIndexWriter {
protected void generateIndexFile() throws DocFileIOException { protected void generateIndexFile() throws DocFileIOException {
String title = resources.getText("doclet.Window_Single_Index"); String title = resources.getText("doclet.Window_Single_Index");
HtmlTree body = getBody(getWindowTitle(title)); HtmlTree body = getBody(getWindowTitle(title));
HtmlTree header = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(header); addTop(headerContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
header.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
body.add(header);
HtmlTree main = HtmlTree.MAIN();
main.add(HtmlTree.DIV(HtmlStyle.header,
HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
contents.getContent("doclet.Index"))));
HtmlTree divTree = new HtmlTree(HtmlTag.DIV); HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
divTree.setStyle(HtmlStyle.contentContainer); divTree.setStyle(HtmlStyle.contentContainer);
elements = new TreeSet<>(indexbuilder.getIndexMap().keySet()); elements = new TreeSet<>(indexbuilder.getIndexMap().keySet());
@ -120,13 +117,18 @@ public class SingleIndexWriter extends AbstractIndexWriter {
} }
} }
addLinksForIndexes(divTree); addLinksForIndexes(divTree);
main.add(divTree);
body.add(main);
HtmlTree footer = HtmlTree.FOOTER(); HtmlTree footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.add(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
body.add(footer); body.add(new BodyContents()
.setHeader(headerContent)
.addMainContent(HtmlTree.DIV(HtmlStyle.header,
HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
contents.getContent("doclet.Index"))))
.addMainContent(divTree)
.setFooter(footer)
.toContent());
createSearchIndexFiles(); createSearchIndexFiles();
printHtmlDocument(null, "index", body); printHtmlDocument(null, "index", body);
} }

View file

@ -32,6 +32,8 @@ import java.util.ListIterator;
import java.util.Set; import java.util.Set;
import java.util.TreeSet; import java.util.TreeSet;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.Entity; import jdk.javadoc.internal.doclets.formats.html.markup.Entity;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
@ -122,12 +124,11 @@ public class SplitIndexWriter extends AbstractIndexWriter {
String title = resources.getText("doclet.Window_Split_Index", String title = resources.getText("doclet.Window_Split_Index",
unicode.toString()); unicode.toString());
HtmlTree body = getBody(getWindowTitle(title)); HtmlTree body = getBody(getWindowTitle(title));
HtmlTree header = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(header); addTop(headerContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
header.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
body.add(header); Content main = new ContentBuilder();
HtmlTree main = HtmlTree.MAIN();
main.add(HtmlTree.DIV(HtmlStyle.header, main.add(HtmlTree.DIV(HtmlStyle.header,
HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING, HtmlTree.HEADING(Headings.PAGE_TITLE_HEADING,
contents.getContent("doclet.Index")))); contents.getContent("doclet.Index"))));
@ -144,12 +145,15 @@ public class SplitIndexWriter extends AbstractIndexWriter {
} }
addLinksForIndexes(divTree); addLinksForIndexes(divTree);
main.add(divTree); main.add(divTree);
body.add(main);
HtmlTree footer = HtmlTree.FOOTER(); HtmlTree footer = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
footer.add(navBar.getContent(false)); footer.add(navBar.getContent(false));
addBottom(footer); addBottom(footer);
body.add(footer); body.add(new BodyContents()
.setHeader(headerContent)
.addMainContent(main)
.setFooter(footer)
.toContent());
String description = "index: " + unicode; String description = "index: " + unicode;
printHtmlDocument(null, description, body); printHtmlDocument(null, description, body);
} }

View file

@ -31,6 +31,7 @@ import javax.lang.model.element.Element;
import javax.lang.model.element.TypeElement; import javax.lang.model.element.TypeElement;
import com.sun.source.doctree.DocTree; import com.sun.source.doctree.DocTree;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -60,9 +61,9 @@ import jdk.javadoc.internal.doclets.toolkit.util.DocPath;
public abstract class SubWriterHolderWriter extends HtmlDocletWriter { public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
/** /**
* The HTML tree for main tag. * The HTML builder for the body contents.
*/ */
protected HtmlTree mainTree = HtmlTree.MAIN(); protected BodyContents bodyContents = new BodyContents();
public SubWriterHolderWriter(HtmlConfiguration configuration, DocPath filename) { public SubWriterHolderWriter(HtmlConfiguration configuration, DocPath filename) {
super(configuration, filename); super(configuration, filename);
@ -191,22 +192,19 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
/** /**
* Add the class content tree. * Add the class content tree.
* *
* @param contentTree content tree to which the class content will be added
* @param classContentTree class content tree which will be added to the content tree * @param classContentTree class content tree which will be added to the content tree
*/ */
public void addClassContentTree(Content contentTree, Content classContentTree) { public void addClassContentTree(Content classContentTree) {
mainTree.add(classContentTree); bodyContents.addMainContent(classContentTree);
contentTree.add(mainTree);
} }
/** /**
* Add the annotation content tree. * Add the annotation content tree.
* *
* @param contentTree content tree to which the annotation content will be added
* @param annotationContentTree annotation content tree which will be added to the content tree * @param annotationContentTree annotation content tree which will be added to the content tree
*/ */
public void addAnnotationContentTree(Content contentTree, Content annotationContentTree) { public void addAnnotationContentTree(Content annotationContentTree) {
addClassContentTree(contentTree, annotationContentTree); addClassContentTree(annotationContentTree);
} }
/** /**

View file

@ -29,6 +29,8 @@ import java.util.SortedSet;
import javax.lang.model.element.PackageElement; import javax.lang.model.element.PackageElement;
import jdk.javadoc.internal.doclets.formats.html.markup.BodyContents;
import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlStyle;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTag;
import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree; import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
@ -70,6 +72,8 @@ public class TreeWriter extends AbstractTreeWriter {
private final Navigation navBar; private final Navigation navBar;
protected BodyContents bodyContents;
/** /**
* Constructor to construct TreeWriter object. * Constructor to construct TreeWriter object.
* *
@ -81,7 +85,8 @@ public class TreeWriter extends AbstractTreeWriter {
super(configuration, filename, classtree); super(configuration, filename, classtree);
packages = configuration.packages; packages = configuration.packages;
classesOnly = packages.isEmpty(); classesOnly = packages.isEmpty();
this.navBar = new Navigation(null, configuration, fixedNavDiv, PageMode.TREE, path); this.navBar = new Navigation(null, configuration, PageMode.TREE, path);
this.bodyContents = new BodyContents();
} }
/** /**
@ -111,21 +116,23 @@ public class TreeWriter extends AbstractTreeWriter {
HtmlStyle.title, headContent); HtmlStyle.title, headContent);
Content div = HtmlTree.DIV(HtmlStyle.header, heading); Content div = HtmlTree.DIV(HtmlStyle.header, heading);
addPackageTreeLinks(div); addPackageTreeLinks(div);
HtmlTree htmlTree = HtmlTree.MAIN(); Content mainContent = new ContentBuilder();
htmlTree.add(div); mainContent.add(div);
HtmlTree divTree = new HtmlTree(HtmlTag.DIV); HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
divTree.setStyle(HtmlStyle.contentContainer); divTree.setStyle(HtmlStyle.contentContainer);
addTree(classtree.baseClasses(), "doclet.Class_Hierarchy", divTree); addTree(classtree.baseClasses(), "doclet.Class_Hierarchy", divTree);
addTree(classtree.baseInterfaces(), "doclet.Interface_Hierarchy", divTree); addTree(classtree.baseInterfaces(), "doclet.Interface_Hierarchy", divTree);
addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree); addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree);
addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true); addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree, true);
htmlTree.add(divTree); mainContent.add(divTree);
body.add(htmlTree); HtmlTree footerTree = HtmlTree.FOOTER();
htmlTree = HtmlTree.FOOTER();
navBar.setUserFooter(getUserHeaderFooter(false)); navBar.setUserFooter(getUserHeaderFooter(false));
htmlTree.add(navBar.getContent(false)); footerTree.add(navBar.getContent(false));
addBottom(htmlTree); addBottom(footerTree);
body.add(htmlTree); body.add(bodyContents
.addMainContent(mainContent)
.setFooter(footerTree)
.toContent());
printHtmlDocument(null, "class tree", body); printHtmlDocument(null, "class tree", body);
} }
@ -176,11 +183,11 @@ public class TreeWriter extends AbstractTreeWriter {
protected HtmlTree getTreeHeader() { protected HtmlTree getTreeHeader() {
String title = resources.getText("doclet.Window_Class_Hierarchy"); String title = resources.getText("doclet.Window_Class_Hierarchy");
HtmlTree bodyTree = getBody(getWindowTitle(title)); HtmlTree bodyTree = getBody(getWindowTitle(title));
HtmlTree htmlTree = HtmlTree.HEADER(); Content headerContent = new ContentBuilder();
addTop(htmlTree); addTop(headerContent);
navBar.setUserHeader(getUserHeaderFooter(true)); navBar.setUserHeader(getUserHeaderFooter(true));
htmlTree.add(navBar.getContent(true)); headerContent.add(navBar.getContent(true));
bodyTree.add(htmlTree); bodyContents.setHeader(headerContent);
return bodyTree; return bodyTree;
} }

View file

@ -0,0 +1,78 @@
/*
* Copyright (c) 2019, 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;
import jdk.javadoc.internal.doclets.toolkit.Content;
import java.util.ArrayList;
import java.util.List;
/**
* A builder for the contents of the BODY element.
*
* <p><b>This is NOT part of any supported API.
* If you write code that depends on this, you do so at your own risk.
* This code and its internal interfaces are subject to change or
* deletion without notice.</b>
*/
public class BodyContents {
private List<Content> mainContents = new ArrayList<>();
private Content header = HtmlTree.EMPTY;
private Content footer = HtmlTree.EMPTY;
public BodyContents addMainContent(Content content) {
mainContents.add(content);
return this;
}
public BodyContents setHeader(Content header) {
this.header = header;
return this;
}
public BodyContents setFooter(Content footer) {
this.footer = footer;
return this;
}
/**
* Returns the HTML for the contents of the BODY element.
*
* @return the HTML
*/
public Content toContent() {
HtmlTree mainTree = HtmlTree.MAIN();
mainContents.forEach(mainTree::add);
HtmlTree flexHeader = HtmlTree.HEADER().setStyle(HtmlStyle.flexHeader);
flexHeader.add(header);
HtmlTree flexBox = HtmlTree.DIV(HtmlStyle.flexBox, flexHeader);
HtmlTree flexContent = HtmlTree.DIV(HtmlStyle.flexContent, mainTree);
flexContent.add(footer);
flexBox.add(flexContent);
return flexBox;
}
}

View file

@ -73,7 +73,9 @@ public enum HtmlStyle {
externalLink, externalLink,
fieldDetails, fieldDetails,
fieldSummary, fieldSummary,
fixedNav, flexBox,
flexHeader,
flexContent,
header, header,
helpSection, helpSection,
hierarchy, hierarchy,

View file

@ -583,21 +583,6 @@ public class HtmlTree extends Content {
return htmltree; return htmltree;
} }
/**
* Generates a MAIN tag with role attribute, style attribute and some content.
*
* @param styleClass style of the MAIN tag
* @param body content of the MAIN tag
* @return an HtmlTree object for the MAIN tag
*/
public static HtmlTree MAIN(HtmlStyle styleClass, Content body) {
HtmlTree htmltree = HtmlTree.MAIN(body);
if (styleClass != null) {
htmltree.setStyle(styleClass);
}
return htmltree;
}
/** /**
* Generates a META tag with the http-equiv, content and charset attributes. * Generates a META tag with the http-equiv, content and charset attributes.
* *

View file

@ -70,7 +70,6 @@ public class Navigation {
private final DocPath path; private final DocPath path;
private final DocPath pathToRoot; private final DocPath pathToRoot;
private final Links links; private final Links links;
private final HtmlTree fixedNavDiv;
private final PageMode documentedPage; private final PageMode documentedPage;
private Content navLinkModule; private Content navLinkModule;
private Content navLinkPackage; private Content navLinkPackage;
@ -85,9 +84,6 @@ public class Navigation {
private Content userFooter; private Content userFooter;
private final String rowListTitle; private final String rowListTitle;
private final Content searchLabel; private final Content searchLabel;
private static final Script FIXED_NAV_SCRIPT = new Script("<!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n");
public enum PageMode { public enum PageMode {
ALLCLASSES, ALLCLASSES,
@ -133,15 +129,12 @@ public class Navigation {
* *
* @param element element being documented. null if its not an element documentation page * @param element element being documented. null if its not an element documentation page
* @param configuration the configuration object * @param configuration the configuration object
* @param fixedNavDiv the fixed navigation for the header navigation
* @param page the kind of page being documented * @param page the kind of page being documented
* @param path the DocPath object * @param path the DocPath object
*/ */
public Navigation(Element element, HtmlConfiguration configuration, HtmlTree fixedNavDiv, public Navigation(Element element, HtmlConfiguration configuration, PageMode page, DocPath path) {
PageMode page, DocPath path) {
this.configuration = configuration; this.configuration = configuration;
this.element = element; this.element = element;
this.fixedNavDiv = fixedNavDiv;
this.contents = configuration.contents; this.contents = configuration.contents;
this.documentedPage = page; this.documentedPage = page;
this.path = path; this.path = path;
@ -941,10 +934,6 @@ public class Navigation {
tree.add(searchDiv); tree.add(searchDiv);
} }
private void addFixedNavScript(Content tree) {
tree.add(FIXED_NAV_SCRIPT.asContent());
}
/** /**
* Get the navigation content. * Get the navigation content.
* *
@ -952,69 +941,58 @@ public class Navigation {
* @return the navigation contents * @return the navigation contents
*/ */
public Content getContent(boolean top) { public Content getContent(boolean top) {
Content contentTree = new ContentBuilder(); if (configuration.nonavbar) {
if (!configuration.nonavbar) { return new ContentBuilder();
Deque<Content> queue;
Content tree = HtmlTree.NAV();
HtmlTree navDiv = new HtmlTree(HtmlTag.DIV);
if (top) {
queue = topBottomNavContents.get(Position.TOP);
fixedNavDiv.add(Position.TOP.startOfNav());
navDiv.setStyle(HtmlStyle.topNav);
} else {
queue = topBottomNavContents.get(Position.BOTTOM);
tree.add(Position.BOTTOM.startOfNav());
navDiv.setStyle(HtmlStyle.bottomNav);
}
navDiv.add(queue.poll());
HtmlTree skipLinkDiv = HtmlTree.DIV(HtmlStyle.skipNav, queue.poll());
navDiv.add(skipLinkDiv);
navDiv.add(queue.poll());
HtmlTree navList = new HtmlTree(HtmlTag.UL);
navList.setStyle(HtmlStyle.navList);
navList.put(HtmlAttr.TITLE, rowListTitle);
fixedNavDiv.setStyle(HtmlStyle.fixedNav);
addMainNavLinks(navList);
navDiv.add(navList);
Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, top ? userHeader : userFooter);
navDiv.add(aboutDiv);
if (top) {
fixedNavDiv.add(navDiv);
} else {
tree.add(navDiv);
}
HtmlTree subDiv = new HtmlTree(HtmlTag.DIV);
subDiv.setStyle(HtmlStyle.subNav);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
// Add the summary links if present.
HtmlTree ulNavSummary = new HtmlTree(HtmlTag.UL);
ulNavSummary.setStyle(HtmlStyle.subNavList);
addSummaryLinks(ulNavSummary);
div.add(ulNavSummary);
// Add the detail links if present.
HtmlTree ulNavDetail = new HtmlTree(HtmlTag.UL);
ulNavDetail.setStyle(HtmlStyle.subNavList);
addDetailLinks(ulNavDetail);
div.add(ulNavDetail);
subDiv.add(div);
if (top && configuration.createindex) {
addSearch(subDiv);
}
if (top) {
fixedNavDiv.add(subDiv);
fixedNavDiv.add(queue.poll());
fixedNavDiv.add(Position.TOP.endOfNav());
tree.add(fixedNavDiv);
HtmlTree paddingDiv = HtmlTree.DIV(HtmlStyle.navPadding, Entity.NO_BREAK_SPACE);
tree.add(paddingDiv);
addFixedNavScript(tree);
} else {
tree.add(subDiv);
tree.add(queue.poll());
tree.add(Position.BOTTOM.endOfNav());
}
return tree;
} }
return contentTree; Deque<Content> queue;
Content tree = HtmlTree.NAV();
HtmlTree navDiv = new HtmlTree(HtmlTag.DIV);
if (top) {
queue = topBottomNavContents.get(Position.TOP);
tree.add(Position.TOP.startOfNav());
navDiv.setStyle(HtmlStyle.topNav);
} else {
queue = topBottomNavContents.get(Position.BOTTOM);
tree.add(Position.BOTTOM.startOfNav());
navDiv.setStyle(HtmlStyle.bottomNav);
}
navDiv.add(queue.poll());
HtmlTree skipLinkDiv = HtmlTree.DIV(HtmlStyle.skipNav, queue.poll());
navDiv.add(skipLinkDiv);
navDiv.add(queue.poll());
HtmlTree navList = new HtmlTree(HtmlTag.UL);
navList.setStyle(HtmlStyle.navList);
navList.put(HtmlAttr.TITLE, rowListTitle);
addMainNavLinks(navList);
navDiv.add(navList);
Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, top ? userHeader : userFooter);
navDiv.add(aboutDiv);
tree.add(navDiv);
HtmlTree subDiv = new HtmlTree(HtmlTag.DIV);
subDiv.setStyle(HtmlStyle.subNav);
HtmlTree div = new HtmlTree(HtmlTag.DIV);
// Add the summary links if present.
HtmlTree ulNavSummary = new HtmlTree(HtmlTag.UL);
ulNavSummary.setStyle(HtmlStyle.subNavList);
addSummaryLinks(ulNavSummary);
div.add(ulNavSummary);
// Add the detail links if present.
HtmlTree ulNavDetail = new HtmlTree(HtmlTag.UL);
ulNavDetail.setStyle(HtmlStyle.subNavList);
addDetailLinks(ulNavDetail);
div.add(ulNavDetail);
subDiv.add(div);
if (top && configuration.createindex) {
addSearch(subDiv);
}
tree.add(subDiv);
if (top) {
tree.add(Position.TOP.endOfNav());
tree.add(HtmlTree.DIV(HtmlStyle.skipNav, queue.poll()));
} else {
tree.add(queue.poll());
tree.add(Position.BOTTOM.endOfNav());
}
return tree;
} }
} }

View file

@ -112,10 +112,9 @@ public interface AnnotationTypeWriter {
/** /**
* Add the annotation content tree to the documentation content tree. * Add the annotation content tree to the documentation content tree.
* *
* @param contentTree content tree to which the annotation content will be added
* @param annotationContentTree annotation content tree which will be added to the content tree * @param annotationContentTree annotation content tree which will be added to the content tree
*/ */
public void addAnnotationContentTree(Content contentTree, Content annotationContentTree); public void addAnnotationContentTree(Content annotationContentTree);
/** /**
* Get the member tree. * Get the member tree.
@ -143,10 +142,8 @@ public interface AnnotationTypeWriter {
/** /**
* Add the footer of the page. * Add the footer of the page.
*
* @param contentTree content tree to which the footer will be added
*/ */
public void addFooter(Content contentTree); public void addFooter();
/** /**
* Print the document. * Print the document.

View file

@ -177,17 +177,14 @@ public interface ClassWriter {
/** /**
* Add the class content tree. * Add the class content tree.
* *
* @param contentTree content tree to which the class content will be added
* @param classContentTree class content tree which will be added to the content tree * @param classContentTree class content tree which will be added to the content tree
*/ */
public void addClassContentTree(Content contentTree, Content classContentTree); public void addClassContentTree(Content classContentTree);
/** /**
* Add the footer of the page. * Add the footer of the page.
*
* @param contentTree content tree to which the footer will be added
*/ */
public void addFooter(Content contentTree); public void addFooter();
/** /**
* Print the document. * Print the document.

View file

@ -75,10 +75,9 @@ public interface ConstantsSummaryWriter {
/** /**
* Add the content list to the documentation tree. * Add the content list to the documentation tree.
* *
* @param contentTree the tree to which the contents list will be added
* @param contentListTree the content that will be added to the list * @param contentListTree the content that will be added to the list
*/ */
public abstract void addContentsList(Content contentTree, Content contentListTree); public abstract void addContentsList(Content contentListTree);
/** /**
* Get the constant summaries for the document. * Get the constant summaries for the document.
@ -129,17 +128,14 @@ public interface ConstantsSummaryWriter {
/** /**
* Add the summaries list to the content tree. * Add the summaries list to the content tree.
* *
* @param contentTree the tree to which the summaries list will be added
* @param summariesTree the summaries content tree that will be added to the list * @param summariesTree the summaries content tree that will be added to the list
*/ */
public abstract void addConstantSummaries(Content contentTree, Content summariesTree); public abstract void addConstantSummaries(Content summariesTree);
/** /**
* Adds the footer for the summary documentation. * Adds the footer for the summary documentation.
*
* @param contentTree content tree to which the footer will be added
*/ */
public abstract void addFooter(Content contentTree); public abstract void addFooter();
/** /**
* Print the constants summary document. * Print the constants summary document.

View file

@ -111,17 +111,14 @@ public interface ModuleSummaryWriter {
/** /**
* Adds the module content tree to the documentation tree. * Adds the module content tree to the documentation tree.
* *
* @param contentTree the tree to which the module content tree will be added
* @param moduleContentTree the content tree that will be added * @param moduleContentTree the content tree that will be added
*/ */
public abstract void addModuleContent(Content contentTree, Content moduleContentTree); public abstract void addModuleContent(Content moduleContentTree);
/** /**
* Adds the footer to the documentation tree. * Adds the footer to the documentation tree.
*
* @param contentTree the tree to which the footer will be added
*/ */
public abstract void addModuleFooter(Content contentTree); public abstract void addModuleFooter();
/** /**
* Print the module summary document. * Print the module summary document.

View file

@ -143,17 +143,14 @@ public interface PackageSummaryWriter {
* Adds the tag information from the "packages.html" or "package-info.java" file to the * Adds the tag information from the "packages.html" or "package-info.java" file to the
* documentation tree. * documentation tree.
* *
* @param contentTree the content tree to which the package content tree will be added
* @param packageContentTree the package content tree to be added * @param packageContentTree the package content tree to be added
*/ */
public abstract void addPackageContent(Content contentTree, Content packageContentTree); public abstract void addPackageContent(Content packageContentTree);
/** /**
* Adds the footer to the documentation tree. * Adds the footer to the documentation tree.
*
* @param contentTree the tree to which the footer will be added
*/ */
public abstract void addPackageFooter(Content contentTree); public abstract void addPackageFooter();
/** /**
* Print the package summary document. * Print the package summary document.

View file

@ -140,19 +140,16 @@ public interface SerializedFormWriter {
public SerialMethodWriter getSerialMethodWriter(TypeElement typeElement); public SerialMethodWriter getSerialMethodWriter(TypeElement typeElement);
/** /**
* Get the serialized content. * Add the serialized content to the body content.
* *
* @param serializedTreeContent content for serialized data * @param serializedTreeContent content for serialized data
* @return a content tree for serialized information
*/ */
public Content getSerializedContent(Content serializedTreeContent); public void addSerializedContent(Content serializedTreeContent);
/** /**
* Add the footer. * Add the footer.
*
* @param serializedTree the serialized tree to be added
*/ */
public void addFooter(Content serializedTree); public void addFooter();
/** /**
* Print the serialized form document. * Print the serialized form document.

View file

@ -58,11 +58,6 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
*/ */
private final AnnotationTypeWriter writer; private final AnnotationTypeWriter writer;
/**
* The content tree for the annotation documentation.
*/
private Content contentTree;
/** /**
* Construct a new ClassBuilder. * Construct a new ClassBuilder.
* *
@ -97,17 +92,16 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
*/ */
@Override @Override
public void build() throws DocletException { public void build() throws DocletException {
buildAnnotationTypeDoc(contentTree); buildAnnotationTypeDoc();
} }
/** /**
* Build the annotation type documentation. * Build the annotation type documentation.
* *
* @param contentTree the content tree to which the documentation will be added
* @throws DocletException if there is a problem building the documentation * @throws DocletException if there is a problem building the documentation
*/ */
protected void buildAnnotationTypeDoc(Content contentTree) throws DocletException { protected void buildAnnotationTypeDoc() throws DocletException {
contentTree = writer.getHeader(resources.getText("doclet.AnnotationType") + Content contentTree = writer.getHeader(resources.getText("doclet.AnnotationType") +
" " + utils.getSimpleName(annotationType)); " " + utils.getSimpleName(annotationType));
Content annotationContentTree = writer.getAnnotationContentHeader(); Content annotationContentTree = writer.getAnnotationContentHeader();
@ -115,8 +109,8 @@ public class AnnotationTypeBuilder extends AbstractBuilder {
buildMemberSummary(annotationContentTree); buildMemberSummary(annotationContentTree);
buildAnnotationTypeMemberDetails(annotationContentTree); buildAnnotationTypeMemberDetails(annotationContentTree);
writer.addAnnotationContentTree(contentTree, annotationContentTree); writer.addAnnotationContentTree(annotationContentTree);
writer.addFooter(contentTree); writer.addFooter();
writer.printDocument(contentTree); writer.printDocument(contentTree);
copyDocFiles(); copyDocFiles();
} }

View file

@ -69,11 +69,6 @@ public class ClassBuilder extends AbstractBuilder {
*/ */
private final boolean isEnum; private final boolean isEnum;
/**
* The content tree for the class documentation.
*/
private Content contentTree;
private final Utils utils; private final Utils utils;
/** /**
@ -118,16 +113,15 @@ public class ClassBuilder extends AbstractBuilder {
*/ */
@Override @Override
public void build() throws DocletException { public void build() throws DocletException {
buildClassDoc(contentTree); buildClassDoc();
} }
/** /**
* Handles the {@literal <TypeElement>} tag. * Handles the {@literal <TypeElement>} tag.
* *
* @param contentTree the content tree to which the documentation will be added
* @throws DocletException if there is a problem while building the documentation * @throws DocletException if there is a problem while building the documentation
*/ */
protected void buildClassDoc(Content contentTree) throws DocletException { protected void buildClassDoc() throws DocletException {
String key; String key;
if (isInterface) { if (isInterface) {
key = "doclet.Interface"; key = "doclet.Interface";
@ -136,7 +130,7 @@ public class ClassBuilder extends AbstractBuilder {
} else { } else {
key = "doclet.Class"; key = "doclet.Class";
} }
contentTree = writer.getHeader(resources.getText(key) + " " Content contentTree = writer.getHeader(resources.getText(key) + " "
+ utils.getSimpleName(typeElement)); + utils.getSimpleName(typeElement));
Content classContentTree = writer.getClassContentHeader(); Content classContentTree = writer.getClassContentHeader();
@ -145,8 +139,8 @@ public class ClassBuilder extends AbstractBuilder {
buildMemberSummary(classContentTree); buildMemberSummary(classContentTree);
buildMemberDetails(classContentTree); buildMemberDetails(classContentTree);
writer.addClassContentTree(contentTree, classContentTree); writer.addClassContentTree(classContentTree);
writer.addFooter(contentTree); writer.addFooter();
writer.printDocument(contentTree); writer.printDocument(contentTree);
copyDocFiles(); copyDocFiles();
} }

View file

@ -83,11 +83,6 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
*/ */
private TypeElement currentClass; private TypeElement currentClass;
/**
* The content tree for the constant summary documentation.
*/
private Content contentTree;
/** /**
* True if first package is listed. * True if first package is listed.
*/ */
@ -129,31 +124,28 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
//Doclet does not support this output. //Doclet does not support this output.
return; return;
} }
buildConstantSummary(contentTree); buildConstantSummary();
} }
/** /**
* Build the constant summary. * Build the constant summary.
* *
* @param contentTree the content tree to which the documentation will be added
* @throws DocletException if there is a problem while building the documentation * @throws DocletException if there is a problem while building the documentation
*/ */
protected void buildConstantSummary(Content contentTree) throws DocletException { protected void buildConstantSummary() throws DocletException {
contentTree = writer.getHeader(); Content contentTree = writer.getHeader();
buildContents(contentTree); buildContents();
buildConstantSummaries(contentTree); buildConstantSummaries();
writer.addFooter(contentTree); writer.addFooter();
writer.printDocument(contentTree); writer.printDocument(contentTree);
} }
/** /**
* Build the list of packages. * Build the list of packages.
*
* @param contentTree the content tree to which the content list will be added
*/ */
protected void buildContents(Content contentTree) { protected void buildContents() {
Content contentListTree = writer.getContentsHeader(); Content contentListTree = writer.getContentsHeader();
printedPackageHeaders.clear(); printedPackageHeaders.clear();
for (PackageElement pkg : configuration.packages) { for (PackageElement pkg : configuration.packages) {
@ -161,16 +153,15 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
writer.addLinkToPackageContent(pkg, printedPackageHeaders, contentListTree); writer.addLinkToPackageContent(pkg, printedPackageHeaders, contentListTree);
} }
} }
writer.addContentsList(contentTree, contentListTree); writer.addContentsList(contentListTree);
} }
/** /**
* Build the summary for each documented package. * Build the summary for each documented package.
* *
* @param contentTree the tree to which the summaries will be added
* @throws DocletException if there is a problem while building the documentation * @throws DocletException if there is a problem while building the documentation
*/ */
protected void buildConstantSummaries(Content contentTree) throws DocletException { protected void buildConstantSummaries() throws DocletException {
printedPackageHeaders.clear(); printedPackageHeaders.clear();
Content summariesTree = writer.getConstantSummaries(); Content summariesTree = writer.getConstantSummaries();
for (PackageElement aPackage : configuration.packages) { for (PackageElement aPackage : configuration.packages) {
@ -184,7 +175,7 @@ public class ConstantsSummaryBuilder extends AbstractBuilder {
first = false; first = false;
} }
} }
writer.addConstantSummaries(contentTree, summariesTree); writer.addConstantSummaries(summariesTree);
} }
/** /**

View file

@ -55,11 +55,6 @@ public class ModuleSummaryBuilder extends AbstractBuilder {
*/ */
private final ModuleSummaryWriter moduleWriter; private final ModuleSummaryWriter moduleWriter;
/**
* The content that will be added to the module summary documentation tree.
*/
private Content contentTree;
/** /**
* Construct a new ModuleSummaryBuilder. * Construct a new ModuleSummaryBuilder.
* *
@ -101,21 +96,20 @@ public class ModuleSummaryBuilder extends AbstractBuilder {
//Doclet does not support this output. //Doclet does not support this output.
return; return;
} }
buildModuleDoc(contentTree); buildModuleDoc();
} }
/** /**
* Build the module documentation. * Build the module documentation.
* *
* @param contentTree the content tree to which the documentation will be added
* @throws DocletException if there is a problem while building the documentation * @throws DocletException if there is a problem while building the documentation
*/ */
protected void buildModuleDoc(Content contentTree) throws DocletException { protected void buildModuleDoc() throws DocletException {
contentTree = moduleWriter.getModuleHeader(mdle.getQualifiedName().toString()); Content contentTree = moduleWriter.getModuleHeader(mdle.getQualifiedName().toString());
buildContent(contentTree); buildContent();
moduleWriter.addModuleFooter(contentTree); moduleWriter.addModuleFooter();
moduleWriter.printDocument(contentTree); moduleWriter.printDocument(contentTree);
DocFilesHandler docFilesHandler = configuration.getWriterFactory().getDocFilesHandler(mdle); DocFilesHandler docFilesHandler = configuration.getWriterFactory().getDocFilesHandler(mdle);
docFilesHandler.copyDocFiles(); docFilesHandler.copyDocFiles();
@ -124,18 +118,16 @@ public class ModuleSummaryBuilder extends AbstractBuilder {
/** /**
* Build the content for the module doc. * Build the content for the module doc.
* *
* @param contentTree the content tree to which the module contents
* will be added
* @throws DocletException if there is a problem while building the documentation * @throws DocletException if there is a problem while building the documentation
*/ */
protected void buildContent(Content contentTree) throws DocletException { protected void buildContent() throws DocletException {
Content moduleContentTree = moduleWriter.getContentHeader(); Content moduleContentTree = moduleWriter.getContentHeader();
buildModuleDescription(moduleContentTree); buildModuleDescription(moduleContentTree);
buildModuleTags(moduleContentTree); buildModuleTags(moduleContentTree);
buildSummary(moduleContentTree); buildSummary(moduleContentTree);
moduleWriter.addModuleContent(contentTree, moduleContentTree); moduleWriter.addModuleContent(moduleContentTree);
} }
/** /**

View file

@ -60,11 +60,6 @@ public class PackageSummaryBuilder extends AbstractBuilder {
*/ */
private final PackageSummaryWriter packageWriter; private final PackageSummaryWriter packageWriter;
/**
* The content that will be added to the package summary documentation tree.
*/
private Content contentTree;
/** /**
* Construct a new PackageSummaryBuilder. * Construct a new PackageSummaryBuilder.
* *
@ -107,21 +102,20 @@ public class PackageSummaryBuilder extends AbstractBuilder {
//Doclet does not support this output. //Doclet does not support this output.
return; return;
} }
buildPackageDoc(contentTree); buildPackageDoc();
} }
/** /**
* Build the package documentation. * Build the package documentation.
* *
* @param contentTree the content tree to which the documentation will be added
* @throws DocletException if there is a problem while building the documentation * @throws DocletException if there is a problem while building the documentation
*/ */
protected void buildPackageDoc(Content contentTree) throws DocletException { protected void buildPackageDoc() throws DocletException {
contentTree = packageWriter.getPackageHeader(utils.getPackageName(packageElement)); Content contentTree = packageWriter.getPackageHeader(utils.getPackageName(packageElement));
buildContent(contentTree); buildContent();
packageWriter.addPackageFooter(contentTree); packageWriter.addPackageFooter();
packageWriter.printDocument(contentTree); packageWriter.printDocument(contentTree);
DocFilesHandler docFilesHandler = configuration DocFilesHandler docFilesHandler = configuration
.getWriterFactory() .getWriterFactory()
@ -132,18 +126,16 @@ public class PackageSummaryBuilder extends AbstractBuilder {
/** /**
* Build the content for the package. * Build the content for the package.
* *
* @param contentTree the content tree to which the package contents
* will be added
* @throws DocletException if there is a problem while building the documentation * @throws DocletException if there is a problem while building the documentation
*/ */
protected void buildContent(Content contentTree) throws DocletException { protected void buildContent() throws DocletException {
Content packageContentTree = packageWriter.getContentHeader(); Content packageContentTree = packageWriter.getContentHeader();
buildPackageDescription(packageContentTree); buildPackageDescription(packageContentTree);
buildPackageTags(packageContentTree); buildPackageTags(packageContentTree);
buildSummary(packageContentTree); buildSummary(packageContentTree);
packageWriter.addPackageContent(contentTree, packageContentTree); packageWriter.addPackageContent(packageContentTree);
} }
/** /**

View file

@ -95,12 +95,6 @@ public class SerializedFormBuilder extends AbstractBuilder {
*/ */
protected Element currentMember; protected Element currentMember;
/**
* The content that will be added to the serialized form documentation tree.
*/
private Content contentTree;
/** /**
* Construct a new SerializedFormBuilder. * Construct a new SerializedFormBuilder.
* @param context the build context. * @param context the build context.
@ -137,32 +131,30 @@ public class SerializedFormBuilder extends AbstractBuilder {
//Doclet does not support this output. //Doclet does not support this output.
return; return;
} }
buildSerializedForm(contentTree); buildSerializedForm();
} }
/** /**
* Build the serialized form. * Build the serialized form.
* *
* @param serializedTree content tree to which the documentation will be added
* @throws DocletException if there is a problem while building the documentation * @throws DocletException if there is a problem while building the documentation
*/ */
protected void buildSerializedForm(Content serializedTree) throws DocletException { protected void buildSerializedForm() throws DocletException {
serializedTree = writer.getHeader(resources.getText( Content contentTree = writer.getHeader(resources.getText(
"doclet.Serialized_Form")); "doclet.Serialized_Form"));
buildSerializedFormSummaries(serializedTree); buildSerializedFormSummaries();
writer.addFooter(serializedTree); writer.addFooter();
writer.printDocument(serializedTree); writer.printDocument(contentTree);
} }
/** /**
* Build the serialized form summaries. * Build the serialized form summaries.
* *
* @param serializedTree content tree to which the documentation will be added
* @throws DocletException if there is a problem while building the documentation * @throws DocletException if there is a problem while building the documentation
*/ */
protected void buildSerializedFormSummaries(Content serializedTree) protected void buildSerializedFormSummaries()
throws DocletException { throws DocletException {
Content serializedSummariesTree = writer.getSerializedSummariesHeader(); Content serializedSummariesTree = writer.getSerializedSummariesHeader();
for (PackageElement pkg : configuration.packages) { for (PackageElement pkg : configuration.packages) {
@ -170,8 +162,7 @@ public class SerializedFormBuilder extends AbstractBuilder {
buildPackageSerializedForm(serializedSummariesTree); buildPackageSerializedForm(serializedSummariesTree);
} }
serializedTree.add(writer.getSerializedContent( writer.addSerializedContent(serializedSummariesTree);
serializedSummariesTree));
} }
/** /**

View file

@ -102,9 +102,6 @@ function loadScripts(doc, tag) {
if (!tagSearchIndex) { if (!tagSearchIndex) {
createElem(doc, tag, 'tag-search-index.js'); createElem(doc, tag, 'tag-search-index.js');
} }
$(window).resize(function() {
$('.navPadding').css('padding-top', $('.fixedNav').css("height"));
});
} }
function createElem(doc, tag, path) { function createElem(doc, tag, path) {

View file

@ -40,13 +40,6 @@ a[href]:hover, a[href]:focus {
a[name] { a[name] {
color:#353833; color:#353833;
} }
a[name]:before, a[name]:target, a[id]:before, a[id]:target {
content:"";
display:inline-block;
position:relative;
padding-top:129px;
margin-top:-129px;
}
pre { pre {
font-family:'DejaVu Sans Mono', monospace; font-family:'DejaVu Sans Mono', monospace;
font-size:14px; font-size:14px;
@ -131,14 +124,19 @@ button {
/* /*
* Styles for navigation bar. * Styles for navigation bar.
*/ */
.navPadding { .flexBox {
padding-top: 107px;
}
.fixedNav {
position:fixed; position:fixed;
width:100%; display:flex;
z-index:999; flex-direction:column;
background-color:#ffffff; height: 100%;
width: 100%;
}
.flexHeader {
flex: 0 0 auto;
}
.flexContent {
flex: 1 1 auto;
overflow-y: auto;
} }
.topNav { .topNav {
background-color:#4D7A97; background-color:#4D7A97;
@ -632,7 +630,7 @@ ul.ui-autocomplete li {
background-size:12px; background-size:12px;
border:0 none; border:0 none;
width:16px; width:16px;
height:17px; height:16px;
position:relative; position:relative;
left:-4px; left:-4px;
top:-4px; top:-4px;
@ -649,8 +647,8 @@ ul.ui-autocomplete li {
font-style:italic; font-style:italic;
font-size:12px; font-size:12px;
} }
.searchTagResult:before, .searchTagResult:target { .searchTagResult:target {
color:red; background-color:yellow;
} }
.moduleGraph span { .moduleGraph span {
display:none; display:none;

View file

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @bug 8210047 8199892 8215599 * @bug 8210047 8199892 8215599 8223378
* @summary some pages contains content outside of landmark region * @summary some pages contains content outside of landmark region
* @library /tools/lib ../../lib * @library /tools/lib ../../lib
* @modules * @modules
@ -74,7 +74,7 @@ public class TestHtmlLandmarkRegions extends JavadocTester {
checkExit(Exit.OK); checkExit(Exit.OK);
checkOrder("index.html", checkOrder("index.html",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">", + "<nav role=\"navigation\">",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<div class=\"header\">\n" + "<div class=\"header\">\n"
@ -98,7 +98,7 @@ public class TestHtmlLandmarkRegions extends JavadocTester {
checkExit(Exit.OK); checkExit(Exit.OK);
checkOrder("index.html", checkOrder("index.html",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">", + "<nav role=\"navigation\">",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<div class=\"header\">\n" + "<div class=\"header\">\n"
@ -130,9 +130,10 @@ public class TestHtmlLandmarkRegions extends JavadocTester {
checkExit(Exit.OK); checkExit(Exit.OK);
checkOrder("pkg1/doc-files/s.html", checkOrder("pkg1/doc-files/s.html",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n", + "<nav role=\"navigation\">\n",
"<main role=\"main\">A sample doc file", "<main role=\"main\">\n"
+ "<div class=\"contentContainer\">A sample doc file",
"<footer role=\"contentinfo\">\n" "<footer role=\"contentinfo\">\n"
+ "<nav role=\"navigation\">" + "<nav role=\"navigation\">"
); );

View file

@ -24,7 +24,7 @@
/* /*
* @test * @test
* @bug 8072945 8081854 8141492 8148985 8150188 4649116 8173707 8151743 8169819 8183037 8182765 8196202 * @bug 8072945 8081854 8141492 8148985 8150188 4649116 8173707 8151743 8169819 8183037 8182765 8196202
* 8202624 8210047 8184205 8221871 8223733 * 8202624 8210047 8184205 8221871 8223733 8223378
* @summary Test the version of HTML generated by the javadoc tool. * @summary Test the version of HTML generated by the javadoc tool.
* @author bpatel * @author bpatel
* @library ../../lib * @library ../../lib
@ -78,9 +78,8 @@ public class TestHtmlVersion extends JavadocTester {
"<div class=\"overviewSummary\">\n" "<div class=\"overviewSummary\">\n"
+ "<table>\n" + "<table>\n"
+ "<caption>", + "<caption>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<footer role=\"contentinfo\">\n" "<footer role=\"contentinfo\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
@ -94,9 +93,8 @@ public class TestHtmlVersion extends JavadocTester {
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<div class=\"typeSummary\">\n<table>", "<div class=\"typeSummary\">\n<table>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
@ -124,9 +122,8 @@ public class TestHtmlVersion extends JavadocTester {
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<li class=\"circle\">", "<li class=\"circle\">",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
@ -150,9 +147,8 @@ public class TestHtmlVersion extends JavadocTester {
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<div class=\"useSummary\">\n<table>", "<div class=\"useSummary\">\n<table>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
@ -168,9 +164,8 @@ public class TestHtmlVersion extends JavadocTester {
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<div class=\"constantsSummary\">\n<table>", "<div class=\"constantsSummary\">\n<table>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
@ -190,9 +185,8 @@ public class TestHtmlVersion extends JavadocTester {
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<div class=\"deprecatedSummary\">\n<table>", "<div class=\"deprecatedSummary\">\n<table>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
@ -207,9 +201,8 @@ public class TestHtmlVersion extends JavadocTester {
"<a id=\"navbar.top.firstrow\">\n" "<a id=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
@ -227,9 +220,8 @@ public class TestHtmlVersion extends JavadocTester {
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<li class=\"circle\">", "<li class=\"circle\">",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
@ -252,11 +244,11 @@ public class TestHtmlVersion extends JavadocTester {
"<a id=\"navbar.top.firstrow\">\n" "<a id=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"</header>\n" "</header>\n"
+ "<div class=\"flexContent\">\n"
+ "<main role=\"main\">", + "<main role=\"main\">",
"<footer role=\"contentinfo\">\n" "<footer role=\"contentinfo\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
@ -275,9 +267,8 @@ public class TestHtmlVersion extends JavadocTester {
"<a id=\"navbar.top.firstrow\">\n" "<a id=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
@ -298,11 +289,11 @@ public class TestHtmlVersion extends JavadocTester {
"<a id=\"navbar.top.firstrow\">\n" "<a id=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
"<section class=\"nestedClassSummary\"><a id=\"nested.class.summary\">\n" "<section class=\"nestedClassSummary\"><a id=\"nested.class.summary\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
@ -349,11 +340,11 @@ public class TestHtmlVersion extends JavadocTester {
"<a id=\"navbar.top.firstrow\">\n" "<a id=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
"<section class=\"constantsSummary\"><a id=\"enum.constant.summary\">\n" "<section class=\"constantsSummary\"><a id=\"enum.constant.summary\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
@ -388,11 +379,11 @@ public class TestHtmlVersion extends JavadocTester {
"<a id=\"navbar.top.firstrow\">\n" "<a id=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
"<section class=\"methodSummary\"><a id=\"method.summary\">\n" "<section class=\"methodSummary\"><a id=\"method.summary\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
@ -416,11 +407,11 @@ public class TestHtmlVersion extends JavadocTester {
"<a id=\"navbar.top.firstrow\">\n" "<a id=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
"<section class=\"constructorSummary\"><a id=\"constructor.summary\">\n" "<section class=\"constructorSummary\"><a id=\"constructor.summary\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
@ -442,11 +433,11 @@ public class TestHtmlVersion extends JavadocTester {
"<a id=\"navbar.top.firstrow\">\n" "<a id=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
"<section class=\"constructorSummary\"><a id=\"constructor.summary\">\n" "<section class=\"constructorSummary\"><a id=\"constructor.summary\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
@ -468,11 +459,11 @@ public class TestHtmlVersion extends JavadocTester {
"<a id=\"navbar.top.firstrow\">\n" "<a id=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
"<section class=\"memberSummary\"><a id=\"annotation.type.required.element.summary\">\n" "<section class=\"memberSummary\"><a id=\"annotation.type.required.element.summary\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
@ -500,9 +491,8 @@ public class TestHtmlVersion extends JavadocTester {
"<a id=\"navbar.top.firstrow\">\n" "<a id=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<header role=\"banner\">\n" "<header role=\"banner\" class=\"flexHeader\">\n"
+ "<nav role=\"navigation\">\n" + "<nav role=\"navigation\">\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->", + "<!-- ========= START OF TOP NAVBAR ======= -->",
"<main role=\"main\">\n" "<main role=\"main\">\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
@ -528,7 +518,6 @@ public class TestHtmlVersion extends JavadocTester {
"<table summary=\"Package Summary table, listing packages, and an explanation\">\n" "<table summary=\"Package Summary table, listing packages, and an explanation\">\n"
+ "<caption>", + "<caption>",
"</noscript>\n" "</noscript>\n"
+ "<div class=\"fixedNav\">\n"
+ "<!-- ========= START OF TOP NAVBAR ======= -->"); + "<!-- ========= START OF TOP NAVBAR ======= -->");
// Negated test for package-summary page // Negated test for package-summary page
@ -574,11 +563,6 @@ public class TestHtmlVersion extends JavadocTester {
+ "</a>", + "</a>",
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "</div>\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n"
+ "<script type=\"text/javascript\"><!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
"<div class=\"constantsSummary\">\n" "<div class=\"constantsSummary\">\n"
+ "<table summary=\"Constant Field Values table, listing constant fields, and values\">"); + "<table summary=\"Constant Field Values table, listing constant fields, and values\">");
@ -592,11 +576,6 @@ public class TestHtmlVersion extends JavadocTester {
+ "</a>", + "</a>",
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "</div>\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n"
+ "<script type=\"text/javascript\"><!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "<div class=\"header\">\n" + "<div class=\"header\">\n"
+ "<h1 title=\"Deprecated API\" class=\"title\">Deprecated API</h1>\n" + "<h1 title=\"Deprecated API\" class=\"title\">Deprecated API</h1>\n"
+ "<h2 title=\"Contents\">Contents</h2>", + "<h2 title=\"Contents\">Contents</h2>",
@ -620,11 +599,6 @@ public class TestHtmlVersion extends JavadocTester {
+ "</a>", + "</a>",
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "</div>\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n"
+ "<script type=\"text/javascript\"><!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
"<li class=\"blockList\">\n" "<li class=\"blockList\">\n"
+ "<h2 title=\"Package\">Package&nbsp;pkg</h2>"); + "<h2 title=\"Package\">Package&nbsp;pkg</h2>");
@ -638,11 +612,6 @@ public class TestHtmlVersion extends JavadocTester {
+ "</a>", + "</a>",
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "</div>\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n"
+ "<script type=\"text/javascript\"><!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
"<div class=\"contentContainer\">\n" "<div class=\"contentContainer\">\n"
+ "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>", + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>",
@ -660,11 +629,6 @@ public class TestHtmlVersion extends JavadocTester {
+ "</a>", + "</a>",
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "</div>\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n"
+ "<script type=\"text/javascript\"><!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "<div class=\"contentContainer\">"); + "<div class=\"contentContainer\">");
// Negated test for src-html page // Negated test for src-html page
@ -682,11 +646,6 @@ public class TestHtmlVersion extends JavadocTester {
+ "</a>", + "</a>",
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "</div>\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n"
+ "<script type=\"text/javascript\"><!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
"<ul class=\"blockList\">\n" "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\">\n" + "<li class=\"blockList\">\n"
@ -703,8 +662,6 @@ public class TestHtmlVersion extends JavadocTester {
"<a name=\"navbar.top.firstrow\">\n" "<a name=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">",
"<!-- ======== NESTED CLASS SUMMARY ======== -->\n" "<!-- ======== NESTED CLASS SUMMARY ======== -->\n"
+ "<ul class=\"blockList\">\n" + "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a name=\"nested.class.summary\">\n" + "<li class=\"blockList\"><a name=\"nested.class.summary\">\n"
@ -763,8 +720,6 @@ public class TestHtmlVersion extends JavadocTester {
"<a name=\"navbar.top.firstrow\">\n" "<a name=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">",
"<!-- =========== ENUM CONSTANT SUMMARY =========== -->\n" "<!-- =========== ENUM CONSTANT SUMMARY =========== -->\n"
+ "<ul class=\"blockList\">\n" + "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a name=\"enum.constant.summary\">\n" + "<li class=\"blockList\"><a name=\"enum.constant.summary\">\n"
@ -801,8 +756,6 @@ public class TestHtmlVersion extends JavadocTester {
"<a name=\"navbar.top.firstrow\">\n" "<a name=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">",
"<!-- ========== METHOD SUMMARY =========== -->\n" "<!-- ========== METHOD SUMMARY =========== -->\n"
+ "<ul class=\"blockList\">\n" + "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a name=\"method.summary\">\n" + "<li class=\"blockList\"><a name=\"method.summary\">\n"
@ -825,8 +778,6 @@ public class TestHtmlVersion extends JavadocTester {
"<a name=\"navbar.top.firstrow\">\n" "<a name=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">",
"<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n" "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
+ "<ul class=\"blockList\">\n" + "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a name=\"constructor.summary\">\n" + "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
@ -847,8 +798,6 @@ public class TestHtmlVersion extends JavadocTester {
"<a name=\"navbar.top.firstrow\">\n" "<a name=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">",
"<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n" "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
+ "<ul class=\"blockList\">\n" + "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a name=\"constructor.summary\">\n" + "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
@ -869,8 +818,6 @@ public class TestHtmlVersion extends JavadocTester {
"<a name=\"navbar.top.firstrow\">\n" "<a name=\"navbar.top.firstrow\">\n"
+ "<!-- -->\n" + "<!-- -->\n"
+ "</a>", + "</a>",
"<!-- ======== START OF CLASS DATA ======== -->\n"
+ "<div class=\"header\">",
"<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->\n" "<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->\n"
+ "<ul class=\"blockList\">\n" + "<ul class=\"blockList\">\n"
+ "<li class=\"blockList\"><a name=\"annotation.type.required.element.summary\">\n" + "<li class=\"blockList\"><a name=\"annotation.type.required.element.summary\">\n"
@ -903,11 +850,6 @@ public class TestHtmlVersion extends JavadocTester {
+ "</a>", + "</a>",
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "</div>\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n"
+ "<script type=\"text/javascript\"><!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "<div class=\"header\">", + "<div class=\"header\">",
"<div class=\"useSummary\">\n" "<div class=\"useSummary\">\n"
+ "<table summary=\"Use table, listing packages, and an explanation\">", + "<table summary=\"Use table, listing packages, and an explanation\">",

View file

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @bug 4665566 4855876 7025314 8012375 8015997 8016328 8024756 8148985 8151921 8151743 8196202 * @bug 4665566 4855876 7025314 8012375 8015997 8016328 8024756 8148985 8151921 8151743 8196202 8223378
* @summary Verify that the output has the right javascript. * @summary Verify that the output has the right javascript.
* @author jamieh * @author jamieh
* @library ../../lib * @library ../../lib
@ -48,18 +48,18 @@ public class TestJavascript extends JavadocTester {
"pkg", testSrc("TestJavascript.java")); "pkg", testSrc("TestJavascript.java"));
checkExit(Exit.OK); checkExit(Exit.OK);
checkOutput("pkg/C.html", true, checkOutput("pkg/C.html", false,
"<script type=\"text/javascript\"><!--\n" "<script type=\"text/javascript\"><!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n" + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n" + "//-->\n"
+ "</script>"); + "</script>");
checkOutput("index.html", true, checkOutput("index.html", false,
"<script type=\"text/javascript\"><!--\n" "<script type=\"text/javascript\"><!--\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n" + "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"); + "//-->\n");
checkOutput("script.js", true, checkOutput("script.js", false,
"$(window).resize(function() {\n" "$(window).resize(function() {\n"
+ " $('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n" + " $('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ " });"); + " });");

View file

@ -27,7 +27,7 @@
* 8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218 * 8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218
* 8175823 8166306 8178043 8181622 8183511 8169819 8074407 8183037 8191464 * 8175823 8166306 8178043 8181622 8183511 8169819 8074407 8183037 8191464
8164407 8192007 8182765 8196200 8196201 8196202 8196202 8205593 8202462 8164407 8192007 8182765 8196200 8196201 8196202 8196202 8205593 8202462
8184205 8219060 8184205 8219060 8223378
* @summary Test modules support in javadoc. * @summary Test modules support in javadoc.
* @author bpatel * @author bpatel
* @library ../../lib * @library ../../lib
@ -533,6 +533,7 @@ public class TestModules extends JavadocTester {
checkOutput("index.html", found, checkOutput("index.html", found,
"</nav>\n" "</nav>\n"
+ "</header>\n" + "</header>\n"
+ "<div class=\"flexContent\">\n"
+ "<main role=\"main\">\n" + "<main role=\"main\">\n"
+ "<div class=\"contentContainer\">\n" + "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">The overview summary page header.</div>\n" + "<div class=\"block\">The overview summary page header.</div>\n"
@ -744,9 +745,9 @@ public class TestModules extends JavadocTester {
+ "<th class=\"colLast\" scope=\"col\">Description</th>\n" + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+ "</tr>\n" + "</tr>\n"
+ "</thead>", + "</thead>",
"</script>\n" "</nav>\n"
+ "</nav>\n"
+ "</header>\n" + "</header>\n"
+ "<div class=\"flexContent\">\n"
+ "<main role=\"main\">\n" + "<main role=\"main\">\n"
+ "<div class=\"contentContainer\">\n" + "<div class=\"contentContainer\">\n"
+ "<div class=\"block\">The overview summary page header.</div>\n" + "<div class=\"block\">The overview summary page header.</div>\n"

View file

@ -24,7 +24,7 @@
/* /*
* @test * @test
* @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188 8151743 8196027 8182765 * @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188 8151743 8196027 8182765
* 8196200 8196202 * 8196200 8196202 8223378
* @summary Make sure the Next/Prev Class links iterate through all types. * @summary Make sure the Next/Prev Class links iterate through all types.
* Make sure the navagation is 2 columns, not 3. * Make sure the navagation is 2 columns, not 3.
* @author jamieh * @author jamieh
@ -85,26 +85,23 @@ public class TestNavigation extends JavadocTester {
// Remaining tests check for additional padding to offset the fixed navigation bar. // Remaining tests check for additional padding to offset the fixed navigation bar.
checkOutput("pkg/A.html", true, checkOutput("pkg/A.html", true,
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "<div class=\"skipNav\"><a id=\"skip.navbar.top\">\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n" + "<!-- -->\n"
+ "<script type=\"text/javascript\"><!--\n" + "</a></div>\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "</nav>\n" + "</nav>\n"
+ "</header>\n" + "</header>\n"
+ "<div class=\"flexContent\">\n"
+ "<main role=\"main\">\n"
+ "<!-- ======== START OF CLASS DATA ======== -->"); + "<!-- ======== START OF CLASS DATA ======== -->");
checkOutput("pkg/package-summary.html", true, checkOutput("pkg/package-summary.html", true,
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "<div class=\"skipNav\"><a id=\"skip.navbar.top\">\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n" + "<!-- -->\n"
+ "<script type=\"text/javascript\"><!--\n" + "</a></div>\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "</nav>\n" + "</nav>\n"
+ "</header>\n" + "</header>\n"
+ "<div class=\"flexContent\">\n"
+ "<main role=\"main\">\n" + "<main role=\"main\">\n"
+ "<div class=\"header\">"); + "<div class=\"header\">");
} }
@ -121,24 +118,20 @@ public class TestNavigation extends JavadocTester {
checkOutput("pkg/A.html", true, checkOutput("pkg/A.html", true,
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "<div class=\"skipNav\"><a id=\"skip.navbar.top\">\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n" + "<!-- -->\n"
+ "<script type=\"text/javascript\"><!--\n" + "</a></div>\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "</nav>\n" + "</nav>\n"
+ "</header>\n" + "</header>\n"
+ "<div class=\"flexContent\">\n"
+ "<main role=\"main\">\n"
+ "<!-- ======== START OF CLASS DATA ======== -->"); + "<!-- ======== START OF CLASS DATA ======== -->");
checkOutput("pkg/package-summary.html", true, checkOutput("pkg/package-summary.html", true,
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "<div class=\"skipNav\"><a id=\"skip.navbar.top\">\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n" + "<!-- -->\n"
+ "<script type=\"text/javascript\"><!--\n" + "</a></div>\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n"
+ "//-->\n"
+ "</script>\n"
+ "</nav>"); + "</nav>");
} }
@ -155,11 +148,9 @@ public class TestNavigation extends JavadocTester {
checkOutput("pkg/A.html", false, checkOutput("pkg/A.html", false,
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "</div>\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n" + "<div class=\"skipNav\"><a id=\"skip.navbar.top\">\n"
+ "<script type=\"text/javascript\"><!--\n" + "<!-- -->\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n" + "</a></div>\n"
+ "//-->\n"
+ "</script>\n"
+ "</nav>\n" + "</nav>\n"
+ "</header>\n" + "</header>\n"
+ "<!-- ======== START OF CLASS DATA ======== -->"); + "<!-- ======== START OF CLASS DATA ======== -->");
@ -167,11 +158,9 @@ public class TestNavigation extends JavadocTester {
checkOutput("pkg/package-summary.html", false, checkOutput("pkg/package-summary.html", false,
"<!-- ========= END OF TOP NAVBAR ========= -->\n" "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+ "</div>\n" + "</div>\n"
+ "<div class=\"navPadding\">&nbsp;</div>\n" + "<div class=\"skipNav\"><a id=\"skip.navbar.top\">\n"
+ "<script type=\"text/javascript\"><!--\n" + "<!-- -->\n"
+ "$('.navPadding').css('padding-top', $('.fixedNav').css(\"height\"));\n" + "</a></div>\n"
+ "//-->\n"
+ "</script>\n"
+ "</nav>"); + "</nav>");
} }

View file

@ -25,7 +25,7 @@
* @test * @test
* @bug 8141492 8071982 8141636 8147890 8166175 8168965 8176794 8175218 8147881 * @bug 8141492 8071982 8141636 8147890 8166175 8168965 8176794 8175218 8147881
* 8181622 8182263 8074407 8187521 8198522 8182765 8199278 8196201 8196202 * 8181622 8182263 8074407 8187521 8198522 8182765 8199278 8196201 8196202
* 8184205 8214468 8222548 * 8184205 8214468 8222548 8223378
* @summary Test the search feature of javadoc. * @summary Test the search feature of javadoc.
* @author bpatel * @author bpatel
* @library ../../lib * @library ../../lib
@ -385,7 +385,7 @@ public class TestSearch extends JavadocTester {
+ "<input type=\"text\" id=\"search\" value=\"search\" disabled=\"disabled\">\n" + "<input type=\"text\" id=\"search\" value=\"search\" disabled=\"disabled\">\n"
+ "<input type=\"reset\" id=\"reset\" value=\"reset\" disabled=\"disabled\">\n"); + "<input type=\"reset\" id=\"reset\" value=\"reset\" disabled=\"disabled\">\n");
checkOutput(fileName, true, checkOutput(fileName, true,
"<div class=\"fixedNav\">"); "<div class=\"flexBox\">");
} }
void checkSingleIndex(boolean expectedOutput, boolean html5) { void checkSingleIndex(boolean expectedOutput, boolean html5) {

View file

@ -52,29 +52,29 @@ var $ = function(f) {
f(); f();
} else { } else {
return { return {
val: function() { val: function() {
return this; return this;
}, },
prop: function() { prop: function() {
return this; return this;
}, },
addClass: function() { addClass: function() {
return this; return this;
},
removeClass: function() {
return this;
}, },
on: function() { removeClass: function() {
return this; return this;
}, },
focus: function() { on: function() {
return this; return this;
}, },
blur: function() { focus: function() {
return this; return this;
}, },
click: function() { blur: function() {
return this; return this;
},
click: function() {
return this;
}, },
catcomplete: function(o) { catcomplete: function(o) {
o.close = function() {}; o.close = function() {};
@ -90,11 +90,11 @@ var $ = function(f) {
return resultList; return resultList;
}; };
for (var i = 0; i < clargs.length; i++) { for (var i = 0; i < clargs.length; i++) {
search(clargs[i]); search(clargs[i]);
} }
}, },
"0": { "0": {
setSelectionRange: function() { setSelectionRange: function() {
return this; return this;
} }
} }

View file

@ -24,7 +24,7 @@
/* /*
* @test * @test
* @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261 8162363 8160196 8151743 8177417 * @bug 4494033 7028815 7052425 8007338 8023608 8008164 8016549 8072461 8154261 8162363 8160196 8151743 8177417
* 8175218 8176452 8181215 8182263 8183511 8169819 8183037 8185369 8182765 8196201 8184205 * 8175218 8176452 8181215 8182263 8183511 8169819 8183037 8185369 8182765 8196201 8184205 8223378
* @summary Run tests on doclet stylesheet. * @summary Run tests on doclet stylesheet.
* @author jamieh * @author jamieh
* @library ../../lib * @library ../../lib
@ -143,18 +143,8 @@ public class TestStylesheet extends JavadocTester {
+ " padding:0px 0px 12px 10px;\n" + " padding:0px 0px 12px 10px;\n"
+ "}", + "}",
"@import url('resources/fonts/dejavu.css');", "@import url('resources/fonts/dejavu.css');",
".navPadding {\n" ".searchTagResult:target {\n"
+ " padding-top: 107px;\n" + " background-color:yellow;\n"
+ "}",
"a[name]:before, a[name]:target, a[id]:before, a[id]:target {\n"
+ " content:\"\";\n"
+ " display:inline-block;\n"
+ " position:relative;\n"
+ " padding-top:129px;\n"
+ " margin-top:-129px;\n"
+ "}",
".searchTagResult:before, .searchTagResult:target {\n"
+ " color:red;\n"
+ "}", + "}",
"a[href]:hover, a[href]:focus {\n" "a[href]:hover, a[href]:focus {\n"
+ " text-decoration:none;\n" + " text-decoration:none;\n"
@ -190,7 +180,7 @@ public class TestStylesheet extends JavadocTester {
+ " background-size:12px;\n" + " background-size:12px;\n"
+ " border:0 none;\n" + " border:0 none;\n"
+ " width:16px;\n" + " width:16px;\n"
+ " height:17px;\n" + " height:16px;\n"
+ " position:relative;\n" + " position:relative;\n"
+ " left:-4px;\n" + " left:-4px;\n"
+ " top:-4px;\n" + " top:-4px;\n"

View file

@ -23,7 +23,7 @@
/* /*
* @test * @test
* @bug 6227616 8043186 8196202 * @bug 6227616 8043186 8196202 8223378
* @summary Test the new -top option. * @summary Test the new -top option.
* @author jamieh * @author jamieh
* @library ../../lib * @library ../../lib
@ -87,6 +87,30 @@ public class TestTopOption extends JavadocTester {
"help-doc.html"); "help-doc.html");
} }
@Test
public void testNoNavbar() {
javadoc("-overview", testSrc("overview.html"),
"-use",
"-top", "TOP TEXT",
"-nonavbar",
"-d", "out-3",
"-sourcepath", testSrc,
"pkg");
checkExit(Exit.OK);
checkTopText(
"pkg/AnnotationType.html",
"pkg/class-use/AnnotationType.html",
"pkg/Cl.html",
"pkg/class-use/Cl.html",
"pkg/package-summary.html",
"pkg/package-use.html",
"index.html",
"overview-tree.html",
"constant-values.html",
"help-doc.html");
}
void checkTopText(String... files) { void checkTopText(String... files) {
for (String file : files) { for (String file : files) {
checkOutput(file, true, "TOP TEXT"); checkOutput(file, true, "TOP TEXT");