RFR: 8335122: Reorganize internal low-level support for HTML in jdk.javadoc [v4]

Jonathan Gibbons jjg at openjdk.org
Tue Jul 30 17:53:33 UTC 2024


On Fri, 26 Jul 2024 10:52:22 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:

>> Jonathan Gibbons has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Cleanup use of HtmlStyle and HtmlStyles
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlTag.java line 87:
> 
>> 85:             attrs(AttrKind.HTML4, CLEAR)),
>> 86: 
>> 87:     BUTTON(BlockType.OTHER, EndKind.REQUIRED,
> 
> Several tag constants that use `BlockType.OTHER` in this enum are defined as [Phrasing Content](https://html.spec.whatwg.org/#phrasing-content) in the HTML5 spec. Since HTML5 phrasing content roughly corresponds to pre-HTML5 inline content these tags should use `BlockType.INLINE` here. This includes the following tags:
> 
>  - BUTTON
>  - INPUT
>  - LABEL
>  - LINK
>  - SCRIPT
> 
> These tags were also flagged as `phrasingContent` in the old doclet `TagName` enum. I'm not sure whether marking it as `INLINE` content will break DocLint tests.
> 
> It would seem like a good idea to suggest using [HTML5 content categories](https://developer.mozilla.org/en-US/docs/Web/HTML/Content_categories) in the new merged code, but the new categories are more complex and overlapping, and don't include list and table content, so there is not a lot to gain besides maybe more up-to-date terminology.

I'll look to upgrade these. In the original impl of DocLint, it was something of a conscious decision to avoid supporting input elements.

I'm surprised LINK is phrasing content: I thought it could only appear in HEAD elements. I will check.

Generally, moving towards HTML 5 names is a good goal, but some of that could/should be part of a DocLint cleanup. This is primarily just a merge, not an upgrade.   And, while DocLint is intended to be helpful, it is specifically for doc comments and their likely content, and not a full conformance checker.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/19916#discussion_r1697355146


More information about the javadoc-dev mailing list