Skip to content

Commit

Permalink
respond to feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
nizarbenalla committed Jan 27, 2025
1 parent 09aaa5e commit 16675e7
Show file tree
Hide file tree
Showing 7 changed files with 19 additions and 24 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,22 +82,22 @@ public void test(Path base) throws Exception {

checkOutput("ma/module-summary.html", true,
"""
<link rel="stylesheet" type="text/css" href="../ma/doc-files/spanstyle.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="../ma/doc-files/spanstyle.css">""");

checkOutput("ma/pa/package-summary.html", true,
"""
<link rel="stylesheet" type="text/css" href="../../ma/doc-files/spanstyle.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="../../ma/doc-files/spanstyle.css">""");

checkOutput("ma/pa/A.html", true,
"""
<link rel="stylesheet" type="text/css" href="../../ma/doc-files/spanstyle.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="../../ma/doc-files/spanstyle.css">""");

checkOutput("ma/pa/pb/B.html", true,
"""
<link rel="stylesheet" type="text/css" href="../../../ma/doc-files/spanstyle.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="../../../ma/doc-files/spanstyle.css">""");

checkOutput("ma/pa/pb/package-summary.html", true,
"""
<link rel="stylesheet" type="text/css" href="../../../ma/doc-files/spanstyle.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="../../../ma/doc-files/spanstyle.css">""");
}
}
10 changes: 5 additions & 5 deletions test/langtools/jdk/javadoc/doclet/testOptions/TestOptions.java
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ public void testStylesheetFile() {

checkOutput("resource-files/custom-stylesheet.css", true, "Custom javadoc style sheet");
checkOutput("pkg/Foo.html", true, """
<link rel="stylesheet" type="text/css" href="../resource-files/custom-stylesheet.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="../resource-files/custom-stylesheet.css">""");
}

@Test
Expand All @@ -131,7 +131,7 @@ public void testStylesheetFileAltOption() {

checkOutput("resource-files/custom-stylesheet.css", true, "Custom javadoc style sheet");
checkOutput("pkg/Foo.html", true, """
<link rel="stylesheet" type="text/css" href="../resource-files/custom-stylesheet.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="../resource-files/custom-stylesheet.css">""");
}

@Test
Expand All @@ -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,
"""
<link rel="stylesheet" type="text/css" href="../resource-files/additional-stylesheet-1.css" title="Style" translate="no">
<link rel="stylesheet" type="text/css" href="../resource-files/additional-stylesheet-2.css" title="Style" translate="no">
<link rel="stylesheet" type="text/css" href="../resource-files/additional-stylesheet-3.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="../resource-files/additional-stylesheet-1.css">
<link rel="stylesheet" type="text/css" href="../resource-files/additional-stylesheet-2.css">
<link rel="stylesheet" type="text/css" href="../resource-files/additional-stylesheet-3.css">""");
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,15 +82,15 @@ public void test(Path base) throws Exception {

checkOutput("pkg/A.html", true,
"""
<link rel="stylesheet" type="text/css" href="../pkg/doc-files/spanstyle.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="../pkg/doc-files/spanstyle.css">""");

checkOutput("pkg/package-summary.html", true,
"""
<link rel="stylesheet" type="text/css" href="../pkg/doc-files/spanstyle.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="../pkg/doc-files/spanstyle.css">""");

checkOutput("pkg2/B.html", false,
"""
<link rel="stylesheet" type="text/css" href="../pkg2/doc-files/spanstyle.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="../pkg2/doc-files/spanstyle.css">""");

}
}
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ void checkSearchOutput(String fileName, boolean expectedOutput) {
// Test for search related markup
checkOutput(fileName, expectedOutput,
"""
<link rel="stylesheet" type="text/css" href="resource-files/jquery-ui.min.css" title="Style" translate="no">
<link rel="stylesheet" type="text/css" href="resource-files/jquery-ui.min.css">
""",
"""
<script type="text/javascript" src="script-files/jquery-3.7.1.min.js"></script>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ public void test(Path base) {
// Test whether a link to the stylesheet file is inserted properly
// in the class documentation.
"""
<link rel="stylesheet" type="text/css" href="../resource-files/stylesheet.css" title="Style" translate="no">""",
<link rel="stylesheet" type="text/css" href="../resource-files/stylesheet.css">""",
"""
<div class="block">Test comment for a class which has an <a name="named_anchor">anchor_with_name</a> and
an <a id="named_anchor1">anchor_with_id</a>.</div>""");
Expand All @@ -200,7 +200,7 @@ public void test(Path base) {

checkOutput("index.html", true,
"""
<link rel="stylesheet" type="text/css" href="resource-files/stylesheet.css" title="Style" translate="no">""");
<link rel="stylesheet" type="text/css" href="resource-files/stylesheet.css">""");

checkOutput("resource-files/stylesheet.css", false,
"""
Expand Down

0 comments on commit 16675e7

Please sign in to comment.