aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorGravatar Hannes Wallnöfer <hannesw@openjdk.org> 2021-03-25 08:59:29 +0000
committerGravatar Hannes Wallnöfer <hannesw@openjdk.org> 2021-03-25 08:59:29 +0000
commitf69afba52735008613f0ede7d650372e95e9a6e0 (patch)
tree697c164574dd8a2909047b565fc28a3c7457699b
parentd82464f8518ea859712b45bc4788b822ed2f9e63 (diff)
downloadjdk-f69afba52735008613f0ede7d650372e95e9a6e0.tar.gz
jdk-f69afba52735008613f0ede7d650372e95e9a6e0.zip
8263300: add HtmlId for the block containing a class's description.
Reviewed-by: jjg
-rw-r--r--src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java2
-rw-r--r--src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java1
-rw-r--r--src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java5
-rw-r--r--src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java5
-rw-r--r--src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css2
-rw-r--r--test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java2
-rw-r--r--test/langtools/jdk/javadoc/doclet/testModules/TestModules.java2
7 files changed, 10 insertions, 9 deletions
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
index f8787114258..60ac8ad995e 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassWriterImpl.java
@@ -176,7 +176,7 @@ public class ClassWriterImpl extends SubWriterHolderWriter implements ClassWrite
@Override
public Content getClassInfo(Content classInfoTree) {
- return getMemberTree(HtmlStyle.description, classInfoTree);
+ return getMemberTree(HtmlIds.CLASS_DESCRIPTION, HtmlStyle.classDescription, classInfoTree);
}
@Override
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java
index 5ec23cd035c..42e9ae8df1a 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlIds.java
@@ -71,6 +71,7 @@ public class HtmlIds {
static final HtmlId ANNOTATION_TYPE_ELEMENT_DETAIL = HtmlId.of("annotation-interface-element-detail");
static final HtmlId ANNOTATION_TYPE_OPTIONAL_ELEMENT_SUMMARY = HtmlId.of("annotation-interface-optional-element-summary");
static final HtmlId ANNOTATION_TYPE_REQUIRED_ELEMENT_SUMMARY = HtmlId.of("annotation-interface-required-element-summary");
+ static final HtmlId CLASS_DESCRIPTION = HtmlId.of("class-description");
static final HtmlId CONSTRUCTOR_DETAIL = HtmlId.of("constructor-detail");
static final HtmlId CONSTRUCTOR_SUMMARY = HtmlId.of("constructor-summary");
static final HtmlId ENUM_CONSTANT_DETAIL = HtmlId.of("enum-constant-detail");
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java
index 936724dedd5..5fe0a1edd43 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/SubWriterHolderWriter.java
@@ -327,11 +327,12 @@ public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
/**
* Get the member tree
*
+ * @param id the id to be used for the content tree
* @param style the style class to be added to the content tree
* @param contentTree the tree used to generate the complete member tree
* @return the member tree
*/
- public Content getMemberTree(HtmlStyle style, Content contentTree) {
- return HtmlTree.SECTION(style, contentTree);
+ public Content getMemberTree(HtmlId id, HtmlStyle style, Content contentTree) {
+ return HtmlTree.SECTION(style, contentTree).setId(id);
}
}
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java
index e9479fa749f..8a733be3a0b 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlStyle.java
@@ -476,11 +476,10 @@ public enum HtmlStyle {
// generated from documentation comments.
/**
- * The class of the element used to present the documentation comment for a type or member
- * element.
+ * The class of the element used to present the documentation comment for a type element.
* The content of the block tags will be in a nested element with class {@link #notes}.
*/
- description,
+ classDescription,
/**
* The class of the element used to present the documentation comment for a module element,
diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css
index 9c5a8875d8c..c25513569e9 100644
--- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css
+++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css
@@ -655,7 +655,7 @@ ul.ui-autocomplete li {
.inherited-list {
margin: 10px 0 10px 0;
}
-section.description {
+section.class-description {
line-height: 1.4;
}
.summary section[class$="-summary"], .details section[class$="-details"],
diff --git a/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java b/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java
index 23b5657b7a5..eb49ac0b8b8 100644
--- a/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java
+++ b/test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java
@@ -119,7 +119,7 @@ public class TestMemberInheritance extends JavadocTester {
checkOutput("pkg2/DocumentedNonGenericChild.html", true,
"""
- <section class="description">
+ <section class="class-description" id="class-description">
<hr>
<div class="type-signature"><span class="modifiers">public abstract class </span\
><span class="element-name type-name-label">DocumentedNonGenericChild</span>
diff --git a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
index 410eb6650a8..a6eaabe773c 100644
--- a/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
+++ b/test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
@@ -1359,7 +1359,7 @@ public class TestModules extends JavadocTester {
""");
checkOutput("moduleA/testpkgmdlA/TestClassInModuleA.html", true,
"""
- <section class="description">
+ <section class="class-description" id="class-description">
<hr>
<div class="type-signature"><span class="modifiers">public class </span><span cl\
ass="element-name"><a href="../../src-html/moduleA/testpkgmdlA/TestClassInModule\