8219998: Eliminate inherently singleton lists
authorpmuthuswamy
Tue, 23 Apr 2019 18:28:48 +0530
changeset 54596 86c1da00dd6a
parent 54595 a61da18408c1
child 54597 ab57d6bebed8
8219998: Eliminate inherently singleton lists Reviewed-by: jjg
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialMethodWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeFieldWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeRequiredMemberWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/ConstructorWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/EnumConstantWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/FieldWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/MethodWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/PackageSummaryWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/PropertyWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/SerializedFormWriter.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css
test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java
test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java
test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java
test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java
test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java
test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java
test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java
test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java
test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestBadOverride.java
test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java
test/langtools/jdk/javadoc/doclet/testSingletonLists/TestSingletonLists.java
test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java
test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java
test/langtools/jdk/javadoc/lib/javadoc/tester/A11yChecker.java
test/langtools/jdk/javadoc/lib/javadoc/tester/HtmlChecker.java
test/langtools/jdk/javadoc/lib/javadoc/tester/HtmlParser.java
test/langtools/jdk/javadoc/lib/javadoc/tester/JavadocTester.java
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -498,7 +498,7 @@
      */
     @Override
     public Content getInheritedSummaryHeader(TypeElement tElement) {
-        Content inheritedTree = writer.getMemberTreeHeader();
+        Content inheritedTree = writer.getMemberInheritedTree();
         writer.addInheritedSummaryHeader(this, tElement, inheritedTree);
         return inheritedTree;
     }
@@ -551,8 +551,8 @@
      */
     public Content getMemberTree(Content memberTree, boolean isLastContent) {
         if (isLastContent)
-            return HtmlTree.UL(HtmlStyle.blockListLast, memberTree);
+            return HtmlTree.LI(HtmlStyle.blockListLast, memberTree);
         else
-            return HtmlTree.UL(HtmlStyle.blockList, memberTree);
+            return HtmlTree.LI(HtmlStyle.blockList, memberTree);
     }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractTreeWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -118,7 +118,7 @@
             Content headingContent = contents.getContent(heading);
             Content sectionHeading = HtmlTree.HEADING(Headings.CONTENT_HEADING, true,
                     headingContent);
-            HtmlTree htmlTree = HtmlTree.SECTION(sectionHeading);
+            HtmlTree htmlTree = HtmlTree.SECTION(HtmlStyle.hierarchy, sectionHeading);
             addLevelInfo(!utils.isInterface(firstTypeElement) ? firstTypeElement : null,
                     sset, isEnums, htmlTree);
             div.add(htmlTree);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllClassesIndexWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -152,11 +152,8 @@
         Content headerDiv = HtmlTree.DIV(HtmlStyle.header, pHeading);
         content.add(headerDiv);
         if (!table.isEmpty()) {
-            HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
-            HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
-            HtmlTree div = new HtmlTree(HtmlTag.DIV);
+            HtmlTree div = new HtmlTree(HtmlTag.DIV, table.toContent());
             div.setStyle(HtmlStyle.allClassesContainer);
-            div.add(ul);
             content.add(div);
             if (table.needsScript()) {
                 getMainBodyScript().append(table.getScript());
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AllPackagesIndexWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -125,7 +125,6 @@
                 table.addRow(pkg, packageLinkContent, summaryContent);
             }
         }
-        HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
-        content.add(HtmlTree.UL(HtmlStyle.blockList, li));
+        content.add(table.toContent());
     }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -25,18 +25,18 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
-import jdk.javadoc.internal.doclets.formats.html.markup.Table;
-
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.type.TypeMirror;
 
-import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
+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.HtmlTag;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
 import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeFieldWriter;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
@@ -72,7 +72,7 @@
             Content memberSummaryTree) {
         memberSummaryTree.add(
                 MarkerComments.START_OF_ANNOTATION_TYPE_FIELD_SUMMARY);
-        Content memberTree = writer.getMemberTreeHeader();
+        Content memberTree = new ContentBuilder();
         writer.addSummaryHeader(this, typeElement, memberTree);
         return memberTree;
     }
@@ -88,7 +88,7 @@
      * {@inheritDoc}
      */
     public void addMemberTree(Content memberSummaryTree, Content memberTree) {
-        writer.addMemberTree(memberSummaryTree, memberTree);
+        writer.addMemberTree(HtmlStyle.fieldSummary, memberSummaryTree, memberTree);
     }
 
     /**
@@ -101,16 +101,17 @@
     /**
      * {@inheritDoc}
      */
-    public void addAnnotationDetailsTreeHeader(TypeElement typeElement,
-            Content memberDetailsTree) {
+    public Content getAnnotationDetailsTreeHeader(TypeElement typeElement) {
+        Content memberDetailsTree = new ContentBuilder();
         if (!writer.printedAnnotationFieldHeading) {
-            memberDetailsTree.add(links.createAnchor(
-                    SectionName.ANNOTATION_TYPE_FIELD_DETAIL));
             Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
                     contents.fieldDetailsLabel);
             memberDetailsTree.add(heading);
+            memberDetailsTree.add(links.createAnchor(
+                    SectionName.ANNOTATION_TYPE_FIELD_DETAIL));
             writer.printedAnnotationFieldHeading = true;
         }
+        return memberDetailsTree;
     }
 
     /**
@@ -118,12 +119,12 @@
      */
     public Content getAnnotationDocTreeHeader(Element member,
             Content annotationDetailsTree) {
-        annotationDetailsTree.add(links.createAnchor(name(member)));
-        Content annotationDocTree = writer.getMemberTreeHeader();
+        Content annotationDocTree = new ContentBuilder();
         Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
         heading.add(name(member));
         annotationDocTree.add(heading);
-        return annotationDocTree;
+        annotationDocTree.add(links.createAnchor(name(member)));
+        return HtmlTree.SECTION(HtmlStyle.detail, annotationDocTree);
     }
 
     /**
@@ -171,8 +172,11 @@
     /**
      * {@inheritDoc}
      */
