8026770: javadoc creates invalid HTML in profile summary pages
authorbpatel
Wed, 23 Oct 2013 13:54:13 -0700
changeset 21494 eb34dbccfb60
parent 21493 d3f44b144a76
child 21495 40291cbc31c2
8026770: javadoc creates invalid HTML in profile summary pages Reviewed-by: jjg
langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java
langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java
langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Wed Oct 23 10:28:10 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Wed Oct 23 13:54:13 2013 -0700
@@ -391,8 +391,7 @@
                 tbody.addContent(tr);
             }
             table.addContent(tbody);
-            Content li = HtmlTree.LI(HtmlStyle.blockList, table);
-            summaryContentTree.addContent(li);
+            summaryContentTree.addContent(table);
         }
     }
 
--- a/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java	Wed Oct 23 10:28:10 2013 -0700
+++ b/langtools/src/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java	Wed Oct 23 13:54:13 2013 -0700
@@ -175,8 +175,11 @@
      */
     public void addClassesSummary(ClassDoc[] classes, String label,
             String tableSummary, String[] tableHeader, Content packageSummaryContentTree) {
+        HtmlTree li = new HtmlTree(HtmlTag.LI);
+        li.addStyle(HtmlStyle.blockList);
         addClassesSummary(classes, label, tableSummary, tableHeader,
-                packageSummaryContentTree, profileValue);
+                li, profileValue);
+        packageSummaryContentTree.addContent(li);
     }
 
     /**
--- a/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java	Wed Oct 23 10:28:10 2013 -0700
+++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java	Wed Oct 23 13:54:13 2013 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug      8006124 8009684 8016921 8023700 8024096 8008164 8026567
+ * @bug      8006124 8009684 8016921 8023700 8024096 8008164 8026567 8026770
  * @summary  Test javadoc support for profiles.
  * @author   Bhavesh Patel, Evgeniya Stepanova
  * @library  ../lib/
@@ -85,6 +85,20 @@
             "<h3><a href=\"pkg2/compact2-package-summary.html\" "
             + "target=\"classFrame\">pkg2</a></h3>"
         },
+        {PROFILE_BUG_ID + FS + "compact2-summary.html",
+            "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
+            + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">"
+            + "pkg2</a></h3>" + NL + "<table class=\"typeSummary\" border=\"0\" "
+            + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, "
+            + "listing classes, and an explanation\">"
+        },
+        {PROFILE_BUG_ID + FS + "compact2-summary.html",
+            "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
+            + "<h3><a href=\"pkg4/compact2-package-summary.html\" target=\"classFrame\">"
+            + "pkg4</a></h3>" + NL + "<table class=\"typeSummary\" border=\"0\" "
+            + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, "
+            + "listing classes, and an explanation\">"
+        },
         // Tests for profileName-package-summary.html listing the summary for a
         // package in a profile.
         {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
@@ -94,6 +108,12 @@
         {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
             "<div class=\"subTitle\">compact3</div>"
         },
+        {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
+            "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
+            + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" "
+            + "cellspacing=\"0\" summary=\"Interface Summary table, listing "
+            + "interfaces, and an explanation\">"
+        },
         //Test for "overview-frame.html" showing the "All Profiles" link.
         {PROFILE_BUG_ID + FS + "overview-frame.html",
             "<span><a href=\"profile-overview-frame.html\" "
@@ -171,6 +191,21 @@
             + "target=\"classFrame\">Anno1Pkg4</a></li>"
         },
         {PROFILE_BUG_ID + FS + "compact1-summary.html","<li>Use</li>"
+        },
+        {PROFILE_BUG_ID + FS + "compact2-summary.html",
+            "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
+            + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">"
+            + "pkg2</a></h3>" + NL + "<li class=\"blockList\">" + NL
+            + "<table class=\"typeSummary\" border=\"0\" "
+            + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, "
+            + "listing classes, and an explanation\">"
+        },
+        {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
+            "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL
+            + "<li class=\"blockList\">" + NL
+            + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" "
+            + "cellspacing=\"0\" summary=\"Interface Summary table, listing "
+            + "interfaces, and an explanation\">"
         }
     };
     private static final String[][] PACKAGES_TEST = {