8221871: javadoc should not set role=region on <section> elements
authorjjg
Fri, 05 Apr 2019 15:57:33 -0700
changeset 54444 259b40b4d473
parent 54443 dfba4e321ab3
child 54445 a5da0277d9bb
8221871: javadoc should not set role=region on <section> elements Reviewed-by: hannesw
src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java
test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java
test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java
test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java	Fri Apr 05 11:28:23 2019 -0700
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java	Fri Apr 05 15:57:33 2019 -0700
@@ -722,9 +722,7 @@
      * @return an HtmlTree object for the SECTION tag
      */
     public static HtmlTree SECTION() {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.SECTION);
-        htmltree.setRole(Role.REGION);
-        return htmltree;
+        return new HtmlTree(HtmlTag.SECTION);
     }
 
     /**
@@ -734,9 +732,7 @@
      * @return an HtmlTree object for the SECTION tag
      */
     public static HtmlTree SECTION(Content body) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.SECTION, nullCheck(body));
-        htmltree.setRole(Role.REGION);
-        return htmltree;
+        return new HtmlTree(HtmlTag.SECTION, nullCheck(body));
     }
 
     /**
--- a/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Fri Apr 05 11:28:23 2019 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java	Fri Apr 05 15:57:33 2019 -0700
@@ -109,7 +109,7 @@
 
         checkOutput("pkg3/package-summary.html", true,
                 "<div class=\"contentContainer\">\n"
-                + "<section role=\"region\"><a id=\"package.description\">\n"
+                + "<section><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	Fri Apr 05 11:28:23 2019 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java	Fri Apr 05 15:57:33 2019 -0700
@@ -24,7 +24,7 @@
 /*
  * @test
  * @bug 8072945 8081854 8141492 8148985 8150188 4649116 8173707 8151743 8169819 8183037 8182765 8196202
- *      8202624 8210047 8184205
+ *      8202624 8210047 8184205 8221871
  * @summary Test the version of HTML generated by the javadoc tool.
  * @author bpatel
  * @library ../../lib
@@ -100,7 +100,7 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\"><a id=\"package.description\">\n"
+                "<section><a id=\"package.description\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<div class=\"block\">Test package.</div>",
@@ -129,13 +129,13 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -173,9 +173,9 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"Contents\">Contents</h2>\n",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"pkg\">pkg.*</h2>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -212,7 +212,7 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"Package\">Package&nbsp;pkg</h2>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -232,13 +232,13 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>\n",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>\n",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -280,11 +280,11 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2>Overview</h2>\n",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2>Package</h2>\n",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2>Class or Interface</h2>\n",
                 "<footer role=\"contentinfo\">\n"
                 + "<nav role=\"navigation\">\n"
@@ -303,46 +303,46 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"nested.class.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Nested Class Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n<table>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"field.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Field Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n<table>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Constructor Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n<table>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"method.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Method Summary</h2>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"field.detail\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Field Detail</h2>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Constructor Detail</h2>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"method.detail\">\n"
                 + "<!--   -->\n"
@@ -365,7 +365,7 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"enum.constant.summary\">\n"
                 + "<!--   -->\n"
@@ -373,7 +373,7 @@
                 + "<h2>Enum Constant Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n",
                 "<table aria-labelledby=\"t0\">\n",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"method.summary\">\n"
                 + "<!--   -->\n"
@@ -381,13 +381,13 @@
                 + "<h2>Method Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n",
                 "<table aria-labelledby=\"t0\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"enum.constant.detail\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Enum Constant Detail</h2>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"method.detail\">\n"
                 + "<!--   -->\n"
@@ -410,7 +410,7 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"method.summary\">\n"
                 + "<!--   -->\n"
@@ -418,7 +418,7 @@
                 + "<h2>Method Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n",
                 "<table aria-labelledby=\"t0\">\n",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"method.detail\">\n"
                 + "<!--   -->\n"
@@ -441,13 +441,13 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Constructor Summary</h2>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
                 + "<!--   -->\n"
@@ -470,13 +470,13 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Constructor Summary</h2>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
                 + "<!--   -->\n"
@@ -499,21 +499,21 @@
                 + "<!-- ========= START OF TOP NAVBAR ======= -->",
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"annotation.type.required.element.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Required Element Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n<table>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"annotation.type.optional.element.summary\">\n"
                 + "<!--   -->\n"
                 + "</a>\n"
                 + "<h2>Optional Element Summary</h2>\n"
                 + "<div class=\"memberSummary\">\n<table>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\"><a id=\"annotation.type.element.detail\">\n"
                 + "<!--   -->\n"
@@ -537,7 +537,7 @@
                 "<main role=\"main\">\n"
                 + "<div class=\"header\">",
                 "<div class=\"useSummary\">\n<table>",
-                "<section role=\"region\"><a id=\"pkg\">\n"
+                "<section><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"
@@ -568,7 +568,7 @@
                 "<a name=\"navbar.top.firstrow\">\n"
                 + "<!--   -->\n"
                 + "</a>",
-                "<section role=\"region\">\n"
+                "<section>\n"
                 + "<h2 title=\"Package 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\">",
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Fri Apr 05 11:28:23 2019 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java	Fri Apr 05 15:57:33 2019 -0700
@@ -478,7 +478,7 @@
 
     void checkHtml5Description(boolean found) {
         checkOutput("moduleA/module-summary.html", found,
-                "<section role=\"region\">\n"
+                "<section>\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 role=\"region\">\n"
+                "<section>\n"
                 + "<!-- ============ MODULE DESCRIPTION =========== -->\n"
                 + "<a id=\"module.description\">\n"
                 + "<!--   -->\n"
--- a/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Fri Apr 05 11:28:23 2019 -0700
+++ b/test/langtools/jdk/javadoc/doclet/testUseOption/TestUseOption.java	Fri Apr 05 15:57:33 2019 -0700
@@ -151,7 +151,7 @@
         );
         checkOutput("class-use/UsedInC.html", true,
                 "<li class=\"blockList\">\n"
-                + "<section role=\"region\"><a id=\"unnamed.package\">"
+                + "<section><a id=\"unnamed.package\">"
         );
         checkOutput("package-use.html", true,
                 "<th class=\"colFirst\" scope=\"row\">"