-    public Content getAnnotationDetails(Content annotationDetailsTree) {
-        return HtmlTree.SECTION(getMemberTree(annotationDetailsTree));
+    public Content getAnnotationDetails(Content annotationDetailsTreeHeader, Content annotationDetailsTree) {
+        Content annotationDetails = new ContentBuilder();
+        annotationDetails.add(annotationDetailsTreeHeader);
+        annotationDetails.add(annotationDetailsTree);
+        return getMemberTree(HtmlTree.SECTION(HtmlStyle.fieldDetails, annotationDetails));
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -25,14 +25,14 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
-
-import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
-
 import javax.lang.model.element.AnnotationValue;
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
 
+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.TableHeader;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
 import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeOptionalMemberWriter;
@@ -74,7 +74,7 @@
             Content memberSummaryTree) {
         memberSummaryTree.add(
                 MarkerComments.START_OF_ANNOTATION_TYPE_OPTIONAL_MEMBER_SUMMARY);
-        Content memberTree = writer.getMemberTreeHeader();
+        Content memberTree = new ContentBuilder();
         writer.addSummaryHeader(this, typeElement, memberTree);
         return memberTree;
     }
@@ -84,7 +84,7 @@
      */
     @Override
     public void addMemberTree(Content memberSummaryTree, Content memberTree) {
-        writer.addMemberTree(memberSummaryTree, memberTree);
+        writer.addMemberTree(HtmlStyle.memberSummary, memberSummaryTree, memberTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -25,18 +25,18 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
-import jdk.javadoc.internal.doclets.formats.html.markup.Table;
-
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.type.TypeMirror;
 
-import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
+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.HtmlTag;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
 import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeRequiredMemberWriter;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
@@ -74,7 +74,7 @@
             Content memberSummaryTree) {
         memberSummaryTree.add(
                 MarkerComments.START_OF_ANNOTATION_TYPE_REQUIRED_MEMBER_SUMMARY);
-        Content memberTree = writer.getMemberTreeHeader();
+        Content memberTree = new ContentBuilder();
         writer.addSummaryHeader(this, typeElement, memberTree);
         return memberTree;
     }
@@ -90,7 +90,7 @@
      * {@inheritDoc}
      */
     public void addMemberTree(Content memberSummaryTree, Content memberTree) {
-        writer.addMemberTree(memberSummaryTree, memberTree);
+        writer.addMemberTree(HtmlStyle.memberSummary, memberSummaryTree, memberTree);
     }
 
     /**
@@ -103,16 +103,17 @@
     /**
      * {@inheritDoc}
      */
-    public void addAnnotationDetailsTreeHeader(TypeElement te,
-            Content memberDetailsTree) {
+    public Content getAnnotationDetailsTreeHeader(TypeElement te) {
+        Content memberDetailsTree = new ContentBuilder();
         if (!writer.printedAnnotationHeading) {
-            memberDetailsTree.add(links.createAnchor(
-                    SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL));
             Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
                     contents.annotationTypeDetailsLabel);
             memberDetailsTree.add(heading);
+            memberDetailsTree.add(links.createAnchor(
+                    SectionName.ANNOTATION_TYPE_ELEMENT_DETAIL));
             writer.printedAnnotationHeading = true;
         }
+        return memberDetailsTree;
     }
 
     /**
@@ -121,13 +122,13 @@
     @Override
     public Content getAnnotationDocTreeHeader(Element member, Content annotationDetailsTree) {
         String simpleName = name(member);
-        annotationDetailsTree.add(links.createAnchor(
-                simpleName + utils.signature((ExecutableElement) member)));
-        Content annotationDocTree = writer.getMemberTreeHeader();
+        Content annotationDocTree = new ContentBuilder();
         Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
         heading.add(simpleName);
         annotationDocTree.add(heading);
-        return annotationDocTree;
+        annotationDocTree.add(links.createAnchor(
+                simpleName + utils.signature((ExecutableElement) member)));
+        return HtmlTree.SECTION(HtmlStyle.detail, annotationDocTree);
     }
 
     /**
@@ -175,8 +176,9 @@
     /**
      * {@inheritDoc}
      */
-    public Content getAnnotationDetails(Content annotationDetailsTree) {
-        return HtmlTree.SECTION(getMemberTree(annotationDetailsTree));
+    public Content getAnnotationDetails(Content annotationDetailsTreeHeader, Content annotationDetailsTree) {
+        Content annotationDetails = new ContentBuilder(annotationDetailsTreeHeader, annotationDetailsTree);
+        return getMemberTree(HtmlTree.SECTION(HtmlStyle.memberDetails, annotationDetails));
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AnnotationTypeWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -171,7 +171,7 @@
      */
     @Override
     public Content getAnnotationInfo(Content annotationInfoTree) {
-        return getMemberTree(HtmlStyle.description, annotationInfoTree);
+        return HtmlTree.SECTION(HtmlStyle.description, annotationInfoTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -249,14 +249,13 @@
      * @param contentTree the content tree to which the class use information will be added
      */
     protected void addClassUse(Content contentTree) {
-        HtmlTree ul = new HtmlTree(HtmlTag.UL);
-        ul.setStyle(HtmlStyle.blockList);
+        Content content = new ContentBuilder();
         if (configuration.packages.size() > 1) {
-            addPackageList(ul);
-            addPackageAnnotationList(ul);
+            addPackageList(content);
+            addPackageAnnotationList(content);
         }
-        addClassList(ul);
-        contentTree.add(ul);
+        addClassList(content);
+        contentTree.add(content);
     }
 
     /**
@@ -276,8 +275,7 @@
         for (PackageElement pkg : pkgSet) {
             addPackageUse(pkg, table);
         }
-        Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
-        contentTree.add(li);
+        contentTree.add(table.toContent());
     }
 
     /**
@@ -305,8 +303,7 @@
             addSummaryComment(pkg, summary);
             table.addRow(getPackageLink(pkg), summary);
         }
-        Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
-        contentTree.add(li);
+        contentTree.add(table.toContent());
     }
 
     /**
@@ -319,7 +316,7 @@
         ul.setStyle(HtmlStyle.blockList);
         for (PackageElement pkg : pkgSet) {
             Content markerAnchor = links.createAnchor(getPackageAnchorName(pkg));
-            HtmlTree htmlTree = HtmlTree.SECTION(markerAnchor);
+            HtmlTree htmlTree = HtmlTree.SECTION(HtmlStyle.detail, markerAnchor);
             Content link = contents.getContent("doclet.ClassUse_Uses.of.0.in.1",
                     getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
                             typeElement)),
@@ -329,7 +326,7 @@
             addClassUse(pkg, htmlTree);
             ul.add(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
         }
-        Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
+        Content li = HtmlTree.SECTION(HtmlStyle.classUses, ul);
         contentTree.add(li);
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstantsSummaryWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -157,7 +157,7 @@
         Content headingContent = contents.contentsHeading;
         Content heading = HtmlTree.HEADING(Headings.CONTENT_HEADING, true,
                 headingContent);
-        HtmlTree section = HtmlTree.SECTION(heading);
+        HtmlTree section = HtmlTree.SECTION(HtmlStyle.packages, heading);
         section.add(contentListTree);
         div.add(section);
         mainTree.add(div);
@@ -194,7 +194,7 @@
         Content heading = HtmlTree.HEADING(Headings.ConstantsSummary.PACKAGE_HEADING, true,
                 pkgNameContent);
         heading.add(headingContent);
-        summaryTree = HtmlTree.SECTION(heading);
+        summaryTree = HtmlTree.SECTION(HtmlStyle.constantsSummary, heading);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ConstructorWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -25,25 +25,26 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
-import jdk.javadoc.internal.doclets.formats.html.markup.Table;
-import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
-
-import java.util.*;
+import java.util.Arrays;
+import java.util.List;
 
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
 
+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.HtmlTag;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
 import jdk.javadoc.internal.doclets.toolkit.ConstructorWriter;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
 import jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable;
 
-import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.*;
+import static jdk.javadoc.internal.doclets.toolkit.util.VisibleMemberTable.Kind.CONSTRUCTORS;
 
 
 /**
@@ -98,7 +99,7 @@
     public Content getMemberSummaryHeader(TypeElement typeElement,
             Content memberSummaryTree) {
         memberSummaryTree.add(MarkerComments.START_OF_CONSTRUCTOR_SUMMARY);
-        Content memberTree = writer.getMemberTreeHeader();
+        Content memberTree = new ContentBuilder();
         writer.addSummaryHeader(this, typeElement, memberTree);
         return memberTree;
     }
@@ -108,7 +109,7 @@
      */
     @Override
     public void addMemberTree(Content memberSummaryTree, Content memberTree) {
-        writer.addMemberTree(memberSummaryTree, memberTree);
+        writer.addMemberTree(HtmlStyle.constructorSummary, memberSummaryTree, memberTree);
     }
 
     /**
@@ -118,12 +119,12 @@
     public Content getConstructorDetailsTreeHeader(TypeElement typeElement,
             Content memberDetailsTree) {
         memberDetailsTree.add(MarkerComments.START_OF_CONSTRUCTOR_DETAILS);
-        Content constructorDetailsTree = writer.getMemberTreeHeader();
-        constructorDetailsTree.add(links.createAnchor(
-                SectionName.CONSTRUCTOR_DETAIL));
+        Content constructorDetailsTree = new ContentBuilder();
         Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
                 contents.constructorDetailsLabel);
         constructorDetailsTree.add(heading);
+        constructorDetailsTree.add(links.createAnchor(
+                SectionName.CONSTRUCTOR_DETAIL));
         return constructorDetailsTree;
     }
 
@@ -134,15 +135,15 @@
     public Content getConstructorDocTreeHeader(ExecutableElement constructor,
             Content constructorDetailsTree) {
         String erasureAnchor;
-        if ((erasureAnchor = getErasureAnchor(constructor)) != null) {
-            constructorDetailsTree.add(links.createAnchor((erasureAnchor)));
-        }
-        constructorDetailsTree.add(links.createAnchor(writer.getAnchor(constructor)));
-        Content constructorDocTree = writer.getMemberTreeHeader();
+        Content constructorDocTree = new ContentBuilder();
         Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
         heading.add(name(constructor));
         constructorDocTree.add(heading);
-        return constructorDocTree;
+        if ((erasureAnchor = getErasureAnchor(constructor)) != null) {
+            constructorDocTree.add(links.createAnchor((erasureAnchor)));
+        }
+        constructorDocTree.add(links.createAnchor(writer.getAnchor(constructor)));
+        return HtmlTree.SECTION(HtmlStyle.detail, constructorDocTree);
     }
 
     /**
@@ -194,8 +195,9 @@
      * {@inheritDoc}
      */
     @Override
-    public Content getConstructorDetails(Content constructorDetailsTree) {
-        return HtmlTree.SECTION(getMemberTree(constructorDetailsTree));
+    public Content getConstructorDetails(Content constructorDetailsTreeHeader, Content constructorDetailsTree) {
+        Content constructorDetails = new ContentBuilder(constructorDetailsTreeHeader, constructorDetailsTree);
+        return getMemberTree(HtmlTree.SECTION(HtmlStyle.constructorDetails, constructorDetails));
     }
 
     /**
@@ -303,4 +305,9 @@
             tdSummaryType.add(code);
         }
     }
+
+    @Override
+    public Content getMemberTreeHeader(){
+        return writer.getMemberTreeHeader();
+    }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/EnumConstantWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -26,17 +26,17 @@
 package jdk.javadoc.internal.doclets.formats.html;
 
 
-import jdk.javadoc.internal.doclets.formats.html.markup.Table;
-import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
-
 import javax.lang.model.element.Element;
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.element.VariableElement;
 
+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.HtmlTag;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.EnumConstantWriter;
 import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
@@ -70,7 +70,7 @@
     public Content getMemberSummaryHeader(TypeElement typeElement,
             Content memberSummaryTree) {
         memberSummaryTree.add(MarkerComments.START_OF_ENUM_CONSTANT_SUMMARY);
-        Content memberTree = writer.getMemberTreeHeader();
+        Content memberTree = new ContentBuilder();
         writer.addSummaryHeader(this, typeElement, memberTree);
         return memberTree;
     }
@@ -80,7 +80,7 @@
      */
     @Override
     public void addMemberTree(Content memberSummaryTree, Content memberTree) {
-        writer.addMemberTree(memberSummaryTree, memberTree);
+        writer.addMemberTree(HtmlStyle.constantsSummary, memberSummaryTree, memberTree);
     }
 
     /**
@@ -90,12 +90,12 @@
     public Content getEnumConstantsDetailsTreeHeader(TypeElement typeElement,
             Content memberDetailsTree) {
         memberDetailsTree.add(MarkerComments.START_OF_ENUM_CONSTANT_DETAILS);
-        Content enumConstantsDetailsTree = writer.getMemberTreeHeader();
-        enumConstantsDetailsTree.add(links.createAnchor(
-                SectionName.ENUM_CONSTANT_DETAIL));
+        Content enumConstantsDetailsTree = new ContentBuilder();
         Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
                 contents.enumConstantDetailLabel);
         enumConstantsDetailsTree.add(heading);
+        enumConstantsDetailsTree.add(links.createAnchor(
+                SectionName.ENUM_CONSTANT_DETAIL));
         return enumConstantsDetailsTree;
     }
 
@@ -105,12 +105,12 @@
     @Override
     public Content getEnumConstantsTreeHeader(VariableElement enumConstant,
             Content enumConstantsDetailsTree) {
-        enumConstantsDetailsTree.add(links.createAnchor(name(enumConstant)));
-        Content enumConstantsTree = writer.getMemberTreeHeader();
+        Content enumConstantsTree = new ContentBuilder();
         Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
         heading.add(name(enumConstant));
         enumConstantsTree.add(heading);
-        return enumConstantsTree;
+        enumConstantsTree.add(links.createAnchor(name(enumConstant)));
+        return HtmlTree.SECTION(HtmlStyle.detail, enumConstantsTree);
     }
 
     /**
@@ -162,8 +162,11 @@
      * {@inheritDoc}
      */
     @Override
-    public Content getEnumConstantsDetails(Content enumConstantsDetailsTree) {
-        return HtmlTree.SECTION(getMemberTree(enumConstantsDetailsTree));
+    public Content getEnumConstantsDetails(Content enumConstantsDetailsTreeHeader,
+            Content enumConstantsDetailsTree) {
+        Content enumConstantsDetails =
+                new ContentBuilder(enumConstantsDetailsTreeHeader, enumConstantsDetailsTree);
+        return getMemberTree(HtmlTree.SECTION(HtmlStyle.constantDetails, enumConstantsDetails));
     }
 
     /**
@@ -261,4 +264,9 @@
         String name = utils.getFullyQualifiedName(member) + "." + member.getSimpleName();
         return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, member, name);
     }
+
+    @Override
+    public Content getMemberTreeHeader(){
+        return writer.getMemberTreeHeader();
+    }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/FieldWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -25,9 +25,6 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
-import jdk.javadoc.internal.doclets.formats.html.markup.Table;
-import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
-
 import java.util.Arrays;
 import java.util.List;
 
@@ -35,10 +32,13 @@
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.element.VariableElement;
 
+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.HtmlTag;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.FieldWriter;
 import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
@@ -74,7 +74,7 @@
     public Content getMemberSummaryHeader(TypeElement typeElement,
             Content memberSummaryTree) {
         memberSummaryTree.add(MarkerComments.START_OF_FIELD_SUMMARY);
-        Content memberTree = writer.getMemberTreeHeader();
+        Content memberTree = new ContentBuilder();
         writer.addSummaryHeader(this, typeElement, memberTree);
         return memberTree;
     }
@@ -84,7 +84,7 @@
      */
     @Override
     public void addMemberTree(Content memberSummaryTree, Content memberTree) {
-        writer.addMemberTree(memberSummaryTree, memberTree);
+        writer.addMemberTree(HtmlStyle.fieldSummary, memberSummaryTree, memberTree);
     }
 
     /**
@@ -93,12 +93,12 @@
     @Override
     public Content getFieldDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) {
         memberDetailsTree.add(MarkerComments.START_OF_FIELD_DETAILS);
-        Content fieldDetailsTree = writer.getMemberTreeHeader();
-        fieldDetailsTree.add(links.createAnchor(
-                SectionName.FIELD_DETAIL));
+        Content fieldDetailsTree = new ContentBuilder();
         Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
                 contents.fieldDetailsLabel);
         fieldDetailsTree.add(heading);
+        fieldDetailsTree.add(links.createAnchor(
+                SectionName.FIELD_DETAIL));
         return fieldDetailsTree;
     }
 
@@ -107,12 +107,12 @@
      */
     @Override
     public Content getFieldDocTreeHeader(VariableElement field, Content fieldDetailsTree) {
-        fieldDetailsTree.add(links.createAnchor(name(field)));
-        Content fieldTree = writer.getMemberTreeHeader();
+        Content fieldTree = new ContentBuilder();
         Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
         heading.add(name(field));
         fieldTree.add(heading);
-        return fieldTree;
+        fieldTree.add(links.createAnchor(name(field)));
+        return HtmlTree.SECTION(HtmlStyle.detail, fieldTree);
     }
 
     /**
@@ -166,8 +166,9 @@
      * {@inheritDoc}
      */
     @Override
-    public Content getFieldDetails(Content fieldDetailsTree) {
-        return HtmlTree.SECTION(getMemberTree(fieldDetailsTree));
+    public Content getFieldDetails(Content fieldDetailsTreeHeader, Content fieldDetailsTree) {
+        Content fieldDetails = new ContentBuilder(fieldDetailsTreeHeader, fieldDetailsTree);
+        return getMemberTree(HtmlTree.SECTION(HtmlStyle.fieldDetails, fieldDetails));
     }
 
     /**
@@ -290,4 +291,9 @@
         String name = utils.getFullyQualifiedName(member) + "." + member.getSimpleName();
         return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, member, name);
     }
+
+    @Override
+    public Content getMemberTreeHeader(){
+        return writer.getMemberTreeHeader();
+    }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HelpWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -127,7 +127,7 @@
         if (configuration.createoverview) {
             Content overviewHeading = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                 contents.overviewLabel);
-            htmlTree = HtmlTree.SECTION(overviewHeading);
+            htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, overviewHeading);
             String overviewKey = configuration.showModules
                     ? "doclet.help.overview.modules.body"
                     : "doclet.help.overview.packages.body";
@@ -143,7 +143,7 @@
         if (configuration.showModules) {
             Content moduleHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                     contents.moduleLabel);
-            htmlTree = HtmlTree.SECTION(moduleHead);
+            htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, moduleHead);
             Content moduleIntro = contents.getContent("doclet.help.module.intro");
             Content modulePara = HtmlTree.P(moduleIntro);
             htmlTree.add(modulePara);
@@ -158,7 +158,7 @@
         // Package
         Content packageHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                 contents.packageLabel);
-        htmlTree = HtmlTree.SECTION(packageHead);
+        htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, packageHead);
         Content packageIntro = contents.getContent("doclet.help.package.intro");
         Content packagePara = HtmlTree.P(packageIntro);
         htmlTree.add(packagePara);
@@ -175,7 +175,7 @@
         // Class/interface
         Content classHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                 contents.getContent("doclet.help.class_interface.head"));
-        htmlTree = HtmlTree.SECTION(classHead);
+        htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, classHead);
         Content classIntro = contents.getContent("doclet.help.class_interface.intro");
         Content classPara = HtmlTree.P(classIntro);
         htmlTree.add(classPara);
@@ -210,7 +210,7 @@
         // Annotation Types
         Content aHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                 contents.annotationType);
-        htmlTree = HtmlTree.SECTION(aHead);
+        htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, aHead);
         Content aIntro = contents.getContent("doclet.help.annotation_type.intro");
         Content aPara = HtmlTree.P(aIntro);
         htmlTree.add(aPara);
@@ -225,7 +225,7 @@
 
         // Enums
         Content enumHead = HtmlTree.HEADING(Headings.CONTENT_HEADING, contents.enum_);
-        htmlTree = HtmlTree.SECTION(enumHead);
+        htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, enumHead);
         Content eIntro = contents.getContent("doclet.help.enum.intro");
         Content enumPara = HtmlTree.P(eIntro);
         htmlTree.add(enumPara);
@@ -241,7 +241,7 @@
         if (configuration.classuse) {
             Content useHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                     contents.getContent("doclet.help.use.head"));
-            htmlTree = HtmlTree.SECTION(useHead);
+            htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, useHead);
             Content useBody = contents.getContent("doclet.help.use.body");
             Content usePara = HtmlTree.P(useBody);
             htmlTree.add(usePara);
@@ -252,7 +252,7 @@
         if (configuration.createtree) {
             Content treeHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                     contents.getContent("doclet.help.tree.head"));
-            htmlTree = HtmlTree.SECTION(treeHead);
+            htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, treeHead);
             Content treeIntro = contents.getContent("doclet.help.tree.intro",
                     links.createLink(DocPaths.OVERVIEW_TREE,
                     resources.getText("doclet.Class_Hierarchy")),
@@ -270,7 +270,7 @@
         if (!(configuration.nodeprecatedlist || configuration.nodeprecated)) {
             Content dHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                     contents.deprecatedAPI);
-            htmlTree = HtmlTree.SECTION(dHead);
+            htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, dHead);
             Content deprBody = contents.getContent("doclet.help.deprecated.body",
                     links.createLink(DocPaths.DEPRECATED_LIST,
                     resources.getText("doclet.Deprecated_API")));
@@ -291,7 +291,7 @@
             }
             Content indexHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                     contents.getContent("doclet.help.index.head"));
-            htmlTree = HtmlTree.SECTION(indexHead);
+            htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, indexHead);
             Content indexBody = contents.getContent("doclet.help.index.body", indexlink);
             Content indexPara = HtmlTree.P(indexBody);
             htmlTree.add(indexPara);
@@ -301,7 +301,7 @@
         // Serialized Form
         Content sHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                 contents.serializedForm);
-        htmlTree = HtmlTree.SECTION(sHead);
+        htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, sHead);
         Content serialBody = contents.getContent("doclet.help.serial_form.body");
         Content serialPara = HtmlTree.P(serialBody);
         htmlTree.add(serialPara);
@@ -310,7 +310,7 @@
         // Constant Field Values
         Content constHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                 contents.constantsSummaryTitle);
-        htmlTree = HtmlTree.SECTION(constHead);
+        htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, constHead);
         Content constantsBody = contents.getContent("doclet.help.constants.body",
                 links.createLink(DocPaths.CONSTANT_VALUES,
                 resources.getText("doclet.Constants_Summary")));
@@ -321,7 +321,7 @@
         // Search
         Content searchHead = HtmlTree.HEADING(Headings.CONTENT_HEADING,
                 contents.getContent("doclet.help.search.head"));
-        htmlTree = HtmlTree.SECTION(searchHead);
+        htmlTree = HtmlTree.SECTION(HtmlStyle.helpSection, searchHead);
         Content searchBody = contents.getContent("doclet.help.search.body");
         Content searchPara = HtmlTree.P(searchBody);
         htmlTree.add(searchPara);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialFieldWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -103,15 +103,14 @@
      * @return a content tree for the serializable fields content
      */
     public Content getSerializableFields(String heading, Content serializableFieldsTree) {
-        HtmlTree li = new HtmlTree(HtmlTag.LI);
-        li.setStyle(HtmlStyle.blockList);
+        HtmlTree section = HtmlTree.SECTION(HtmlStyle.detail);
         if (serializableFieldsTree.isValid()) {
             Content headingContent = new StringContent(heading);
             Content serialHeading = HtmlTree.HEADING(Headings.SerializedForm.CLASS_SUBHEADING, headingContent);
-            li.add(serialHeading);
-            li.add(serializableFieldsTree);
+            section.add(serialHeading);
+            section.add(serializableFieldsTree);
         }
-        return li;
+        return HtmlTree.LI(HtmlStyle.blockList, section);
     }
 
     @Override
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialMethodWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlSerialMethodWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -95,9 +95,9 @@
     public Content getSerializableMethods(String heading, Content serializableMethodContent) {
         Content headingContent = new StringContent(heading);
         Content serialHeading = HtmlTree.HEADING(Headings.SerializedForm.CLASS_SUBHEADING, headingContent);
-        Content li = HtmlTree.LI(HtmlStyle.blockList, serialHeading);
-        li.add(serializableMethodContent);
-        return li;
+        Content section = HtmlTree.SECTION(HtmlStyle.detail, serialHeading);
+        section.add(serializableMethodContent);
+        return HtmlTree.LI(HtmlStyle.blockList, section);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/MethodWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -25,9 +25,6 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
-import jdk.javadoc.internal.doclets.formats.html.markup.Table;
-import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
-
 import java.util.SortedSet;
 import java.util.TreeSet;
 
@@ -36,10 +33,13 @@
 import javax.lang.model.element.TypeElement;
 import javax.lang.model.type.TypeMirror;
 
+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.HtmlTag;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
 import jdk.javadoc.internal.doclets.toolkit.MethodWriter;
@@ -87,7 +87,7 @@
     @Override
     public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) {
         memberSummaryTree.add(MarkerComments.START_OF_METHOD_SUMMARY);
-        Content memberTree = writer.getMemberTreeHeader();
+        Content memberTree = new ContentBuilder();
         writer.addSummaryHeader(this, typeElement, memberTree);
         return memberTree;
     }
@@ -97,7 +97,7 @@
      */
     @Override
     public void addMemberTree(Content memberSummaryTree, Content memberTree) {
-        writer.addMemberTree(memberSummaryTree, memberTree);
+        writer.addMemberTree(HtmlStyle.methodSummary, memberSummaryTree, memberTree);
     }
 
     /**
@@ -106,11 +106,11 @@
     @Override
     public Content getMethodDetailsTreeHeader(TypeElement typeElement, Content memberDetailsTree) {
         memberDetailsTree.add(MarkerComments.START_OF_METHOD_DETAILS);
-        Content methodDetailsTree = writer.getMemberTreeHeader();
-        methodDetailsTree.add(links.createAnchor(SectionName.METHOD_DETAIL));
+        Content methodDetailsTree = new ContentBuilder();
         Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
                 contents.methodDetailLabel);
         methodDetailsTree.add(heading);
+        methodDetailsTree.add(links.createAnchor(SectionName.METHOD_DETAIL));
         return methodDetailsTree;
     }
 
@@ -120,15 +120,15 @@
     @Override
     public Content getMethodDocTreeHeader(ExecutableElement method, Content methodDetailsTree) {
         String erasureAnchor;
-        if ((erasureAnchor = getErasureAnchor(method)) != null) {
-            methodDetailsTree.add(links.createAnchor((erasureAnchor)));
-        }
-        methodDetailsTree.add(links.createAnchor(writer.getAnchor(method)));
-        Content methodDocTree = writer.getMemberTreeHeader();
+        Content methodDocTree = new ContentBuilder();
         Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
         heading.add(name(method));
         methodDocTree.add(heading);
-        return methodDocTree;
+        if ((erasureAnchor = getErasureAnchor(method)) != null) {
+            methodDocTree.add(links.createAnchor((erasureAnchor)));
+        }
+        methodDocTree.add(links.createAnchor(writer.getAnchor(method)));
+        return HtmlTree.SECTION(HtmlStyle.detail, methodDocTree);
     }
 
     /**
@@ -210,8 +210,9 @@
      * {@inheritDoc}
      */
     @Override
-    public Content getMethodDetails(Content methodDetailsTree) {
-        return HtmlTree.SECTION(getMemberTree(methodDetailsTree));
+    public Content getMethodDetails(Content methodDetailsTreeHeader, Content methodDetailsTree) {
+        Content methodDetails = new ContentBuilder(methodDetailsTreeHeader, methodDetailsTree);
+        return getMemberTree(HtmlTree.SECTION(HtmlStyle.methodDetails, methodDetails));
     }
 
     /**
@@ -411,4 +412,9 @@
             htmltree.add(Contents.SPACE);
         }
     }
+
+    @Override
+    public Content getMemberTreeHeader(){
+        return writer.getMemberTreeHeader();
+    }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ModuleWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -166,11 +166,6 @@
      */
     protected HtmlTree mainTree = HtmlTree.MAIN();
 
-    /**
-     * The HTML tree for section tag.
-     */
-    protected HtmlTree sectionTree = HtmlTree.SECTION();
-
     private final Navigation navBar;
 
     /**
@@ -237,9 +232,9 @@
      */
     @Override
     public Content getSummaryHeader() {
-        HtmlTree li = new HtmlTree(HtmlTag.LI);
-        li.setStyle(HtmlStyle.blockList);
-        return li;
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.setStyle(HtmlStyle.blockList);
+        return ul;
     }
 
     /**
@@ -249,8 +244,7 @@
      */
     @Override
     public Content getSummaryTree(Content summaryContentTree) {
-        HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, summaryContentTree);
-        return ul;
+        return HtmlTree.SECTION(HtmlStyle.summary, summaryContentTree);
     }
 
     /**
@@ -506,10 +500,9 @@
             TableHeader requiresTableHeader =
                     new TableHeader(contents.modifierLabel, contents.moduleLabel,
                             contents.descriptionLabel);
-            HtmlTree li = new HtmlTree(HtmlTag.LI);
-            li.setStyle(HtmlStyle.blockList);
+            HtmlTree section = HtmlTree.SECTION(HtmlStyle.modulesSummary);
             addSummaryHeader(MarkerComments.START_OF_MODULES_SUMMARY, SectionName.MODULES,
-                    contents.navModules, li);
+                    contents.navModules, section);
             if (display(requires)) {
                 String text = resources.getText("doclet.Requires_Summary");
                 String tableSummary = resources.getText("doclet.Member_Table_Summary",
@@ -519,7 +512,7 @@
                 Table table = getTable3(caption, tableSummary, HtmlStyle.requiresSummary,
                             requiresTableHeader);
                 addModulesList(requires, table);
-                li.add(table.toContent());
+                section.add(table.toContent());
             }
             // Display indirect modules table in both "api" and "all" mode.
             if (display(indirectModules)) {
@@ -531,10 +524,9 @@
                 Table amrTable = getTable3(amrCaption, amrTableSummary, HtmlStyle.requiresSummary,
                             requiresTableHeader);
                 addModulesList(indirectModules, amrTable);
-                li.add(amrTable.toContent());
+                section.add(amrTable.toContent());
             }
-            HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
-            summaryContentTree.add(ul);
+            summaryContentTree.add(HtmlTree.LI(HtmlStyle.blockList, section));
         }
     }
 
@@ -558,12 +550,11 @@
     public void addPackagesSummary(Content summaryContentTree) {
         if (display(packages)
                 || display(indirectPackages) || display(indirectOpenPackages)) {
-            HtmlTree li = new HtmlTree(HtmlTag.LI);
-            li.setStyle(HtmlStyle.blockList);
+            HtmlTree section = HtmlTree.SECTION(HtmlStyle.packagesSummary);
             addSummaryHeader(MarkerComments.START_OF_PACKAGES_SUMMARY, SectionName.PACKAGES,
-                    contents.navPackages, li);
+                    contents.navPackages, section);
             if (display(packages)) {
-                addPackageSummary(li);
+                addPackageSummary(section);
             }
             TableHeader indirectPackagesHeader =
                     new TableHeader(contents.fromLabel, contents.packagesLabel);
@@ -572,17 +563,16 @@
                 Table aepTable = getTable2(new StringContent(aepText),
                         HtmlStyle.packagesSummary, indirectPackagesHeader);
                 addIndirectPackages(aepTable, indirectPackages);
-                li.add(aepTable.toContent());
+                section.add(aepTable.toContent());
             }
             if (display(indirectOpenPackages)) {
                 String aopText = resources.getText("doclet.Indirect_Opens_Summary");
                 Table aopTable = getTable2(new StringContent(aopText), HtmlStyle.packagesSummary,
                         indirectPackagesHeader);
                 addIndirectPackages(aopTable, indirectOpenPackages);
-                li.add(aopTable.toContent());
+                section.add(aopTable.toContent());
             }
-            HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
-            summaryContentTree.add(ul);
+            summaryContentTree.add(HtmlTree.LI(HtmlStyle.blockList, section));
         }
     }
 
@@ -737,10 +727,9 @@
         boolean haveProvides = displayServices(provides.keySet(), providesTrees);
 
         if (haveProvides || haveUses) {
-            HtmlTree li = new HtmlTree(HtmlTag.LI);
-            li.setStyle(HtmlStyle.blockList);
+            HtmlTree section = HtmlTree.SECTION(HtmlStyle.servicesSummary);
             addSummaryHeader(MarkerComments.START_OF_SERVICES_SUMMARY, SectionName.SERVICES,
-                    contents.navServices, li);
+                    contents.navServices, section);
             TableHeader usesProvidesTableHeader =
                     new TableHeader(contents.typeLabel, contents.descriptionLabel);
             if (haveProvides) {
@@ -749,7 +738,7 @@
                         usesProvidesTableHeader);
                 addProvidesList(table);
                 if (!table.isEmpty()) {
-                    li.add(table.toContent());
+                    section.add(table.toContent());
                 }
             }
             if (haveUses){
@@ -758,11 +747,10 @@
                         usesProvidesTableHeader);
                 addUsesList(table);
                 if (!table.isEmpty()) {
-                    li.add(table.toContent());
+                    section.add(table.toContent());
                 }
             }
-            HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, li);
-            summaryContentTree.add(ul);
+            summaryContentTree.add(HtmlTree.LI(HtmlStyle.blockList, section));
         }
     }
 
@@ -866,7 +854,7 @@
     @Override
     public void addModuleDescription(Content moduleContentTree) {
         if (!utils.getFullBody(mdle).isEmpty()) {
-            Content tree = HtmlTree.SECTION();
+            Content tree = HtmlTree.SECTION(HtmlStyle.moduleDescription);
             addDeprecationInfo(tree);
             tree.add(MarkerComments.START_OF_MODULE_DESCRIPTION);
             tree.add(links.createAnchor(SectionName.MODULE_DESCRIPTION));
@@ -880,7 +868,7 @@
      */
     @Override
     public void addModuleTags(Content moduleContentTree) {
-        Content tree = HtmlTree.SECTION();
+        Content tree = HtmlTree.SECTION(HtmlStyle.moduleTags);
         addTagsInfo(mdle, tree);
         moduleContentTree.add(tree);
     }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/NestedClassWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -25,18 +25,18 @@
 
 package jdk.javadoc.internal.doclets.formats.html;
 
-import jdk.javadoc.internal.doclets.formats.html.markup.Table;
-import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
-
 import java.util.Arrays;
 import java.util.List;
 
 import javax.lang.model.element.Element;
 import javax.lang.model.element.TypeElement;
 
+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.StringContent;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
 
@@ -71,7 +71,7 @@
     public Content getMemberSummaryHeader(TypeElement typeElement,
             Content memberSummaryTree) {
         memberSummaryTree.add(MarkerComments.START_OF_NESTED_CLASS_SUMMARY);
-        Content memberTree = writer.getMemberTreeHeader();
+        Content memberTree = new ContentBuilder();
         writer.addSummaryHeader(this, typeElement, memberTree);
         return memberTree;
     }
@@ -81,7 +81,7 @@
      */
     @Override
     public void addMemberTree(Content memberSummaryTree, Content memberTree) {
-        writer.addMemberTree(memberSummaryTree, memberTree);
+        writer.addMemberTree(HtmlStyle.nestedClassSummary, memberSummaryTree, memberTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageUseWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -151,13 +151,12 @@
      * @param contentTree the content tree to which the package use information will be added
      */
     protected void addPackageUse(Content contentTree) {
-        HtmlTree ul = new HtmlTree(HtmlTag.UL);
-        ul.setStyle(HtmlStyle.blockList);
+        Content content = new ContentBuilder();
         if (configuration.packages.size() > 1) {
-            addPackageList(ul);
+            addPackageList(content);
         }
-        addClassList(ul);
-        contentTree.add(ul);
+        addClassList(content);
+        contentTree.add(content);
     }
 
     /**
@@ -185,8 +184,7 @@
             }
             table.addRow(packageLink, summary);
         }
-        Content li = HtmlTree.LI(HtmlStyle.blockList, table.toContent());
-        contentTree.add(li);
+        contentTree.add(table.toContent());
     }
 
     /**
@@ -197,11 +195,12 @@
     protected void addClassList(Content contentTree) {
         TableHeader classTableHeader = new TableHeader(
                 contents.classLabel, contents.descriptionLabel);
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.setStyle(HtmlStyle.blockList);
         for (String packageName : usingPackageToUsedClasses.keySet()) {
             PackageElement usingPackage = utils.elementUtils.getPackageElement(packageName);
-            HtmlTree li = new HtmlTree(HtmlTag.LI);
-            li.setStyle(HtmlStyle.blockList);
-            li.add(links.createAnchor(getPackageAnchorName(usingPackage)));
+            HtmlTree section = HtmlTree.SECTION(HtmlStyle.detail);
+            section.add(links.createAnchor(getPackageAnchorName(usingPackage)));
             String tableSummary = resources.getText("doclet.Use_Table_Summary",
                                                         resources.getText("doclet.classes"));
             Content caption = contents.getContent(
@@ -223,9 +222,11 @@
 
                 table.addRow(typeContent, summary);
             }
-            li.add(table.toContent());
-            contentTree.add(li);
+            section.add(table.toContent());
+            ul.add(HtmlTree.LI(HtmlStyle.blockList, section));
         }
+        Content li = HtmlTree.SECTION(HtmlStyle.packageUses, ul);
+        contentTree.add(li);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PackageWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -77,7 +77,7 @@
     /**
      * The HTML tree for section tag.
      */
-    protected HtmlTree sectionTree = HtmlTree.SECTION();
+    protected HtmlTree sectionTree = HtmlTree.SECTION(HtmlStyle.packageDescription, new ContentBuilder());
 
     private final Navigation navBar;
 
@@ -320,4 +320,12 @@
         printHtmlDocument(configuration.metakeywords.getMetaKeywords(packageElement),
                 description, stylesheetContent, contentTree);
     }
+
+    /**
+     * {@inheritDoc}
+     */
+    @Override
+    public Content getPackageSummary(Content summaryContentTree) {
+        return HtmlTree.SECTION(HtmlStyle.summary, summaryContentTree);
+    }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/PropertyWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -26,17 +26,17 @@
 package jdk.javadoc.internal.doclets.formats.html;
 
 
-import jdk.javadoc.internal.doclets.formats.html.markup.Table;
-import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
-
 import javax.lang.model.element.Element;
 import javax.lang.model.element.ExecutableElement;
 import javax.lang.model.element.TypeElement;
 
+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.HtmlTag;
 import jdk.javadoc.internal.doclets.formats.html.markup.HtmlTree;
 import jdk.javadoc.internal.doclets.formats.html.markup.StringContent;
+import jdk.javadoc.internal.doclets.formats.html.markup.Table;
+import jdk.javadoc.internal.doclets.formats.html.markup.TableHeader;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.MemberSummaryWriter;
 import jdk.javadoc.internal.doclets.toolkit.PropertyWriter;
@@ -68,7 +68,7 @@
     @Override
     public Content getMemberSummaryHeader(TypeElement typeElement, Content memberSummaryTree) {
         memberSummaryTree.add(MarkerComments.START_OF_PROPERTY_SUMMARY);
-        Content memberTree = writer.getMemberTreeHeader();
+        Content memberTree = new ContentBuilder();
         writer.addSummaryHeader(this, typeElement, memberTree);
         return memberTree;
     }
@@ -78,7 +78,7 @@
      */
     @Override
     public void addMemberTree(Content memberSummaryTree, Content memberTree) {
-        writer.addMemberTree(memberSummaryTree, memberTree);
+        writer.addMemberTree(HtmlStyle.propertySummary, memberSummaryTree, memberTree);
     }
 
     /**
@@ -88,11 +88,11 @@
     public Content getPropertyDetailsTreeHeader(TypeElement typeElement,
             Content memberDetailsTree) {
         memberDetailsTree.add(MarkerComments.START_OF_PROPERTY_DETAILS);
-        Content propertyDetailsTree = writer.getMemberTreeHeader();
-        propertyDetailsTree.add(links.createAnchor(SectionName.PROPERTY_DETAIL));
+        Content propertyDetailsTree = new ContentBuilder();
         Content heading = HtmlTree.HEADING(Headings.TypeDeclaration.DETAILS_HEADING,
                 contents.propertyDetailsLabel);
         propertyDetailsTree.add(heading);
+        propertyDetailsTree.add(links.createAnchor(SectionName.PROPERTY_DETAIL));
         return propertyDetailsTree;
     }
 
@@ -102,12 +102,12 @@
     @Override
     public Content getPropertyDocTreeHeader(ExecutableElement property,
             Content propertyDetailsTree) {
-        propertyDetailsTree.add(links.createAnchor(name(property)));
-        Content propertyDocTree = writer.getMemberTreeHeader();
+        Content propertyDocTree = new ContentBuilder();
         Content heading = new HtmlTree(Headings.TypeDeclaration.MEMBER_HEADING);
         heading.add(utils.getPropertyLabel(name(property)));
         propertyDocTree.add(heading);
-        return propertyDocTree;
+        propertyDocTree.add(links.createAnchor(name(property)));
+        return HtmlTree.SECTION(HtmlStyle.detail, propertyDocTree);
     }
 
     /**
@@ -181,8 +181,9 @@
      * {@inheritDoc}
      */
     @Override
-    public Content getPropertyDetails(Content propertyDetailsTree) {
-        return HtmlTree.SECTION(getMemberTree(propertyDetailsTree));
+    public Content getPropertyDetails(Content propertyDetailsTreeHeader, Content propertyDetailsTree) {
+        Content propertyDetails = new ContentBuilder(propertyDetailsTreeHeader, propertyDetailsTree);
+        return getMemberTree(HtmlTree.SECTION(HtmlStyle.propertyDetails, propertyDetails));
     }
 
     /**
@@ -312,4 +313,9 @@
         return writer.getDocLink(LinkInfoImpl.Kind.MEMBER, member,
                 utils.getFullyQualifiedName(member));
     }
+
+    @Override
+    public Content getMemberTreeHeader(){
+        return writer.getMemberTreeHeader();
+    }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SerializedFormWriterImpl.java	Tue Apr 23 18:28:48 2019 +0530
@@ -109,7 +109,7 @@
      * @return the package serialized form header tree
      */
     public Content getPackageSerializedHeader() {
-        return HtmlTree.SECTION();
+        return HtmlTree.SECTION(HtmlStyle.serializedPackageContainer);
     }
 
     /**
@@ -158,7 +158,7 @@
                 ? getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.DEFAULT, typeElement)
                         .label(configuration.getClassName(typeElement)))
                 : new StringContent(utils.getFullyQualifiedName(typeElement));
-        Content li = HtmlTree.LI(HtmlStyle.blockList, links.createAnchor(
+        Content section = HtmlTree.SECTION(HtmlStyle.serializedClassDetails, links.createAnchor(
                 utils.getFullyQualifiedName(typeElement)));
         Content superClassLink = typeElement.getSuperclass() != null
                 ? getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.SERIALIZED_FORM,
@@ -172,8 +172,8 @@
             contents.getContent(
             "doclet.Class_0_extends_implements_serializable", classLink,
             superClassLink);
-        li.add(HtmlTree.HEADING(Headings.SerializedForm.CLASS_HEADING, className));
-        return li;
+        section.add(HtmlTree.HEADING(Headings.SerializedForm.CLASS_HEADING, className));
+        return section;
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -90,8 +90,8 @@
      */
     public void addInheritedSummaryHeader(AbstractMemberWriter mw, TypeElement typeElement,
             Content inheritedTree) {
+        mw.addInheritedSummaryLabel(typeElement, inheritedTree);
         mw.addInheritedSummaryAnchor(typeElement, inheritedTree);
-        mw.addInheritedSummaryLabel(typeElement, inheritedTree);
     }
 
     /**
@@ -212,23 +212,29 @@
     /**
      * Get the member header tree
      *
-     * @return a content tree the member header
+     * @return a content tree for the member header
      */
     public Content getMemberTreeHeader() {
-        HtmlTree li = new HtmlTree(HtmlTag.LI);
-        li.setStyle(HtmlStyle.blockList);
-        return li;
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        ul.setStyle(HtmlStyle.blockList);
+        return ul;
+    }
+
+    public Content getMemberInheritedTree() {
+        HtmlTree div = new HtmlTree(HtmlTag.DIV);
+        div.setStyle(HtmlStyle.inheritedList);
+        return div;
     }
 
     /**
-     * Add the member tree.
-     *
+     * Adds the member tree with css style.
+     * @param style the css style to be applied to member tree
      * @param memberSummaryTree the content tree representing the member summary
      * @param memberTree the content tree representing the member
      */
-    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
-        HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(memberTree));
-        memberSummaryTree.add(htmlTree);
+    public void addMemberTree(HtmlStyle style, Content memberSummaryTree, Content memberTree) {
+        HtmlTree htmlTree = HtmlTree.SECTION(style, memberTree);
+        memberSummaryTree.add(getMemberTree(htmlTree));
     }
 
     /**
@@ -238,8 +244,7 @@
      * @return a content tree for the member
      */
     public Content getMemberTree(Content contentTree) {
-        Content ul = HtmlTree.UL(HtmlStyle.blockList, contentTree);
-        return ul;
+        return HtmlTree.LI(HtmlStyle.blockList, contentTree);
     }
 
     /**
@@ -249,7 +254,7 @@
      * @return a content tree for the member summary
      */
     public Content getMemberSummaryTree(Content contentTree) {
-        return getMemberTree(HtmlStyle.summary, contentTree);
+        return HtmlTree.SECTION(HtmlStyle.summary, contentTree);
     }
 
     /**
@@ -259,7 +264,7 @@
      * @return a content tree for the member details
      */
     public Content getMemberDetailsTree(Content contentTree) {
-        return getMemberTree(HtmlStyle.details, contentTree);
+        return HtmlTree.SECTION(HtmlStyle.details, contentTree);
     }
 
     /**
@@ -270,7 +275,6 @@
      * @return the member tree
      */
     public Content getMemberTree(HtmlStyle style, Content contentTree) {
-        Content div = HtmlTree.DIV(style, getMemberTree(contentTree));
-        return div;
+        return HtmlTree.SECTION(style, contentTree);
     }
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java	Tue Apr 23 18:28:48 2019 +0530
@@ -48,12 +48,16 @@
     bottomNav,
     circle,
     classUseContainer,
+    classUses,
     colConstructorName,
     colDeprecatedItemName,
     colFirst,
     colLast,
     colSecond,
     constantsSummary,
+    constructorDetails,
+    constructorSummary,
+    constantDetails,
     constantValuesContainer,
     contentContainer,
     deprecatedLabel,
@@ -63,40 +67,58 @@
     description,
     descfrmTypeLabel,
     details,
+    detail,
     docSummary,
     emphasizedPhrase,
     externalLink,
+    fieldDetails,
+    fieldSummary,
     fixedNav,
     header,
+    helpSection,
+    hierarchy,
     horizontal,
     footer,
     implementationLabel,
     indexContainer,
     indexNav,
     inheritance,
+    inheritedList,
     interfaceName,
     leftContainer,
     leftTop,
     leftBottom,
     legalCopy,
     mainContainer,
+    memberDetails,
     memberNameLabel,
     memberNameLink,
     memberSummary,
+    methodDetails,
     methodSignature,
+    methodSummary,
+    moduleDescription,
     moduleLabelInPackage,
     moduleLabelInType,
+    moduleTags,
+    modulesSummary,
     nameValue,
     navBarCell1Rev,
     navList,
     navListSearch,
     navPadding,
+    nestedClassSummary,
     overrideSpecifyLabel,
     overviewSummary,
+    packages,
+    packageDescription,
     packageHierarchyLabel,
     packageLabelInType,
     packagesSummary,
+    packageUses,
     paramLabel,
+    propertyDetails,
+    propertySummary,
     providesSummary,
     requiresSummary,
     returnLabel,
@@ -107,6 +129,9 @@
     searchTagResult,
     seeLabel,
     serializedFormContainer,
+    serializedPackageContainer,
+    serializedClassDetails,
+    servicesSummary,
     simpleTagLabel,
     skipNav,
     sourceContainer,
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java	Tue Apr 23 18:28:48 2019 +0530
@@ -717,22 +717,30 @@
     }
 
     /**
-     * Generates a SECTION tag with role attribute.
+     * Generates a SECTION tag with style class attribute.
      *
+     * @param styleClass the style class for the tag
      * @return an HtmlTree object for the SECTION tag
      */
-    public static HtmlTree SECTION() {
-        return new HtmlTree(HtmlTag.SECTION);
+    public static HtmlTree SECTION(HtmlStyle styleClass) {
+        HtmlTree htmlTree = new HtmlTree(HtmlTag.SECTION);
+        htmlTree.setStyle(styleClass);
+        return htmlTree;
     }
 
     /**
-     * Generates a SECTION tag with role attribute and some content.
+     * Generates a SECTION tag with style class attribute and some content.
      *
+     * @param styleClass the style class for the tag
      * @param body content of the section tag
      * @return an HtmlTree object for the SECTION tag
      */
-    public static HtmlTree SECTION(Content body) {
-        return new HtmlTree(HtmlTag.SECTION, nullCheck(body));
+    public static HtmlTree SECTION(HtmlStyle styleClass, Content body) {
+        HtmlTree htmlTree = new HtmlTree(HtmlTag.SECTION, nullCheck(body));
+        if (styleClass != null) {
+            htmlTree.setStyle(styleClass);
+        }
+        return htmlTree;
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Navigation.java	Tue Apr 23 18:28:48 2019 +0530
@@ -935,11 +935,10 @@
         String reset = "reset";
         HtmlTree inputText = HtmlTree.INPUT("text", searchValueId, searchValueId);
         HtmlTree inputReset = HtmlTree.INPUT(reset, reset, reset);
-        HtmlTree liInput = HtmlTree.LI(HtmlTree.LABEL(searchValueId, searchLabel));
-        liInput.add(inputText);
-        liInput.add(inputReset);
-        HtmlTree ulSearch = HtmlTree.UL(HtmlStyle.navListSearch, liInput);
-        tree.add(ulSearch);
+        HtmlTree searchDiv = HtmlTree.DIV(HtmlStyle.navListSearch, HtmlTree.LABEL(searchValueId, searchLabel));
+        searchDiv.add(inputText);
+        searchDiv.add(inputReset);
+        tree.add(searchDiv);
     }
 
     private void addFixedNavScript(Content tree) {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeFieldWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeFieldWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -62,10 +62,8 @@
      * Add the annotation type details tree header.
      *
      * @param typeElement the annotation type being documented
-     * @param memberDetailsTree the content tree representing member details
      */
-    public void addAnnotationDetailsTreeHeader(TypeElement typeElement,
-            Content memberDetailsTree);
+    public Content getAnnotationDetailsTreeHeader(TypeElement typeElement);
 
     /**
      * Get the annotation type documentation tree header.
@@ -79,10 +77,11 @@
     /**
      * Get the annotation type details tree.
      *
+     * @param annotationDetailsTreeHeader the content tree representing annotation type details header
      * @param annotationDetailsTree the content tree representing annotation type details
      * @return content tree for the annotation type details
      */
-    public Content getAnnotationDetails(Content annotationDetailsTree);
+    public Content getAnnotationDetails(Content annotationDetailsTreeHeader, Content annotationDetailsTree);
 
     /**
      * Get the annotation type documentation.
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeRequiredMemberWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/AnnotationTypeRequiredMemberWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -61,10 +61,8 @@
      * Add the annotation type details tree header.
      *
      * @param typeElement the annotation type being documented
-     * @param memberDetailsTree the content tree representing member details
      */
-    public void addAnnotationDetailsTreeHeader(TypeElement typeElement,
-            Content memberDetailsTree);
+    public Content getAnnotationDetailsTreeHeader(TypeElement typeElement);
 
     /**
      * Get the annotation type documentation tree header.
@@ -79,10 +77,11 @@
     /**
      * Get the annotation type details tree.
      *
+     * @param annotationDetailsTreeHeader the content tree representing annotation type details header
      * @param annotationDetailsTree the content tree representing annotation type details
      * @return content tree for the annotation type details
      */
-    public Content getAnnotationDetails(Content annotationDetailsTree);
+    public Content getAnnotationDetails(Content annotationDetailsTreeHeader, Content annotationDetailsTree);
 
     /**
      * Get the annotation type documentation.
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/ConstructorWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/ConstructorWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -99,10 +99,11 @@
     /**
      * Get the constructor details tree.
      *
+     * memberDetailsTreeHeader the content tree representing member details header
      * @param memberDetailsTree the content tree representing member details
      * @return content tree for the constructor details
      */
-    public Content getConstructorDetails(Content memberDetailsTree);
+    public Content getConstructorDetails(Content memberDetailsTreeHeader, Content memberDetailsTree);
 
     /**
      * Get the constructor documentation.
@@ -119,4 +120,11 @@
      * @param foundNonPubConstructor true if we found a non public constructor.
      */
     public void setFoundNonPubConstructor(boolean foundNonPubConstructor);
+
+    /**
+     * Gets the member header tree.
+     *
+     * @return a content tree for the member header
+     */
+    public Content getMemberTreeHeader();
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/EnumConstantWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/EnumConstantWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -102,7 +102,7 @@
      * @param memberDetailsTree the content tree representing member details
      * @return content tree for the enum constant details
      */
-    public Content getEnumConstantsDetails(Content memberDetailsTree);
+    public Content getEnumConstantsDetails(Content memberDetailsTreeHeader, Content memberDetailsTree);
 
     /**
      * Get the enum constants documentation.
@@ -112,4 +112,11 @@
      * @return content tree for the enum constants documentation
      */
     public Content getEnumConstants(Content enumConstantsTree, boolean isLastContent);
+
+    /**
+     * Gets the member header tree.
+     *
+     * @return a content tree for the member header
+     */
+    public Content getMemberTreeHeader();
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/FieldWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/FieldWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -100,10 +100,11 @@
     /**
      * Get the field details tree.
      *
+     * @param memberDetailsTreeHeader the content tree representing member details tree header
      * @param memberDetailsTree the content tree representing member details
      * @return content tree for the field details
      */
-    public Content getFieldDetails(Content memberDetailsTree);
+    public Content getFieldDetails(Content memberDetailsTreeHeader, Content memberDetailsTree);
 
     /**
      * Get the field documentation.
@@ -113,4 +114,11 @@
      * @return content tree for the field documentation
      */
     public Content getFieldDoc(Content fieldDocTree, boolean isLastContent);
+
+    /**
+     * Gets the member header tree.
+     *
+     * @return a content tree for the member header
+     */
+    public Content getMemberTreeHeader();
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/MethodWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/MethodWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -101,10 +101,11 @@
     /**
      * Get the method details tree.
      *
+     * @param methodDetailsTreeHeader the content tree representing method details header
      * @param methodDetailsTree the content tree representing method details
      * @return content tree for the method details
      */
-    public Content getMethodDetails(Content methodDetailsTree);
+    public Content getMethodDetails(Content methodDetailsTreeHeader, Content methodDetailsTree);
 
     /**
      * Get the method documentation.
@@ -114,4 +115,11 @@
      * @return content tree for the method documentation
      */
     public Content getMethodDoc(Content methodDocTree, boolean isLastContent);
+
+    /**
+     * Gets the member header tree.
+     *
+     * @return a content tree for the member header
+     */
+    public Content getMemberTreeHeader();
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/PackageSummaryWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/PackageSummaryWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -163,4 +163,11 @@
      */
     public abstract void printDocument(Content contentTree) throws DocFileIOException;
 
+    /**
+     * Gets the package summary tree.
+     * @param summaryContentTree the content tree representing the package summary
+     * @return a content tree for the package summary
+     */
+    public abstract Content getPackageSummary(Content summaryContentTree);
+
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/PropertyWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/PropertyWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -99,10 +99,11 @@
     /**
      * Get the property details tree.
      *
+     * @param memberDetailsTreeHeader the content tree representing member details header
      * @param memberDetailsTree the content tree representing member details
      * @return content tree for the property details
      */
-    public Content getPropertyDetails(Content memberDetailsTree);
+    public Content getPropertyDetails(Content memberDetailsTreeHeader, Content memberDetailsTree);
 
     /**
      * Get the property documentation.
@@ -112,4 +113,11 @@
      * @return content tree for the property documentation
      */
     public Content getPropertyDoc(Content propertyDocTree, boolean isLastContent);
+
+    /**
+     * Gets the member header tree.
+     *
+     * @return a content tree for the member header
+     */
+    public Content getMemberTreeHeader();
 }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/SerializedFormWriter.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/SerializedFormWriter.java	Tue Apr 23 18:28:48 2019 +0530
@@ -163,6 +163,14 @@
     public abstract void printDocument(Content serializedTree) throws DocFileIOException;
 
     /**
+     * Gets the member tree.
+     *
+     * @param contentTree the tree used to generate the complete member tree
+     * @return a content tree for the member
+     */
+    public Content getMemberTree(Content contentTree);
+
+    /**
      * Write the serialized form for a given field.
      */
     public interface SerialFieldWriter {
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -28,6 +28,7 @@
 import javax.lang.model.element.PackageElement;
 import javax.lang.model.element.TypeElement;
 
+import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
 import jdk.javadoc.internal.doclets.toolkit.AnnotationTypeWriter;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.DocFilesHandler;
@@ -149,8 +150,7 @@
      */
     protected void buildAnnotationTypeInfo(Content annotationContentTree)
             throws DocletException {
-        Content annotationInfoTree = writer.getAnnotationInfoTreeHeader();
-
+        Content annotationInfoTree = new ContentBuilder();
         buildAnnotationTypeSignature(annotationInfoTree);
         buildDeprecationInfo(annotationInfoTree);
         buildAnnotationTypeDescription(annotationInfoTree);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeFieldBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -139,12 +139,12 @@
         }
         if (hasMembersToDocument()) {
             writer.addAnnotationFieldDetailsMarker(memberDetailsTree);
+            Content annotationDetailsTreeHeader = writer.getAnnotationDetailsTreeHeader(typeElement);
+            Content detailsTree = writer.getMemberTreeHeader();
 
             Element lastElement = members.get(members.size() - 1);
             for (Element member : members) {
                 currentMember = member;
-                Content detailsTree = writer.getMemberTreeHeader();
-                writer.addAnnotationDetailsTreeHeader(typeElement, detailsTree);
                 Content annotationDocTree = writer.getAnnotationDocTreeHeader(currentMember,
                         detailsTree);
 
@@ -155,8 +155,8 @@
 
                 detailsTree.add(writer.getAnnotationDoc(
                         annotationDocTree, currentMember == lastElement));
-                memberDetailsTree.add(writer.getAnnotationDetails(detailsTree));
             }
+            memberDetailsTree.add(writer.getAnnotationDetails(annotationDetailsTreeHeader, detailsTree));
         }
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/AnnotationTypeRequiredMemberBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -142,11 +142,11 @@
         }
         if (hasMembersToDocument()) {
             writer.addAnnotationDetailsMarker(memberDetailsTree);
+            Content annotationDetailsTreeHeader = writer.getAnnotationDetailsTreeHeader(typeElement);
+            Content detailsTree = writer.getMemberTreeHeader();
             Element lastMember = members.get((members.size() - 1));
             for (Element member : members) {
                 currentMember = member;
-                Content detailsTree = writer.getMemberTreeHeader();
-                writer.addAnnotationDetailsTreeHeader(typeElement, detailsTree);
                 Content annotationDocTree = writer.getAnnotationDocTreeHeader(
                         currentMember, detailsTree);
 
@@ -154,8 +154,8 @@
 
                 detailsTree.add(writer.getAnnotationDoc(
                         annotationDocTree, currentMember == lastMember));
-                memberDetailsTree.add(writer.getAnnotationDetails(detailsTree));
             }
+            memberDetailsTree.add(writer.getAnnotationDetails(annotationDetailsTreeHeader, detailsTree));
         }
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ClassBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -28,6 +28,7 @@
 import javax.lang.model.element.PackageElement;
 import javax.lang.model.element.TypeElement;
 
+import jdk.javadoc.internal.doclets.formats.html.markup.ContentBuilder;
 import jdk.javadoc.internal.doclets.toolkit.ClassWriter;
 import jdk.javadoc.internal.doclets.toolkit.Content;
 import jdk.javadoc.internal.doclets.toolkit.DocFilesHandler;
@@ -166,8 +167,7 @@
      * @throws DocletException if there is a problem while building the documentation
      */
     protected void buildClassInfo(Content classContentTree) throws DocletException {
-        Content classInfoTree = writer.getClassInfoTreeHeader();
-
+        Content classInfoTree = new ContentBuilder();
         buildTypeParamInfo(classInfoTree);
         buildSuperInterfacesInfo(classInfoTree);
         buildImplementedInterfacesInfo(classInfoTree);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/ConstructorBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -135,8 +135,9 @@
             return;
         }
         if (hasMembersToDocument()) {
-            Content constructorDetailsTree = writer.getConstructorDetailsTreeHeader(typeElement,
+            Content constructorDetailsTreeHeader = writer.getConstructorDetailsTreeHeader(typeElement,
                     memberDetailsTree);
+            Content constructorDetailsTree = writer.getMemberTreeHeader();
 
             Element lastElement = constructors.get(constructors.size() - 1);
             for (Element contructor : constructors) {
@@ -152,7 +153,7 @@
                         currentConstructor == lastElement));
             }
             memberDetailsTree.add(
-                    writer.getConstructorDetails(constructorDetailsTree));
+                    writer.getConstructorDetails(constructorDetailsTreeHeader, constructorDetailsTree));
         }
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/EnumConstantBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -123,8 +123,9 @@
             return;
         }
         if (hasMembersToDocument()) {
-            Content enumConstantsDetailsTree = writer.getEnumConstantsDetailsTreeHeader(typeElement,
+            Content enumConstantsDetailsTreeHeader = writer.getEnumConstantsDetailsTreeHeader(typeElement,
                     memberDetailsTree);
+            Content enumConstantsDetailsTree = writer.getMemberTreeHeader();
             Element lastElement = enumConstants.get(enumConstants.size() - 1);
             for (Element enumConstant : enumConstants) {
                 currentElement = (VariableElement)enumConstant;
@@ -140,7 +141,7 @@
                         enumConstantsTree, currentElement == lastElement));
             }
             memberDetailsTree.add(
-                    writer.getEnumConstantsDetails(enumConstantsDetailsTree));
+                    writer.getEnumConstantsDetails(enumConstantsDetailsTreeHeader, enumConstantsDetailsTree));
         }
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/FieldBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -125,7 +125,8 @@
             return;
         }
         if (!fields.isEmpty()) {
-            Content fieldDetailsTree = writer.getFieldDetailsTreeHeader(typeElement, memberDetailsTree);
+            Content fieldDetailsTreeHeader = writer.getFieldDetailsTreeHeader(typeElement, memberDetailsTree);
+            Content fieldDetailsTree = writer.getMemberTreeHeader();
 
             Element lastElement = fields.get(fields.size() - 1);
             for (Element element : fields) {
@@ -141,7 +142,7 @@
                         fieldDocTree, currentElement == lastElement));
             }
             memberDetailsTree.add(
-                    writer.getFieldDetails(fieldDetailsTree));
+                    writer.getFieldDetails(fieldDetailsTreeHeader, fieldDetailsTree));
         }
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MemberSummaryBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -465,7 +465,7 @@
                 Content linksTree = writer.getInheritedSummaryLinksTree();
                 addSummaryFootNote(inheritedClass, inheritedMembers, linksTree, writer);
                 inheritedTree.add(linksTree);
-                summaryTreeList.add(writer.getMemberTree(inheritedTree));
+                summaryTreeList.add(inheritedTree);
             }
         }
     }
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/MethodBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -126,8 +126,9 @@
             return;
         }
         if (hasMembersToDocument()) {
-            Content methodDetailsTree = writer.getMethodDetailsTreeHeader(typeElement,
+            Content methodDetailsTreeHeader = writer.getMethodDetailsTreeHeader(typeElement,
                     memberDetailsTree);
+            Content methodDetailsTree = writer.getMemberTreeHeader();
 
             Element lastElement = methods.get(methods.size() - 1);
             for (Element method : methods) {
@@ -142,7 +143,7 @@
                 methodDetailsTree.add(writer.getMethodDoc(
                         methodDocTree, currentMethod == lastElement));
             }
-            memberDetailsTree.add(writer.getMethodDetails(methodDetailsTree));
+            memberDetailsTree.add(writer.getMethodDetails(methodDetailsTreeHeader, methodDetailsTree));
         }
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PackageSummaryBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -163,7 +163,7 @@
         buildErrorSummary(summaryContentTree);
         buildAnnotationTypeSummary(summaryContentTree);
 
-        packageContentTree.add(summaryContentTree);
+        packageContentTree.add(packageWriter.getPackageSummary(summaryContentTree));
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/PropertyBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -125,8 +125,9 @@
             return;
         }
         if (hasMembersToDocument()) {
-            Content propertyDetailsTree = writer.getPropertyDetailsTreeHeader(typeElement,
+            Content propertyDetailsTreeHeader = writer.getPropertyDetailsTreeHeader(typeElement,
                     memberDetailsTree);
+            Content propertyDetailsTree = writer.getMemberTreeHeader();
             Element lastElement = properties.get(properties.size() - 1);
             for (Element property : properties) {
                 currentProperty = (ExecutableElement)property;
@@ -141,7 +142,7 @@
                         propertyDocTree, currentProperty == lastElement));
             }
             memberDetailsTree.add(
-                    writer.getPropertyDetails(propertyDetailsTree));
+                    writer.getPropertyDetails(propertyDetailsTreeHeader, propertyDetailsTree));
         }
     }
 
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/builders/SerializedFormBuilder.java	Tue Apr 23 18:28:48 2019 +0530
@@ -232,7 +232,7 @@
                 buildSerialUIDInfo(classTree);
                 buildClassContent(classTree);
 
