From 0abdc381b72f9dca86ac8f9c8943980eda7fd853 Mon Sep 17 00:00:00 2001 From: Jonathan Gibbons Date: Fri, 5 Apr 2019 15:57:33 -0700 Subject: [PATCH] 8221871: javadoc should not set role=region on
elements Reviewed-by: hannesw --- .../doclets/formats/html/markup/HtmlTree.java | 8 +- .../doclet/testHtmlTag/TestHtmlTag.java | 2 +- .../testHtmlVersion/TestHtmlVersion.java | 76 +++++++++---------- .../doclet/testModules/TestModules.java | 4 +- .../doclet/testUseOption/TestUseOption.java | 2 +- 5 files changed, 44 insertions(+), 48 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java index 47ddf05b630..27c89b03168 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java @@ -722,9 +722,7 @@ public class HtmlTree extends Content { * @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 @@ public class HtmlTree extends Content { * @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)); } /** diff --git a/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java b/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java index 90257477da3..a57f4847787 100644 --- a/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java +++ b/test/langtools/jdk/javadoc/doclet/testHtmlTag/TestHtmlTag.java @@ -109,7 +109,7 @@ public class TestHtmlTag extends JavadocTester { checkOutput("pkg3/package-summary.html", true, "
\n" - + "
\n" + + "
\n" + "\n" + "\n" + "

This is the first line. Note the newlines before the <p> is relevant.

\n" diff --git a/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java b/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java index 6ebfabd813b..21b8cdb85b7 100644 --- a/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java +++ b/test/langtools/jdk/javadoc/doclet/testHtmlVersion/TestHtmlVersion.java @@ -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 @@ public class TestHtmlVersion extends JavadocTester { + "", "
\n" + "
", - "
\n" + "
\n" + "\n" + "\n" + "
Test package.
", @@ -129,13 +129,13 @@ public class TestHtmlVersion extends JavadocTester { + "", "
\n" + "
", - "
\n" + "
\n" + "

Class Hierarchy

", - "
\n" + "
\n" + "

Interface Hierarchy

", - "
\n" + "
\n" + "

Annotation Type Hierarchy

", - "
\n" + "
\n" + "

Enum Hierarchy

", "