RFR: 8351881: Tidy complains about missing "alt" attribute
Nizar Benalla
nbenalla at openjdk.org
Wed Mar 12 18:53:53 UTC 2025
On Wed, 12 Mar 2025 18:44:09 GMT, Jonathan Gibbons <jjg at openjdk.org> wrote:
>> Please review this change to add missing "alt" attributes to the left and right pointing angles used in the sidebar hide/show buttons and prevent `jdkCheckHtml.java` from failing.
>>
>> TIA.
>
> 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
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/24016#discussion_r1992113020
More information about the javadoc-dev
mailing list