From hannesw at openjdk.org Mon Mar 3 15:05:35 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Mon, 3 Mar 2025 15:05:35 GMT Subject: RFR: 8344301: Refine stylesheet for API docs [v4] In-Reply-To: References: Message-ID: > This is an extensive update to the JavaDoc stylesheet that focuses on layout and typography, with the purpose of making API docs easier to read and use. > > List of changes: > > - Slightly increase text and navigation fonts to improve readability and to better match the code font (which remains unchanged). > - Fix font size and line height inconsistencies in many places. > - Limit the maximal width of page content to improve readability on large displays. If more horizontal space is available, page content is centered. > - Remove light gray section background in class and module pages to simplify and unclutter the layout. > - Add a subtle gray background to code elements in normal text to set them apart. > - Highlight headings of member details when they are used as link targets. > - Reserve use of bold font in member summary tables to element names to make them easier to spot and reduce visual noise. > - Slightly reduce width of TOC sidebar and use ellipsis (...) if content does not fit (but long signatures continue to wrap). > - Make method signatures in details easier to read on small dispays by allowing them to wrap before parameters and throws sections. > - Make tabs on top of summary tables scroll instead of wrapping if they overflow the available horizontal space. > - Hide TOC sidebar and copy-to-clipboard buttons in addition to the top navigation bar when printing a page. > - Improve styling of additional HTML files in `doc-files` directories. > - Reduce rollover animations and remove smooth scrolling in order to improve accessibility. > - Add background to `
` elements (will look great with [JDK-8346118](https://bugs.openjdk.org/browse/JDK-8346118)).
>  - Various cleanup.
> 
> There are too many non-trivial changes in the stylesheet to try explaining them here, but of course I'll be happy to discuss every change on request.
> 
> [Full JDK API docs are available for testing and comparison](https://cr.openjdk.org/~hannesw/8344301/api.05/index.html).

Hannes Walln?fer has updated the pull request incrementally with two additional commits since the last revision:

 - Changes:
    - Adjust subnav link color to meet WCAG contrast rules
    - Use subnav color for captions with links to meet WCAG rules
    - Make table header work with new caption color
    - Adjust some gaps
 - Changes:
    - Bring back breadcrumb highlight for current element
    - Use default tab color for search page caption

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23678/files
  - new: https://git.openjdk.org/jdk/pull/23678/files/817dcb00..7e301b70

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23678&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23678&range=02-03

  Stats: 60 lines in 4 files changed: 31 ins; 14 del; 15 mod
  Patch: https://git.openjdk.org/jdk/pull/23678.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23678/head:pull/23678

PR: https://git.openjdk.org/jdk/pull/23678

From hannesw at openjdk.org  Mon Mar  3 16:48:38 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Mon, 3 Mar 2025 16:48:38 GMT
Subject: RFR: 8346118: Improve whitespace normalization in preformatted text
Message-ID: 

Please review an enhancement to make `DocCommentParser` normalize whitespace inside `
` elements. The normalization is conceptually simple and and intended to be minimally invasive. Before parsing, `DocCommentParser` checks whether the text is a traditional doc comment and whether every line starts with a space character, which is commonly the case in traditional doc comments. If so, a single leading space is removed in block content (top level text and `{@code}`/`{@literal}` tags) when parsing within HTML `
` tags.

This fixes the incidental one-space indentation in the vast majority of JDK code samples using `
` alone or in combination with `` or `{@code}`. In fact, I only found one code sample in JDK code that isn't solved by this change, for which I included a fix in this PR (it's in `String.startsWith(String, int)`, where I replaced the 10 char indentation and trailing line with a `
`). The many added `boolean inBlockContent` arguments pased around in `DocCommentParser` are to make sure the removal is not applied to multiline inline content, which is maybe a bit fussy considering there is not a lot of multiline inline content in `
` tags and it usually would not mind about removal of a non-essential space character, but I wanted to keep the change minimal. There are few javadoc tests that had to be adapted, most of the testing is done in `test/langtools/tools/javac/doctree`. 

If the exact number of leading whitespace in `
` tags is important to any javadoc user the old output can be restored by increasing the indentation by 1. There will be a release note for this of course. 

Unfortunately, there is another whitespace problem that can't be solved as easily, and that is a leading blank line caused by `
\n` open tags. Browsers will [ignore a newline immediately following a `
` tag][1], but not if there is a `` tag in between. There are hundreds of occurrences of this in JDK code, including variants with space characters mixed in. The fix in javadoc proper would be too complex, so I decided to solve it with 3 lines of JavaScript and a regex to reverse the order of `\n` at the beginning of `
` tags while removing any intermediary space. Script operation is indiscernible and it solves the problem.

[1]: https://html.spec.whatwg.org/#the-pre-element:the-pre-element

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

Commit messages:
 - Make sure whitespace normalization is only applied to block content
 - Only normalize inside 
 tags, add tests
 - 8346118: Improve whitespace normalization in preformatted text

Changes: https://git.openjdk.org/jdk/pull/23868/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23868&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8346118
  Stats: 334 lines in 11 files changed: 258 ins; 0 del; 76 mod
  Patch: https://git.openjdk.org/jdk/pull/23868.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23868/head:pull/23868

PR: https://git.openjdk.org/jdk/pull/23868

From liach at openjdk.org  Mon Mar  3 17:16:54 2025
From: liach at openjdk.org (Chen Liang)
Date: Mon, 3 Mar 2025 17:16:54 GMT
Subject: RFR: 8345555: Improve layout of search results [v2]
In-Reply-To: <4jq45fp2d8Myti_6nTFUu0DGViGykRjSpgM-oh3f4MQ=.ccd20a64-1bbe-44f6-ab54-429121e08ca4@github.com>
References: 
 <4jq45fp2d8Myti_6nTFUu0DGViGykRjSpgM-oh3f4MQ=.ccd20a64-1bbe-44f6-ab54-429121e08ca4@github.com>
Message-ID: 

On Mon, 17 Feb 2025 19:54:49 GMT, Hannes Walln?fer  wrote:

>> Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. 
>> 
>> The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.02/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged.
>> 
>> Screenshot 2025-02-17 at 14 56 52
>> 
>> On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem.
>> 
>> There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. 
>> 
>> Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags
>> 
>> On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to ...
>
> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Rename label property as it has special meaning to jquery-ui

Seems fine; @nizarbenalla please review too.

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexWriter.java line 263:

> 261:             case SYSTEM_PROPERTY -> "doclet.System_property_in";
> 262:             case SECTION -> "doclet.Section_in";
> 263:             case EXTERNAL_SPEC-> "doclet.External_specification_in";

Suggestion:

            case EXTERNAL_SPEC -> "doclet.External_specification_in";

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexItem.java line 127:

> 125:          * {@return the kind of index item for a program element}
> 126:          */
> 127:         public static Kind ofElement (Element elem, Utils utils) {

Suggestion:

        public static Kind ofElement(Element elem, Utils utils) {

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

PR Review: https://git.openjdk.org/jdk/pull/23666#pullrequestreview-2654746323
PR Review Comment: https://git.openjdk.org/jdk/pull/23666#discussion_r1977880767
PR Review Comment: https://git.openjdk.org/jdk/pull/23666#discussion_r1977885842

From liach at openjdk.org  Mon Mar  3 17:20:59 2025
From: liach at openjdk.org (Chen Liang)
Date: Mon, 3 Mar 2025 17:20:59 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v6]
In-Reply-To: 
References: 
 
Message-ID: <7cDq6kmPLqIHPEis_BwPdAdGEFdG076hJ8g37xELRJc=.b02df83f-e6de-4b8e-adb9-aabb1bb0d05c@github.com>

On Fri, 28 Feb 2025 15:13:07 GMT, Hannes Walln?fer  wrote:

>> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
>> 
>>  - / to switch focus to the search input
>>  - . to switch focus to the sidebar filter input
>>  - Esc to first reset input and then relinquish focus in either input field
>> 
>> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
>> 
>> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
>> 
>> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
>> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
>> 
>> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
>> 
>> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.
>
> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add @bug id to tests

Looks fine. @nizarbenalla please check out too.

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

Marked as reviewed by liach (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23777#pullrequestreview-2654763443

From weijun at openjdk.org  Mon Mar  3 17:34:55 2025
From: weijun at openjdk.org (Weijun Wang)
Date: Mon, 3 Mar 2025 17:34:55 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v6]
In-Reply-To: 
References: 
 
Message-ID: 

On Fri, 28 Feb 2025 15:13:07 GMT, Hannes Walln?fer  wrote:

>> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
>> 
>>  - / to switch focus to the search input
>>  - . to switch focus to the sidebar filter input
>>  - Esc to first reset input and then relinquish focus in either input field
>> 
>> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
>> 
>> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
>> 
>> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
>> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
>> 
>> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
>> 
>> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.
>
> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add @bug id to tests

The keyboard shortcuts are great! However, I don't quite get what "be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly" means. If I press the up/down keys I can see the right side is scrolling (in a constant speed) and whatever section shows up is highlighted on the left side. How do I navigate to a section quickly? I thought you meant every down key press will jump to the next section.

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

PR Comment: https://git.openjdk.org/jdk/pull/23777#issuecomment-2695094462

From hannesw at openjdk.org  Mon Mar  3 19:10:16 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Mon, 3 Mar 2025 19:10:16 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v6]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Mon, 3 Mar 2025 17:32:03 GMT, Weijun Wang  wrote:

> The keyboard shortcuts are great! However, I don't quite get what "be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly" means. If I press the up/down keys I can see the right side is scrolling (in a constant speed) and whatever section shows up is highlighted on the left side. How do I navigate to a section quickly? I thought you meant every down key press will jump to the next section.

Sorry for being imprecise, what I meant was this: 

 - type something in the left side "Filter" input
 - press tab or arrow-down key to move focus to the first item in the list
 - optionally navigate with tab/shift-tab/arrow keys to the list item of choice
 - hit enter to go to the item and reset the filter input

So the only way to get the orange highlight that can be moved by tab/arrow keys is via tabbing/arrowing out of the filter input box. That's because this is the keyboard focus, which can't be set by mouse/trackpad.

Unfortunately Safari has a bug where the focus sometimes does not show when pressing arrow-down from the filter input, but tab should always work. The bug has already been fixed and will hopefully be in the released version soon.

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

PR Comment: https://git.openjdk.org/jdk/pull/23777#issuecomment-2695303284

From weijun at openjdk.org  Mon Mar  3 19:52:57 2025
From: weijun at openjdk.org (Weijun Wang)
Date: Mon, 3 Mar 2025 19:52:57 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v6]
In-Reply-To: 
References: 
 
Message-ID: <-7M_izw-cqtiUm-cwXCytLXJBVXFhEW91Ekt0uTab3o=.36c2bdd4-c2e1-49be-84d4-7cfea47847ba@github.com>

On Fri, 28 Feb 2025 15:13:07 GMT, Hannes Walln?fer  wrote:

>> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
>> 
>>  - / to switch focus to the search input
>>  - . to switch focus to the sidebar filter input
>>  - Esc to first reset input and then relinquish focus in either input field
>> 
>> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
>> 
>> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
>> 
>> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
>> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
>> 
>> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
>> 
>> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.
>
> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add @bug id to tests

Wow, that?s neat! Sorry, I should have played around with it a bit more before asking.

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

PR Comment: https://git.openjdk.org/jdk/pull/23777#issuecomment-2695391508

From hannesw at openjdk.org  Mon Mar  3 19:55:42 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Mon, 3 Mar 2025 19:55:42 GMT
Subject: RFR: 8345555: Improve layout of search results [v3]
In-Reply-To: 
References: 
Message-ID: 

> Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. 
> 
> The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.02/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged.
> 
> Screenshot 2025-02-17 at 14 56 52
> 
> On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem.
> 
> There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. 
> 
> Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags
> 
> On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to the code so it will be eas...

Hannes Walln?fer has updated the pull request incrementally with three additional commits since the last revision:

 - Review feedback (formatting)
 - Remove counterproductive restriction in search pattern
 - Fix search menu selecting item at current mouse position

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23666/files
  - new: https://git.openjdk.org/jdk/pull/23666/files/48a70635..65de882c

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=01-02

  Stats: 23 lines in 3 files changed: 6 ins; 7 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/23666.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23666/head:pull/23666

PR: https://git.openjdk.org/jdk/pull/23666

From hannesw at openjdk.org  Mon Mar  3 20:08:53 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Mon, 3 Mar 2025 20:08:53 GMT
Subject: RFR: 8345555: Improve layout of search results [v2]
In-Reply-To: 
References: 
 <4jq45fp2d8Myti_6nTFUu0DGViGykRjSpgM-oh3f4MQ=.ccd20a64-1bbe-44f6-ab54-429121e08ca4@github.com>
 
Message-ID: 

On Mon, 3 Mar 2025 17:14:07 GMT, Chen Liang  wrote:

>> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Rename label property as it has special meaning to jquery-ui
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexItem.java line 127:
> 
>> 125:          * {@return the kind of index item for a program element}
>> 126:          */
>> 127:         public static Kind ofElement (Element elem, Utils utils) {
> 
> Suggestion:
> 
>         public static Kind ofElement(Element elem, Utils utils) {

Thanks, @liach! I pushed the changes you suggested along with two small fixes.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23666#discussion_r1978124216

From liach at openjdk.org  Tue Mar  4 02:16:57 2025
From: liach at openjdk.org (Chen Liang)
Date: Tue, 4 Mar 2025 02:16:57 GMT
Subject: RFR: 8344301: Refine stylesheet for API docs [v4]
In-Reply-To: 
References: 
 
Message-ID: 

On Mon, 3 Mar 2025 15:05:35 GMT, Hannes Walln?fer  wrote:

>> This is an extensive update to the JavaDoc stylesheet that focuses on layout and typography, with the purpose of making API docs easier to read and use.
>> 
>> List of changes:
>> 
>>  - Slightly increase text and navigation fonts to improve readability and to better match the code font (which remains unchanged). 
>>  - Fix font size and line height inconsistencies in many places.
>>  - Limit the maximal width of page content to improve readability on large displays. If more horizontal space is available, page content is centered.
>>  - Remove light gray section background in class and module pages to simplify and unclutter the layout. 
>>  - Add a subtle gray background to code elements in normal text to set them apart.
>>  - Highlight headings of member details when they are used as link targets.
>>  - Reserve use of bold font in member summary tables to element names to make them easier to spot and reduce visual noise.
>>  - Slightly reduce width of TOC sidebar and use ellipsis (...) if content does not fit (but long signatures continue to wrap).
>>  - Make method signatures in details easier to read on small dispays by allowing them to wrap before parameters and throws sections.
>>  - Make tabs on top of summary tables scroll instead of wrapping if they overflow the available horizontal space.
>>  - Hide TOC sidebar and copy-to-clipboard buttons in addition to the top navigation bar when printing a page.
>>  - Improve styling of additional HTML files in `doc-files` directories.
>>  - Reduce rollover animations and remove smooth scrolling in order to improve accessibility.
>>  - Add background to `
` elements (will look great with [JDK-8346118](https://bugs.openjdk.org/browse/JDK-8346118)).
>>  - Various cleanup.
>> 
>> There are too many non-trivial changes in the stylesheet to try explaining them here, but of course I'll be happy to discuss every change on request.
>> 
>> [Full JDK API docs are available for testing and comparison](https://cr.openjdk.org/~hannesw/8344301/api.05/index.html).
>
> Hannes Walln?fer has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Changes:
>     - Adjust subnav link color to meet WCAG contrast rules
>     - Use subnav color for captions with links to meet WCAG rules
>     - Make table header work with new caption color
>     - Adjust some gaps
>  - Changes:
>     - Bring back breadcrumb highlight for current element
>     - Use default tab color for search page caption

Looks good. @nizarbenalla for a look too.

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

Marked as reviewed by liach (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23678#pullrequestreview-2655750579

From liach at openjdk.org  Tue Mar  4 02:17:55 2025
From: liach at openjdk.org (Chen Liang)
Date: Tue, 4 Mar 2025 02:17:55 GMT
Subject: RFR: 8349369:
 test/docs/jdk/javadoc/doccheck/checks/jdkCheckLinks.java did not report on
 missing man page files
In-Reply-To: 
References: 
 
Message-ID: 

On Tue, 18 Feb 2025 17:11:33 GMT, Hannes Walln?fer  wrote:

>> Please review this small update to make the test more robust, the test did not always check links to other files if they did not contain a fragment or a `#`symbol.
>> 
>> I'd like to add that the original [doccheck](https://github.com/openjdk/doccheck) also didn't pick up on these missing files when I ran it. 
>> 
>> TIA
>
> test/docs/jdk/javadoc/doccheck/doccheckutils/checkers/LinkChecker.java line 227:
> 
>> 225:                 && missingFiles == 0
>> 226:                 && badSchemes == 0
>> 227:                 && log.noErrors();
> 
> So we have both these counters and the `log` instance to track errors. Shouldn't the `missingIds` counter have bee increased when the error was logged?

Indeed, would be much better if we can just check `log.noErrors()`.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23441#discussion_r1978498602

From hannesw at openjdk.org  Tue Mar  4 15:33:16 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Tue, 4 Mar 2025 15:33:16 GMT
Subject: RFR: 8350007: Add usage message to the javadoc executable [v3]
In-Reply-To: 
References: 
 
 
 
 
Message-ID: 

On Wed, 26 Feb 2025 20:16:36 GMT, Nizar Benalla  wrote:

>> `jpackage` and `jar` return 0 if there are no args. `javap` returns `2`/`EXIT_CMDERR` so it's not very consistent.
>> 
>> This is the behavior when returning `CMDERR`
>> 
>> 
>> nizar-mac! $ javadoc 
>> error: Usage:
>>       javadoc [options] [packagenames] [sourcefiles] [@files]
>>   For more details on available options, use --help or --help-extra
>> 1 error
>> 
>> 
>> I'm not sure we want to emit an error? Returning 0 or 1 might better.
>> But I can understand why we would want to keep those things the same.
>
> For the record, I discussed this offline with a couple of people.
> Since the user didn't ask for the help message, this is indeed be an invalid run and returning a non-zero value might  be the right thing to do.

I see, you can't return an error without generating the `error: ` prefix and the `1 error` line. That's a pity, as the `error: Usage:` line makes no sense, because the usage message is not an error message. An acceptable solution could be to print the usage method, and then throw the original error message, which produces:


Usage:
    javadoc [options] [packagenames] [sourcefiles] [@files]
For more details on available options, use --help or --help-extra
error: No modules, packages or classes specified.
1 error

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23618#discussion_r1979693905

From jjg at openjdk.org  Wed Mar  5 18:09:53 2025
From: jjg at openjdk.org (Jonathan Gibbons)
Date: Wed, 5 Mar 2025 18:09:53 GMT
Subject: RFR: 8346118: Improve whitespace normalization in preformatted
 text
In-Reply-To: 
References: 
Message-ID: 

On Mon, 3 Mar 2025 16:41:18 GMT, Hannes Walln?fer  wrote:

> Please review an enhancement to make `DocCommentParser` normalize whitespace inside `
` elements. The normalization is conceptually simple and and intended to be minimally invasive. Before parsing, `DocCommentParser` checks whether the text is a traditional doc comment and whether every line starts with a space character, which is commonly the case in traditional doc comments. If so, a single leading space is removed in block content (top level text and `{@code}`/`{@literal}` tags) when parsing within HTML `
` tags.
> 
> This fixes the incidental one-space indentation in the vast majority of JDK code samples using `
` alone or in combination with `` or `{@code}`. In fact, I only found one code sample in JDK code that isn't solved by this change, for which I included a fix in this PR (it's in `String.startsWith(String, int)`, where I replaced the 10 char indentation and trailing line with a `
`). > > The many added `boolean inBlockContent` arguments pased around in `DocCommentParser` are to make sure the removal is not applied to multiline inline content, which is maybe a bit fussy considering there is not a lot of multiline inline content in `
` tags and it usually would not mind about removal of a non-essential space character, but I wanted to keep the change minimal. There are few javadoc tests that had to be adapted, most of the testing is done in `test/langtools/tools/javac/doctree`. 
> 
> If the exact number of leading whitespace in `
` tags is important to any javadoc user the old output can be restored by increasing the indentation by 1. There will be a release note for this of course. 
> 
> Unfortunately, there is another whitespace problem that can't be solved as easily, and that is a leading blank line caused by `
\n` open tags. Browsers will [ignore a newline immediately following a `
` tag][1], but not if there is a `` tag in between. There are hundreds of occurrences of this in JDK code, including variants with space characters mixed in. The fix in javadoc proper would be too complex, so I decided to solve it with 3 lines of JavaScript and a regex to reverse the order of `\n` at the beginning of `
` tags while removing any intermediary space. Script operation is indiscernible and it solves the problem.
> 
> [1]: https://html.spec.whatwg.org/#the-pre-element:the-pre-element

As you indicated, there are two problems being addressed here, which might indicate the need for two separate patches. These issues are:

1. The leading 1-space problem.
2. The trailing newline-after-
 problem

For the first, it is unduly hard work to fix this just for `
` blocks. I still think that an overall better long-term solution would be to apply a conceptual `stripIndent` to the entire doc comment. This would bring traditional comments into line with the new Markdown comments, and can be done in just a few lines in `DocCommentParser`, and doing it there in DCP means you need not update `Elements.getDocComment`. If nothing else, I would suggest doing the experiment and comparing the generated docs, to verify there are no unexpected side effects. If there are any significant unexpected side effects, then your approach might deserve a second look. You could also make this a JDK-version-specific change if you wanted: meaning the new behavior does not apply to older JDK versions, although that is not a policy we have adhered to in the past.

For the second, I just feel that is a step too far, using JavaScript to clean up what some might consider to be bad input. Authors should either write HTML according to the HTML (and CSS?) specs, so that `javadoc` is just a "pass-through" layer, or authors should use a suitable construct, like `{@snippet...}`, that is "pleasing" to look at in source form while still generating the desired output.

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

PR Comment: https://git.openjdk.org/jdk/pull/23868#issuecomment-2701699839

From hannesw at openjdk.org  Wed Mar  5 20:48:57 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Wed, 5 Mar 2025 20:48:57 GMT
Subject: RFR: 8346118: Improve whitespace normalization in preformatted
 text
In-Reply-To: 
References: 
Message-ID: 

On Mon, 3 Mar 2025 16:41:18 GMT, Hannes Walln?fer  wrote:

> Please review an enhancement to make `DocCommentParser` normalize whitespace inside `
` elements. The normalization is conceptually simple and and intended to be minimally invasive. Before parsing, `DocCommentParser` checks whether the text is a traditional doc comment and whether every line starts with a space character, which is commonly the case in traditional doc comments. If so, a single leading space is removed in block content (top level text and `{@code}`/`{@literal}` tags) when parsing within HTML `
` tags.
> 
> This fixes the incidental one-space indentation in the vast majority of JDK code samples using `
` alone or in combination with `` or `{@code}`. In fact, I only found one code sample in JDK code that isn't solved by this change, for which I included a fix in this PR (it's in `String.startsWith(String, int)`, where I replaced the 10 char indentation and trailing line with a `
`). > > The many added `boolean inBlockContent` arguments pased around in `DocCommentParser` are to make sure the removal is not applied to multiline inline content, which is maybe a bit fussy considering there is not a lot of multiline inline content in `
` tags and it usually would not mind about removal of a non-essential space character, but I wanted to keep the change minimal. There are few javadoc tests that had to be adapted, most of the testing is done in `test/langtools/tools/javac/doctree`. 
> 
> If the exact number of leading whitespace in `
` tags is important to any javadoc user the old output can be restored by increasing the indentation by 1. There will be a release note for this of course. 
> 
> Unfortunately, there is another whitespace problem that can't be solved as easily, and that is a leading blank line caused by `
\n` open tags. Browsers will [ignore a newline immediately following a `
` tag][1], but not if there is a `` tag in between. There are hundreds of occurrences of this in JDK code, including variants with space characters mixed in. The fix in javadoc proper would be too complex, so I decided to solve it with 3 lines of JavaScript and a regex to reverse the order of `\n` at the beginning of `
` tags while removing any intermediary space. Script operation is indiscernible and it solves the problem.
> 
> [1]: https://html.spec.whatwg.org/#the-pre-element:the-pre-element

Thanks for reviewing this, Jon. I agree there are two issues that maybe shold be handled separately. 

Regarding the first issue, stripping leading space in `DocCommentParser`, I did in fact start out processing the whole doc comment. I was pretty far into fixing tests when I realized that this approach breaks our ability to get a diagnostic position from a string extracted from the comment. The source postion mapping is generated in `JavadocScanner`, and it would be quite complex to keep track of whitespace removed after the fact and correctly translate to a source position. 

The test that made me realize this problem was [TestDocTreeDiags.java], which tests reporting positions inside strings extracted from the comment (added in [JDK-8268420]) , but with wholesale whitespace removal also start positions are affected. I should have mentioned this in the PR description, but it was already long enough as it was.

[TestDocTreeDiags.java]: https://github.com/openjdk/jdk/blob/master/test/langtools/jdk/javadoc/doclet/testDocTreeDiags/TestDocTreeDiags.java
[JDK-8268420]: https://bugs.openjdk.org/browse/JDK-8268420

This is why I reverted to the proposed minimalistic solution, limiting space removal to text and `{@code}`/`{@literal}` tags within `
` elements. These are all doctrees that are passed though without further processing, so it is highly unlikely that anybody would ever want to report a source position inside of them. The begin postions will be correct since we're parsing the unchanged doc comment, but positions inside the string after the first line break would report a wrong position. This is why I filed [a CSR to amend the spec for above mentioned method][CSR] with a note about this. 

[CSR]: https://bugs.openjdk.org/browse/JDK-8350428

Regarding the second issue, I agree the JavaScript solution is not ideal. But it's a small price to pay in order to get readable and good looking documentation. We have close to 1000 instances of `
{@code}` in JDK source code alone, and they will never get fixed and continue to haunt our otherwise great documentation. The same problem affects most Java libraries out there. You see I'm quite passionate about this, but I agree to move it to a separate issue if you think that's the best way to handle this.

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

PR Comment: https://git.openjdk.org/jdk/pull/23868#issuecomment-2702033467

From hannesw at openjdk.org  Thu Mar  6 05:18:26 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Thu, 6 Mar 2025 05:18:26 GMT
Subject: RFR: 8346118: Improve whitespace normalization in preformatted
 text [v2]
In-Reply-To: 
References: 
Message-ID: 

> Please review an enhancement to make `DocCommentParser` normalize whitespace inside `
` elements. The normalization is conceptually simple and and intended to be minimally invasive. Before parsing, `DocCommentParser` checks whether the text is a traditional doc comment and whether every line starts with a space character, which is commonly the case in traditional doc comments. If so, a single leading space is removed in block content (top level text and `{@code}`/`{@literal}` tags) when parsing within HTML `
` tags.
> 
> This fixes the incidental one-space indentation in the vast majority of JDK code samples using `
` alone or in combination with `` or `{@code}`. In fact, I only found one code sample in JDK code that isn't solved by this change, for which I included a fix in this PR (it's in `String.startsWith(String, int)`, where I replaced the 10 char indentation and trailing line with a `
`). > > The many added `boolean inBlockContent` arguments pased around in `DocCommentParser` are to make sure the removal is not applied to multiline inline content, which is maybe a bit fussy considering there is not a lot of multiline inline content in `
` tags and it usually would not mind about removal of a non-essential space character, but I wanted to keep the change minimal. There are few javadoc tests that had to be adapted, most of the testing is done in `test/langtools/tools/javac/doctree`. 
> 
> If the exact number of leading whitespace in `
` tags is important to any javadoc user the old output can be restored by increasing the indentation by 1. There will be a release note for this of course. 
> 
> Unfortunately, there is another whitespace problem that can't be solved as easily, and that is a leading blank line caused by `
\n` open tags. Browsers will [ignore a newline immediately following a `
` tag][1], but not if there is a `` tag in between. There are hundreds of occurrences of this in JDK code, including variants with space characters mixed in. The fix in javadoc proper would be too complex, so I decided to solve it with 3 lines of JavaScript and a regex to reverse the order of `\n` at the beginning of `
` tags while removing any intermediary space. Script operation is indiscernible and it solves the problem.
> 
> [1]: https://html.spec.whatwg.org/#the-pre-element:the-pre-element

Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:

  Remove script for normalizing leading space in pre/code based on review feedback

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23868/files
  - new: https://git.openjdk.org/jdk/pull/23868/files/13638f80..d2128b3a

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23868&range=01
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23868&range=00-01

  Stats: 9 lines in 1 file changed: 0 ins; 9 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/23868.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23868/head:pull/23868

PR: https://git.openjdk.org/jdk/pull/23868

From hannesw at openjdk.org  Thu Mar  6 05:31:52 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Thu, 6 Mar 2025 05:31:52 GMT
Subject: RFR: 8346118: Improve whitespace normalization in preformatted
 text [v2]
In-Reply-To: 
References: 
 
Message-ID: 

On Thu, 6 Mar 2025 05:18:26 GMT, Hannes Walln?fer  wrote:

>> Please review an enhancement to make `DocCommentParser` normalize whitespace inside `
` elements. The normalization is conceptually simple and and intended to be minimally invasive. Before parsing, `DocCommentParser` checks whether the text is a traditional doc comment and whether every line starts with a space character, which is commonly the case in traditional doc comments. If so, a single leading space is removed in block content (top level text and `{@code}`/`{@literal}` tags) when parsing within HTML `
` tags.
>> 
>> This fixes the incidental one-space indentation in the vast majority of JDK code samples using `
` alone or in combination with `` or `{@code}`. In fact, I only found one code sample in JDK code that isn't solved by this change, for which I included a fix in this PR (it's in `String.startsWith(String, int)`, where I replaced the 10 char indentation and trailing line with a `
`). >> >> The many added `boolean inBlockContent` arguments pased around in `DocCommentParser` are to make sure the removal is not applied to multiline inline content, which is maybe a bit fussy considering there is not a lot of multiline inline content in `
` tags and it usually would not mind about removal of a non-essential space character, but I wanted to keep the change minimal. There are few javadoc tests that had to be adapted, most of the testing is done in `test/langtools/tools/javac/doctree`. 
>> 
>> If the exact number of leading whitespace in `
` tags is important to any javadoc user the old output can be restored by increasing the indentation by 1. There will be a release note for this of course. 
>> 
>> Unfortunately, there is another whitespace problem that can't be solved as easily, and that is a leading blank line caused by `
\n` open tags. Browsers will [ignore a newline immediately following a `
` tag][1], but not if there is a `` tag in between. There are hundreds of occurrences of this in JDK code, including variants with space characters mixed in. The fix in javadoc proper would be too complex, so I decided to solve it with 3 lines of JavaScript and a regex to reverse the order of `\n` at the beginning of `
` tags while removing any intermediary space. Script operation is indiscernible and it solves the problem.
>> 
>> [1]: https://html.spec.whatwg.org/#the-pre-element:the-pre-element
>
> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Remove script for normalizing leading space in pre/code based on review feedback

I removed the script to strip leading whitespace based on your feedback. 

Regarding the added complexity this patch adds to `DocCommentParser` (which I dislike as you do): I think we could reconsider exclusion of multiline inline content. The test examples I came up with are very contrived (multiline `title` attribute and `{@index}` tag inside `
`, both of which would not mind removal of redundant space after line breaks). I initially tried using a `{@snippet}` tag inside `
` which is also completely unrealistic, but `{@snippet}` is not even affected as it does its own parsing.

Without that exclusion, the patch is mostly just two simple methods, and all the added complexity to `content` and other existing methods is gone.

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

PR Comment: https://git.openjdk.org/jdk/pull/23868#issuecomment-2702853308

From nbenalla at openjdk.org  Thu Mar  6 10:52:53 2025
From: nbenalla at openjdk.org (Nizar Benalla)
Date: Thu, 6 Mar 2025 10:52:53 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v6]
In-Reply-To: 
References: 
 
Message-ID: 

On Fri, 28 Feb 2025 15:13:07 GMT, Hannes Walln?fer  wrote:

>> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
>> 
>>  - / to switch focus to the search input
>>  - . to switch focus to the sidebar filter input
>>  - Esc to first reset input and then relinquish focus in either input field
>> 
>> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
>> 
>> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
>> 
>> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
>> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
>> 
>> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
>> 
>> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.
>
> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Add @bug id to tests

Code looks fine, the keyboard navigation is great!

Question: for TOC navigation, should the navigation using tab/shift-tab be documented as well? Or maybe mentioning the fact you need to first focus on the input field for it to work.

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

PR Review: https://git.openjdk.org/jdk/pull/23777#pullrequestreview-2664071923

From nbenalla at openjdk.org  Thu Mar  6 12:10:04 2025
From: nbenalla at openjdk.org (Nizar Benalla)
Date: Thu, 6 Mar 2025 12:10:04 GMT
Subject: RFR: 8344301: Refine stylesheet for API docs [v4]
In-Reply-To: 
References: 
 
Message-ID: 

On Mon, 3 Mar 2025 15:05:35 GMT, Hannes Walln?fer  wrote:

>> This is an extensive update to the JavaDoc stylesheet that focuses on layout and typography, with the purpose of making API docs easier to read and use.
>> 
>> List of changes:
>> 
>>  - Slightly increase text and navigation fonts to improve readability and to better match the code font (which remains unchanged). 
>>  - Fix font size and line height inconsistencies in many places.
>>  - Limit the maximal width of page content to improve readability on large displays. If more horizontal space is available, page content is centered.
>>  - Remove light gray section background in class and module pages to simplify and unclutter the layout. 
>>  - Add a subtle gray background to code elements in normal text to set them apart.
>>  - Highlight headings of member details when they are used as link targets.
>>  - Reserve use of bold font in member summary tables to element names to make them easier to spot and reduce visual noise.
>>  - Slightly reduce width of TOC sidebar and use ellipsis (...) if content does not fit (but long signatures continue to wrap).
>>  - Make method signatures in details easier to read on small dispays by allowing them to wrap before parameters and throws sections.
>>  - Make tabs on top of summary tables scroll instead of wrapping if they overflow the available horizontal space.
>>  - Hide TOC sidebar and copy-to-clipboard buttons in addition to the top navigation bar when printing a page.
>>  - Improve styling of additional HTML files in `doc-files` directories.
>>  - Reduce rollover animations and remove smooth scrolling in order to improve accessibility.
>>  - Add background to `
` elements (will look great with [JDK-8346118](https://bugs.openjdk.org/browse/JDK-8346118)).
>>  - Various cleanup.
>> 
>> There are too many non-trivial changes in the stylesheet to try explaining them here, but of course I'll be happy to discuss every change on request.
>> 
>> [Full JDK API docs are available for testing and comparison](https://cr.openjdk.org/~hannesw/8344301/api.05/index.html).
>
> Hannes Walln?fer has updated the pull request incrementally with two additional commits since the last revision:
> 
>  - Changes:
>     - Adjust subnav link color to meet WCAG contrast rules
>     - Use subnav color for captions with links to meet WCAG rules
>     - Make table header work with new caption color
>     - Adjust some gaps
>  - Changes:
>     - Bring back breadcrumb highlight for current element
>     - Use default tab color for search page caption

I left a couple of comments, but they are not a blocker for this PR.
Our stylesheet is quite large so we might want to consider running a linter on it in the future.

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css line 827:

> 825:     font-size: inherit;
> 826: }
> 827: code {

I noticed there is a duplicate `code` selector (first used in line 162), is this intentional?
I also think it's odd to have `code` after `:is(h1, h2, h3, h4, h5, h6, sup, sub, small, big) code`

src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css line 1537:

> 1535:     }
> 1536: }
> 1537: pre {

Duplicate selector, It doesn't have the same fields as the one from line 129

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

PR Review: https://git.openjdk.org/jdk/pull/23678#pullrequestreview-2664235129
PR Review Comment: https://git.openjdk.org/jdk/pull/23678#discussion_r1983234865
PR Review Comment: https://git.openjdk.org/jdk/pull/23678#discussion_r1983231137

From hannesw at openjdk.org  Thu Mar  6 16:42:42 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Thu, 6 Mar 2025 16:42:42 GMT
Subject: RFR: 8346118: Improve whitespace normalization in preformatted
 text [v3]
In-Reply-To: 
References: 
Message-ID: 

> Please review an enhancement to make `DocCommentParser` normalize whitespace inside `
` elements. The normalization is conceptually simple and and intended to be minimally invasive. Before parsing, `DocCommentParser` checks whether the text is a traditional doc comment and whether every line starts with a space character, which is commonly the case in traditional doc comments. If so, a single leading space is removed in block content (top level text and `{@code}`/`{@literal}` tags) when parsing within HTML `
` tags.
> 
> This fixes the incidental one-space indentation in the vast majority of JDK code samples using `
` alone or in combination with `` or `{@code}`. In fact, I only found one code sample in JDK code that isn't solved by this change, for which I included a fix in this PR (it's in `String.startsWith(String, int)`, where I replaced the 10 char indentation and trailing line with a `
`). > > The many added `boolean inBlockContent` arguments pased around in `DocCommentParser` are to make sure the removal is not applied to multiline inline content, which is maybe a bit fussy considering there is not a lot of multiline inline content in `
` tags and it usually would not mind about removal of a non-essential space character, but I wanted to keep the change minimal. There are few javadoc tests that had to be adapted, most of the testing is done in `test/langtools/tools/javac/doctree`. 
> 
> If the exact number of leading whitespace in `
` tags is important to any javadoc user the old output can be restored by increasing the indentation by 1. There will be a release note for this of course. 
> 
> Unfortunately, there is another whitespace problem that can't be solved as easily, and that is a leading blank line caused by `
\n` open tags. Browsers will [ignore a newline immediately following a `
` tag][1], but not if there is a `` tag in between. There are hundreds of occurrences of this in JDK code, including variants with space characters mixed in. The fix in javadoc proper would be too complex, so I decided to solve it with 3 lines of JavaScript and a regex to reverse the order of `\n` at the beginning of `
` tags while removing any intermediary space. Script operation is indiscernible and it solves the problem.
> 
> [1]: https://html.spec.whatwg.org/#the-pre-element:the-pre-element

Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:

  Switch to post-processing approach that fixes both problems
  
  This implements a visitor-based post-processing method in
  DocCommentParser that is able to fix both kinds of whitespace
  common in traditional doc comments. Tests have to be adapted
  to the additional normalization step. A few more tests should
  be added on the javadoc side.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23868/files
  - new: https://git.openjdk.org/jdk/pull/23868/files/d2128b3a..8a9036d6

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23868&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23868&range=01-02

  Stats: 304 lines in 4 files changed: 200 ins; 63 del; 41 mod
  Patch: https://git.openjdk.org/jdk/pull/23868.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23868/head:pull/23868

PR: https://git.openjdk.org/jdk/pull/23868

From hannesw at openjdk.org  Thu Mar  6 16:54:13 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Thu, 6 Mar 2025 16:54:13 GMT
Subject: RFR: 8346118: Improve whitespace normalization in preformatted
 text [v4]
In-Reply-To: 
References: 
Message-ID: 

> Please review an enhancement to make `DocCommentParser` normalize whitespace inside `
` elements. The normalization is conceptually simple and and intended to be minimally invasive. Before parsing, `DocCommentParser` checks whether the text is a traditional doc comment and whether every line starts with a space character, which is commonly the case in traditional doc comments. If so, a single leading space is removed in block content (top level text and `{@code}`/`{@literal}` tags) when parsing within HTML `
` tags.
> 
> This fixes the incidental one-space indentation in the vast majority of JDK code samples using `
` alone or in combination with `` or `{@code}`. In fact, I only found one code sample in JDK code that isn't solved by this change, for which I included a fix in this PR (it's in `String.startsWith(String, int)`, where I replaced the 10 char indentation and trailing line with a `
`). > > The many added `boolean inBlockContent` arguments pased around in `DocCommentParser` are to make sure the removal is not applied to multiline inline content, which is maybe a bit fussy considering there is not a lot of multiline inline content in `
` tags and it usually would not mind about removal of a non-essential space character, but I wanted to keep the change minimal. There are few javadoc tests that had to be adapted, most of the testing is done in `test/langtools/tools/javac/doctree`. 
> 
> If the exact number of leading whitespace in `
` tags is important to any javadoc user the old output can be restored by increasing the indentation by 1. There will be a release note for this of course. 
> 
> Unfortunately, there is another whitespace problem that can't be solved as easily, and that is a leading blank line caused by `
\n` open tags. Browsers will [ignore a newline immediately following a `
` tag][1], but not if there is a `` tag in between. There are hundreds of occurrences of this in JDK code, including variants with space characters mixed in. The fix in javadoc proper would be too complex, so I decided to solve it with 3 lines of JavaScript and a regex to reverse the order of `\n` at the beginning of `
` tags while removing any intermediary space. Script operation is indiscernible and it solves the problem.
> 
> [1]: https://html.spec.whatwg.org/#the-pre-element:the-pre-element

Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:

  Fix comment

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23868/files
  - new: https://git.openjdk.org/jdk/pull/23868/files/8a9036d6..69464173

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23868&range=03
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23868&range=02-03

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/23868.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23868/head:pull/23868

PR: https://git.openjdk.org/jdk/pull/23868

From hannesw at openjdk.org  Fri Mar  7 07:41:58 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Fri, 7 Mar 2025 07:41:58 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v6]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Thu, 6 Mar 2025 10:50:29 GMT, Nizar Benalla  wrote:

> Question: for TOC navigation, should the navigation using tab/shift-tab be documented as well? Or maybe mentioning the fact you need to first focus on the input field for it to work.

Good point, I'll update the help text to include the tab key. I will also add an item for left/right arrow keys to switch between table tabs.

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

PR Comment: https://git.openjdk.org/jdk/pull/23777#issuecomment-2705742669

From hannesw at openjdk.org  Fri Mar  7 08:23:27 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Fri, 7 Mar 2025 08:23:27 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v7]
In-Reply-To: 
References: 
Message-ID: 

> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
> 
>  - / to switch focus to the search input
>  - . to switch focus to the sidebar filter input
>  - Esc to first reset input and then relinquish focus in either input field
> 
> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
> 
> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
> 
> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
> 
> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
> 
> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.

Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:

  Improve keyboard navigation help section

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23777/files
  - new: https://git.openjdk.org/jdk/pull/23777/files/b19d43f2..0bac1ec7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23777&range=06
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23777&range=05-06

  Stats: 15 lines in 2 files changed: 4 ins; 1 del; 10 mod
  Patch: https://git.openjdk.org/jdk/pull/23777.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23777/head:pull/23777

PR: https://git.openjdk.org/jdk/pull/23777

From hannesw at openjdk.org  Fri Mar  7 08:23:27 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Fri, 7 Mar 2025 08:23:27 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v6]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Thu, 6 Mar 2025 10:50:29 GMT, Nizar Benalla  wrote:

>> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Add @bug id to tests
>
> Code looks fine, the keyboard navigation is great!
> 
> Question: for TOC navigation, should the navigation using tab/shift-tab be documented as well? Or maybe mentioning the fact you need to first focus on the input field for it to work.

I improved the help section based on @nizarbenalla's feedback, also making list items shorter and more uniform. This is how it looks now:

![grafik](https://github.com/user-attachments/assets/c3b10440-87b3-4f46-8cf1-61a62001069b)

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

PR Comment: https://git.openjdk.org/jdk/pull/23777#issuecomment-2705814231

From hannesw at openjdk.org  Fri Mar  7 08:33:42 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Fri, 7 Mar 2025 08:33:42 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v8]
In-Reply-To: 
References: 
Message-ID: 

> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
> 
>  - / to switch focus to the search input
>  - . to switch focus to the sidebar filter input
>  - Esc to first reset input and then relinquish focus in either input field
> 
> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
> 
> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
> 
> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
> 
> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
> 
> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.

Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:

  Reverse down/up arrows

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23777/files
  - new: https://git.openjdk.org/jdk/pull/23777/files/0bac1ec7..f447ea6b

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23777&range=07
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23777&range=06-07

  Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod
  Patch: https://git.openjdk.org/jdk/pull/23777.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23777/head:pull/23777

PR: https://git.openjdk.org/jdk/pull/23777

From hannesw at openjdk.org  Fri Mar  7 08:44:08 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Fri, 7 Mar 2025 08:44:08 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v9]
In-Reply-To: 
References: 
Message-ID: 

> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
> 
>  - / to switch focus to the search input
>  - . to switch focus to the sidebar filter input
>  - Esc to first reset input and then relinquish focus in either input field
> 
> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
> 
> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
> 
> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
> 
> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
> 
> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.

Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:

  Wording

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23777/files
  - new: https://git.openjdk.org/jdk/pull/23777/files/f447ea6b..f39e20c7

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23777&range=08
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23777&range=07-08

  Stats: 1 line in 1 file changed: 0 ins; 0 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/23777.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23777/head:pull/23777

PR: https://git.openjdk.org/jdk/pull/23777

From hannesw at openjdk.org  Fri Mar  7 09:20:31 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Fri, 7 Mar 2025 09:20:31 GMT
Subject: RFR: 8344301: Refine stylesheet for API docs [v5]
In-Reply-To: 
References: 
Message-ID: 

> This is an extensive update to the JavaDoc stylesheet that focuses on layout and typography, with the purpose of making API docs easier to read and use.
> 
> List of changes:
> 
>  - Slightly increase text and navigation fonts to improve readability and to better match the code font (which remains unchanged). 
>  - Fix font size and line height inconsistencies in many places.
>  - Limit the maximal width of page content to improve readability on large displays. If more horizontal space is available, page content is centered.
>  - Remove light gray section background in class and module pages to simplify and unclutter the layout. 
>  - Add a subtle gray background to code elements in normal text to set them apart.
>  - Highlight headings of member details when they are used as link targets.
>  - Reserve use of bold font in member summary tables to element names to make them easier to spot and reduce visual noise.
>  - Slightly reduce width of TOC sidebar and use ellipsis (...) if content does not fit (but long signatures continue to wrap).
>  - Make method signatures in details easier to read on small dispays by allowing them to wrap before parameters and throws sections.
>  - Make tabs on top of summary tables scroll instead of wrapping if they overflow the available horizontal space.
>  - Hide TOC sidebar and copy-to-clipboard buttons in addition to the top navigation bar when printing a page.
>  - Improve styling of additional HTML files in `doc-files` directories.
>  - Reduce rollover animations and remove smooth scrolling in order to improve accessibility.
>  - Add background to `
` elements (will look great with [JDK-8346118](https://bugs.openjdk.org/browse/JDK-8346118)).
>  - Various cleanup.
> 
> There are too many non-trivial changes in the stylesheet to try explaining them here, but of course I'll be happy to discuss every change on request.
> 
> [Full JDK API docs are available for testing and comparison](https://cr.openjdk.org/~hannesw/8344301/api.05/index.html).

Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:

  Review feedback: merge duplicate selectors

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23678/files
  - new: https://git.openjdk.org/jdk/pull/23678/files/7e301b70..40599452

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23678&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23678&range=03-04

  Stats: 34 lines in 1 file changed: 15 ins; 19 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/23678.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23678/head:pull/23678

PR: https://git.openjdk.org/jdk/pull/23678

From hannesw at openjdk.org  Fri Mar  7 09:27:54 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Fri, 7 Mar 2025 09:27:54 GMT
Subject: RFR: 8344301: Refine stylesheet for API docs [v4]
In-Reply-To: 
References: 
 
 
Message-ID: 

On Thu, 6 Mar 2025 12:04:49 GMT, Nizar Benalla  wrote:

>> Hannes Walln?fer has updated the pull request incrementally with two additional commits since the last revision:
>> 
>>  - Changes:
>>     - Adjust subnav link color to meet WCAG contrast rules
>>     - Use subnav color for captions with links to meet WCAG rules
>>     - Make table header work with new caption color
>>     - Adjust some gaps
>>  - Changes:
>>     - Bring back breadcrumb highlight for current element
>>     - Use default tab color for search page caption
>
> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/resources/stylesheet.css line 827:
> 
>> 825:     font-size: inherit;
>> 826: }
>> 827: code {
> 
> I noticed there is a duplicate `code` selector (first used in line 162), is this intentional?
> I also think it's odd to have `code` after `:is(h1, h2, h3, h4, h5, h6, sup, sub, small, big) code`

I merged the duplicate selectors. 

The `:is(...) code` selector is to use inherited (natural) font size in places where our standard code font size is not appropriate, such as in headings or the ["Discussion" sections in j.l.invoke.MethodHandles](https://cr.openjdk.org/~hannesw/8344301/api.06/java.base/java/lang/invoke/MethodHandles.html#exactInvoker(java.lang.invoke.MethodType)). This wouldn't be necessary if we would use relative font size for code, but we want a constant size in most places (text, summary lists, block tags, signatures) which would be much harder to get with relative size.

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

PR Review Comment: https://git.openjdk.org/jdk/pull/23678#discussion_r1984728510

From nbenalla at openjdk.org  Fri Mar  7 11:41:54 2025
From: nbenalla at openjdk.org (Nizar Benalla)
Date: Fri, 7 Mar 2025 11:41:54 GMT
Subject: RFR: 8344301: Refine stylesheet for API docs [v5]
In-Reply-To: 
References: 
 
Message-ID: <65xwl3LWVYKwc92Ju4nNBS-Igzra3hZtfQbSU1SXUFo=.c444f88e-71f7-480b-8fb5-a5e2d599970c@github.com>

On Fri, 7 Mar 2025 09:20:31 GMT, Hannes Walln?fer  wrote:

>> This is an extensive update to the JavaDoc stylesheet that focuses on layout and typography, with the purpose of making API docs easier to read and use.
>> 
>> List of changes:
>> 
>>  - Slightly increase text and navigation fonts to improve readability and to better match the code font (which remains unchanged). 
>>  - Fix font size and line height inconsistencies in many places.
>>  - Limit the maximal width of page content to improve readability on large displays. If more horizontal space is available, page content is centered.
>>  - Remove light gray section background in class and module pages to simplify and unclutter the layout. 
>>  - Add a subtle gray background to code elements in normal text to set them apart.
>>  - Highlight headings of member details when they are used as link targets.
>>  - Reserve use of bold font in member summary tables to element names to make them easier to spot and reduce visual noise.
>>  - Slightly reduce width of TOC sidebar and use ellipsis (...) if content does not fit (but long signatures continue to wrap).
>>  - Make method signatures in details easier to read on small dispays by allowing them to wrap before parameters and throws sections.
>>  - Make tabs on top of summary tables scroll instead of wrapping if they overflow the available horizontal space.
>>  - Hide TOC sidebar and copy-to-clipboard buttons in addition to the top navigation bar when printing a page.
>>  - Improve styling of additional HTML files in `doc-files` directories.
>>  - Reduce rollover animations and remove smooth scrolling in order to improve accessibility.
>>  - Add background to `
` elements (will look great with [JDK-8346118](https://bugs.openjdk.org/browse/JDK-8346118)).
>>  - Various cleanup.
>> 
>> There are too many non-trivial changes in the stylesheet to try explaining them here, but of course I'll be happy to discuss every change on request.
>> 
>> [Full JDK API docs are available for testing and comparison](https://cr.openjdk.org/~hannesw/8344301/api.05/index.html).
>
> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review feedback: merge duplicate selectors

Looks good.

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

Marked as reviewed by nbenalla (Committer).

PR Review: https://git.openjdk.org/jdk/pull/23678#pullrequestreview-2667014443

From nbenalla at openjdk.org  Fri Mar  7 12:10:53 2025
From: nbenalla at openjdk.org (Nizar Benalla)
Date: Fri, 7 Mar 2025 12:10:53 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v9]
In-Reply-To: 
References: 
 
Message-ID: 

On Fri, 7 Mar 2025 08:44:08 GMT, Hannes Walln?fer  wrote:

>> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
>> 
>>  - / to switch focus to the search input
>>  - . to switch focus to the sidebar filter input
>>  - Esc to first reset input and then relinquish focus in either input field
>> 
>> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
>> 
>> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
>> 
>> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
>> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
>> 
>> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
>> 
>> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.
>
> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Wording

Thanks for updating the help text. Looks good.

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

Marked as reviewed by nbenalla (Committer).

PR Review: https://git.openjdk.org/jdk/pull/23777#pullrequestreview-2667069550

From liach at openjdk.org  Fri Mar  7 20:42:56 2025
From: liach at openjdk.org (Chen Liang)
Date: Fri, 7 Mar 2025 20:42:56 GMT
Subject: RFR: 8344301: Refine stylesheet for API docs [v5]
In-Reply-To: 
References: 
 
Message-ID: 

On Fri, 7 Mar 2025 09:20:31 GMT, Hannes Walln?fer  wrote:

>> This is an extensive update to the JavaDoc stylesheet that focuses on layout and typography, with the purpose of making API docs easier to read and use.
>> 
>> List of changes:
>> 
>>  - Slightly increase text and navigation fonts to improve readability and to better match the code font (which remains unchanged). 
>>  - Fix font size and line height inconsistencies in many places.
>>  - Limit the maximal width of page content to improve readability on large displays. If more horizontal space is available, page content is centered.
>>  - Remove light gray section background in class and module pages to simplify and unclutter the layout. 
>>  - Add a subtle gray background to code elements in normal text to set them apart.
>>  - Highlight headings of member details when they are used as link targets.
>>  - Reserve use of bold font in member summary tables to element names to make them easier to spot and reduce visual noise.
>>  - Slightly reduce width of TOC sidebar and use ellipsis (...) if content does not fit (but long signatures continue to wrap).
>>  - Make method signatures in details easier to read on small dispays by allowing them to wrap before parameters and throws sections.
>>  - Make tabs on top of summary tables scroll instead of wrapping if they overflow the available horizontal space.
>>  - Hide TOC sidebar and copy-to-clipboard buttons in addition to the top navigation bar when printing a page.
>>  - Improve styling of additional HTML files in `doc-files` directories.
>>  - Reduce rollover animations and remove smooth scrolling in order to improve accessibility.
>>  - Add background to `
` elements (will look great with [JDK-8346118](https://bugs.openjdk.org/browse/JDK-8346118)).
>>  - Various cleanup.
>> 
>> There are too many non-trivial changes in the stylesheet to try explaining them here, but of course I'll be happy to discuss every change on request.
>> 
>> [Full JDK API docs are available for testing and comparison](https://cr.openjdk.org/~hannesw/8344301/api.05/index.html).
>
> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Review feedback: merge duplicate selectors

Looks good in a chromium browser.

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

Marked as reviewed by liach (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23678#pullrequestreview-2668311862

From liach at openjdk.org  Fri Mar  7 20:47:53 2025
From: liach at openjdk.org (Chen Liang)
Date: Fri, 7 Mar 2025 20:47:53 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v9]
In-Reply-To: 
References: 
 
Message-ID: 

On Fri, 7 Mar 2025 08:44:08 GMT, Hannes Walln?fer  wrote:

>> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
>> 
>>  - / to switch focus to the search input
>>  - . to switch focus to the sidebar filter input
>>  - Esc to first reset input and then relinquish focus in either input field
>> 
>> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
>> 
>> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
>> 
>> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
>> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
>> 
>> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
>> 
>> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.
>
> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
> 
>   Wording

Marked as reviewed by liach (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/23777#pullrequestreview-2668319702

From hannesw at openjdk.org  Mon Mar 10 07:57:05 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Mon, 10 Mar 2025 07:57:05 GMT
Subject: Integrated: 8344301: Refine stylesheet for API docs
In-Reply-To: 
References: 
Message-ID: <5vQClF-hTNQGGPtRJle8YtRR0BY1rkR7ogo6R2EOeAY=.2760f83f-84ac-4155-b007-1575c4cfd9aa@github.com>

On Tue, 18 Feb 2025 14:02:55 GMT, Hannes Walln?fer  wrote:

> This is an extensive update to the JavaDoc stylesheet that focuses on layout and typography, with the purpose of making API docs easier to read and use.
> 
> List of changes:
> 
>  - Slightly increase text and navigation fonts to improve readability and to better match the code font (which remains unchanged). 
>  - Fix font size and line height inconsistencies in many places.
>  - Limit the maximal width of page content to improve readability on large displays. If more horizontal space is available, page content is centered.
>  - Remove light gray section background in class and module pages to simplify and unclutter the layout. 
>  - Add a subtle gray background to code elements in normal text to set them apart.
>  - Highlight headings of member details when they are used as link targets.
>  - Reserve use of bold font in member summary tables to element names to make them easier to spot and reduce visual noise.
>  - Slightly reduce width of TOC sidebar and use ellipsis (...) if content does not fit (but long signatures continue to wrap).
>  - Make method signatures in details easier to read on small dispays by allowing them to wrap before parameters and throws sections.
>  - Make tabs on top of summary tables scroll instead of wrapping if they overflow the available horizontal space.
>  - Hide TOC sidebar and copy-to-clipboard buttons in addition to the top navigation bar when printing a page.
>  - Improve styling of additional HTML files in `doc-files` directories.
>  - Reduce rollover animations and remove smooth scrolling in order to improve accessibility.
>  - Add background to `
` elements (will look great with [JDK-8346118](https://bugs.openjdk.org/browse/JDK-8346118)).
>  - Various cleanup.
> 
> There are too many non-trivial changes in the stylesheet to try explaining them here, but of course I'll be happy to discuss every change on request.
> 
> [Full JDK API docs are available for testing and comparison](https://cr.openjdk.org/~hannesw/8344301/api.05/index.html).

This pull request has now been integrated.

Changeset: 08872623
Author:    Hannes Walln?fer 
URL:       https://git.openjdk.org/jdk/commit/088726238664985ebf2bc60deca96f22245e9ce3
Stats:     425 lines in 7 files changed: 163 ins; 147 del; 115 mod

8344301: Refine stylesheet for API docs

Reviewed-by: liach, nbenalla

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

PR: https://git.openjdk.org/jdk/pull/23678

From hannesw at openjdk.org  Mon Mar 10 08:40:48 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Mon, 10 Mar 2025 08:40:48 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v10]
In-Reply-To: 
References: 
Message-ID: 

> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
> 
>  - / to switch focus to the search input
>  - . to switch focus to the sidebar filter input
>  - Esc to first reset input and then relinquish focus in either input field
> 
> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
> 
> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
> 
> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
> 
> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
> 
> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.

Hannes Walln?fer has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 10 commits:

 - Merge branch 'master' into JDK-8350638
 - Wording
 - Reverse down/up arrows
 - Improve keyboard navigation help section
 - Add @bug id to tests
 - better workaround for focus-visible problem on Safari
   
   (Works in Safari Tech Preview, will work in release soon)
 - Use focus instead of focus-visible to always show focus
 - - Use themed focus highlight for TOC entries
   - Move focus back on input when typing on TOC focus
 - Move buttons to hide/show sidebar to the bottom and make them keyboard-accessible
 - 8350638: Make keyboard navigation more usable in API docs

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

Changes: https://git.openjdk.org/jdk/pull/23777/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23777&range=09
  Stats: 372 lines in 21 files changed: 229 ins; 52 del; 91 mod
  Patch: https://git.openjdk.org/jdk/pull/23777.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23777/head:pull/23777

PR: https://git.openjdk.org/jdk/pull/23777

From nbenalla at openjdk.org  Mon Mar 10 12:58:17 2025
From: nbenalla at openjdk.org (Nizar Benalla)
Date: Mon, 10 Mar 2025 12:58:17 GMT
Subject: RFR: 8350007: Add usage message to the javadoc executable [v5]
In-Reply-To: 
References: 
Message-ID: 

> This patch adds a new message when you run the `javadoc` executable with any arguments.
> Currently, unlike most other tools, running `javadoc` without any arguments does not show you how to use the tool or point you to use the `--help` option, this can be improved.
> 
> Before change:
> 
> W $ ./javadoc
> error: No modules, packages or classes specified.
> 1 error
> 
> 
> After change:
> 
> W $ ./javadoc
> Usage:
>     javadoc [options] [packagenames] [sourcefiles] [@files]
> For additional help on usage:           javadoc --help

Nizar Benalla has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:

 - review feedback: improve error message
 - Merge branch 'master' into javadoc-usage-message
 - update test
 - keep the same return value and write to STDERR
 - respond to feedback
 - Merge branch 'master' into javadoc-usage-message
 - update test with new usage message
 - improve javadoc executable message

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/23618/files
  - new: https://git.openjdk.org/jdk/pull/23618/files/d67e033b..1814c4b0

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=23618&range=04
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23618&range=03-04

  Stats: 39103 lines in 1148 files changed: 17535 ins; 15983 del; 5585 mod
  Patch: https://git.openjdk.org/jdk/pull/23618.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23618/head:pull/23618

PR: https://git.openjdk.org/jdk/pull/23618

From nbenalla at openjdk.org  Mon Mar 10 13:02:02 2025
From: nbenalla at openjdk.org (Nizar Benalla)
Date: Mon, 10 Mar 2025 13:02:02 GMT
Subject: RFR: 8350007: Add usage message to the javadoc executable [v5]
In-Reply-To: 
References: 
 
Message-ID: 

On Mon, 10 Mar 2025 12:58:17 GMT, Nizar Benalla  wrote:

>> This patch adds a new message when you run the `javadoc` executable with any arguments.
>> Currently, unlike most other tools, running `javadoc` without any arguments does not show you how to use the tool or point you to use the `--help` option, this can be improved.
>> 
>> Before change:
>> 
>> W $ ./javadoc
>> error: No modules, packages or classes specified.
>> 1 error
>> 
>> 
>> After change:
>> 
>> W $ ./javadoc
>> Usage:
>>     javadoc [options] [packagenames] [sourcefiles] [@files]
>> For additional help on usage:           javadoc --help
>
> Nizar Benalla has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
> 
>  - review feedback: improve error message
>  - Merge branch 'master' into javadoc-usage-message
>  - update test
>  - keep the same return value and write to STDERR
>  - respond to feedback
>  - Merge branch 'master' into javadoc-usage-message
>  - update test with new usage message
>  - improve javadoc executable message

nizar-mac! $ javadoc
Usage:
    javadoc [options] [packagenames] [sourcefiles] [@files]
For more details on available options, use --help or --help-extra
error: No modules, packages or classes specified.
1 error

flushing is necessary to print out the usage message consistently before the error

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

PR Comment: https://git.openjdk.org/jdk/pull/23618#issuecomment-2710516531

From liach at openjdk.org  Mon Mar 10 13:27:02 2025
From: liach at openjdk.org (Chen Liang)
Date: Mon, 10 Mar 2025 13:27:02 GMT
Subject: RFR: 8350638: Make keyboard navigation more usable in API docs
 [v10]
In-Reply-To: 
References: 
 
Message-ID: 

On Mon, 10 Mar 2025 08:40:48 GMT, Hannes Walln?fer  wrote:

>> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
>> 
>>  - / to switch focus to the search input
>>  - . to switch focus to the sidebar filter input
>>  - Esc to first reset input and then relinquish focus in either input field
>> 
>> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
>> 
>> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
>> 
>> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
>> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
>> 
>> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
>> 
>> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.
>
> Hannes Walln?fer has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 10 commits:
> 
>  - Merge branch 'master' into JDK-8350638
>  - Wording
>  - Reverse down/up arrows
>  - Improve keyboard navigation help section
>  - Add @bug id to tests
>  - better workaround for focus-visible problem on Safari
>    
>    (Works in Safari Tech Preview, will work in release soon)
>  - Use focus instead of focus-visible to always show focus
>  - - Use themed focus highlight for TOC entries
>    - Move focus back on input when typing on TOC focus
>  - Move buttons to hide/show sidebar to the bottom and make them keyboard-accessible
>  - 8350638: Make keyboard navigation more usable in API docs

Marked as reviewed by liach (Reviewer).

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

PR Review: https://git.openjdk.org/jdk/pull/23777#pullrequestreview-2670945495

From hannesw at openjdk.org  Mon Mar 10 13:32:01 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Mon, 10 Mar 2025 13:32:01 GMT
Subject: Integrated: 8350638: Make keyboard navigation more usable in API docs
In-Reply-To: 
References: 
Message-ID: <4yVvkird-YRiVCM2-bFa673bqiSBqpYlqbhdUc_DV70=.16717cfb-5e55-40aa-8c0d-4dc685dd1c90@github.com>

On Tue, 25 Feb 2025 15:09:35 GMT, Hannes Walln?fer  wrote:

> Please review a change to improve keyboard navigation in API documentation. Since the search feature was introduce in JDK 9 the search field grabbed the focus on page load, which is handy for searching but renders every other way of keyboard navigation impossible. With this change, instead of setting the focus on the search box, we introduce a few keyboard shortcuts to control focus:
> 
>  - / to switch focus to the search input
>  - . to switch focus to the sidebar filter input
>  - Esc to first reset input and then relinquish focus in either input field
> 
> Keyboard use of the TOC sidebar has also be greatly improved, it can now be navigated with the up/down arrow keys and lives up to the job of navigating to any page section very quickly. (I had a type-to-search version that was even quicker, but that's not allowed for accessibility unless there's a way to disable it.)
> 
> The feature [can be tested here][1]. There's also a [new section][2] on the Help page to document it.
> 
> [1]: https://cr.openjdk.org/~hannesw/8350638/api.00/java.base/java/lang/String.html 
> [2]: https://cr.openjdk.org/~hannesw/8350638/api.00/help-doc.html#help-keyboard-navigation
> 
> The Java changes in this PR are mostly to remove some elements from the tab order to be able to directly tab from the filter input to the results in the sidebar, and to add or improve messages for the feature itself or the new help section. 
> 
> The JavaScript changes may look a bit scary, but mostly I just added the keyboard listening code. The sidebar filtering code was just slightly improved and moved out into a separate component. Generally the script file looks a bit nicer now and hasn't grown all that much. The stylesheet changes are mostly to improve layout of the sidebar filter input and fix rendering bugs with the keyboard focus. Finally, I added a new `HtmlTree` factory method for `` elements which I use in the help section as well as in the help box on the searchpage.

This pull request has now been integrated.

Changeset: e90b6bdb
Author:    Hannes Walln?fer 
URL:       https://git.openjdk.org/jdk/commit/e90b6bdb875315de6b962e2c7d36606d9a593eb9
Stats:     372 lines in 21 files changed: 229 ins; 52 del; 91 mod

8350638: Make keyboard navigation more usable in API docs

Reviewed-by: liach, nbenalla

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

PR: https://git.openjdk.org/jdk/pull/23777

From hannesw at openjdk.org  Mon Mar 10 15:46:52 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Mon, 10 Mar 2025 15:46:52 GMT
Subject: RFR: 8350920: Allow inherited member summaries to be viewed inline
Message-ID: 

Please review an enhancement to allow switching between the traditional condensed footnote-style summary and the summary table format for inherited members (types, fields, methods and properties) that are inherited from included types. You can test the feature in [the doc bundle I uploaded][apidocs] or watch the short screencast below.

[apidocs]: https://cr.openjdk.org/~hannesw/8350920/api.00/java.base/module-summary.html

https://github.com/user-attachments/assets/0aaa1f8b-c18b-4922-b704-2b2cdc05ca79

I added two new protected methods to the `AbstractMemberWriter` class, `createInheritedSummaryTable` and `getInheritedSummaryId`. Otherwise this is mostly reusing existing functionality (we already had the feature to display the signature of an inherited method in the context of the current class).

The writers for non-inheritable members such as constructors or enum constants were simplified a bit by implementing formerly abstract methods in `AbstractMemberWriter` as concrete methods throwing `UnsupportedOperationException` so they don't have to be implemented as empty methods in these writers.

The UI to switch between member list presentations is implemented in `script.js.template`. If no summary list presentation is available (because the supertype is not part of the documentation bundle) nothing changes in the UI.

I added a `stripTags()` method to `Content` to return the plain text content with HTML tags stripped that could be used in a few other places. The patch also adds two new vector graphics files called right.svg and down.svg for the right and downwards pointing angle.

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

Commit messages:
 - Add svg files
 - 8350920: Allow inherited member summaries to be viewed inline

Changes: https://git.openjdk.org/jdk/pull/23967/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23967&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8350920
  Stats: 545 lines in 29 files changed: 430 ins; 55 del; 60 mod
  Patch: https://git.openjdk.org/jdk/pull/23967.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/23967/head:pull/23967

PR: https://git.openjdk.org/jdk/pull/23967

From hannesw at openjdk.org  Mon Mar 10 15:57:02 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Mon, 10 Mar 2025 15:57:02 GMT
Subject: RFR: 8350007: Add usage message to the javadoc executable [v5]
In-Reply-To: 
References: 
 
Message-ID: <68udoUXFr-Y1eYrZTyyQJWWBkX4X29qrACYWEud3Uqg=.1e5fcb20-42ab-46ed-859d-1c9ac8d230d7@github.com>

On Mon, 10 Mar 2025 12:58:17 GMT, Nizar Benalla  wrote:

>> This patch adds a new message when you run the `javadoc` executable with any arguments.
>> Currently, unlike most other tools, running `javadoc` without any arguments does not show you how to use the tool or point you to use the `--help` option, this can be improved.
>> 
>> Before change:
>> 
>> W $ ./javadoc
>> error: No modules, packages or classes specified.
>> 1 error
>> 
>> 
>> After change:
>> 
>> W $ ./javadoc
>> Usage:
>>     javadoc [options] [packagenames] [sourcefiles] [@files]
>> For additional help on usage:           javadoc --help
>
> Nizar Benalla has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
> 
>  - review feedback: improve error message
>  - Merge branch 'master' into javadoc-usage-message
>  - update test
>  - keep the same return value and write to STDERR
>  - respond to feedback
>  - Merge branch 'master' into javadoc-usage-message
>  - update test with new usage message
>  - improve javadoc executable message

Nice!

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

Marked as reviewed by hannesw (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/23618#pullrequestreview-2671482448

From nbenalla at openjdk.org  Mon Mar 10 16:18:59 2025
From: nbenalla at openjdk.org (Nizar Benalla)
Date: Mon, 10 Mar 2025 16:18:59 GMT
Subject: RFR: 8350007: Add usage message to the javadoc executable [v5]
In-Reply-To: 
References: 
 
Message-ID: 

On Mon, 10 Mar 2025 12:58:17 GMT, Nizar Benalla  wrote:

>> This patch adds a new message when you run the `javadoc` executable with any arguments.
>> Currently, unlike most other tools, running `javadoc` without any arguments does not show you how to use the tool or point you to use the `--help` option, this can be improved.
>> 
>> Before change:
>> 
>> W $ ./javadoc
>> error: No modules, packages or classes specified.
>> 1 error
>> 
>> 
>> After change:
>> 
>> W $ ./javadoc
>> Usage:
>>     javadoc [options] [packagenames] [sourcefiles] [@files]
>> For additional help on usage:           javadoc --help
>
> Nizar Benalla has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase. The pull request contains eight additional commits since the last revision:
> 
>  - review feedback: improve error message
>  - Merge branch 'master' into javadoc-usage-message
>  - update test
>  - keep the same return value and write to STDERR
>  - respond to feedback
>  - Merge branch 'master' into javadoc-usage-message
>  - update test with new usage message
>  - improve javadoc executable message

Thanks!

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

PR Comment: https://git.openjdk.org/jdk/pull/23618#issuecomment-2711122330

From nbenalla at openjdk.org  Mon Mar 10 16:18:59 2025
From: nbenalla at openjdk.org (Nizar Benalla)
Date: Mon, 10 Mar 2025 16:18:59 GMT
Subject: Integrated: 8350007: Add usage message to the javadoc executable
In-Reply-To: 
References: 
Message-ID: 

On Thu, 13 Feb 2025 16:41:54 GMT, Nizar Benalla  wrote:

> This patch adds a new message when you run the `javadoc` executable with any arguments.
> Currently, unlike most other tools, running `javadoc` without any arguments does not show you how to use the tool or point you to use the `--help` option, this can be improved.
> 
> Before change:
> 
> W $ ./javadoc
> error: No modules, packages or classes specified.
> 1 error
> 
> 
> After change:
> 
> W $ ./javadoc
> Usage:
>     javadoc [options] [packagenames] [sourcefiles] [@files]
> For additional help on usage:           javadoc --help

This pull request has now been integrated.

Changeset: 6b84bdef
Author:    Nizar Benalla 
URL:       https://git.openjdk.org/jdk/commit/6b84bdef3b203e62cebd77705ef5b3e081302c28
Stats:     11 lines in 3 files changed: 6 ins; 1 del; 4 mod

8350007: Add usage message to the javadoc executable

Reviewed-by: hannesw

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

PR: https://git.openjdk.org/jdk/pull/23618

From hannesw at openjdk.org  Mon Mar 10 17:04:08 2025
From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
Date: Mon, 10 Mar 2025 17:04:08 GMT
Subject: RFR: 8351555: Help section added in JDK-8350638 uses invalid HTML
Message-ID: <_Tzpwb1pijxgmeNToDh0psmfs-e-ZmF2UXEX3Nlim9o=.8f4277da-09f0-4e03-abb8-44c98ccb3f37@github.com>

Please review a change to fix the HTML for the new Keyboard Navigation section added in [JDK-8350638](https://bugs.openjdk.org/browse/JDK-8350638). Instead of adding the `
    ` element to the `

    ` element, both elements are added to the `

    ` element. ------------- Commit messages: - 8351555: Help section added in JDK-8350638 uses invalid HTML Changes: https://git.openjdk.org/jdk/pull/23969/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23969&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8351555 Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/23969.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23969/head:pull/23969 PR: https://git.openjdk.org/jdk/pull/23969 From liach at openjdk.org Mon Mar 10 17:25:01 2025 From: liach at openjdk.org (Chen Liang) Date: Mon, 10 Mar 2025 17:25:01 GMT Subject: RFR: 8351555: Help section added in JDK-8350638 uses invalid HTML In-Reply-To: <_Tzpwb1pijxgmeNToDh0psmfs-e-ZmF2UXEX3Nlim9o=.8f4277da-09f0-4e03-abb8-44c98ccb3f37@github.com> References: <_Tzpwb1pijxgmeNToDh0psmfs-e-ZmF2UXEX3Nlim9o=.8f4277da-09f0-4e03-abb8-44c98ccb3f37@github.com> Message-ID: On Mon, 10 Mar 2025 16:59:17 GMT, Hannes Walln?fer wrote: > Please review a change to fix the HTML for the new Keyboard Navigation section added in [JDK-8350638](https://bugs.openjdk.org/browse/JDK-8350638). Instead of adding the `
      ` element to the `

      ` element, both elements are added to the `

      ` element. Marked as reviewed by liach (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/23969#pullrequestreview-2671706999 From jjg at openjdk.org Mon Mar 10 17:25:01 2025 From: jjg at openjdk.org (Jonathan Gibbons) Date: Mon, 10 Mar 2025 17:25:01 GMT Subject: RFR: 8351555: Help section added in JDK-8350638 uses invalid HTML In-Reply-To: <_Tzpwb1pijxgmeNToDh0psmfs-e-ZmF2UXEX3Nlim9o=.8f4277da-09f0-4e03-abb8-44c98ccb3f37@github.com> References: <_Tzpwb1pijxgmeNToDh0psmfs-e-ZmF2UXEX3Nlim9o=.8f4277da-09f0-4e03-abb8-44c98ccb3f37@github.com> Message-ID: On Mon, 10 Mar 2025 16:59:17 GMT, Hannes Walln?fer wrote: > Please review a change to fix the HTML for the new Keyboard Navigation section added in [JDK-8350638](https://bugs.openjdk.org/browse/JDK-8350638). Instead of adding the `
        ` element to the `

        ` element, both elements are added to the `

        ` element. As well as `noreg-trivial, I would suggest `noreg-other`, since the output is not dependent on user input and should be caught by `tidy` ------------- Marked as reviewed by jjg (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/23969#pullrequestreview-2671711698 From hannesw at openjdk.org Mon Mar 10 17:25:02 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Mon, 10 Mar 2025 17:25:02 GMT Subject: Integrated: 8351555: Help section added in JDK-8350638 uses invalid HTML In-Reply-To: <_Tzpwb1pijxgmeNToDh0psmfs-e-ZmF2UXEX3Nlim9o=.8f4277da-09f0-4e03-abb8-44c98ccb3f37@github.com> References: <_Tzpwb1pijxgmeNToDh0psmfs-e-ZmF2UXEX3Nlim9o=.8f4277da-09f0-4e03-abb8-44c98ccb3f37@github.com> Message-ID: On Mon, 10 Mar 2025 16:59:17 GMT, Hannes Walln?fer wrote: > Please review a change to fix the HTML for the new Keyboard Navigation section added in [JDK-8350638](https://bugs.openjdk.org/browse/JDK-8350638). Instead of adding the `
          ` element to the `

          ` element, both elements are added to the `

          ` element. This pull request has now been integrated. Changeset: 7999091e Author: Hannes Walln?fer URL: https://git.openjdk.org/jdk/commit/7999091e3e976fe62d859d508bf649b6ec7bc94e Stats: 2 lines in 1 file changed: 0 ins; 0 del; 2 mod 8351555: Help section added in JDK-8350638 uses invalid HTML Reviewed-by: liach, jjg ------------- PR: https://git.openjdk.org/jdk/pull/23969 From hannesw at openjdk.org Tue Mar 11 14:37:36 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Tue, 11 Mar 2025 14:37:36 GMT Subject: RFR: 8345555: Improve layout of search results [v4] In-Reply-To: References: Message-ID: > Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. > > The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.02/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged. > > Screenshot 2025-02-17 at 14 56 52 > > On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem. > > There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. > > Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags > > On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to the code so it will be eas... Hannes Walln?fer has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains seven commits: - Make standalone search page keyboard-friendly - Merge branch 'master' into javadoc-search - Review feedback (formatting) - Remove counterproductive restriction in search pattern - Fix search menu selecting item at current mouse position - Rename label property as it has special meaning to jquery-ui - 8345555: Improve layout of search results ------------- Changes: https://git.openjdk.org/jdk/pull/23666/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=03 Stats: 799 lines in 26 files changed: 418 ins; 84 del; 297 mod Patch: https://git.openjdk.org/jdk/pull/23666.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23666/head:pull/23666 PR: https://git.openjdk.org/jdk/pull/23666 From hannesw at openjdk.org Tue Mar 11 17:42:36 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Tue, 11 Mar 2025 17:42:36 GMT Subject: RFR: 8345555: Improve layout of search results [v5] In-Reply-To: References: Message-ID: > Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. > > The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged. > > Screenshot 2025-02-17 at 14 56 52 > > On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem. > > There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. > > Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags > > On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to the code so it will be eas... Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: Improve focus handling ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23666/files - new: https://git.openjdk.org/jdk/pull/23666/files/ea0a1834..478c22d1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=04 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=03-04 Stats: 36 lines in 2 files changed: 15 ins; 6 del; 15 mod Patch: https://git.openjdk.org/jdk/pull/23666.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23666/head:pull/23666 PR: https://git.openjdk.org/jdk/pull/23666 From nbenalla at openjdk.org Tue Mar 11 18:01:03 2025 From: nbenalla at openjdk.org (Nizar Benalla) Date: Tue, 11 Mar 2025 18:01:03 GMT Subject: RFR: 8345555: Improve layout of search results [v5] In-Reply-To: References: Message-ID: On Tue, 11 Mar 2025 17:42:36 GMT, Hannes Walln?fer wrote: >> Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. >> >> The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged. >> >> Screenshot 2025-02-17 at 14 56 52 >> >> On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem. >> >> There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. >> >> Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags >> >> On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to ... > > Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: > > Improve focus handling Sorry, I lost track of this PR. Currently reviewing. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23666#issuecomment-2715235089 From hannesw at openjdk.org Wed Mar 12 10:47:21 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Wed, 12 Mar 2025 10:47:21 GMT Subject: RFR: 8345555: Improve layout of search results [v6] In-Reply-To: References: Message-ID: > Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. > > The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged. > > Screenshot 2025-02-17 at 14 56 52 > > On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem. > > There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. > > Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags > > On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to the code so it will be eas... Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: Implement module selector for search page ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23666/files - new: https://git.openjdk.org/jdk/pull/23666/files/478c22d1..008c331d Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=05 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=04-05 Stats: 271 lines in 15 files changed: 138 ins; 68 del; 65 mod Patch: https://git.openjdk.org/jdk/pull/23666.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23666/head:pull/23666 PR: https://git.openjdk.org/jdk/pull/23666 From hannesw at openjdk.org Wed Mar 12 10:53:42 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Wed, 12 Mar 2025 10:53:42 GMT Subject: RFR: 8345555: Improve layout of search results [v7] In-Reply-To: References: Message-ID: > Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. > > The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged. > > Screenshot 2025-02-17 at 14 56 52 > > On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem. > > There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. > > Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags > > On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to the code so it will be eas... Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: Simplify lambda ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23666/files - new: https://git.openjdk.org/jdk/pull/23666/files/008c331d..a2793957 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=06 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=05-06 Stats: 5 lines in 1 file changed: 0 ins; 4 del; 1 mod Patch: https://git.openjdk.org/jdk/pull/23666.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23666/head:pull/23666 PR: https://git.openjdk.org/jdk/pull/23666 From hannesw at openjdk.org Wed Mar 12 11:12:41 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Wed, 12 Mar 2025 11:12:41 GMT Subject: RFR: 8345555: Improve layout of search results [v8] In-Reply-To: References: Message-ID: <5axi5JeLlDSlkGnYyn-A52aBf1dMxzuUZvcXUCl2pKc=.8a93af9b-7fbc-4272-9a6f-b22ee44555b5@github.com> > Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. > > The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged. > > Screenshot 2025-02-17 at 14 56 52 > > On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem. > > There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. > > Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags > > On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to the code so it will be eas... Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: Add back tab switch from packages to types ------------- Changes: - all: https://git.openjdk.org/jdk/pull/23666/files - new: https://git.openjdk.org/jdk/pull/23666/files/a2793957..1691d4f1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=07 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=06-07 Stats: 6 lines in 1 file changed: 2 ins; 0 del; 4 mod Patch: https://git.openjdk.org/jdk/pull/23666.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23666/head:pull/23666 PR: https://git.openjdk.org/jdk/pull/23666 From hannesw at openjdk.org Wed Mar 12 13:27:36 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Wed, 12 Mar 2025 13:27:36 GMT Subject: RFR: 8351626: Update remaining icons to SVG format Message-ID: Please review a change to update the remaining `.png` files used by JavaDoc with `.svg` files. In addition to the looking glass and "x" icons used in the search box this also adds left and right pointing angles used in breadcrumb navigation and sidebar hide/show buttons that previously used glyphs. ------------- Commit messages: - 8351626: Update remaining icons to SVG format Changes: https://git.openjdk.org/jdk/pull/24007/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24007&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8351626 Stats: 104 lines in 17 files changed: 72 ins; 4 del; 28 mod Patch: https://git.openjdk.org/jdk/pull/24007.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24007/head:pull/24007 PR: https://git.openjdk.org/jdk/pull/24007 From nbenalla at openjdk.org Wed Mar 12 14:10:01 2025 From: nbenalla at openjdk.org (Nizar Benalla) Date: Wed, 12 Mar 2025 14:10:01 GMT Subject: RFR: 8351626: Update remaining icons to SVG format In-Reply-To: References: Message-ID: On Wed, 12 Mar 2025 13:22:07 GMT, Hannes Walln?fer wrote: > Please review a change to update the remaining `.png` files used by JavaDoc with `.svg` files. In addition to the looking glass and "x" icons used in the search box this also adds left and right pointing angles used in breadcrumb navigation and sidebar hide/show buttons that previously used glyphs. Looks good and trivial. ------------- Marked as reviewed by nbenalla (Committer). PR Review: https://git.openjdk.org/jdk/pull/24007#pullrequestreview-2678652211 From jjg at openjdk.org Wed Mar 12 15:19:52 2025 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 12 Mar 2025 15:19:52 GMT Subject: RFR: 8351626: Update remaining icons to SVG format In-Reply-To: References: Message-ID: On Wed, 12 Mar 2025 13:22:07 GMT, Hannes Walln?fer wrote: > Please review a change to update the remaining `.png` files used by JavaDoc with `.svg` files. In addition to the looking glass and "x" icons used in the search box this also adds left and right pointing angles used in breadcrumb navigation and sidebar hide/show buttons that previously used glyphs. Marked as reviewed by jjg (Reviewer). ------------- PR Review: https://git.openjdk.org/jdk/pull/24007#pullrequestreview-2678910178 From hannesw at openjdk.org Wed Mar 12 15:56:58 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Wed, 12 Mar 2025 15:56:58 GMT Subject: RFR: 8351626: Update remaining icons to SVG format In-Reply-To: References: Message-ID: <7xG8BIWlaF6JBP1TupP6G-Ra15wsS39PJU0gPMW1n1Y=.50134722-787e-46b4-89bf-27aa12a670e6@github.com> On Wed, 12 Mar 2025 13:22:07 GMT, Hannes Walln?fer wrote: > Please review a change to update the remaining `.png` files used by JavaDoc with `.svg` files. In addition to the looking glass and "x" icons used in the search box this also adds left and right pointing angles used in breadcrumb navigation and sidebar hide/show buttons that previously used glyphs. Thanks! ------------- PR Comment: https://git.openjdk.org/jdk/pull/24007#issuecomment-2718350124 From hannesw at openjdk.org Wed Mar 12 15:56:59 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Wed, 12 Mar 2025 15:56:59 GMT Subject: Integrated: 8351626: Update remaining icons to SVG format In-Reply-To: References: Message-ID: On Wed, 12 Mar 2025 13:22:07 GMT, Hannes Walln?fer wrote: > Please review a change to update the remaining `.png` files used by JavaDoc with `.svg` files. In addition to the looking glass and "x" icons used in the search box this also adds left and right pointing angles used in breadcrumb navigation and sidebar hide/show buttons that previously used glyphs. This pull request has now been integrated. Changeset: f16a7426 Author: Hannes Walln?fer URL: https://git.openjdk.org/jdk/commit/f16a74260f329ccef51faa2e375bce5947057a49 Stats: 104 lines in 17 files changed: 72 ins; 4 del; 28 mod 8351626: Update remaining icons to SVG format Reviewed-by: nbenalla, jjg ------------- PR: https://git.openjdk.org/jdk/pull/24007 From hannesw at openjdk.org Wed Mar 12 16:25:42 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Wed, 12 Mar 2025 16:25:42 GMT Subject: RFR: 8350920: Allow inherited member summaries to be viewed inline [v2] In-Reply-To: References: Message-ID: > Please review an enhancement to allow switching between the traditional condensed footnote-style summary and the summary table format for inherited members (types, fields, methods and properties) that are inherited from included types. You can test the feature in [the doc bundle I uploaded][apidocs] or watch the short screencast below. > > [apidocs]: https://cr.openjdk.org/~hannesw/8350920/api.00/java.base/module-summary.html > > https://github.com/user-attachments/assets/0aaa1f8b-c18b-4922-b704-2b2cdc05ca79 > > I added two new protected methods to the `AbstractMemberWriter` class, `createInheritedSummaryTable` and `getInheritedSummaryId`. Otherwise this is mostly reusing existing functionality (we already had the feature to display the signature of an inherited method in the context of the current class). > > The writers for non-inheritable members such as constructors or enum constants were simplified a bit by implementing formerly abstract methods in `AbstractMemberWriter` as concrete methods throwing `UnsupportedOperationException` so they don't have to be implemented as empty methods in these writers. > > The UI to switch between member list presentations is implemented in `script.js.template`. If no summary list presentation is available (because the supertype is not part of the documentation bundle) nothing changes in the UI. > > I added a `stripTags()` method to `Content` to return the plain text content with HTML tags stripped that could be used in a few other places. The patch also adds two new vector graphics files called right.svg and down.svg for the right and downwards pointing angle. Hannes Walln?fer has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits: - Merge branch 'master' into JDK-8350920 - Add svg files - 8350920: Allow inherited member summaries to be viewed inline ------------- Changes: https://git.openjdk.org/jdk/pull/23967/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23967&range=01 Stats: 524 lines in 27 files changed: 411 ins; 55 del; 58 mod Patch: https://git.openjdk.org/jdk/pull/23967.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/23967/head:pull/23967 PR: https://git.openjdk.org/jdk/pull/23967 From nbenalla at openjdk.org Wed Mar 12 17:07:59 2025 From: nbenalla at openjdk.org (Nizar Benalla) Date: Wed, 12 Mar 2025 17:07:59 GMT Subject: RFR: 8351626: Update remaining icons to SVG format In-Reply-To: References: Message-ID: On Wed, 12 Mar 2025 13:22:07 GMT, Hannes Walln?fer wrote: > Please review a change to update the remaining `.png` files used by JavaDoc with `.svg` files. In addition to the looking glass and "x" icons used in the search box this also adds left and right pointing angles used in breadcrumb navigation and sidebar hide/show buttons that previously used glyphs. Apologies, I missed this while reviewing but it seems like `tidy` is complaining about the lack of the `alt` property. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24007#issuecomment-2718553958 From nbenalla at openjdk.org Wed Mar 12 18:13:21 2025 From: nbenalla at openjdk.org (Nizar Benalla) Date: Wed, 12 Mar 2025 18:13:21 GMT Subject: RFR: 8351881: Tidy complains about missing "alt" attribute Message-ID: 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. ------------- Commit messages: - add missing alt attribute Changes: https://git.openjdk.org/jdk/pull/24016/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24016&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8351881 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod Patch: https://git.openjdk.org/jdk/pull/24016.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24016/head:pull/24016 PR: https://git.openjdk.org/jdk/pull/24016 From hannesw at openjdk.org Wed Mar 12 18:29:52 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Wed, 12 Mar 2025 18:29:52 GMT Subject: RFR: 8351881: Tidy complains about missing "alt" attribute In-Reply-To: References: Message-ID: <9en-7Q6zwGnJuZ5GxLEMFoRTKIpHc63LshrlftM2I0Y=.397a1a18-f06a-40d0-9eaf-80fbaf5ae84c@github.com> On Wed, 12 Mar 2025 18:08:24 GMT, Nizar Benalla 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. Looks good, thanks for fixing. ------------- Marked as reviewed by hannesw (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24016#pullrequestreview-2679506704 From jjg at openjdk.org Wed Mar 12 18:46:57 2025 From: jjg at openjdk.org (Jonathan Gibbons) Date: Wed, 12 Mar 2025 18:46:57 GMT Subject: RFR: 8351881: Tidy complains about missing "alt" attribute In-Reply-To: References: Message-ID: On Wed, 12 Mar 2025 18:08:24 GMT, Nizar Benalla 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. ------------- PR Review Comment: https://git.openjdk.org/jdk/pull/24016#discussion_r1992103888 From nbenalla at openjdk.org Wed Mar 12 18:53:53 2025 From: nbenalla at openjdk.org (Nizar Benalla) Date: Wed, 12 Mar 2025 18:53:53 GMT Subject: RFR: 8351881: Tidy complains about missing "alt" attribute In-Reply-To: References: Message-ID: On Wed, 12 Mar 2025 18:44:09 GMT, Jonathan Gibbons 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 From nbenalla at openjdk.org Wed Mar 12 18:59:57 2025 From: nbenalla at openjdk.org (Nizar Benalla) Date: Wed, 12 Mar 2025 18:59:57 GMT Subject: Integrated: 8351881: Tidy complains about missing "alt" attribute In-Reply-To: References: Message-ID: On Wed, 12 Mar 2025 18:08:24 GMT, Nizar Benalla 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. This pull request has now been integrated. Changeset: db531bf7 Author: Nizar Benalla URL: https://git.openjdk.org/jdk/commit/db531bf7df517eb6a07080aceb2a88a3b90d5e94 Stats: 4 lines in 1 file changed: 2 ins; 0 del; 2 mod 8351881: Tidy complains about missing "alt" attribute Reviewed-by: hannesw ------------- PR: https://git.openjdk.org/jdk/pull/24016 From jjg at openjdk.org Thu Mar 13 03:07:04 2025 From: jjg at openjdk.org (Jonathan Gibbons) Date: Thu, 13 Mar 2025 03:07:04 GMT Subject: RFR: 8351881: Tidy complains about missing "alt" attribute In-Reply-To: References: Message-ID: On Wed, 12 Mar 2025 18:51:07 GMT, Nizar Benalla 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 From nbenalla at openjdk.org Thu Mar 13 10:12:06 2025 From: nbenalla at openjdk.org (Nizar Benalla) Date: Thu, 13 Mar 2025 10:12:06 GMT Subject: RFR: 8345555: Improve layout of search results [v8] In-Reply-To: <5axi5JeLlDSlkGnYyn-A52aBf1dMxzuUZvcXUCl2pKc=.8a93af9b-7fbc-4272-9a6f-b22ee44555b5@github.com> References: <5axi5JeLlDSlkGnYyn-A52aBf1dMxzuUZvcXUCl2pKc=.8a93af9b-7fbc-4272-9a6f-b22ee44555b5@github.com> Message-ID: On Wed, 12 Mar 2025 11:12:41 GMT, Hannes Walln?fer wrote: >> Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. >> >> The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged. >> >> Screenshot 2025-02-17 at 14 56 52 >> >> On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem. >> >> There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. >> >> Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags >> >> On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to ... > > Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision: > > Add back tab switch from packages to types I think the code is fine, I like the new search feature but I have some nits. - I used an automated script to check the copyright headers. I believe these files need to have the copyright years updated src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SpecTaglet.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SystemPropertyTaglet.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/TagletWriter.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlAttr.java src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlTag.java test/langtools/jdk/javadoc/doclet/testIndex/TestIndex.java test/langtools/jdk/javadoc/doclet/testIndexInDocFiles/TestIndexInDocFiles.java test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java - Adding the bug id to the tests would be good too. - Could we add more CSS to the select box (to filter modules) in the search page? It stands out a little. ------------- PR Comment: https://git.openjdk.org/jdk/pull/23666#issuecomment-2720687925 From hannesw at openjdk.org Thu Mar 13 18:19:03 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Thu, 13 Mar 2025 18:19:03 GMT Subject: Withdrawn: 8346118: Improve whitespace normalization in preformatted text In-Reply-To: References: Message-ID: On Mon, 3 Mar 2025 16:41:18 GMT, Hannes Walln?fer wrote: > Please review an enhancement to make `DocCommentParser` normalize whitespace inside `
          ` elements. The normalization is conceptually simple and and intended to be minimally invasive. Before parsing, `DocCommentParser` checks whether the text is a traditional doc comment and whether every line starts with a space character, which is commonly the case in traditional doc comments. If so, a single leading space is removed in block content (top level text and `{@code}`/`{@literal}` tags) when parsing within HTML `
          ` tags.
          > 
          > This fixes the incidental one-space indentation in the vast majority of JDK code samples using `
          ` alone or in combination with `` or `{@code}`. In fact, I only found one code sample in JDK code that isn't solved by this change, for which I included a fix in this PR (it's in `String.startsWith(String, int)`, where I replaced the 10 char indentation and trailing line with a `
          `). > > The many added `boolean inBlockContent` arguments pased around in `DocCommentParser` are to make sure the removal is not applied to multiline inline content, which is maybe a bit fussy considering there is not a lot of multiline inline content in `
          ` tags and it usually would not mind about removal of a non-essential space character, but I wanted to keep the change minimal. There are few javadoc tests that had to be adapted, most of the testing is done in `test/langtools/tools/javac/doctree`. 
          > 
          > If the exact number of leading whitespace in `
          ` tags is important to any javadoc user the old output can be restored by increasing the indentation by 1. There will be a release note for this of course. 
          > 
          > Unfortunately, there is another whitespace problem that can't be solved as easily, and that is a leading blank line caused by `
          \n` open tags. Browsers will [ignore a newline immediately following a `
          ` tag][1], but not if there is a `` tag in between. There are hundreds of occurrences of this in JDK code, including variants with space characters mixed in. The fix in javadoc proper would be too complex, so I decided to solve it with 3 lines of JavaScript and a regex to reverse the order of `\n` at the beginning of `
          ` tags while removing any intermediary space. Script operation is indiscernible and it solves the problem.
          > 
          > [1]: https://html.spec.whatwg.org/#the-pre-element:the-pre-element
          
          This pull request has been closed without being integrated.
          
          -------------
          
          PR: https://git.openjdk.org/jdk/pull/23868
          
          From hannesw at openjdk.org  Thu Mar 13 18:19:02 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Thu, 13 Mar 2025 18:19:02 GMT
          Subject: RFR: 8346118: Improve whitespace normalization in preformatted
           text
          In-Reply-To: 
          References: 
           
          Message-ID: 
          
          On Wed, 5 Mar 2025 18:07:11 GMT, Jonathan Gibbons  wrote:
          
          >> Please review an enhancement to make `DocCommentParser` normalize whitespace inside `
          ` elements. The normalization is conceptually simple and and intended to be minimally invasive. Before parsing, `DocCommentParser` checks whether the text is a traditional doc comment and whether every line starts with a space character, which is commonly the case in traditional doc comments. If so, a single leading space is removed in block content (top level text and `{@code}`/`{@literal}` tags) when parsing within HTML `
          ` tags.
          >> 
          >> This fixes the incidental one-space indentation in the vast majority of JDK code samples using `
          ` alone or in combination with `` or `{@code}`. In fact, I only found one code sample in JDK code that isn't solved by this change, for which I included a fix in this PR (it's in `String.startsWith(String, int)`, where I replaced the 10 char indentation and trailing line with a `
          `). >> >> The many added `boolean inBlockContent` arguments pased around in `DocCommentParser` are to make sure the removal is not applied to multiline inline content, which is maybe a bit fussy considering there is not a lot of multiline inline content in `
          ` tags and it usually would not mind about removal of a non-essential space character, but I wanted to keep the change minimal. There are few javadoc tests that had to be adapted, most of the testing is done in `test/langtools/tools/javac/doctree`. 
          >> 
          >> If the exact number of leading whitespace in `
          ` tags is important to any javadoc user the old output can be restored by increasing the indentation by 1. There will be a release note for this of course. 
          >> 
          >> Unfortunately, there is another whitespace problem that can't be solved as easily, and that is a leading blank line caused by `
          \n` open tags. Browsers will [ignore a newline immediately following a `
          ` tag][1], but not if there is a `` tag in between. There are hundreds of occurrences of this in JDK code, including variants with space characters mixed in. The fix in javadoc proper would be too complex, so I decided to solve it with 3 lines of JavaScript and a regex to reverse the order of `\n` at the beginning of `
          ` tags while removing any intermediary space. Script operation is indiscernible and it solves the problem.
          >> 
          >> [1]: https://html.spec.whatwg.org/#the-pre-element:the-pre-element
          >
          > As you indicated, there are two problems being addressed here, which might indicate the need for two separate patches. These issues are:
          > 
          > 1. The leading 1-space problem.
          > 2. The trailing newline-after-
           problem
          > 
          > For the first, it is unduly hard work to fix this just for `
          ` blocks. I still think that an overall better long-term solution would be to apply a conceptual `stripIndent` to the entire doc comment. This would bring traditional comments into line with the new Markdown comments, and can be done in just a few lines in `DocCommentParser`, and doing it there in DCP means you need not update `Elements.getDocComment`. If nothing else, I would suggest doing the experiment and comparing the generated docs, to verify there are no unexpected side effects. If there are any significant unexpected side effects, then your approach might deserve a second look. You could also make this a JDK-version-specific change if you wanted: meaning the new behavior does not apply to older JDK versions, although that is not a policy we have adhered to in the past.
          > 
          > For the second, I just feel that is a step too far, using JavaScript to clean up what some might consider to be bad input. Authors should either write HTML according to the HTML (and CSS?) specs, so that `javadoc` is just a "pass-through" layer, or authors should use a suitable construct, like `{@snippet...}`, that is "pleasing" to look at in source form while still generating the desired output.
          
          After discussion with @jonathan-gibbons we have agreed that the two issues in this PR should be handled separately.
          
          -------------
          
          PR Comment: https://git.openjdk.org/jdk/pull/23868#issuecomment-2722311586
          
          From hannesw at openjdk.org  Fri Mar 14 10:49:15 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Fri, 14 Mar 2025 10:49:15 GMT
          Subject: RFR: 8345555: Improve layout of search results [v9]
          In-Reply-To: 
          References: 
          Message-ID: 
          
          > Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. 
          > 
          > The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged.
          > 
          > Screenshot 2025-02-17 at 14 56 52
          > 
          > On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem.
          > 
          > There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. 
          > 
          > Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags
          > 
          > On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to the code so it will be eas...
          
          Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
          
            Add styles for module selector
          
          -------------
          
          Changes:
            - all: https://git.openjdk.org/jdk/pull/23666/files
            - new: https://git.openjdk.org/jdk/pull/23666/files/1691d4f1..2a2e04f1
          
          Webrevs:
           - full: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=08
           - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=07-08
          
            Stats: 7 lines in 1 file changed: 5 ins; 1 del; 1 mod
            Patch: https://git.openjdk.org/jdk/pull/23666.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/23666/head:pull/23666
          
          PR: https://git.openjdk.org/jdk/pull/23666
          
          From hannesw at openjdk.org  Fri Mar 14 13:46:09 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Fri, 14 Mar 2025 13:46:09 GMT
          Subject: RFR: 8345555: Improve layout of search results [v10]
          In-Reply-To: 
          References: 
          Message-ID: 
          
          > Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. 
          > 
          > The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged.
          > 
          > Screenshot 2025-02-17 at 14 56 52
          > 
          > On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem.
          > 
          > There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. 
          > 
          > Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags
          > 
          > On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to the code so it will be eas...
          
          Hannes Walln?fer has updated the pull request incrementally with two additional commits since the last revision:
          
           - Add bug id to more tests
           - Update copyright years
             
             Note: any commit hashes below might be outdated due to subsequent
             history rewriting (e.g. git rebase).
             
              + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java due to 973bf1362eb
              + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexWriter.java due to 65de882c21a
              + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SpecTaglet.java due to 973bf1362eb
              + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SystemPropertyTaglet.java due to 973bf1362eb
              + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/TagletWriter.java due to 973bf1362eb
              + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlAttr.java due to 008c331d854
              + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlTag.java due to 008c331d854
              + update test/langtools/jdk/javadoc/doclet/testIndex/TestIndex.java due to 973bf1362eb
              + update test/langtools/jdk/javadoc/doclet/testIndexInDocFiles/TestIndexInDocFiles.java due to 973bf1362eb
              + update test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java due to 973bf1362eb
              + update test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java due to 973bf1362eb
              + update test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java due to 973bf1362eb
          
          -------------
          
          Changes:
            - all: https://git.openjdk.org/jdk/pull/23666/files
            - new: https://git.openjdk.org/jdk/pull/23666/files/2a2e04f1..e95acda7
          
          Webrevs:
           - full: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=09
           - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=08-09
          
            Stats: 16 lines in 14 files changed: 0 ins; 0 del; 16 mod
            Patch: https://git.openjdk.org/jdk/pull/23666.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/23666/head:pull/23666
          
          PR: https://git.openjdk.org/jdk/pull/23666
          
          From nbenalla at openjdk.org  Fri Mar 14 14:03:59 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Fri, 14 Mar 2025 14:03:59 GMT
          Subject: RFR: 8345555: Improve layout of search results [v10]
          In-Reply-To: 
          References: 
           
          Message-ID: 
          
          On Fri, 14 Mar 2025 13:46:09 GMT, Hannes Walln?fer  wrote:
          
          >> Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. 
          >> 
          >> The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged.
          >> 
          >> Screenshot 2025-02-17 at 14 56 52
          >> 
          >> On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem.
          >> 
          >> There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. 
          >> 
          >> Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags
          >> 
          >> On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to ...
          >
          > Hannes Walln?fer has updated the pull request incrementally with two additional commits since the last revision:
          > 
          >  - Add bug id to more tests
          >  - Update copyright years
          >    
          >    Note: any commit hashes below might be outdated due to subsequent
          >    history rewriting (e.g. git rebase).
          >    
          >     + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/HtmlDocletWriter.java due to 973bf1362eb
          >     + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/IndexWriter.java due to 65de882c21a
          >     + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SpecTaglet.java due to 973bf1362eb
          >     + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SystemPropertyTaglet.java due to 973bf1362eb
          >     + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/TagletWriter.java due to 973bf1362eb
          >     + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlAttr.java due to 008c331d854
          >     + update src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlTag.java due to 008c331d854
          >     + update test/langtools/jdk/javadoc/doclet/testIndex/TestIndex.java due to 973bf1362eb
          >     + update test/langtools/jdk/javadoc/doclet/testIndexInDocFiles/TestIndexInDocFiles.java due to 973bf1362eb
          >     + update test/langtools/jdk/javadoc/doclet/testMemberInheritance/TestMemberInheritance.java due to 973bf1362eb
          >     + update test/langtools/jdk/javadoc/doclet/testModules/TestModulePackages.java due to 973bf1362eb
          >     + update test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java due to 973bf1362eb
          
          I've checked the new CSS on multiple browsers. Copyright years and bug ids have been updated.
          
          Latest change looks good!
          
          -------------
          
          Marked as reviewed by nbenalla (Committer).
          
          PR Review: https://git.openjdk.org/jdk/pull/23666#pullrequestreview-2685664543
          
          From hannesw at openjdk.org  Sat Mar 15 06:48:52 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Sat, 15 Mar 2025 06:48:52 GMT
          Subject: RFR: 8345555: Improve layout of search results [v11]
          In-Reply-To: 
          References: 
          Message-ID: 
          
          > Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. 
          > 
          > The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged.
          > 
          > Screenshot 2025-02-17 at 14 56 52
          > 
          > On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem.
          > 
          > There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. 
          > 
          > Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags
          > 
          > On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to the code so it will be eas...
          
          Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
          
            Fix maximum size for search menu
             - Correctly calculate available vertical space
             - Align width with page content with visible sidebar
             - Allow more width on small displays
             - Add padding to result text label
          
          -------------
          
          Changes:
            - all: https://git.openjdk.org/jdk/pull/23666/files
            - new: https://git.openjdk.org/jdk/pull/23666/files/e95acda7..cb3c51f8
          
          Webrevs:
           - full: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=10
           - incr: https://webrevs.openjdk.org/?repo=jdk&pr=23666&range=09-10
          
            Stats: 7 lines in 1 file changed: 2 ins; 0 del; 5 mod
            Patch: https://git.openjdk.org/jdk/pull/23666.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/23666/head:pull/23666
          
          PR: https://git.openjdk.org/jdk/pull/23666
          
          From liach at openjdk.org  Sat Mar 15 15:48:57 2025
          From: liach at openjdk.org (Chen Liang)
          Date: Sat, 15 Mar 2025 15:48:57 GMT
          Subject: RFR: 8345555: Improve layout of search results [v11]
          In-Reply-To: 
          References: 
           
          Message-ID: 
          
          On Sat, 15 Mar 2025 06:48:52 GMT, Hannes Walln?fer  wrote:
          
          >> Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. 
          >> 
          >> The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged.
          >> 
          >> Screenshot 2025-02-17 at 14 56 52
          >> 
          >> On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem.
          >> 
          >> There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. 
          >> 
          >> Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags
          >> 
          >> On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to ...
          >
          > Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   Fix maximum size for search menu
          >    - Correctly calculate available vertical space
          >    - Align width with page content with visible sidebar
          >    - Allow more width on small displays
          >    - Add padding to result text label
          
          test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java line 467:
          
          > 465:         checkOutput("index-all.html", true,
          > 466:                 """
          > 467:                     method(Vector<Object>)"""
          
          Is this caused by replacing `Util.flatSignature` with `makeSignature(.., false, true)`?
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/23666#discussion_r1996980901
          
          From hannesw at openjdk.org  Sat Mar 15 16:10:58 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Sat, 15 Mar 2025 16:10:58 GMT
          Subject: RFR: 8345555: Improve layout of search results [v11]
          In-Reply-To: 
          References: 
           
           
          Message-ID: <1POoukxSBT8fiGyhn53XWfFJ2QA57V5oT8OYhTu9UOE=.6d0e04d0-e42b-4e63-8b05-58690e03643e@github.com>
          
          On Sat, 15 Mar 2025 15:45:48 GMT, Chen Liang  wrote:
          
          >> Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
          >> 
          >>   Fix maximum size for search menu
          >>    - Correctly calculate available vertical space
          >>    - Align width with page content with visible sidebar
          >>    - Allow more width on small displays
          >>    - Add padding to result text label
          >
          > test/langtools/jdk/javadoc/doclet/testNewLanguageFeatures/TestNewLanguageFeatures.java line 467:
          > 
          >> 465:         checkOutput("index-all.html", true,
          >> 466:                 """
          >> 467:                     method(Vector<Object>)"""
          > 
          > Is this caused by replacing `Util.flatSignature` with `makeSignature(.., false, true)`?
          
          Yes.
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/23666#discussion_r1996997122
          
          From liach at openjdk.org  Sat Mar 15 16:21:59 2025
          From: liach at openjdk.org (Chen Liang)
          Date: Sat, 15 Mar 2025 16:21:59 GMT
          Subject: RFR: 8345555: Improve layout of search results [v11]
          In-Reply-To: 
          References: 
           
          Message-ID: 
          
          On Sat, 15 Mar 2025 06:48:52 GMT, Hannes Walln?fer  wrote:
          
          >> Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. 
          >> 
          >> The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged.
          >> 
          >> Screenshot 2025-02-17 at 14 56 52
          >> 
          >> On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem.
          >> 
          >> There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. 
          >> 
          >> Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags
          >> 
          >> On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to ...
          >
          > Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   Fix maximum size for search menu
          >    - Correctly calculate available vertical space
          >    - Align width with page content with visible sidebar
          >    - Allow more width on small displays
          >    - Add padding to result text label
          
          Marked as reviewed by liach (Reviewer).
          
          -------------
          
          PR Review: https://git.openjdk.org/jdk/pull/23666#pullrequestreview-2687984553
          
          From hannesw at openjdk.org  Mon Mar 17 09:03:05 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Mon, 17 Mar 2025 09:03:05 GMT
          Subject: Integrated: 8345555: Improve layout of search results
          In-Reply-To: 
          References: 
          Message-ID: 
          
          On Mon, 17 Feb 2025 14:46:47 GMT, Hannes Walln?fer  wrote:
          
          > Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. 
          > 
          > The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged.
          > 
          > Screenshot 2025-02-17 at 14 56 52
          > 
          > On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem.
          > 
          > There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. 
          > 
          > Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags
          > 
          > On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to the code so it will be eas...
          
          This pull request has now been integrated.
          
          Changeset: c8913d2c
          Author:    Hannes Walln?fer 
          URL:       https://git.openjdk.org/jdk/commit/c8913d2c9cd2ec522dc660cce01eb555e95dc775
          Stats:     1089 lines in 33 files changed: 562 ins; 145 del; 382 mod
          
          8345555: Improve layout of search results
          
          Reviewed-by: liach, nbenalla
          
          -------------
          
          PR: https://git.openjdk.org/jdk/pull/23666
          
          From hannesw at openjdk.org  Mon Mar 17 09:03:04 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Mon, 17 Mar 2025 09:03:04 GMT
          Subject: RFR: 8345555: Improve layout of search results [v11]
          In-Reply-To: 
          References: 
           
          Message-ID: 
          
          On Sat, 15 Mar 2025 06:48:52 GMT, Hannes Walln?fer  wrote:
          
          >> Please review an enhancement to JavaDoc search to provide more context and a nicer layout for search results. This adds a new "kind" field to the search index to describes search items, such as "Static method", "Interface, or "System property" etc. Additionally, the drop-down search box uses a new two-column layout for search results to display this information. Previously we always displayed fully qualified names and signatures, now we mostly display simple names except if the user entered a qualified search term. 
          >> 
          >> The screenshot below shows an example of the new layout, you can of course [test the feature yourself](https://cr.openjdk.org/~hannesw/8345555/api.03/) (top-level files only). Note that the change affects moslty the drop-down search menu, the standalone search page was slightly updated to work with the new data but is otherwise unchanged.
          >> 
          >> Screenshot 2025-02-17 at 14 56 52
          >> 
          >> On the Java side, the feature is implemented by adding a new `IndexItem.Kind` enum class listing all possible kinds of index items, which include API `Element`s, JavaDoc tags and summary pages. The purpose if this enum is to send its `ordinal`s to the browser via JSON where it is used as array index into an array of localized messages. This means that the Java enum and JavaScript array have to be kept in sync manually, but it's relatively rare that new language elements or JavaDoc tags get added so that shouldn't be a problem.
          >> 
          >> There is a small change in JavaDoc HTML output because "System property" and "External specification" are now kinds of tags and no longer used as descriptions. On index pages they are now listed as "System property in package foo" rather than "Search tag in package foo" with the description "System Tag" added in the next line. 
          >> 
          >> Only actual `{@index}` tags can now have a description, which continues to be added as second line in index pages. In search, the description is now appended to the search term separated by "-", which makes it more visible and allows it to be searched for: https://cr.openjdk.org/~hannesw/8345555/api.02/search.html?q=tool&c=searchTags
          >> 
          >> On the JavaScript side, changes went a bit further than originally planned. I finally fixed the format of constructors not to show the class name twice, which required some retuning of ranking of search results. I used this occasion to add lots of comments to ...
          >
          > Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   Fix maximum size for search menu
          >    - Correctly calculate available vertical space
          >    - Align width with page content with visible sidebar
          >    - Allow more width on small displays
          >    - Add padding to result text label
          
          Thanks!
          
          -------------
          
          PR Comment: https://git.openjdk.org/jdk/pull/23666#issuecomment-2728660010
          
          From hannesw at openjdk.org  Mon Mar 17 16:51:04 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Mon, 17 Mar 2025 16:51:04 GMT
          Subject: RFR: 8352151: Fix display issues in javadoc-generated docs
          Message-ID: 
          
          Please review a patch to fix a number of display bugs in javadoc-generated documentation.
          
           -  Snippet copy button is transparent and can overlap with snippet content ([example][example-snippet])
           - After clicking on the second-to-last item in the sidebar, the last item is highlighted if the click triggers scrolling to the end of the page ([example][example-target])
           - No indentation on sidebar entries beyond the first two levels of hierarchy (only applies to [help page][example-indent])
           - (Minor) Add vertical margin to search page inputs so they look better when wrapped
          
          [example-snippet]: https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/invoke/MethodHandle.html#asSpreader(int,java.lang.Class,int)
          [example-target]: https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/Thread.Builder.html#start(java.lang.Runnable)
          [example-indent]: https://download.java.net/java/early_access/jdk25/docs/api/help-doc.html
          
          The sidebar highlighting script actually became simpler, which is great. The snippet copy button change is a bit more involved, because I had to change snippet layout to not overlay snippet content with the copy button, and make the button opaque. But the result is better than what we had before IMO. The other changes are simple one-liners.
          
          -------------
          
          Commit messages:
           - 8352151: Fix display issues in javadoc-generated docs
          
          Changes: https://git.openjdk.org/jdk/pull/24083/files
            Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24083&range=00
            Issue: https://bugs.openjdk.org/browse/JDK-8352151
            Stats: 95 lines in 2 files changed: 19 ins; 45 del; 31 mod
            Patch: https://git.openjdk.org/jdk/pull/24083.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24083/head:pull/24083
          
          PR: https://git.openjdk.org/jdk/pull/24083
          
          From hannesw at openjdk.org  Tue Mar 18 17:05:44 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Tue, 18 Mar 2025 17:05:44 GMT
          Subject: RFR: 8352249: Remove incidental whitespace in traditional doc comments
          Message-ID: <7U7VUjG-qIfM5AkHx7SaPnoh_rRBkxBl-et2TYzZ6VQ=.01406987-8cd8-4385-8945-92fb7b3f568d@github.com>
          
          Please review a patch to remove incidental indentation from traditional doc comments. This adds a `stripIndent()` method to the `Tokens.Comment` interface and a new `JavadocTokenizer.StrippedComment` nested class that implements indentation stripping while maintaining a map of position offsets to the original comment. 
          
          While the patch changes `javadoc` output by removing leading whitespace, the change is generally not visible in the browser except in `
          ` elements, which is the point of this enhancement. 
          
          The change affects most tree positions in the AST checker tests in javac/doctree, but mostly does not affect the structure of the parsed trees, with the exception of `BreakIterator` tests in `FirstSentenceTest.java`. 
          
          `BreakIterator` does not recognize `.\n` immediately followed by a lower case letter as sentence break, while it recognizes the break if the letter is an upper-case letter *or* if there is a space between the line break and the letter. I find this rule a bit peculiar but AFAICT we can't influence the behavior of `BreakIterator`, so I have added tests that cover both lower and upper-case behavior.
          
          The source position lookup in the stripped comment is implemented by creating a new `OffsetMap` that translates from the stripped to the original comment, then using the original comment's `OffsetMap` to translate the position to the source file. `OffsetMap` is relatively lightweight (usually 2 `int[]` elements per comment paragraph), so the added overhead is not too bad. 
          
          Inspired by [JDK-8305688](https://bugs.openjdk.org/browse/JDK-8305688) I did various test builds with restricted jobs and memory settings, but didn't notice any change in processing or memory overhead to API docs builds.
          
          -------------
          
          Commit messages:
           - Rename method
           - Update comment
           - Clean up code, add comments, tests and @bug id
           - Updated copyright year in testSourceTab breaks test
           - Update remaining doctree tests & copyright headers
           - Avoid losing the last of multiple trailing newlines in stripComment
           - Remove unnecessary variable
           - Don't rely on trailing newline
           - Strip indentation from traditional doc comments
          
          Changes: https://git.openjdk.org/jdk/pull/24032/files
            Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24032&range=00
            Issue: https://bugs.openjdk.org/browse/JDK-8352249
            Stats: 1386 lines in 63 files changed: 268 ins; 5 del; 1113 mod
            Patch: https://git.openjdk.org/jdk/pull/24032.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24032/head:pull/24032
          
          PR: https://git.openjdk.org/jdk/pull/24032
          
          From hannesw at openjdk.org  Wed Mar 19 08:22:25 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Wed, 19 Mar 2025 08:22:25 GMT
          Subject: RFR: 8352249: Remove incidental whitespace in traditional doc
           comments [v2]
          In-Reply-To: <7U7VUjG-qIfM5AkHx7SaPnoh_rRBkxBl-et2TYzZ6VQ=.01406987-8cd8-4385-8945-92fb7b3f568d@github.com>
          References: <7U7VUjG-qIfM5AkHx7SaPnoh_rRBkxBl-et2TYzZ6VQ=.01406987-8cd8-4385-8945-92fb7b3f568d@github.com>
          Message-ID: 
          
          > Please review a patch to remove incidental indentation from traditional doc comments. This adds a `stripIndent()` method to the `Tokens.Comment` interface and a new `JavadocTokenizer.StrippedComment` nested class that implements indentation stripping while maintaining a map of position offsets to the original comment. 
          > 
          > While the patch changes `javadoc` output by removing leading whitespace, the change is generally not visible in the browser except in `
          ` elements, which is the point of this enhancement. 
          > 
          > The change affects most tree positions in the AST checker tests in javac/doctree, but mostly does not affect the structure of the parsed trees, with the exception of `BreakIterator` tests in `FirstSentenceTest.java`. 
          > 
          > `BreakIterator` does not recognize `.\n` immediately followed by a lower case letter as sentence break, while it recognizes the break if the letter is an upper-case letter *or* if there is a space between the line break and the letter. I find this rule a bit peculiar but AFAICT we can't influence the behavior of `BreakIterator`, so I have added tests that cover both lower and upper-case behavior.
          > 
          > The source position lookup in the stripped comment is implemented by creating a new `OffsetMap` that translates from the stripped to the original comment, then using the original comment's `OffsetMap` to translate the position to the source file. `OffsetMap` is relatively lightweight (usually 2 `int[]` elements per comment paragraph), so the added overhead is not too bad. 
          > 
          > Inspired by [JDK-8305688](https://bugs.openjdk.org/browse/JDK-8305688) I did various test builds with restricted jobs and memory settings, but didn't notice any change in processing or memory overhead to API docs builds.
          
          Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
          
            Whitespace normalization in PrettyCheck becomes simpler
          
          -------------
          
          Changes:
            - all: https://git.openjdk.org/jdk/pull/24032/files
            - new: https://git.openjdk.org/jdk/pull/24032/files/eb9a090c..1c21de77
          
          Webrevs:
           - full: https://webrevs.openjdk.org/?repo=jdk&pr=24032&range=01
           - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24032&range=00-01
          
            Stats: 55 lines in 3 files changed: 0 ins; 48 del; 7 mod
            Patch: https://git.openjdk.org/jdk/pull/24032.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24032/head:pull/24032
          
          PR: https://git.openjdk.org/jdk/pull/24032
          
          From hannesw at openjdk.org  Wed Mar 19 11:31:51 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Wed, 19 Mar 2025 11:31:51 GMT
          Subject: RFR: 8352389: Remove incidental whitespace in pre/code content
          Message-ID: <_nIhYXPaNlvsFHzHejW-nHWfSubHnTRN2OqLqbyOj00=.e3f2b677-512f-413c-b26d-7996275a986d@github.com>
          
          Please review a change to remove incidental whitespace commonly found at the beginning of `
          ` or `
          {@code` tags. This patch is dependent on [JDK-8352249](https://bugs.openjdk.org/browse/JDK-8352249) and completes the removal of incidental whitespace in traditional doc comments. 
          
          This is implemented by parsing content of `
          ` elements into a separate list buffer in `DocCommentParser`, and filter the content for leading blank linkes when the element is closed. The decision to filter `
          ` element contents only once the element is closed was made in order to be able to keep the logic in a single method without further complicating other parts of `DocCommentParser`.
          
          -------------
          
          Depends on: https://git.openjdk.org/jdk/pull/24032
          
          Commit messages:
           - Improve test
           - Add comment
           - 8352389: Remove incidental whitespace in pre/code content
          
          Changes: https://git.openjdk.org/jdk/pull/24112/files
            Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24112&range=00
            Issue: https://bugs.openjdk.org/browse/JDK-8352389
            Stats: 354 lines in 7 files changed: 342 ins; 3 del; 9 mod
            Patch: https://git.openjdk.org/jdk/pull/24112.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24112/head:pull/24112
          
          PR: https://git.openjdk.org/jdk/pull/24112
          
          From liach at openjdk.org  Wed Mar 19 23:33:13 2025
          From: liach at openjdk.org (Chen Liang)
          Date: Wed, 19 Mar 2025 23:33:13 GMT
          Subject: RFR: 8352249: Remove incidental whitespace in traditional doc
           comments [v2]
          In-Reply-To: 
          References: <7U7VUjG-qIfM5AkHx7SaPnoh_rRBkxBl-et2TYzZ6VQ=.01406987-8cd8-4385-8945-92fb7b3f568d@github.com>
           
          Message-ID: 
          
          On Wed, 19 Mar 2025 08:22:25 GMT, Hannes Walln?fer  wrote:
          
          >> Please review a patch to remove incidental indentation from traditional doc comments, comparable to doing a `String.stripIndent()` on the comment contents but without special treatment of a last blank line. This adds a `stripIndent()` method to the `Tokens.Comment` interface and a new `JavadocTokenizer.StrippedComment` nested class that implements indentation stripping while maintaining a map of position offsets to the original comment. 
          >> 
          >> While the patch changes `javadoc` output by removing leading whitespace, the change is generally not visible in the browser except in `
          ` elements, which is the point of this enhancement. 
          >> 
          >> The change affects most tree positions in the AST checker tests in javac/doctree, but mostly does not affect the structure of the parsed trees, with the exception of `BreakIterator` tests in `FirstSentenceTest.java`. 
          >> 
          >> `BreakIterator` does not recognize `.\n` immediately followed by a lower case letter as sentence break, while it recognizes the break if the letter is an upper-case letter *or* if there is a space between the line break and the letter. I find this rule a bit peculiar but AFAICT we can't influence the behavior of `BreakIterator`, so I have added tests that cover both lower and upper-case behavior.
          >> 
          >> The source position lookup in the stripped comment is implemented by creating a new `OffsetMap` that translates from the stripped to the original comment, then using the original comment's `OffsetMap` to translate the position to the source file. `OffsetMap` is relatively lightweight (usually 2 `int[]` elements per comment paragraph), so the added overhead is not too bad. 
          >> 
          >> Inspired by [JDK-8305688](https://bugs.openjdk.org/browse/JDK-8305688) I did various test builds with restricted jobs and memory settings, but didn't notice any change in processing or memory overhead to API docs builds.
          >
          > Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   Whitespace normalization in PrettyCheck becomes simpler
          
          Looks good.
          
          -------------
          
          Marked as reviewed by liach (Reviewer).
          
          PR Review: https://git.openjdk.org/jdk/pull/24032#pullrequestreview-2700546175
          
          From hannesw at openjdk.org  Thu Mar 20 06:02:12 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Thu, 20 Mar 2025 06:02:12 GMT
          Subject: RFR: 8352249: Remove incidental whitespace in traditional doc
           comments [v2]
          In-Reply-To: 
          References: <7U7VUjG-qIfM5AkHx7SaPnoh_rRBkxBl-et2TYzZ6VQ=.01406987-8cd8-4385-8945-92fb7b3f568d@github.com>
           
          Message-ID: <-ORVCezfWrCYimEOORZHcheJusIrftPY9Mdt7xkGIWs=.54cd70b7-28f4-4fd0-a046-fa73a1d80efa@github.com>
          
          On Wed, 19 Mar 2025 08:22:25 GMT, Hannes Walln?fer  wrote:
          
          >> Please review a patch to remove incidental indentation from traditional doc comments, comparable to doing a `String.stripIndent()` on the comment contents but without special treatment of a last blank line. This adds a `stripIndent()` method to the `Tokens.Comment` interface and a new `JavadocTokenizer.StrippedComment` nested class that implements indentation stripping while maintaining a map of position offsets to the original comment. 
          >> 
          >> While the patch changes `javadoc` output by removing leading whitespace, the change is generally not visible in the browser except in `
          ` elements, which is the point of this enhancement. 
          >> 
          >> The change affects most tree positions in the AST checker tests in javac/doctree, but mostly does not affect the structure of the parsed trees, with the exception of `BreakIterator` tests in `FirstSentenceTest.java`. 
          >> 
          >> `BreakIterator` does not recognize `.\n` immediately followed by a lower case letter as sentence break, while it recognizes the break if the letter is an upper-case letter *or* if there is a space between the line break and the letter. I find this rule a bit peculiar but AFAICT we can't influence the behavior of `BreakIterator`, so I have added tests that cover both lower and upper-case behavior.
          >> 
          >> The source position lookup in the stripped comment is implemented by creating a new `OffsetMap` that translates from the stripped to the original comment, then using the original comment's `OffsetMap` to translate the position to the source file. `OffsetMap` is relatively lightweight (usually 2 `int[]` elements per comment paragraph), so the added overhead is not too bad. 
          >> 
          >> Inspired by [JDK-8305688](https://bugs.openjdk.org/browse/JDK-8305688) I did various test builds with restricted jobs and memory settings, but didn't notice any change in processing or memory overhead to API docs builds.
          >
          > Hannes Walln?fer has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   Whitespace normalization in PrettyCheck becomes simpler
          
          Thanks!
          
          -------------
          
          PR Comment: https://git.openjdk.org/jdk/pull/24032#issuecomment-2739289037
          
          From hannesw at openjdk.org  Thu Mar 20 06:02:13 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Thu, 20 Mar 2025 06:02:13 GMT
          Subject: Integrated: 8352249: Remove incidental whitespace in traditional doc
           comments
          In-Reply-To: <7U7VUjG-qIfM5AkHx7SaPnoh_rRBkxBl-et2TYzZ6VQ=.01406987-8cd8-4385-8945-92fb7b3f568d@github.com>
          References: <7U7VUjG-qIfM5AkHx7SaPnoh_rRBkxBl-et2TYzZ6VQ=.01406987-8cd8-4385-8945-92fb7b3f568d@github.com>
          Message-ID: 
          
          On Thu, 13 Mar 2025 13:12:10 GMT, Hannes Walln?fer  wrote:
          
          > Please review a patch to remove incidental indentation from traditional doc comments, comparable to doing a `String.stripIndent()` on the comment contents but without special treatment of a last blank line. This adds a `stripIndent()` method to the `Tokens.Comment` interface and a new `JavadocTokenizer.StrippedComment` nested class that implements indentation stripping while maintaining a map of position offsets to the original comment. 
          > 
          > While the patch changes `javadoc` output by removing leading whitespace, the change is generally not visible in the browser except in `
          ` elements, which is the point of this enhancement. 
          > 
          > The change affects most tree positions in the AST checker tests in javac/doctree, but mostly does not affect the structure of the parsed trees, with the exception of `BreakIterator` tests in `FirstSentenceTest.java`. 
          > 
          > `BreakIterator` does not recognize `.\n` immediately followed by a lower case letter as sentence break, while it recognizes the break if the letter is an upper-case letter *or* if there is a space between the line break and the letter. I find this rule a bit peculiar but AFAICT we can't influence the behavior of `BreakIterator`, so I have added tests that cover both lower and upper-case behavior.
          > 
          > The source position lookup in the stripped comment is implemented by creating a new `OffsetMap` that translates from the stripped to the original comment, then using the original comment's `OffsetMap` to translate the position to the source file. `OffsetMap` is relatively lightweight (usually 2 `int[]` elements per comment paragraph), so the added overhead is not too bad. 
          > 
          > Inspired by [JDK-8305688](https://bugs.openjdk.org/browse/JDK-8305688) I did various test builds with restricted jobs and memory settings, but didn't notice any change in processing or memory overhead to API docs builds.
          
          This pull request has now been integrated.
          
          Changeset: a5d06a18
          Author:    Hannes Walln?fer 
          URL:       https://git.openjdk.org/jdk/commit/a5d06a18762c81eda5883c07b42621278b9209c9
          Stats:     1438 lines in 64 files changed: 268 ins; 53 del; 1117 mod
          
          8352249: Remove incidental whitespace in traditional doc comments
          
          Reviewed-by: liach
          
          -------------
          
          PR: https://git.openjdk.org/jdk/pull/24032
          
          From hannesw at openjdk.org  Thu Mar 20 06:07:47 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Thu, 20 Mar 2025 06:07:47 GMT
          Subject: RFR: 8352389: Remove incidental whitespace in pre/code content
           [v2]
          In-Reply-To: <_nIhYXPaNlvsFHzHejW-nHWfSubHnTRN2OqLqbyOj00=.e3f2b677-512f-413c-b26d-7996275a986d@github.com>
          References: <_nIhYXPaNlvsFHzHejW-nHWfSubHnTRN2OqLqbyOj00=.e3f2b677-512f-413c-b26d-7996275a986d@github.com>
          Message-ID: <-fUZ7sCv8Q02u6hd6m_jMJbDGHdn_4Ix4Z-hJlTYWkQ=.8166f84e-fd35-4950-9916-d017dceefdde@github.com>
          
          > Please review a change to remove incidental whitespace commonly found at the beginning of `
          ` or `
          {@code` tags. This patch is dependent on [JDK-8352249](https://bugs.openjdk.org/browse/JDK-8352249) and completes the removal of incidental whitespace in traditional doc comments. 
          > 
          > This is implemented by parsing content of `
          ` elements into a separate list buffer in `DocCommentParser`, and filter the content for leading blank linkes when the element is closed. The decision to filter `
          ` element contents only once the element is closed was made in order to be able to keep the logic in a single method without further complicating other parts of `DocCommentParser`.
          
          Hannes Walln?fer has updated the pull request with a new target base due to a merge or a rebase. The incremental webrev excludes the unrelated changes brought in by the merge/rebase.
          
          -------------
          
          Changes:
            - all: https://git.openjdk.org/jdk/pull/24112/files
            - new: https://git.openjdk.org/jdk/pull/24112/files/e3ded45f..e3ded45f
          
          Webrevs:
           - full: https://webrevs.openjdk.org/?repo=jdk&pr=24112&range=01
           - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24112&range=00-01
          
            Stats: 0 lines in 0 files changed: 0 ins; 0 del; 0 mod
            Patch: https://git.openjdk.org/jdk/pull/24112.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24112/head:pull/24112
          
          PR: https://git.openjdk.org/jdk/pull/24112
          
          From hannesw at openjdk.org  Thu Mar 20 07:27:39 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Thu, 20 Mar 2025 07:27:39 GMT
          Subject: RFR: 8352389: Remove incidental whitespace in pre/code content
           [v3]
          In-Reply-To: <_nIhYXPaNlvsFHzHejW-nHWfSubHnTRN2OqLqbyOj00=.e3f2b677-512f-413c-b26d-7996275a986d@github.com>
          References: <_nIhYXPaNlvsFHzHejW-nHWfSubHnTRN2OqLqbyOj00=.e3f2b677-512f-413c-b26d-7996275a986d@github.com>
          Message-ID: 
          
          > Please review a change to remove incidental whitespace commonly found at the beginning of `
          ` or `
          {@code` tags. This patch is dependent on [JDK-8352249](https://bugs.openjdk.org/browse/JDK-8352249) and completes the removal of incidental whitespace in traditional doc comments. 
          > 
          > This is implemented by parsing content of `
          ` elements into a separate list buffer in `DocCommentParser`, and filter the content for leading blank linkes when the element is closed. The decision to filter `
          ` element contents only once the element is closed was made in order to be able to keep the logic in a single method without further complicating other parts of `DocCommentParser`.
          
          Hannes Walln?fer has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 14 commits:
          
           - Merge branch 'master' into JDK-8352389
           - Improve test
           - Add comment
           - 8352389: Remove incidental whitespace in pre/code content
           - Whitespace normalization in PrettyCheck becomes simpler
           - Rename method
           - Update comment
           - Clean up code, add comments, tests and @bug id
           - Updated copyright year in testSourceTab breaks test
           - Update remaining doctree tests & copyright headers
           - ... and 4 more: https://git.openjdk.org/jdk/compare/fb210e3a...5ec3bc04
          
          -------------
          
          Changes: https://git.openjdk.org/jdk/pull/24112/files
            Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24112&range=02
            Stats: 354 lines in 7 files changed: 342 ins; 3 del; 9 mod
            Patch: https://git.openjdk.org/jdk/pull/24112.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24112/head:pull/24112
          
          PR: https://git.openjdk.org/jdk/pull/24112
          
          From hannesw at openjdk.org  Thu Mar 20 17:37:51 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Thu, 20 Mar 2025 17:37:51 GMT
          Subject: RFR: 8352511: Show additional level of headings in table of contents
          Message-ID: 
          
          Please review a patch to show an additional level of headings in the table of contents for module, package and class descriptions. Previously only `

          ` headings were shown in the table of contents, now we also show `

          ` level headings. The `TableOfContents` class no longer provides `pushNestedList`/`popNestedList` methods that require us to manually manage nesting level. Instead, the method to add a TOC entry gets an additional `level` parameter with an enum type to specify the nesting level (`FIRST`, `SECOND`, `THIRD`). The class will then configure the list to the desired nesting level before adding the entry. Of course this works with both tradidtional and Markdown doc comments and has tests for both. There are not too many API elements in JDK that use `

          ` level headings, but those that do benefit a lot from this change. A few examples: - [package java.util.stream](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/util/stream/package-summary.html) - [package java.lang.classfile](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/lang/classfile/package-summary.html) - [package java.lang.invoke](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/lang/invoke/package-summary.html) - [package java.lang.module](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/lang/module/package-summary.html) This PR depends on #24083 not for technical reasons but because that PR fixes the rendering of the third level of TOC entries. ------------- Depends on: https://git.openjdk.org/jdk/pull/24083 Commit messages: - Remove trailing whitespace - 8352511: Show additional level of headings in table of contents Changes: https://git.openjdk.org/jdk/pull/24137/files Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24137&range=00 Issue: https://bugs.openjdk.org/browse/JDK-8352511 Stats: 348 lines in 19 files changed: 240 ins; 44 del; 64 mod Patch: https://git.openjdk.org/jdk/pull/24137.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24137/head:pull/24137 PR: https://git.openjdk.org/jdk/pull/24137 From hannesw at openjdk.org Fri Mar 21 03:12:39 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Fri, 21 Mar 2025 03:12:39 GMT Subject: RFR: 8352511: Show additional level of headings in table of contents [v2] In-Reply-To: References: Message-ID: > Please review a patch to show an additional level of headings in the table of contents for module, package and class descriptions. Previously only `

          ` headings were shown in the table of contents, now we also show `

          ` level headings. > > The `TableOfContents` class no longer provides `pushNestedList`/`popNestedList` methods that require us to manually manage nesting level. Instead, the method to add a TOC entry gets an additional `level` parameter with an enum type to specify the nesting level (`FIRST`, `SECOND`, `THIRD`). The class will then configure the list to the desired nesting level before adding the entry. Of course this works with both tradidtional and Markdown doc comments and has tests for both. > > There are not too many API elements in JDK that use `

          ` level headings, but those that do benefit a lot from this change. A few examples: > > - [package java.util.stream](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/util/stream/package-summary.html) > - [package java.lang.classfile](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/lang/classfile/package-summary.html) > - [package java.lang.invoke](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/lang/invoke/package-summary.html) > - [package java.lang.module](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/lang/module/package-summary.html) > > This PR depends on #24083 not for technical reasons but because that PR fixes the rendering of the third level of TOC entries. Hannes Walln?fer has updated the pull request incrementally with two additional commits since the last revision: - Update copyright headers - Update ListBuilder ------------- Changes: - all: https://git.openjdk.org/jdk/pull/24137/files - new: https://git.openjdk.org/jdk/pull/24137/files/917737d8..6ae180c1 Webrevs: - full: https://webrevs.openjdk.org/?repo=jdk&pr=24137&range=01 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24137&range=00-01 Stats: 32 lines in 14 files changed: 0 ins; 9 del; 23 mod Patch: https://git.openjdk.org/jdk/pull/24137.diff Fetch: git fetch https://git.openjdk.org/jdk.git pull/24137/head:pull/24137 PR: https://git.openjdk.org/jdk/pull/24137 From liach at openjdk.org Fri Mar 21 05:09:05 2025 From: liach at openjdk.org (Chen Liang) Date: Fri, 21 Mar 2025 05:09:05 GMT Subject: RFR: 8352151: Fix display issues in javadoc-generated docs In-Reply-To: References: Message-ID: On Mon, 17 Mar 2025 16:06:58 GMT, Hannes Walln?fer wrote: > Please review a patch to fix a number of display bugs in javadoc-generated documentation. > > - Snippet copy button is transparent and can overlap with snippet content ([before][snippet-before], [after][snippet-after]) > - After clicking on the second-to-last item in the sidebar, the last item is highlighted if the click triggers scrolling to the end of the page ([before][target-before], [after][target-after]) > - No indentation on sidebar entries beyond the first two levels of hierarchy ([before][indent-before], [after][indent-after]) > - (Minor) Add vertical margin to search page inputs so they look better when wrapped > > [snippet-before]: https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/invoke/MethodHandle.html#asSpreader(int,java.lang.Class,int) > [snippet-after]: https://cr.openjdk.org/~hannesw/8352151/api.00/java.base/java/lang/invoke/MethodHandle.html#asSpreader(int,java.lang.Class,int) > > [target-before]: https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/Thread.Builder.html#start(java.lang.Runnable) > [target-after]: https://cr.openjdk.org/~hannesw/8352151/api.00/java.base/java/lang/Thread.Builder.html#start(java.lang.Runnable) > > [indent-before]: https://download.java.net/java/early_access/jdk25/docs/api/help-doc.html > [indent-after]: https://cr.openjdk.org/~hannesw/8352151/api.00/help-doc.html > > The sidebar highlighting script actually became simpler, which is great. The snippet copy button change is a bit more involved, because I had to change snippet layout to not overlay snippet content with the copy button, and make the button opaque. But the result is better than what we had before IMO. The other changes are simple one-liners. The js part looks good. Not too sure about the CSS, @nizarbenalla might check too. The rendered effects look good. ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24083#pullrequestreview-2704748162 From liach at openjdk.org Fri Mar 21 05:20:10 2025 From: liach at openjdk.org (Chen Liang) Date: Fri, 21 Mar 2025 05:20:10 GMT Subject: RFR: 8352511: Show additional level of headings in table of contents [v2] In-Reply-To: References: Message-ID: On Fri, 21 Mar 2025 03:12:39 GMT, Hannes Walln?fer wrote: >> Please review a patch to show an additional level of headings in the table of contents for module, package and class descriptions. Previously only `

          ` headings were shown in the table of contents, now we also show `

          ` level headings. >> >> The `TableOfContents` class no longer provides `pushNestedList`/`popNestedList` methods that require us to manually manage nesting level. Instead, the method to add a TOC entry gets an additional `level` parameter with an enum type to specify the nesting level (`FIRST`, `SECOND`, `THIRD`). The class will then configure the list to the desired nesting level before adding the entry. Of course this works with both tradidtional and Markdown doc comments and has tests for both. >> >> There are not too many API elements in JDK that use `

          ` level headings, but those that do benefit a lot from this change. A few examples: >> >> - [package java.util.stream](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/util/stream/package-summary.html) >> - [package java.lang.classfile](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/lang/classfile/package-summary.html) >> - [package java.lang.invoke](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/lang/invoke/package-summary.html) >> - [package java.lang.module](https://cr.openjdk.org/~hannesw/8352511/api.00/java.base/java/lang/module/package-summary.html) >> >> This PR depends on #24083 not for technical reasons but because that PR fixes the rendering of the third level of TOC entries. > > Hannes Walln?fer has updated the pull request incrementally with two additional commits since the last revision: > > - Update copyright headers > - Update ListBuilder Looks good. Since the removal of old push/pop will cause compile errors, I assume you have updated all legacy sites. ------------- Marked as reviewed by liach (Reviewer). PR Review: https://git.openjdk.org/jdk/pull/24137#pullrequestreview-2704760704 From hannesw at openjdk.org Fri Mar 21 05:59:15 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Fri, 21 Mar 2025 05:59:15 GMT Subject: RFR: 8352511: Show additional level of headings in table of contents [v2] In-Reply-To: References: Message-ID: On Fri, 21 Mar 2025 05:17:58 GMT, Chen Liang wrote: > Looks good. Since the removal of old push/pop will cause compile errors, I assume you have updated all legacy sites. This is an internal API that was created specifically for this use and isn't used anywhere else, so we should be fine. ------------- PR Comment: https://git.openjdk.org/jdk/pull/24137#issuecomment-2742387724 From hannesw at openjdk.org Fri Mar 21 06:10:12 2025 From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=) Date: Fri, 21 Mar 2025 06:10:12 GMT Subject: RFR: 8352389: Remove incidental whitespace in pre/code content [v3] In-Reply-To: References: <_nIhYXPaNlvsFHzHejW-nHWfSubHnTRN2OqLqbyOj00=.e3f2b677-512f-413c-b26d-7996275a986d@github.com> Message-ID: On Thu, 20 Mar 2025 07:27:39 GMT, Hannes Walln?fer wrote: >> Please review a change to remove incidental whitespace commonly found at the beginning of combined `pre` and `code` tags. >> >> In a nutshell, using `
          \n` or `
          {@code\n` at the beginning of preformatted code adds an extra empty line at the beginning of the content, compared to just using `
          \n`. This is due to [HTML syntax rules](https://html.spec.whatwg.org/#the-pre-element:the-pre-element) and needlessly complicates use of these tags in doc comments. 
          >> 
          >> This change does the minimum necessary to remove the leading line break. What makes the task slightly more complicated is that we also have to remove any horizontal whitespace between `pre` and `code` tags as these would otherwise add indentation to the first line of actual pre content.
          >> 
          >> This is implemented by parsing content of `
          ` elements into a separate list buffer in `DocCommentParser`, and filtering the content when we encounter the `
          ` close tag. This approach allows us to keep the logic in a single `normalizePreContent` method instead of spreading it in various existing places of `DocCommentParser`. The method uses a `DocTreeVisitor` in combination with a `State` enum to make sure pre content is only modified if all conditions are met (which involves inspecting up to the first three DocTrees). >> >> Normalization is also performed in `
          {@literal\n`. Although `{@literal}` by itself does not cause the problem described above as it does not produce an HTML tag, any horizontal whitespace between `
          ` and `{@literal` will cause the problem, so we err on the side of caution.
          >
          > Hannes Walln?fer has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains 14 commits:
          > 
          >  - Merge branch 'master' into JDK-8352389
          >  - Improve test
          >  - Add comment
          >  - 8352389: Remove incidental whitespace in pre/code content
          >  - Whitespace normalization in PrettyCheck becomes simpler
          >  - Rename method
          >  - Update comment
          >  - Clean up code, add comments, tests and @bug id
          >  - Updated copyright year in testSourceTab breaks test
          >  - Update remaining doctree tests & copyright headers
          >  - ... and 4 more: https://git.openjdk.org/jdk/compare/fb210e3a...5ec3bc04
          
          Note: Github shows 14 commits for this PR, but the first 10 belong to #24032, on which this PR depended and which has already been integrated. Only the last 4 commits actually belong to this PR.
          
          -------------
          
          PR Comment: https://git.openjdk.org/jdk/pull/24112#issuecomment-2742416198
          
          From nbenalla at openjdk.org  Fri Mar 21 11:31:07 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Fri, 21 Mar 2025 11:31:07 GMT
          Subject: RFR: 8352151: Fix display issues in javadoc-generated docs
          In-Reply-To: 
          References: 
          Message-ID: 
          
          On Mon, 17 Mar 2025 16:06:58 GMT, Hannes Walln?fer  wrote:
          
          > Please review a patch to fix a number of display bugs in javadoc-generated documentation.
          > 
          >  -  Snippet copy button is transparent and can overlap with snippet content ([before][snippet-before], [after][snippet-after])
          >  - After clicking on the second-to-last item in the sidebar, the last item is highlighted if the click triggers scrolling to the end of the page ([before][target-before], [after][target-after])
          >  - No indentation on sidebar entries beyond the first two levels of hierarchy ([before][indent-before], [after][indent-after])
          >  - (Minor) Add vertical margin to search page inputs so they look better when wrapped
          > 
          > [snippet-before]: https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/invoke/MethodHandle.html#asSpreader(int,java.lang.Class,int)
          > [snippet-after]: https://cr.openjdk.org/~hannesw/8352151/api.00/java.base/java/lang/invoke/MethodHandle.html#asSpreader(int,java.lang.Class,int)
          > 
          > [target-before]: https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/Thread.Builder.html#start(java.lang.Runnable)
          > [target-after]: https://cr.openjdk.org/~hannesw/8352151/api.00/java.base/java/lang/Thread.Builder.html#start(java.lang.Runnable)
          > 
          > [indent-before]: https://download.java.net/java/early_access/jdk25/docs/api/help-doc.html
          > [indent-after]: https://cr.openjdk.org/~hannesw/8352151/api.00/help-doc.html
          > 
          > The sidebar highlighting script actually became simpler, which is great. The snippet copy button change is a bit more involved, because I had to change snippet layout to not overlay snippet content with the copy button, and make the button opaque. But the result is better than what we had before IMO. The other changes are simple one-liners.
          
          Looks good.
          
          -------------
          
          Marked as reviewed by nbenalla (Committer).
          
          PR Review: https://git.openjdk.org/jdk/pull/24083#pullrequestreview-2705599810
          
          From hannesw at openjdk.org  Fri Mar 21 11:53:28 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Fri, 21 Mar 2025 11:53:28 GMT
          Subject: Integrated: 8352151: Fix display issues in javadoc-generated docs
          In-Reply-To: 
          References: 
          Message-ID: 
          
          On Mon, 17 Mar 2025 16:06:58 GMT, Hannes Walln?fer  wrote:
          
          > Please review a patch to fix a number of display bugs in javadoc-generated documentation.
          > 
          >  -  Snippet copy button is transparent and can overlap with snippet content ([before][snippet-before], [after][snippet-after])
          >  - After clicking on the second-to-last item in the sidebar, the last item is highlighted if the click triggers scrolling to the end of the page ([before][target-before], [after][target-after])
          >  - No indentation on sidebar entries beyond the first two levels of hierarchy ([before][indent-before], [after][indent-after])
          >  - (Minor) Add vertical margin to search page inputs so they look better when wrapped
          > 
          > [snippet-before]: https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/invoke/MethodHandle.html#asSpreader(int,java.lang.Class,int)
          > [snippet-after]: https://cr.openjdk.org/~hannesw/8352151/api.00/java.base/java/lang/invoke/MethodHandle.html#asSpreader(int,java.lang.Class,int)
          > 
          > [target-before]: https://download.java.net/java/early_access/jdk25/docs/api/java.base/java/lang/Thread.Builder.html#start(java.lang.Runnable)
          > [target-after]: https://cr.openjdk.org/~hannesw/8352151/api.00/java.base/java/lang/Thread.Builder.html#start(java.lang.Runnable)
          > 
          > [indent-before]: https://download.java.net/java/early_access/jdk25/docs/api/help-doc.html
          > [indent-after]: https://cr.openjdk.org/~hannesw/8352151/api.00/help-doc.html
          > 
          > The sidebar highlighting script actually became simpler, which is great. The snippet copy button change is a bit more involved, because I had to change snippet layout to not overlay snippet content with the copy button, and make the button opaque. But the result is better than what we had before IMO. The other changes are simple one-liners.
          
          This pull request has now been integrated.
          
          Changeset: 28250f83
          Author:    Hannes Walln?fer 
          URL:       https://git.openjdk.org/jdk/commit/28250f83b728c9b3395d9c4858568a3603172b8a
          Stats:     95 lines in 2 files changed: 19 ins; 45 del; 31 mod
          
          8352151: Fix display issues in javadoc-generated docs
          
          Reviewed-by: liach, nbenalla
          
          -------------
          
          PR: https://git.openjdk.org/jdk/pull/24083
          
          From nbenalla at openjdk.org  Mon Mar 24 14:55:50 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Mon, 24 Mar 2025 14:55:50 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index
          Message-ID: 
          
          Please review this patch to fix an issue in the `tag-search-index.js` generation.
          
          The problem was in the `toJSON()` method of `IndexItem`. When adding the description, it's using `escapeQuotes(description)` which only escapes backslashes and quotes, but doesn't normalize whitespace.
          
          TIA
          
          -------------
          
          Commit messages:
           - fix bug related to line breaks in json
          
          Changes: https://git.openjdk.org/jdk/pull/24202/files
            Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24202&range=00
            Issue: https://bugs.openjdk.org/browse/JDK-8351332
            Stats: 85 lines in 2 files changed: 84 ins; 0 del; 1 mod
            Patch: https://git.openjdk.org/jdk/pull/24202.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24202/head:pull/24202
          
          PR: https://git.openjdk.org/jdk/pull/24202
          
          From liach at openjdk.org  Mon Mar 24 16:12:14 2025
          From: liach at openjdk.org (Chen Liang)
          Date: Mon, 24 Mar 2025 16:12:14 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index
          In-Reply-To: 
          References: 
          Message-ID: 
          
          On Mon, 24 Mar 2025 14:41:43 GMT, Nizar Benalla  wrote:
          
          > Please review this patch to fix an issue in the `tag-search-index.js` generation.
          > 
          > The problem was in the `toJSON()` method of `IndexItem`. When adding the description, it's using `escapeQuotes(description)` which only escapes backslashes and quotes, but doesn't normalize whitespace.
          > 
          > TIA
          
          src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexItem.java line 645:
          
          > 643:                 if (!description.isEmpty()) {
          > 644:                     String normalizedDescription = description.replaceAll("\\s+", " ");
          > 645:                     builder.append("d", escapeQuotes(normalizedDescription));
          
          Should we just handle all whitespaces in `escapeQuotes`?
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/24202#discussion_r2010492415
          
          From nbenalla at openjdk.org  Mon Mar 24 16:17:15 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Mon, 24 Mar 2025 16:17:15 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index
          In-Reply-To: 
          References: 
           
          Message-ID: 
          
          On Mon, 24 Mar 2025 16:09:20 GMT, Chen Liang  wrote:
          
          >> Please review this patch to fix an issue in the `tag-search-index.js` generation.
          >> 
          >> The problem was in the `toJSON()` method of `IndexItem`. When adding the description, it's using `escapeQuotes(description)` which only escapes backslashes and quotes, but doesn't normalize whitespace.
          >> 
          >> TIA
          >
          > src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexItem.java line 645:
          > 
          >> 643:                 if (!description.isEmpty()) {
          >> 644:                     String normalizedDescription = description.replaceAll("\\s+", " ");
          >> 645:                     builder.append("d", escapeQuotes(normalizedDescription));
          > 
          > Should we just handle all whitespaces in `escapeQuotes`?
          
          I thought about it but that may not be necessary because the other json keys (`l`, `h`, `u`) cannot have whitespace in them.
          
          I'm not opposed to handing whitespace in an `escapeQuotesAndWhitespace` method though.
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/24202#discussion_r2010502316
          
          From liach at openjdk.org  Mon Mar 24 16:42:14 2025
          From: liach at openjdk.org (Chen Liang)
          Date: Mon, 24 Mar 2025 16:42:14 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index
          In-Reply-To: 
          References: 
           
           
          Message-ID: 
          
          On Mon, 24 Mar 2025 16:14:54 GMT, Nizar Benalla  wrote:
          
          >> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/util/IndexItem.java line 645:
          >> 
          >>> 643:                 if (!description.isEmpty()) {
          >>> 644:                     String normalizedDescription = description.replaceAll("\\s+", " ");
          >>> 645:                     builder.append("d", escapeQuotes(normalizedDescription));
          >> 
          >> Should we just handle all whitespaces in `escapeQuotes`?
          >
          > I thought about it but that may not be necessary because the other json keys (`l`, `h`, `u`) cannot have whitespace in them.
          > 
          > I'm not opposed to handing whitespace in an `escapeQuotesAndWhitespace` method though.
          
          I think we should have one that escapes spaces and another that fails on spaces to replace the current escapeQuotes.
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/24202#discussion_r2010551795
          
          From nbenalla at openjdk.org  Mon Mar 24 17:16:07 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Mon, 24 Mar 2025 17:16:07 GMT
          Subject: RFR: 8352740: Introduce new factory method HtmlTree.IMG
          Message-ID: 
          
          Please review this small patch to add a new factory method `HtmlTree IMG(DocPath src, String alt)`, to provide a convenient way to reliably create valid tree nodes.
          
          Previously, all uses of `HtmlTag.IMG` followed a similar pattern :
          
          HtmlTree.of(HtmlTag.IMG)
                                  .put(HtmlAttr.SRC, docpath)
                                  .put(HtmlAttr.ALT, alt)
          
          
          However, it was easy to forget to add the required "alt" attribute. Those have been replaced by the new factory method.
          
          No tests are required as part of this change.
          
          TIA
          
          -------------
          
          Commit messages:
           - add new factory method HtmlTree IMG(DocPath src, String alt)
          
          Changes: https://git.openjdk.org/jdk/pull/24204/files
            Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24204&range=00
            Issue: https://bugs.openjdk.org/browse/JDK-8352740
            Stats: 29 lines in 4 files changed: 12 ins; 7 del; 10 mod
            Patch: https://git.openjdk.org/jdk/pull/24204.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24204/head:pull/24204
          
          PR: https://git.openjdk.org/jdk/pull/24204
          
          From liach at openjdk.org  Tue Mar 25 03:15:08 2025
          From: liach at openjdk.org (Chen Liang)
          Date: Tue, 25 Mar 2025 03:15:08 GMT
          Subject: RFR: 8350920: Allow inherited member summaries to be viewed inline
           [v2]
          In-Reply-To: 
          References: 
           
          Message-ID: 
          
          On Wed, 12 Mar 2025 16:25:42 GMT, Hannes Walln?fer  wrote:
          
          >> Please review an enhancement to allow switching between the traditional condensed footnote-style summary and the summary table format for inherited members (types, fields, methods and properties) that are inherited from included types. You can test the feature in [the doc bundle I uploaded][apidocs] or watch the short screencast below.
          >> 
          >> [apidocs]: https://cr.openjdk.org/~hannesw/8350920/api.00/java.base/module-summary.html
          >> 
          >> https://github.com/user-attachments/assets/0aaa1f8b-c18b-4922-b704-2b2cdc05ca79
          >> 
          >> I added two new protected methods to the `AbstractMemberWriter` class, `createInheritedSummaryTable` and `getInheritedSummaryId`. Otherwise this is mostly reusing existing functionality (we already had the feature to display the signature of an inherited method in the context of the current class).
          >> 
          >> The writers for non-inheritable members such as constructors or enum constants were simplified a bit by implementing formerly abstract methods in `AbstractMemberWriter` as concrete methods throwing `UnsupportedOperationException` so they don't have to be implemented as empty methods in these writers.
          >> 
          >> The UI to switch between member list presentations is implemented in `script.js.template`. If no summary list presentation is available (because the supertype is not part of the documentation bundle) nothing changes in the UI.
          >> 
          >> I added a `stripTags()` method to `Content` to return the plain text content with HTML tags stripped that could be used in a few other places. The patch also adds two new vector graphics files called right.svg and down.svg for the right and downwards pointing angle.
          >
          > Hannes Walln?fer has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains three commits:
          > 
          >  - Merge branch 'master' into JDK-8350920
          >  - Add svg files
          >  - 8350920: Allow inherited member summaries to be viewed inline
          
          src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/AbstractMemberWriter.java line 234:
          
          > 232:             // Omit TOC entries for inherited members unless there's a substantial number of own members.
          > 233:             if (!inheritedTocEntries.isEmpty() && ownMemberCount > 8 && inheritedSummaries > 0) {
          > 234:                 writer.tableOfContents.pushNestedList();
          
          We have removed this system for h3 tag support. Can you update this patch?
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/23967#discussion_r2011221005
          
          From liach at openjdk.org  Tue Mar 25 03:18:09 2025
          From: liach at openjdk.org (Chen Liang)
          Date: Tue, 25 Mar 2025 03:18:09 GMT
          Subject: RFR: 8352740: Introduce new factory method HtmlTree.IMG
          In-Reply-To: 
          References: 
          Message-ID: 
          
          On Mon, 24 Mar 2025 17:08:32 GMT, Nizar Benalla  wrote:
          
          > Please review this small patch to add a new factory method `HtmlTree IMG(DocPath src, String alt)`, to provide a convenient way to reliably create valid tree nodes.
          > 
          > Previously, all uses of `HtmlTag.IMG` followed a similar pattern :
          > 
          > HtmlTree.of(HtmlTag.IMG)
          >                         .put(HtmlAttr.SRC, docpath)
          >                         .put(HtmlAttr.ALT, alt)
          > 
          > 
          > However, it was easy to forget to add the required "alt" attribute. Those have been replaced by the new factory method.
          > 
          > No tests are required as part of this change.
          > 
          > TIA
          
          src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlTree.java line 1163:
          
          > 1161:      * {@return an HTML {@code IMG} element}
          > 1162:      */
          > 1163: 
          
          Suggestion:
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/24204#discussion_r2011223141
          
          From hannesw at openjdk.org  Tue Mar 25 04:35:19 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Tue, 25 Mar 2025 04:35:19 GMT
          Subject: RFR: 8350920: Allow inherited member summaries to be viewed inline
           [v3]
          In-Reply-To: 
          References: 
          Message-ID: 
          
          > Please review an enhancement to allow switching between the traditional condensed footnote-style summary and the summary table format for inherited members (types, fields, methods and properties) that are inherited from included types. You can test the feature in [the doc bundle I uploaded][apidocs] or watch the short screencast below.
          > 
          > [apidocs]: https://cr.openjdk.org/~hannesw/8350920/api.00/java.base/module-summary.html
          > 
          > https://github.com/user-attachments/assets/0aaa1f8b-c18b-4922-b704-2b2cdc05ca79
          > 
          > I added two new protected methods to the `AbstractMemberWriter` class, `createInheritedSummaryTable` and `getInheritedSummaryId`. Otherwise this is mostly reusing existing functionality (we already had the feature to display the signature of an inherited method in the context of the current class).
          > 
          > The writers for non-inheritable members such as constructors or enum constants were simplified a bit by implementing formerly abstract methods in `AbstractMemberWriter` as concrete methods throwing `UnsupportedOperationException` so they don't have to be implemented as empty methods in these writers.
          > 
          > The UI to switch between member list presentations is implemented in `script.js.template`. If no summary list presentation is available (because the supertype is not part of the documentation bundle) nothing changes in the UI.
          > 
          > I added a `stripTags()` method to `Content` to return the plain text content with HTML tags stripped that could be used in a few other places. The patch also adds two new vector graphics files called right.svg and down.svg for the right and downwards pointing angle.
          
          Hannes Walln?fer has updated the pull request with a new target base due to a merge or a rebase. The pull request now contains four commits:
          
           - Merge branch 'master' into JDK-8350920
           - Merge branch 'master' into JDK-8350920
           - Add svg files
           - 8350920: Allow inherited member summaries to be viewed inline
          
          -------------
          
          Changes: https://git.openjdk.org/jdk/pull/23967/files
            Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=23967&range=02
            Stats: 521 lines in 27 files changed: 409 ins; 55 del; 57 mod
            Patch: https://git.openjdk.org/jdk/pull/23967.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/23967/head:pull/23967
          
          PR: https://git.openjdk.org/jdk/pull/23967
          
          From nbenalla at openjdk.org  Tue Mar 25 10:06:18 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Tue, 25 Mar 2025 10:06:18 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index
          In-Reply-To: 
          References: 
           
           
           
          Message-ID: 
          
          On Mon, 24 Mar 2025 16:39:02 GMT, Chen Liang  wrote:
          
          >> I thought about it but that may not be necessary because the other json keys (`l`, `h`, `u`) cannot have whitespace in them.
          >> 
          >> I'm not opposed to handing whitespace in an `escapeQuotesAndWhitespace` method though.
          >
          > I think we should have one that escapes spaces and another that fails on spaces to replace the current escapeQuotes.
          
          Apologies. Whitespace is indeed allowed in certain keys, I thought that the Labels would mostly be references (links) but titles and headers are also included in the Index files.
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/24202#discussion_r2011745669
          
          From hannesw at openjdk.org  Tue Mar 25 10:53:18 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Tue, 25 Mar 2025 10:53:18 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index
          In-Reply-To: 
          References: 
           
           
           
           
          Message-ID: 
          
          On Tue, 25 Mar 2025 10:03:01 GMT, Nizar Benalla  wrote:
          
          >> I think we should have one that escapes spaces and another that fails on spaces to replace the current escapeQuotes.
          >
          > Apologies. Whitespace is indeed allowed in certain keys, I thought that the Labels would mostly be references (links) but titles and headers are also included in the Index files.
          
          One thing I noticed is that we have this kind of `"\\s+"` to `" "` whitespace normalization in other related places, notably in `IndexTaglet.java` and `SpecTaglet.java`. Would it make sense to unify the functionality somewhere there, and do it before passing the strings over to `IndexItem`?
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/24202#discussion_r2011827432
          
          From nbenalla at openjdk.org  Tue Mar 25 10:58:57 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Tue, 25 Mar 2025 10:58:57 GMT
          Subject: RFR: 8352740: Introduce new factory method HtmlTree.IMG [v2]
          In-Reply-To: 
          References: 
          Message-ID: 
          
          > Please review this small patch to add a new factory method `HtmlTree IMG(DocPath src, String alt)`, to provide a convenient way to reliably create valid tree nodes.
          > 
          > Previously, all uses of `HtmlTag.IMG` followed a similar pattern :
          > 
          > HtmlTree.of(HtmlTag.IMG)
          >                         .put(HtmlAttr.SRC, docpath)
          >                         .put(HtmlAttr.ALT, alt)
          > 
          > 
          > However, it was easy to forget to add the required "alt" attribute. Those have been replaced by the new factory method.
          > 
          > No tests are required as part of this change.
          > 
          > TIA
          
          Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          
            remove empty line
          
          -------------
          
          Changes:
            - all: https://git.openjdk.org/jdk/pull/24204/files
            - new: https://git.openjdk.org/jdk/pull/24204/files/a00aecc8..fe9a7a58
          
          Webrevs:
           - full: https://webrevs.openjdk.org/?repo=jdk&pr=24204&range=01
           - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24204&range=00-01
          
            Stats: 1 line in 1 file changed: 0 ins; 1 del; 0 mod
            Patch: https://git.openjdk.org/jdk/pull/24204.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24204/head:pull/24204
          
          PR: https://git.openjdk.org/jdk/pull/24204
          
          From hannesw at openjdk.org  Tue Mar 25 11:15:13 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Tue, 25 Mar 2025 11:15:13 GMT
          Subject: RFR: 8352740: Introduce new factory method HtmlTree.IMG [v2]
          In-Reply-To: 
          References: 
           
          Message-ID: <4Nqmu9sT6WXxFDusNPN6W50xL1dVAFF9ypw-GOQR3ng=.daaad9f7-af18-4b8f-ac94-00553cfbf69d@github.com>
          
          On Tue, 25 Mar 2025 10:58:57 GMT, Nizar Benalla  wrote:
          
          >> Please review this small patch to add a new factory method `HtmlTree IMG(DocPath src, String alt)`, to provide a convenient way to reliably create valid tree nodes.
          >> 
          >> Previously, all uses of `HtmlTag.IMG` followed a similar pattern :
          >> 
          >> HtmlTree.of(HtmlTag.IMG)
          >>                         .put(HtmlAttr.SRC, docpath)
          >>                         .put(HtmlAttr.ALT, alt)
          >> 
          >> 
          >> However, it was easy to forget to add the required "alt" attribute. Those have been replaced by the new factory method.
          >> 
          >> No tests are required as part of this change.
          >> 
          >> TIA
          >
          > Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   remove empty line
          
          src/jdk.javadoc/share/classes/jdk/javadoc/internal/html/HtmlTree.java line 1162:
          
          > 1160:     /**
          > 1161:      * {@return an HTML {@code IMG} element}
          > 1162:      */
          
          It would be nice to also document/mention `src` and `alt` parameters/atttributes.
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/24204#discussion_r2011868131
          
          From nbenalla at openjdk.org  Tue Mar 25 11:40:35 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Tue, 25 Mar 2025 11:40:35 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index [v2]
          In-Reply-To: 
          References: 
          Message-ID: 
          
          > Please review this patch to fix an issue in the `tag-search-index.js` generation.
          > 
          > The problem was in the `toJSON()` method of `IndexItem`. When adding the description, it's using `escapeQuotes(description)` which only escapes backslashes and quotes, but doesn't normalize whitespace.
          > 
          > TIA
          
          Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          
            move logic of normalizing whitespace to the common utils class
          
          -------------
          
          Changes:
            - all: https://git.openjdk.org/jdk/pull/24202/files
            - new: https://git.openjdk.org/jdk/pull/24202/files/a3ae59fe..3e040204
          
          Webrevs:
           - full: https://webrevs.openjdk.org/?repo=jdk&pr=24202&range=01
           - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24202&range=00-01
          
            Stats: 11 lines in 5 files changed: 4 ins; 1 del; 6 mod
            Patch: https://git.openjdk.org/jdk/pull/24202.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24202/head:pull/24202
          
          PR: https://git.openjdk.org/jdk/pull/24202
          
          From nbenalla at openjdk.org  Tue Mar 25 11:40:35 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Tue, 25 Mar 2025 11:40:35 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index [v2]
          In-Reply-To: 
          References: 
           
           
           
           
           
          Message-ID: <-Yrn8Ool93uB6-d3fUNgmwGRWCrlGYl1tq0oiI1mPgg=.b39a397d-259a-40fd-943d-a037e5fb6351@github.com>
          
          On Tue, 25 Mar 2025 10:50:19 GMT, Hannes Walln?fer  wrote:
          
          >> Apologies. Whitespace is indeed allowed in certain keys, I thought that the Labels would mostly be references (links) but titles and headers are also included in the Index files.
          >
          > One thing I noticed is that we have this kind of `"\\s+"` to `" "` whitespace normalization in other related places, notably in `IndexTaglet.java` and `SpecTaglet.java`. Would it make sense to unify the functionality somewhere there, and do it before passing the strings over to `IndexItem`?
          
          Updated in [3e04020](https://github.com/openjdk/jdk/pull/24202/commits/3e040204520084254fbed5d1e4245d13aa24cf42).
          I added a new method in `Utils.java` and replaced most uses of `.replaceAll("\\s+", " ")` with it.
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/24202#discussion_r2011906511
          
          From nbenalla at openjdk.org  Tue Mar 25 12:21:29 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Tue, 25 Mar 2025 12:21:29 GMT
          Subject: RFR: 8352740: Introduce new factory method HtmlTree.IMG [v3]
          In-Reply-To: 
          References: 
          Message-ID: <8wvVHnxFbMSz4a8cH-fuCkvuTYDrO5zIf0a1pCP9o3Q=.300db9f0-00ed-4826-8941-e80ba39ec759@github.com>
          
          > Please review this small patch to add a new factory method `HtmlTree IMG(DocPath src, String alt)`, to provide a convenient way to reliably create valid tree nodes.
          > 
          > Previously, all uses of `HtmlTag.IMG` followed a similar pattern :
          > 
          > HtmlTree.of(HtmlTag.IMG)
          >                         .put(HtmlAttr.SRC, docpath)
          >                         .put(HtmlAttr.ALT, alt)
          > 
          > 
          > However, it was easy to forget to add the required "alt" attribute. Those have been replaced by the new factory method.
          > 
          > No tests are required as part of this change.
          > 
          > TIA
          
          Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          
            feedback: document params of the factory method.
          
          -------------
          
          Changes:
            - all: https://git.openjdk.org/jdk/pull/24204/files
            - new: https://git.openjdk.org/jdk/pull/24204/files/fe9a7a58..383a4558
          
          Webrevs:
           - full: https://webrevs.openjdk.org/?repo=jdk&pr=24204&range=02
           - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24204&range=01-02
          
            Stats: 3 lines in 1 file changed: 3 ins; 0 del; 0 mod
            Patch: https://git.openjdk.org/jdk/pull/24204.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24204/head:pull/24204
          
          PR: https://git.openjdk.org/jdk/pull/24204
          
          From liach at openjdk.org  Tue Mar 25 13:32:27 2025
          From: liach at openjdk.org (Chen Liang)
          Date: Tue, 25 Mar 2025 13:32:27 GMT
          Subject: RFR: 8352740: Introduce new factory method HtmlTree.IMG [v3]
          In-Reply-To: <8wvVHnxFbMSz4a8cH-fuCkvuTYDrO5zIf0a1pCP9o3Q=.300db9f0-00ed-4826-8941-e80ba39ec759@github.com>
          References: 
           <8wvVHnxFbMSz4a8cH-fuCkvuTYDrO5zIf0a1pCP9o3Q=.300db9f0-00ed-4826-8941-e80ba39ec759@github.com>
          Message-ID: 
          
          On Tue, 25 Mar 2025 12:21:29 GMT, Nizar Benalla  wrote:
          
          >> Please review this small patch to add a new factory method `HtmlTree IMG(DocPath src, String alt)`, to provide a convenient way to reliably create valid tree nodes.
          >> 
          >> Previously, all uses of `HtmlTag.IMG` followed a similar pattern :
          >> 
          >> HtmlTree.of(HtmlTag.IMG)
          >>                         .put(HtmlAttr.SRC, docpath)
          >>                         .put(HtmlAttr.ALT, alt)
          >> 
          >> 
          >> However, it was easy to forget to add the required "alt" attribute. Those have been replaced by the new factory method.
          >> 
          >> No tests are required as part of this change.
          >> 
          >> TIA
          >
          > Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   feedback: document params of the factory method.
          
          Marked as reviewed by liach (Reviewer).
          
          -------------
          
          PR Review: https://git.openjdk.org/jdk/pull/24204#pullrequestreview-2713767601
          
          From hannesw at openjdk.org  Tue Mar 25 14:21:28 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Tue, 25 Mar 2025 14:21:28 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index [v2]
          In-Reply-To: 
          References: 
           
          Message-ID: 
          
          On Tue, 25 Mar 2025 11:40:35 GMT, Nizar Benalla  wrote:
          
          >> Please review this patch to fix an issue in the `tag-search-index.js` generation.
          >> 
          >> The problem was in the `toJSON()` method of `IndexItem`. When adding the description, it's using `escapeQuotes(description)` which only escapes backslashes and quotes, but doesn't normalize whitespace.
          >> 
          >> TIA
          >
          > Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   move logic of normalizing whitespace to the common utils class
          
          Looks good to me. A doc comment on the new utils method would be nice.
          
          -------------
          
          Marked as reviewed by hannesw (Reviewer).
          
          PR Review: https://git.openjdk.org/jdk/pull/24202#pullrequestreview-2713954463
          
          From jjg at openjdk.org  Tue Mar 25 18:44:16 2025
          From: jjg at openjdk.org (Jonathan Gibbons)
          Date: Tue, 25 Mar 2025 18:44:16 GMT
          Subject: RFR: 8352740: Introduce new factory method HtmlTree.IMG [v3]
          In-Reply-To: <8wvVHnxFbMSz4a8cH-fuCkvuTYDrO5zIf0a1pCP9o3Q=.300db9f0-00ed-4826-8941-e80ba39ec759@github.com>
          References: 
           <8wvVHnxFbMSz4a8cH-fuCkvuTYDrO5zIf0a1pCP9o3Q=.300db9f0-00ed-4826-8941-e80ba39ec759@github.com>
          Message-ID: <6U1UQernp9rCxb17dUPFZUkLn4i7pUV17A5Oj_M6FBs=.1d578ba6-b944-405c-8f6b-fb852e4bbea9@github.com>
          
          On Tue, 25 Mar 2025 12:21:29 GMT, Nizar Benalla  wrote:
          
          >> Please review this small patch to add a new factory method `HtmlTree IMG(DocPath src, String alt)`, to provide a convenient way to reliably create valid tree nodes.
          >> 
          >> Previously, all uses of `HtmlTag.IMG` followed a similar pattern :
          >> 
          >> HtmlTree.of(HtmlTag.IMG)
          >>                         .put(HtmlAttr.SRC, docpath)
          >>                         .put(HtmlAttr.ALT, alt)
          >> 
          >> 
          >> However, it was easy to forget to add the required "alt" attribute. Those have been replaced by the new factory method.
          >> 
          >> No tests are required as part of this change.
          >> 
          >> TIA
          >
          > Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   feedback: document params of the factory method.
          
          Marked as reviewed by jjg (Reviewer).
          
          src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SnippetTaglet.java line 199:
          
          > 197:                         .add(HtmlTree.IMG(pathToRoot.resolve(DocPaths.RESOURCE_FILES)
          > 198:                                         .resolve(DocPaths.CLIPBOARD_SVG),
          > 199:                                 copySnippetText))
          
          Not for this PR, but another tiny cleanup would be to add an overload to `DocPaths.resolve` that takes multiple arguments to be applied (resolve'd) sequentially
          
          -------------
          
          PR Review: https://git.openjdk.org/jdk/pull/24204#pullrequestreview-2714844251
          PR Review Comment: https://git.openjdk.org/jdk/pull/24204#discussion_r2012734109
          
          From liach at openjdk.org  Tue Mar 25 19:08:07 2025
          From: liach at openjdk.org (Chen Liang)
          Date: Tue, 25 Mar 2025 19:08:07 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index [v2]
          In-Reply-To: 
          References: 
           
          Message-ID: 
          
          On Tue, 25 Mar 2025 11:40:35 GMT, Nizar Benalla  wrote:
          
          >> Please review this patch to fix an issue in the `tag-search-index.js` generation.
          >> 
          >> The problem was in the `toJSON()` method of `IndexItem`. When adding the description, it's using `escapeQuotes(description)` which only escapes backslashes and quotes, but doesn't normalize whitespace.
          >> 
          >> TIA
          >
          > Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   move logic of normalizing whitespace to the common utils class
          
          Marked as reviewed by liach (Reviewer).
          
          -------------
          
          PR Review: https://git.openjdk.org/jdk/pull/24202#pullrequestreview-2714896925
          
          From nbenalla at openjdk.org  Wed Mar 26 12:48:16 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Wed, 26 Mar 2025 12:48:16 GMT
          Subject: RFR: 8352740: Introduce new factory method HtmlTree.IMG [v3]
          In-Reply-To: <6U1UQernp9rCxb17dUPFZUkLn4i7pUV17A5Oj_M6FBs=.1d578ba6-b944-405c-8f6b-fb852e4bbea9@github.com>
          References: 
           <8wvVHnxFbMSz4a8cH-fuCkvuTYDrO5zIf0a1pCP9o3Q=.300db9f0-00ed-4826-8941-e80ba39ec759@github.com>
           <6U1UQernp9rCxb17dUPFZUkLn4i7pUV17A5Oj_M6FBs=.1d578ba6-b944-405c-8f6b-fb852e4bbea9@github.com>
          Message-ID: 
          
          On Tue, 25 Mar 2025 18:39:03 GMT, Jonathan Gibbons  wrote:
          
          >> Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          >> 
          >>   feedback: document params of the factory method.
          >
          > src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/taglets/SnippetTaglet.java line 199:
          > 
          >> 197:                         .add(HtmlTree.IMG(pathToRoot.resolve(DocPaths.RESOURCE_FILES)
          >> 198:                                         .resolve(DocPaths.CLIPBOARD_SVG),
          >> 199:                                 copySnippetText))
          > 
          > Not for this PR, but another tiny cleanup would be to add an overload to `DocPaths.resolve` that takes multiple arguments to be applied (resolve'd) sequentially
          
          Thanks Jon, a quick grep shows 9 places where we call `resolve` multiple times in a single statement.
          
          -------------
          
          PR Review Comment: https://git.openjdk.org/jdk/pull/24204#discussion_r2014067199
          
          From nbenalla at openjdk.org  Wed Mar 26 12:48:14 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Wed, 26 Mar 2025 12:48:14 GMT
          Subject: RFR: 8352740: Introduce new factory method HtmlTree.IMG [v3]
          In-Reply-To: <8wvVHnxFbMSz4a8cH-fuCkvuTYDrO5zIf0a1pCP9o3Q=.300db9f0-00ed-4826-8941-e80ba39ec759@github.com>
          References: 
           <8wvVHnxFbMSz4a8cH-fuCkvuTYDrO5zIf0a1pCP9o3Q=.300db9f0-00ed-4826-8941-e80ba39ec759@github.com>
          Message-ID: 
          
          On Tue, 25 Mar 2025 12:21:29 GMT, Nizar Benalla  wrote:
          
          >> Please review this small patch to add a new factory method `HtmlTree IMG(DocPath src, String alt)`, to provide a convenient way to reliably create valid tree nodes.
          >> 
          >> Previously, all uses of `HtmlTag.IMG` followed a similar pattern :
          >> 
          >> HtmlTree.of(HtmlTag.IMG)
          >>                         .put(HtmlAttr.SRC, docpath)
          >>                         .put(HtmlAttr.ALT, alt)
          >> 
          >> 
          >> However, it was easy to forget to add the required "alt" attribute. Those have been replaced by the new factory method.
          >> 
          >> No tests are required as part of this change.
          >> 
          >> TIA
          >
          > Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   feedback: document params of the factory method.
          
          Thanks for the review!
          
          -------------
          
          PR Comment: https://git.openjdk.org/jdk/pull/24204#issuecomment-2754281577
          
          From nbenalla at openjdk.org  Wed Mar 26 12:48:17 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Wed, 26 Mar 2025 12:48:17 GMT
          Subject: Integrated: 8352740: Introduce new factory method HtmlTree.IMG
          In-Reply-To: 
          References: 
          Message-ID: 
          
          On Mon, 24 Mar 2025 17:08:32 GMT, Nizar Benalla  wrote:
          
          > Please review this small patch to add a new factory method `HtmlTree IMG(DocPath src, String alt)`, to provide a convenient way to reliably create valid tree nodes.
          > 
          > Previously, all uses of `HtmlTag.IMG` followed a similar pattern :
          > 
          > HtmlTree.of(HtmlTag.IMG)
          >                         .put(HtmlAttr.SRC, docpath)
          >                         .put(HtmlAttr.ALT, alt)
          > 
          > 
          > However, it was easy to forget to add the required "alt" attribute. Those have been replaced by the new factory method.
          > 
          > No tests are required as part of this change.
          > 
          > TIA
          
          This pull request has now been integrated.
          
          Changeset: c14bbea9
          Author:    Nizar Benalla 
          URL:       https://git.openjdk.org/jdk/commit/c14bbea93e6701719b934dbd1711d26a91b50d7d
          Stats:     31 lines in 4 files changed: 14 ins; 7 del; 10 mod
          
          8352740: Introduce new factory method HtmlTree.IMG
          
          Reviewed-by: liach, jjg
          
          -------------
          
          PR: https://git.openjdk.org/jdk/pull/24204
          
          From nbenalla at openjdk.org  Wed Mar 26 13:04:06 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Wed, 26 Mar 2025 13:04:06 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index [v3]
          In-Reply-To: 
          References: 
          Message-ID: 
          
          > Please review this patch to fix an issue in the `tag-search-index.js` generation.
          > 
          > The problem was in the `toJSON()` method of `IndexItem`. When adding the description, it's using `escapeQuotes(description)` which only escapes backslashes and quotes, but doesn't normalize whitespace.
          > 
          > TIA
          
          Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          
            feedback: add javadoc to `normalizeWhitespace`
          
          -------------
          
          Changes:
            - all: https://git.openjdk.org/jdk/pull/24202/files
            - new: https://git.openjdk.org/jdk/pull/24202/files/3e040204..6942c9da
          
          Webrevs:
           - full: https://webrevs.openjdk.org/?repo=jdk&pr=24202&range=02
           - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24202&range=01-02
          
            Stats: 5 lines in 1 file changed: 5 ins; 0 del; 0 mod
            Patch: https://git.openjdk.org/jdk/pull/24202.diff
            Fetch: git fetch https://git.openjdk.org/jdk.git pull/24202/head:pull/24202
          
          PR: https://git.openjdk.org/jdk/pull/24202
          
          From hannesw at openjdk.org  Wed Mar 26 13:04:07 2025
          From: hannesw at openjdk.org (Hannes =?UTF-8?B?V2FsbG7DtmZlcg==?=)
          Date: Wed, 26 Mar 2025 13:04:07 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index [v3]
          In-Reply-To: 
          References: 
           
          Message-ID: 
          
          On Wed, 26 Mar 2025 13:00:43 GMT, Nizar Benalla  wrote:
          
          >> Please review this patch to fix an issue in the `tag-search-index.js` generation.
          >> 
          >> The problem was in the `toJSON()` method of `IndexItem`. When adding the description, it's using `escapeQuotes(description)` which only escapes backslashes and quotes, but doesn't normalize whitespace.
          >> 
          >> TIA
          >
          > Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   feedback: add javadoc to `normalizeWhitespace`
          
          Marked as reviewed by hannesw (Reviewer).
          
          -------------
          
          PR Review: https://git.openjdk.org/jdk/pull/24202#pullrequestreview-2717067178
          
          From nbenalla at openjdk.org  Wed Mar 26 13:04:10 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Wed, 26 Mar 2025 13:04:10 GMT
          Subject: RFR: 8351332: Line breaks in search tag descriptions corrupt JSON
           search index [v2]
          In-Reply-To: 
          References: 
           
          Message-ID: 
          
          On Tue, 25 Mar 2025 11:40:35 GMT, Nizar Benalla  wrote:
          
          >> Please review this patch to fix an issue in the `tag-search-index.js` generation.
          >> 
          >> The problem was in the `toJSON()` method of `IndexItem`. When adding the description, it's using `escapeQuotes(description)` which only escapes backslashes and quotes, but doesn't normalize whitespace.
          >> 
          >> TIA
          >
          > Nizar Benalla has updated the pull request incrementally with one additional commit since the last revision:
          > 
          >   move logic of normalizing whitespace to the common utils class
          
          I've made a small update to add javadoc to the new method.
          
          Thanks for reviewing, Chen and Hannes.
          
          -------------
          
          PR Comment: https://git.openjdk.org/jdk/pull/24202#issuecomment-2754308332
          PR Comment: https://git.openjdk.org/jdk/pull/24202#issuecomment-2754318069
          
          From nbenalla at openjdk.org  Wed Mar 26 13:04:12 2025
          From: nbenalla at openjdk.org (Nizar Benalla)
          Date: Wed, 26 Mar 2025 13:04:12 GMT
          Subject: Integrated: 8351332: Line breaks in search tag descriptions corrupt
           JSON search index
          In-Reply-To: 
          References: 
          Message-ID: 
          
          On Mon, 24 Mar 2025 14:41:43 GMT, Nizar Benalla  wrote:
          
          > Please review this patch to fix an issue in the `tag-search-index.js` generation.
          > 
          > The problem was in the `toJSON()` method of `IndexItem`. When adding the description, it's using `escapeQuotes(description)` which only escapes backslashes and quotes, but doesn't normalize whitespace.
          > 
          > TIA
          
          This pull request has now been integrated.
          
          Changeset: e2a461bd
          Author:    Nizar Benalla 
          URL:       https://git.openjdk.org/jdk/commit/e2a461bddeade1666fe15fb17cba8c9f4c5e7dab
          Stats:     97 lines in 5 files changed: 92 ins; 0 del; 5 mod
          
          8351332: Line breaks in search tag descriptions corrupt JSON search index
          
          Reviewed-by: hannesw, liach
          
          -------------
          
          PR: https://git.openjdk.org/jdk/pull/24202