From 16675e7c69543f6d0c9736f0d0030d5cfb134c85 Mon Sep 17 00:00:00 2001 From: Nizar Benalla Date: Mon, 27 Jan 2025 15:27:21 +0100 Subject: [PATCH] respond to feedback --- .../internal/doclets/formats/html/markup/Head.java | 3 +-- .../classes/jdk/javadoc/internal/html/HtmlTree.java | 8 ++------ .../TestModuleSpecificStylesheet.java | 10 +++++----- .../jdk/javadoc/doclet/testOptions/TestOptions.java | 10 +++++----- .../TestPackageSpecificStylesheet.java | 6 +++--- .../jdk/javadoc/doclet/testSearch/TestSearch.java | 2 +- .../javadoc/doclet/testStylesheet/TestStylesheet.java | 4 ++-- 7 files changed, 19 insertions(+), 24 deletions(-) diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java index 9792de92b521d..7170c6bcc8a2e 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/Head.java @@ -347,8 +347,7 @@ private void addStylesheets(HtmlTree head) { private void addStylesheet(HtmlTree head, DocPath stylesheet) { head.add(HtmlTree.LINK("stylesheet", "text/css", - pathToRoot.resolve(stylesheet).getPath(), "Style", - "no")); + pathToRoot.resolve(stylesheet).getPath())); } private void addScripts(HtmlTree head) { diff --git a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlTree.java b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlTree.java index c60a1238c8786..d664239033544 100644 --- a/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlTree.java +++ b/src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlTree.java @@ -779,17 +779,13 @@ public static HtmlTree LI(HtmlStyle style, Content body) { * @param rel the relevance of the link: the {@code rel} attribute * @param type the type of link: the {@code type} attribute * @param href the path for the link: the {@code href} attribute - * @param title title for the link: the {@code title} attribute - * @param translate translate property for the link: the {@code translate} attribute * @return the element */ - public static HtmlTree LINK(String rel, String type, String href, String title, String translate) { + public static HtmlTree LINK(String rel, String type, String href) { return new HtmlTree(HtmlTag.LINK) .put(HtmlAttr.REL, rel) .put(HtmlAttr.TYPE, type) - .put(HtmlAttr.HREF, href) - .put(HtmlAttr.TITLE, title) - .put(HtmlAttr.TRANSLATE, translate); + .put(HtmlAttr.HREF, href); } /** diff --git a/test/langtools/jdk/javadoc/doclet/testModuleSpecificStylesheet/TestModuleSpecificStylesheet.java b/test/langtools/jdk/javadoc/doclet/testModuleSpecificStylesheet/TestModuleSpecificStylesheet.java index 279efa00475d4..68deacb0e4756 100644 --- a/test/langtools/jdk/javadoc/doclet/testModuleSpecificStylesheet/TestModuleSpecificStylesheet.java +++ b/test/langtools/jdk/javadoc/doclet/testModuleSpecificStylesheet/TestModuleSpecificStylesheet.java @@ -82,22 +82,22 @@ public void test(Path base) throws Exception { checkOutput("ma/module-summary.html", true, """ - """); + """); checkOutput("ma/pa/package-summary.html", true, """ - """); + """); checkOutput("ma/pa/A.html", true, """ - """); + """); checkOutput("ma/pa/pb/B.html", true, """ - """); + """); checkOutput("ma/pa/pb/package-summary.html", true, """ - """); + """); } } diff --git a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java index 36b84c7a76569..e04135382114b 100644 --- a/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java +++ b/test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java @@ -118,7 +118,7 @@ public void testStylesheetFile() { checkOutput("resource-files/custom-stylesheet.css", true, "Custom javadoc style sheet"); checkOutput("pkg/Foo.html", true, """ - """); + """); } @Test @@ -131,7 +131,7 @@ public void testStylesheetFileAltOption() { checkOutput("resource-files/custom-stylesheet.css", true, "Custom javadoc style sheet"); checkOutput("pkg/Foo.html", true, """ - """); + """); } @Test @@ -149,9 +149,9 @@ public void testAdditionalStylesheetFile() { checkOutput("resource-files/additional-stylesheet-3.css", true, "Additional javadoc style sheet 3"); checkOutput("pkg/Foo.html", true, """ - - - """); + + + """); } @Test diff --git a/test/langtools/jdk/javadoc/doclet/testPackageSpecificStylesheet/TestPackageSpecificStylesheet.java b/test/langtools/jdk/javadoc/doclet/testPackageSpecificStylesheet/TestPackageSpecificStylesheet.java index 9216d55ffa675..284b79577591e 100644 --- a/test/langtools/jdk/javadoc/doclet/testPackageSpecificStylesheet/TestPackageSpecificStylesheet.java +++ b/test/langtools/jdk/javadoc/doclet/testPackageSpecificStylesheet/TestPackageSpecificStylesheet.java @@ -82,15 +82,15 @@ public void test(Path base) throws Exception { checkOutput("pkg/A.html", true, """ - """); + """); checkOutput("pkg/package-summary.html", true, """ - """); + """); checkOutput("pkg2/B.html", false, """ - """); + """); } } diff --git a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java index 014be88485067..ba3f64cd8b29e 100644 --- a/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java +++ b/test/langtools/jdk/javadoc/doclet/testSearch/TestSearch.java @@ -418,7 +418,7 @@ void checkSearchOutput(String fileName, boolean expectedOutput) { // Test for search related markup checkOutput(fileName, expectedOutput, """ - + """, """ diff --git a/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java b/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java index 06d8599e4ddcb..a3dce5448f0f8 100644 --- a/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java +++ b/test/langtools/jdk/javadoc/doclet/testStylesheet/TestStylesheet.java @@ -186,7 +186,7 @@ public void test(Path base) { // Test whether a link to the stylesheet file is inserted properly // in the class documentation. """ - """, + """, """
Test comment for a class which has an anchor_with_name and an anchor_with_id.
"""); @@ -200,7 +200,7 @@ public void test(Path base) { checkOutput("index.html", true, """ - """); + """); checkOutput("resource-files/stylesheet.css", false, """