-                classSerializedTree.add(classTree);
+                classSerializedTree.add(writer.getMemberTree(classTree));
             }
         }
         packageSerializedTree.add(classSerializedTree);
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Tue Apr 23 07:05:38 2019 -0400
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css	Tue Apr 23 18:28:48 2019 +0530
@@ -207,18 +207,13 @@
     padding: 5px 6px;
     text-transform:uppercase;
 }
-ul.navListSearch {
+.subNav .navListSearch {
     float:right;
     margin:0 0 0 0;
-    padding:0;
+    padding:5px 6px;
+    clear:none;
 }
-ul.navListSearch li {
-    list-style:none;
-    float:right;
-    padding: 5px 6px;
-    text-transform:uppercase;
-}
-ul.navListSearch li label {
+.navListSearch label {
     position:relative;
     right:-16px;
 }
@@ -304,7 +299,8 @@
     margin:15px 0;
 }
 body.class-declaration .summary h3,
-body.class-declaration .details h3 {
+body.class-declaration .details h3,
+body.class-declaration .summary .inheritedList h2 {
     background-color:#dee3e9;
     border:1px solid #d0d9e0;
     margin:0 0 6px -8px;
@@ -385,32 +381,11 @@
     margin:10px 0 10px 0;
     padding:0;
 }
-ul.blockList li.blockList, ul.blockListLast li.blockList {
+ul.blockList li.blockList, ul.blockList li.blockListLast {
     list-style:none;
     margin-bottom:15px;
     line-height:1.4;
 }
-ul.blockList ul.blockList li.blockList, ul.blockList ul.blockListLast li.blockList {
-    padding:0px 20px 5px 10px;
-    border:1px solid #ededed; 
-    background-color:#f8f8f8;
-}
-ul.blockList ul.blockList ul.blockList li.blockList, ul.blockList ul.blockList ul.blockListLast li.blockList {
-    padding:0 0 5px 8px;
-    background-color:#ffffff;
-    border:none;
-}
-ul.blockList ul.blockList ul.blockList ul.blockList li.blockList {
-    margin-left:0;
-    padding-left:0;
-    padding-bottom:15px;
-    border:none;
-}
-ul.blockList ul.blockList ul.blockList ul.blockList li.blockListLast {
-    list-style:none;
-    border-bottom:none;
-    padding-bottom:0;
-}
 table tr td dl, table tr td dl dt, table tr td dl dd {
     margin-top:0;
     margin-bottom:1px;
@@ -787,6 +762,23 @@
 .methodSignature {
     white-space:normal;
 }
+.inheritedList {
+    margin: 10px 0 10px 0;
+}
+section.description {
+    line-height: 1.4;
+}
+.summary section[class$="Summary"], .details section[class$="Details"],
+.classUses .detail, .serializedClassDetails {
+    padding: 0px 20px 5px 10px;
+    border: 1px solid #ededed;
+    background-color: #f8f8f8;
+}
+.inheritedList, section[class$="Details"] .detail {
+    padding:0 0 5px 8px;
+    background-color:#ffffff;
+    border:none;
+}
 
 /*
  * Styles for user-provided tables.
--- a/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testAnnotationTypes/TestAnnotationTypes.java	Tue Apr 23 18:28:48 2019 +0530
@@ -62,6 +62,9 @@
                 + "</code></th>",
                 "<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->",
                 "<h3>DEFAULT_NAME</h3>\n"
+                + "<a id=\"DEFAULT_NAME\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre>static final&nbsp;java."
                 + "lang.String&nbsp;DEFAULT_NAME</pre>");
 
@@ -74,17 +77,20 @@
         checkOutput("pkg/AnnotationType.html", true,
                     "<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->",
                     "<ul class=\"blockList\">",
-                    "<li class=\"blockList\"><a id=\"annotation.type.element.detail\">",
+                    "<li class=\"blockList\">",
+                    "<section class=\"memberDetails\">",
+                    "<h2>Element Detail</h2>",
+                    "<a id=\"annotation.type.element.detail\">",
                     "<!--   -->",
                     "</a>",
-                    "<h2>Element Detail</h2>",
+                    "<ul class=\"blockList\">",
+                    "<li class=\"blockListLast\">",
+                    "<section class=\"detail\">",
+                    "<h3>value</h3>",
                     "<a id=\"value()\">",
                     "<!--   -->",
                     "</a>",
-                    "<ul class=\"blockListLast\">",
-                    "<li class=\"blockList\">",
-                    "<h3>value</h3>",
-                    "<pre>int&nbsp;value</pre>" );
+                    "<pre>int&nbsp;value</pre>");
 
         checkOutput("pkg/AnnotationType.html", false,
                 "<HR>\n\n"
--- a/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testHiddenTag/TestHiddenTag.java	Tue Apr 23 18:28:48 2019 +0530
@@ -68,10 +68,11 @@
                 "<code><a href=\"A.html#visibleMethod()\">visibleMethod</a></code>",
                 "<h2>Nested classes/interfaces inherited from class&nbsp;pkg1." +
                 "<a href=\"A.html\" title=\"class in pkg1\">A</a></h2>\n" +
-                "<code><a href=\"A.VisibleInner.html\" title=\"class in pkg1\">" +
+                "<a id=\"nested.classes.inherited.from.class.pkg1.A\">\n" +
+                "<!--   -->\n" +
+                "</a><code><a href=\"A.VisibleInner.html\" title=\"class in pkg1\">" +
                 "A.VisibleInner</a>, <a href=\"A.VisibleInnerExtendsInvisibleInner.html\" " +
-                "title=\"class in pkg1\">A.VisibleInnerExtendsInvisibleInner</a></code></li>\n" +
-                "</ul>");
+                "title=\"class in pkg1\">A.VisibleInnerExtendsInvisibleInner</a></code></div>\n");
 
         checkOutput("pkg1/A.VisibleInner.html", false,
                 "../pkg1/A.VisibleInner.html#VisibleInner()",
@@ -82,7 +83,7 @@
                 "<pre>public static class <span class=\"typeNameLabel\">" +
                 "A.VisibleInnerExtendsInvisibleInner</span>\n" +
                 "extends <a href=\"A.html\" title=\"class in pkg1\">A</a></pre>",
-                "<code><a href=\"A.html#visibleField\">visibleField</a></code></li>",
+                "<code><a href=\"A.html#visibleField\">visibleField</a></code>",
                 "<code><a href=\"A.html#visibleMethod()\">visibleMethod</a></code>");
 
         checkOutput("pkg1/A.VisibleInnerExtendsInvisibleInner.html", false,
--- a/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlDefinitionListTag/TestHtmlDefinitionListTag.java	Tue Apr 23 18:28:48 2019 +0530
@@ -375,10 +375,12 @@
         checkOutput("pkg1/C1.html", expectFound,
                 "<pre class=\"methodSignature\">public&nbsp;void&nbsp;readObject()\n" +
                 "                throws java.io.IOException</pre>\n" +
+                "</section>\n" +
                 "</li>");
 
         checkOutput("pkg1/C2.html", expectFound,
                 "<pre>public&nbsp;C2()</pre>\n" +
+                "</section>\n" +
                 "</li>");
 
         checkOutput("pkg1/C1.ModalExclusionType.html", expectFound,
@@ -386,6 +388,7 @@
                 "static final&nbsp;<a href=\"C1.ModalExclusionType.html\" " +
                 "title=\"enum in pkg1\">C1.ModalExclusionType</a> " +
                 "APPLICATION_EXCLUDE</pre>\n" +
+                "</section>\n" +
                 "</li>");
 
         checkOutput("serialized-form.html", expectFound,
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Tue Apr 23 18:28:48 2019 +0530
@@ -109,7 +109,7 @@
 
         checkOutput("pkg3/package-summary.html", true,
                 "<div class=\"contentContainer\">\n"
-                + "<section><a id=\"package.description\">\n"
+                + "<section class=\"packageDescription\"><a id=\"package.description\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<div class=\"block\"><p>This is the first line. Note the newlines before the &lt;p&gt; is relevant.</div>\n"
--- a/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Tue Apr 23 18:28:48 2019 +0530
@@ -100,7 +100,7 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section><a id=\"package.description\">\n"
+                "<section class=\"packageDescription\"><a id=\"package.description\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<div class=\"block\">Test package.</div>",
@@ -110,6 +110,7 @@
         // No package description
         checkOutput("pkg1/package-summary.html", true,
                 "<div class=\"contentContainer\">\n"
+                + "<section class=\"summary\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
                 + "<div class=\"typeSummary\">\n<table>\n"
@@ -129,13 +130,13 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section>\n"
+                "<section class=\"hierarchy\">\n"
                 + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>",
-                "<section>\n"
+                "<section class=\"hierarchy\">\n"
                 + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>",
-                "<section>\n"
+                "<section class=\"hierarchy\">\n"
                 + "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>",
-                "<section>\n"
+                "<section class=\"hierarchy\">\n"
                 + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -173,9 +174,9 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section>\n"
+                "<section class=\"packages\">\n"
                 + "<h2 title=\"Contents\">Contents</h2>\n",
-                "<section>\n"
+                "<section class=\"constantsSummary\">\n"
                 + "<h2 title=\"pkg\">pkg.*</h2>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -212,7 +213,7 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section>\n"
+                "<section class=\"serializedPackageContainer\">\n"
                 + "<h2 title=\"Package\">Package&nbsp;pkg</h2>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -232,13 +233,13 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section>\n"
+                "<section class=\"hierarchy\">\n"
                 + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>\n",
-                "<section>\n"
+                "<section class=\"hierarchy\">\n"
                 + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>\n",
-                "<section>\n"
+                "<section class=\"hierarchy\">\n"
                 + "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n",
-                "<section>\n"
+                "<section class=\"hierarchy\">\n"
                 + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -280,11 +281,11 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section>\n"
+                "<section class=\"helpSection\">\n"
                 + "<h2>Overview</h2>\n",
-                "<section>\n"
+                "<section class=\"helpSection\">\n"
                 + "<h2>Package</h2>\n",
-                "<section>\n"
+                "<section class=\"helpSection\">\n"
                 + "<h2>Class or Interface</h2>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -303,51 +304,40 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"nested.class.summary\">\n"
+                "<section class=\"nestedClassSummary\"><a id=\"nested.class.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Nested Class Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n<table>",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"field.summary\">\n"
+                "<section class=\"fieldSummary\"><a id=\"field.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Field Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n<table>",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+                "<section class=\"constructorSummary\"><a id=\"constructor.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Constructor Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n<table>",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
+                "<section class=\"methodSummary\"><a id=\"method.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Method Summary</h2>",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"field.detail\">\n"
+                "<section class=\"fieldDetails\">\n"
+                + "<h2>Field Detail</h2>\n"
+                + "<a id=\"field.detail\">\n"
                 + "<!--   -->\n"
-                + "</a>\n"
-                + "<h2>Field Detail</h2>",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+                + "</a>",
+                "<section class=\"constructorDetails\">\n"
+                + "<h2>Constructor Detail</h2>\n"
+                + "<a id=\"constructor.detail\">\n"
                 + "<!--   -->\n"
-                + "</a>\n"
-                + "<h2>Constructor Detail</h2>",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
+                + "</a>",
+                "<section class=\"methodDetails\">\n"
+                + "<h2>Method Detail</h2>\n"
+                + "<a id=\"method.detail\">\n"
                 + "<!--   -->\n"
-                + "</a>\n"
-                + "<h2>Method Detail</h2>",
+                + "</a>",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
                 + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@@ -365,34 +355,28 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"enum.constant.summary\">\n"
+                "<section class=\"constantsSummary\"><a id=\"enum.constant.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Enum Constant Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n",
                 "<table aria-labelledby=\"t0\">\n",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
+                "<section class=\"methodSummary\"><a id=\"method.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Method Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n",
                 "<table aria-labelledby=\"t0\">",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"enum.constant.detail\">\n"
+                "<section class=\"constantDetails\">\n"
+                + "<h2>Enum Constant Detail</h2>\n"
+                + "<a id=\"enum.constant.detail\">\n"
                 + "<!--   -->\n"
-                + "</a>\n"
-                + "<h2>Enum Constant Detail</h2>",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
+                + "</a>\n",
+                "<section class=\"methodDetails\">\n"
+                + "<h2>Method Detail</h2>\n"
+                + "<a id=\"method.detail\">\n"
                 + "<!--   -->\n"
-                + "</a>\n"
-                + "<h2>Method Detail</h2>",
+                + "</a>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
                 + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@@ -410,20 +394,17 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
+                "<section class=\"methodSummary\"><a id=\"method.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Method Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n",
                 "<table aria-labelledby=\"t0\">\n",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
+                "<section class=\"methodDetails\">\n"
+                + "<h2>Method Detail</h2>\n"
+                + "<a id=\"method.detail\">\n"
                 + "<!--   -->\n"
-                + "</a>\n"
-                + "<h2>Method Detail</h2>",
+                + "</a>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
                 + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@@ -441,18 +422,15 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+                "<section class=\"constructorSummary\"><a id=\"constructor.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Constructor Summary</h2>",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+                "<section class=\"constructorDetails\">\n"
+                + "<h2>Constructor Detail</h2>\n"
+                + "<a id=\"constructor.detail\">\n"
                 + "<!--   -->\n"
-                + "</a>\n"
-                + "<h2>Constructor Detail</h2>",
+                + "</a>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
                 + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@@ -470,18 +448,15 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+                "<section class=\"constructorSummary\"><a id=\"constructor.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Constructor Summary</h2>",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+                "<section class=\"constructorDetails\">\n"
+                + "<h2>Constructor Detail</h2>\n"
+                + "<a id=\"constructor.detail\">\n"
                 + "<!--   -->\n"
-                + "</a>\n"
-                + "<h2>Constructor Detail</h2>",
+                + "</a>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
                 + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@@ -499,26 +474,21 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"annotation.type.required.element.summary\">\n"
+                "<section class=\"memberSummary\"><a id=\"annotation.type.required.element.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Required Element Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n<table>",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"annotation.type.optional.element.summary\">\n"
+                "<section class=\"memberSummary\"><a id=\"annotation.type.optional.element.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Optional Element Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n<table>",
-                "<section>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\"><a id=\"annotation.type.element.detail\">\n"
+                "<section class=\"memberDetails\">\n"
+                + "<h2>Element Detail</h2>\n"
+                + "<a id=\"annotation.type.element.detail\">\n"
                 + "<!--   -->\n"
-                + "</a>\n"
-                + "<h2>Element Detail</h2>",
+                + "</a>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
                 + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
@@ -537,7 +507,7 @@
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
                 "<div class=\"useSummary\">\n<table>",
-                "<section><a id=\"pkg\">\n"
+                "<section class=\"detail\"><a id=\"pkg\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Uses of <a href=\"../RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h2>\n"
@@ -569,7 +539,7 @@
                 + "<!--   -->\n"
                 + "</a>",
                 "<section>\n"
-                + "<h2 title=\"Package pkg Description\">Package pkg Description</h2>\n",
+                + "<h2 title=\"PackagAnotherClass.ModalExclusionType.htmle pkg Description\">Package pkg Description</h2>\n",
                 "<div class=\"typeSummary\">\n<table summary=\"Interface Summary table, listing interfaces, and an explanation\">",
                 "<div class=\"typeSummary\">\n<table summary=\"Class Summary table, listing classes, and an explanation\">",
                 "<div class=\"typeSummary\">\n<table summary=\"Enum Summary table, listing enums, and an explanation\">",
--- a/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java	Tue Apr 23 18:28:48 2019 +0530
@@ -132,6 +132,9 @@
 
         checkOutput("pkg/ClassWithStaticMembers.html", true,
                 "<h3>f</h3>\n"
+                + "<a id=\"f\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre>public static&nbsp;int f</pre>\n"
                 + "<div class=\"block\">A hider field</div>",
 
@@ -143,6 +146,9 @@
                 + "</td>\n",
 
                 "<h3>staticMethod</h3>\n"
+                + "<a id=\"staticMethod()\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre class=\"methodSignature\">public static&nbsp;void&nbsp;staticMethod()</pre>\n"
                 + "<div class=\"block\"><span class=\"descfrmTypeLabel\">"
                 + "Description copied from interface:&nbsp;<code>"
@@ -185,7 +191,9 @@
             // Ensure the correct type parameters are displayed correctly
             "<h2>Nested classes/interfaces inherited from interface&nbsp;pkg2."
             + "<a href=\"Spliterator.html\" title=\"interface in pkg2\">Spliterator</a></h2>\n"
-            + "<code><a href=\"Spliterator.OfDouble.html\" title=\"interface in pkg2\">"
+            + "<a id=\"nested.classes.inherited.from.class.pkg2.Spliterator\">\n"
+            + "<!--   -->\n"
+            + "</a><code><a href=\"Spliterator.OfDouble.html\" title=\"interface in pkg2\">"
             + "Spliterator.OfDouble</a>, <a href=\"Spliterator.OfInt.html\" "
             + "title=\"interface in pkg2\">Spliterator.OfInt</a>&lt;"
             + "<a href=\"Spliterator.OfInt.html\" title=\"type parameter in Spliterator.OfInt\">"
--- a/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testJavaFX/TestJavaFX.java	Tue Apr 23 18:28:48 2019 +0530
@@ -87,13 +87,22 @@
                 + "<td class=\"colLast\">\n"
                 + "<div class=\"block\">Defines if paused.</div>",
                 "<h3>paused</h3>\n"
+                + "<a id=\"pausedProperty\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre>public final&nbsp;<a href=\"C.BooleanProperty.html\" "
                 + "title=\"class in pkg1\">C.BooleanProperty</a> pausedProperty</pre>\n"
                 + "<div class=\"block\">Defines if paused. The second line.</div>",
                 "<h3>isPaused</h3>\n"
+                + "<a id=\"isPaused()\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre class=\"methodSignature\">public final&nbsp;double&nbsp;isPaused()</pre>\n"
                 + "<div class=\"block\">Gets the value of the property paused.</div>",
                 "<h3>setPaused</h3>\n"
+                + "<a id=\"setPaused(boolean)\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre class=\"methodSignature\">public final&nbsp;void&nbsp;setPaused&#8203;(boolean&nbsp;value)</pre>\n"
                 + "<div class=\"block\">Sets the value of the property paused.</div>\n"
                 + "<dl>\n"
@@ -102,6 +111,9 @@
                 + "<dt><span class=\"simpleTagLabel\">Default value:</span></dt>\n"
                 + "<dd>false</dd>",
                 "<h3>isPaused</h3>\n"
+                + "<a id=\"isPaused()\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre class=\"methodSignature\">public final&nbsp;double&nbsp;isPaused()</pre>\n"
                 + "<div class=\"block\">Gets the value of the property paused.</div>\n"
                 + "<dl>\n"
@@ -110,12 +122,18 @@
                 + "<dt><span class=\"simpleTagLabel\">Default value:</span></dt>\n"
                 + "<dd>false</dd>",
                 "<h3>rate</h3>\n"
+                + "<a id=\"rateProperty\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre>public final&nbsp;<a href=\"C.DoubleProperty.html\" "
                 + "title=\"class in pkg1\">C.DoubleProperty</a> rateProperty</pre>\n"
                 + "<div class=\"block\">Defines the direction/speed at which the "
                 + "<code>Timeline</code> is expected to\n"
                 + " be played. This is the second line.</div>",
                 "<h3>setRate</h3>\n"
+                + "<a id=\"setRate(double)\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre class=\"methodSignature\">public final&nbsp;void&nbsp;setRate&#8203;(double&nbsp;value)</pre>\n"
                 + "<div class=\"block\">Sets the value of the property rate.</div>\n"
                 + "<dl>\n"
@@ -127,6 +145,9 @@
                 + "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
                 + "<dd>JavaFX 8.0</dd>",
                 "<h3>getRate</h3>\n"
+                + "<a id=\"getRate()\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre class=\"methodSignature\">public final&nbsp;double&nbsp;getRate()</pre>\n"
                 + "<div class=\"block\">Gets the value of the property rate.</div>\n"
                 + "<dl>\n"
@@ -170,8 +191,10 @@
         checkOutput("pkg1/D.html", true,
                 "<h3>Properties inherited from class&nbsp;pkg1."
                     + "<a href=\"C.html\" title=\"class in pkg1\">C</a></h3>\n"
-                    + "<code><a href=\"C.html#pausedProperty\">"
-                    + "paused</a>, <a href=\"C.html#rateProperty\">rate</a></code></li>");
+                    + "<a id=\"properties.inherited.from.class.pkg1.C\">\n"
+                    + "<!--   -->\n"
+                    + "</a><code><a href=\"C.html#pausedProperty\">"
+                    + "paused</a>, <a href=\"C.html#rateProperty\">rate</a></code></div>");
 
         checkOutput("pkg1/D.html", false, "shouldNotAppear");
     }
@@ -191,36 +214,40 @@
         checkExit(Exit.OK);
         checkOutput("pkg2/Test.html", true,
                 "<h2>Property Detail</h2>\n"
-                + "<a id=\"betaProperty\">\n"
-                + "<!--   -->\n"
-                + "</a>\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\">\n"
-                + "<h3>beta</h3>\n"
-                + "<pre>public&nbsp;java.lang.Object betaProperty</pre>\n"
-                + "</li>\n"
-                + "</ul>\n"
-                + "<a id=\"gammaProperty\">\n"
+                + "<a id=\"property.detail\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
+                + "<section class=\"detail\">\n"
+                + "<h3>beta</h3>\n"
+                + "<a id=\"betaProperty\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<pre>public&nbsp;java.lang.Object betaProperty</pre>\n"
+                + "</section>\n"
+                + "</li>\n"
+                + "<li class=\"blockList\">\n"
+                + "<section class=\"detail\">\n"
                 + "<h3>gamma</h3>\n"
+                + "<a id=\"gammaProperty\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre>public final&nbsp;java.util.List&lt;java.lang.String&gt; gammaProperty</pre>\n"
+                + "</section>\n"
                 + "</li>\n"
-                + "</ul>\n"
+                + "<li class=\"blockListLast\">\n"
+                + "<section class=\"detail\">\n"
+                + "<h3>delta</h3>\n"
                 + "<a id=\"deltaProperty\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
-                + "<ul class=\"blockListLast\">\n"
-                + "<li class=\"blockList\">\n"
-                + "<h3>delta</h3>\n"
                 + "<pre>public final&nbsp;java.util.List&lt;"
                 + "java.util.Set&lt;? super java.lang.Object&gt;&gt; deltaProperty</pre>\n"
+                + "</section>\n"
                 + "</li>\n"
                 + "</ul>\n"
-                + "</li>\n"
-                + "</ul>",
+                + "</section>",
                 "<h2>Property Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n<table>\n"
                 + "<caption><span>Properties</span><span class=\"tabEnd\">&nbsp;</span></caption>");
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Tue Apr 23 18:28:48 2019 +0530
@@ -478,7 +478,7 @@
 
     void checkHtml5Description(boolean found) {
         checkOutput("moduleA/module-summary.html", found,
-                "<section>\n"
+                "<section class=\"moduleDescription\">\n"
                 + "<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">Deprecated, for removal:"
                 + " This API element is subject to removal in a future version.</span>\n"
                 + "<div class=\"deprecationComment\">This module is deprecated.</div>\n"
@@ -490,7 +490,7 @@
                 + "<div class=\"block\">This is a test description for the moduleA module with a Search "
                 + "phrase <a id=\"searchphrase\" class=\"searchTagResult\">search phrase</a>.</div>");
         checkOutput("moduleB/module-summary.html", found,
-                "<section>\n"
+                "<section class=\"moduleDescription\">\n"
                 + "<!-- ============ MODULE DESCRIPTION =========== -->\n"
                 + "<a id=\"module.description\">\n"
                 + "<!--   -->\n"
@@ -523,17 +523,17 @@
     void checkHtml5NoDescription(boolean found) {
         checkOutput("moduleA/module-summary.html", found,
                 "<div class=\"contentContainer\">\n"
+                + "<section class=\"summary\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\">\n"
+                + "<section class=\"packagesSummary\">\n"
                 + "<!-- ============ PACKAGES SUMMARY =========== -->");
         checkOutput("moduleB/module-summary.html", found,
                 "<div class=\"contentContainer\">\n"
+                + "<section class=\"summary\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
-                + "<ul class=\"blockList\">\n"
-                + "<li class=\"blockList\">\n"
+                + "<section class=\"packagesSummary\">\n"
                 + "<!-- ============ PACKAGES SUMMARY =========== -->");
     }
 
--- a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java	Tue Apr 23 18:28:48 2019 +0530
@@ -193,10 +193,18 @@
                 "<pre>@Documented\npublic @interface <a href="
                 + "\"../src-html/linksource/AnnotationTypeField.html#line.31\">"
                 + "AnnotationTypeField</a></pre>",
-                "<h3>DEFAULT_NAME</h3>\n<pre>static final&nbsp;java.lang.String&nbsp;"
+                "<h3>DEFAULT_NAME</h3>\n"
+                + "<a id=\"DEFAULT_NAME\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<pre>static final&nbsp;java.lang.String&nbsp;"
                 + "<a href=\"../src-html/linksource/AnnotationTypeField.html#line.32\">"
                 + "DEFAULT_NAME</a></pre>",
-                "<h3>name</h3>\n<pre>java.lang.String&nbsp;<a href="
+                "<h3>name</h3>\n"
+                + "<a id=\"name()\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<pre>java.lang.String&nbsp;<a href="
                 + "\"../src-html/linksource/AnnotationTypeField.html#line.34\">name</a></pre>");
 
         checkOutput("src-html/linksource/AnnotationTypeField.html", true,
--- a/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestBadOverride.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testOverriddenMethods/TestBadOverride.java	Tue Apr 23 18:28:48 2019 +0530
@@ -52,10 +52,13 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg4/Foo.html", true,
-                "<li class=\"blockList\">\n"
+                "<section class=\"detail\">\n"
                 + "<h3>toString</h3>\n"
+                + "<a id=\"toString()\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
                 + "<pre class=\"methodSignature\">public&nbsp;void&nbsp;toString()</pre>\n"
                 + "<div class=\"block\">Why can't I do this ?</div>\n"
-                + "</li>");
+                + "</section>");
     }
 }
--- a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java	Tue Apr 23 18:28:48 2019 +0530
@@ -381,8 +381,8 @@
                 "<script type=\"text/javascript\" src=\"script-dir/jquery-ui.js\"></script>",
                 "var pathtoroot = \"./\";\n"
                 + "loadScripts(document, 'script');",
-                "<ul class=\"navListSearch\">\n",
-                "<li><label for=\"search\">SEARCH:</label>\n"
+                "<div class=\"navListSearch\">",
+                "<label for=\"search\">SEARCH:</label>\n"
                 + "<input type=\"text\" id=\"search\" value=\"search\" disabled=\"disabled\">\n"
                 + "<input type=\"reset\" id=\"reset\" value=\"reset\" disabled=\"disabled\">\n");
         checkOutput(fileName, true,
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/langtools/jdk/javadoc/doclet/testSingletonLists/TestSingletonLists.java	Tue Apr 23 18:28:48 2019 +0530
@@ -0,0 +1,323 @@
+/*
+ * 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.
+ *
+ * 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.
+ */
+
+/*
+ * @test
+ * @bug 8219998
+ * @summary Eliminate inherently singleton lists
+ * @library /tools/lib ../../lib
+ * @modules jdk.javadoc/jdk.javadoc.internal.tool
+ * @modules jdk.compiler/com.sun.tools.javac.api
+ *          jdk.compiler/com.sun.tools.javac.main
+ *          jdk.javadoc/jdk.javadoc.internal.api
+ *          jdk.javadoc/jdk.javadoc.internal.tool
+ * @build toolbox.ToolBox toolbox.JavacTask javadoc.tester.*
+ * @run main TestSingletonLists
+ */
+
+import java.io.IOException;
+import java.io.PrintStream;
+import java.nio.file.Path;
+import java.util.ArrayList;
+import java.util.List;
+import java.util.Map;
+import java.util.Stack;
+import java.util.TreeMap;
+import java.util.function.Function;
+
+import javadoc.tester.HtmlChecker;
+import javadoc.tester.JavadocTester;
+import toolbox.ModuleBuilder;
+import toolbox.ToolBox;
+
+
+public class TestSingletonLists extends JavadocTester {
+    public static void main(String... args) throws Exception {
+        TestSingletonLists tester = new TestSingletonLists();
+        tester.runTests();
+    }
+
+    enum Index  { SINGLE, SPLIT };
+    enum Source { PACKAGES, MODULES };
+
+    final ToolBox tb = new ToolBox();
+
+    public void runTests() throws Exception {
+        for (Source s : Source.values()) {
+            Path src = genSource(s);
+                for (Index i : Index.values()) {
+                    List<String> args = new ArrayList<>();
+                    args.add("-d");
+                    args.add(String.format("out-%s-%s", s, i));
+                    args.add("-use");
+                    if (s != Source.MODULES) {
+                        args.add("-linksource"); // broken, with modules: JDK-8219060
+                    }
+                    if (i == Index.SPLIT) {
+                        args.add("-splitIndex");
+                    }
+                    if (s == Source.PACKAGES) {
+                        args.add("-sourcepath");
+                        args.add(src.toString());
+                        args.add("p1");
+                        args.add("p2");
+                        args.add("p3");
+                    } else {
+                        args.add("--module-source-path");
+                        args.add(src.toString());
+                        args.add("--module");
+                        args.add("mA,mB,mC");
+                    }
+                    javadoc(args.toArray(new String[args.size()]));
+                    checkExit(Exit.OK);
+                    checkLists();
+                }
+        }
+
+        printSummary();
+    }
+
+    Path genSource(Source s) throws IOException {
+        Path src = Path.of("src-" + s);
+        switch (s) {
+            case PACKAGES:
+                for (String p : new String[] { "1", "2", "3" }) {
+                    tb.writeJavaFiles(src, genClasses("p" + p));
+                }
+                break;
+
+            case MODULES:
+                for (String m : new String[] { "A", "B", "C"}) {
+                    ModuleBuilder mb = new ModuleBuilder(tb, "m" + m);
+                    for (String p : new String[] { "1", "2", "3" } ) {
+                        mb.exports("p" + m + p);
+                        mb.classes(genClasses("p" + m + p));
+                    }
+                    mb.write(src);
+                }
+                break;
+        }
+
+        return src;
+    }
+
+
+    String[] genClasses(String pkg) {
+        List<String> list = new ArrayList<>();
+        list.add("package " + pkg + ";");
+        for (int i = 0; i < 3; i++) {
+            list.add(genClass(pkg, i));
+            list.add(genAnno(pkg, i));
+            list.add(genEnum(pkg, i));
+        }
+        return list.toArray(new String[list.size()]);
+    }
+
+    String genClass(String pkg, int index) {
+        String cn = (pkg + "c" + index).toUpperCase();
+        StringBuilder sb = new StringBuilder();
+        int pkgIndex = Character.getNumericValue(pkg.charAt(pkg.length()-1));
+        String pkgdependency = pkg.substring(0, pkg.length()-1) + (pkgIndex == 3 ? 1 : pkgIndex + 1);
+        String enumClassName = pkgdependency.toUpperCase() + "E" + index;
+        sb.append("package ").append(pkg).append(";\n")
+                .append("import " + pkgdependency + ".*;\n")
+                .append("public class ").append(cn).append(" {\n");
+        // fields
+        for (int f = 0; f < 3; f++) {
+            sb.append("public int f").append(f).append(";\n");
+        }
+        // constructors
+        for (int c = 0; c < 3; c++) {
+            sb.append("public ").append(cn).append("(");
+            for (int i = 0; i < c; i++) {
+                sb.append(i == 0 ? "" : ", ").append("int i").append(i);
+            }
+            sb.append(") { }\n");
+        }
+        // methods
+        for (int m = 0; m < 3; m++) {
+            sb.append("public void m").append(m).append("() { }\n");
+        }
+        sb.append("public void n(").append(enumClassName).append(" e){}");
+        sb.append("}\n");
+        return sb.toString();
+    }
+
+    String genAnno(String pkg, int index) {
+        String an = (pkg + "a" + index).toUpperCase();
+        StringBuilder sb = new StringBuilder();
+        sb.append("package ").append(pkg).append(";\n")
+                .append("public @interface ").append(an).append(" {\n");
+        // fields
+        for (int f = 0; f < 3; f++) {
+            sb.append("public static final int f").append(f).append(" = 0;\n");
+        }
+            // values
+        for (int v = 0; v < 6; v++) {
+            sb.append("public int v").append(v).append("()").append(v< 3 ? "" :  " default " + v).append(";\n");
+        }
+        sb.append("}\n");
+        return sb.toString();
+    }
+
+    String genEnum(String pkg, int index) {
+        String en = (pkg + "e" + index).toUpperCase();
+        StringBuilder sb = new StringBuilder();
+        sb.append("package ").append(pkg).append(";\n")
+                .append("public enum ").append(en).append(" {\n");
+             // enum members
+        for (int e = 0; e < 3; e++) {
+            sb.append(e == 0 ? "" : ", ").append("E").append(e);
+        }
+        sb.append(";\n");
+        // fields
+        for (int f = 0; f < 3; f++) {
+            sb.append("public int f").append(f).append(";\n");
+        }
+        // methods
+        for (int m = 0; m < 3; m++) {
+            sb.append("public void m").append(m).append("() { }\n");
+        }
+        sb.append("}\n");
+        return sb.toString();
+    }
+
+    void checkLists() {
+        checking("Check lists");
+        ListChecker c = new ListChecker(out, this::readFile);
+        try {
+            c.checkDirectory(outputDir.toPath());
+            c.report();
+            int errors = c.getErrorCount();
+            if (errors == 0) {
+                passed("No list errors found");
+            } else {
+                failed(errors + " errors found when checking lists");
+            }
+        } catch (IOException e) {
+            failed("exception thrown when reading files: " + e);
+        }
+    }
+
+    /**
+     * A class to check the presence of singleton lists.
+     */
+    public class ListChecker extends HtmlChecker {
+        private int listErrors;
+
+        private boolean inBody;
+        private boolean inNoScript;
+        private Stack<Map<String,Integer>> counts = new Stack<>();
+        private int regionErrors;
+        private String fileName;
+        private boolean inheritanceClass;
+        private List<String> excludeFiles = List.of("overview-tree.html","package-tree.html","module-summary.html");
+
+        ListChecker(PrintStream out, Function<Path,String> fileReader) {
+            super(out, fileReader);
+        }
+
+        protected int getErrorCount() {
+            return errors;
+        }
+
+        @Override
+        public void report() {
+            if (listErrors == 0) {
+                out.println("All lists OK");
+            } else {
+                out.println(listErrors + " list errors");
+            }
+
+            if (regionErrors == 0) {
+                out.println("All regions OK");
+            } else {
+                out.println(regionErrors + " errors in regions");
+            }
+        }
+
+        @Override
+        public void startFile(Path path) {
+            fileName = path.getFileName().toString();
+        }
+
+        @Override
+        public void endFile() {
+        }
+
+        @Override
+        public void docType(String doctype) {
+        }
+
+        @Override
+        public void startElement(String name, Map<String,String> attrs, boolean selfClosing) {
+            switch (name) {
+
+                case "ul": case "ol": case "dl":
+                    counts.push(new TreeMap<>());
+                    if (!attrs.isEmpty() && attrs.containsKey("class")
+                            && attrs.containsValue("inheritance")) {
+                        inheritanceClass = true;
+                    }
+                    break;
+
+                case "li": case "dd": case "dt": {
+                    Map<String, Integer> c = counts.peek();
+                    c.put(name, 1 + c.computeIfAbsent(name, n -> 0));
+                    break;
+                }
+            }
+        }
+
+        @Override
+        public void endElement(String name) {
+            switch (name) {
+                case "ul": case "ol": {
+                    Map<String,Integer> c = counts.pop();
+                    if (c.get("li") == 0) {
+                        error(currFile, getLineNumber(), "empty list");
+                    } else if (c.get("li") == 1 && fileName != null && !excludeFiles.contains(fileName)) {
+                        if (!inheritanceClass) {
+                            error(currFile, getLineNumber(), "singleton list");
+                        } else {
+                            inheritanceClass = false;
+                        }
+                    }
+                    break;
+                }
+
+                case "dl": {
+                    Map<String, Integer> c = counts.pop();
+                    if (c.get("dd") == 0 || c.get("dt") == 0) {
+                        error(currFile, getLineNumber(), "empty list");
+                    }
+                    /*if (c.get("dd") == 1 || c.get("dt") == 1) {
+                        error(currFile, getLineNumber(), "singleton list");
+                    }*/
+                    break;
+                }
+            }
+        }
+    }
+
+}
\ No newline at end of file
--- a/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testSummaryTag/TestSummaryTag.java	Tue Apr 23 18:28:48 2019 +0530
@@ -85,11 +85,14 @@
 
         // make sure the second @summary's content is displayed correctly
         checkOutput("p1/A.html", true,
-             "<li class=\"blockList\">\n"
+             "<section class=\"detail\">\n"
              + "<h3>m3</h3>\n"
+             + "<a id=\"m3()\">\n"
+             + "<!--   -->\n"
+             + "</a>\n"
              + "<pre class=\"methodSignature\">public&nbsp;void&nbsp;m3()</pre>\n"
              + "<div class=\"block\">First sentence  some text maybe second sentence.</div>\n"
-             + "</li>\n"
+             + "</section>\n"
         );
 
         checkOutput("p1/package-summary.html", true,
--- a/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Tue Apr 23 18:28:48 2019 +0530
@@ -151,7 +151,7 @@
         );
         checkOutput("class-use/UsedInC.html", true,
                 "<li class=\"blockList\">\n"
-                + "<section><a id=\"unnamed.package\">"
+                + "<section class=\"detail\"><a id=\"unnamed.package\">"
         );
         checkOutput("package-use.html", true,
                 "<th class=\"colFirst\" scope=\"row\">"
--- a/test/langtools/jdk/javadoc/lib/javadoc/tester/A11yChecker.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/lib/javadoc/tester/A11yChecker.java	Tue Apr 23 18:28:48 2019 +0530
@@ -48,7 +48,7 @@
         super(out, fileReader);
     }
 
-    int getErrorCount() {
+    protected int getErrorCount() {
         return errors;
     }
 
--- a/test/langtools/jdk/javadoc/lib/javadoc/tester/HtmlChecker.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/lib/javadoc/tester/HtmlChecker.java	Tue Apr 23 18:28:48 2019 +0530
@@ -43,15 +43,15 @@
     protected int files;
     protected int errors;
 
-    HtmlChecker(PrintStream out, Function<Path,String> fileReader) {
+    protected HtmlChecker(PrintStream out, Function<Path,String> fileReader) {
         super(out, fileReader);
     }
 
-    void checkDirectory(Path dir) throws IOException {
+    public void checkDirectory(Path dir) throws IOException {
         checkFiles(List.of(dir), false, Collections.emptySet());
     }
 
-    void checkFiles(List<Path> files, boolean skipSubdirs, Set<Path> excludeFiles) throws IOException {
+    public void checkFiles(List<Path> files, boolean skipSubdirs, Set<Path> excludeFiles) throws IOException {
         for (Path file : files) {
             Files.walkFileTree(file, new SimpleFileVisitor<Path>() {
                 int depth = 0;
@@ -86,7 +86,7 @@
         }
     }
 
-    void checkFile(Path file) {
+    protected void checkFile(Path file) {
         try {
             currFile = file.toAbsolutePath().normalize();
             read(file);
@@ -96,9 +96,9 @@
         }
     }
 
-    abstract void report();
+    protected abstract void report();
 
-    int getErrorCount() {
+    protected int getErrorCount() {
         return errors;
     }
 
--- a/test/langtools/jdk/javadoc/lib/javadoc/tester/HtmlParser.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/lib/javadoc/tester/HtmlParser.java	Tue Apr 23 18:28:48 2019 +0530
@@ -101,7 +101,7 @@
     }
 
 
-    int getLineNumber() {
+    protected int getLineNumber() {
         return lineNumber;
     }
 
--- a/test/langtools/jdk/javadoc/lib/javadoc/tester/JavadocTester.java	Tue Apr 23 07:05:38 2019 -0400
+++ b/test/langtools/jdk/javadoc/lib/javadoc/tester/JavadocTester.java	Tue Apr 23 18:28:48 2019 +0530
@@ -772,7 +772,7 @@
         return readFile(new File(baseDir), fileName);
     }
 
-    private String readFile(Path file) {
+    protected String readFile(Path file) {
         File baseDir;
         if (file.startsWith(outputDir.toPath())) {
             baseDir = outputDir;