RFR: 8351881: Tidy complains about missing "alt" attribute

Jonathan Gibbons jjg at openjdk.org
Thu Mar 13 03:07:04 UTC 2025


On Wed, 12 Mar 2025 18:51:07 GMT, Nizar Benalla <nbenalla at openjdk.org> wrote:

>> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/TableOfContents.java line 114:
>> 
>>> 112:                         .put(HtmlAttr.SRC, writer.pathToRoot.resolve(DocPaths.RESOURCE_FILES)
>>> 113:                                 .resolve(DocPaths.LEFT_SVG).getPath())
>>> 114:                         .put(HtmlAttr.ALT, writer.contents.hideSidebar.toString())));
>> 
>> It would be better to introduce and use a new factory method in HtmlTree
>> 
>>     HtmlTree IMG(DocPath src, String alt)
>> 
>> so that the API makes any similar error less likely in future.
>
> I will add this in a follow up PR, thanks for the suggestion

Consider it a general principle, to use static factory methods in HtmlTree to establish preferred or convenient ways to reliably create valid tree nodes.

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/24016#discussion_r1992606647


More information about the javadoc-dev mailing list