RFR: 8248566: Make API docs more usable on mobile browsers

Hannes Wallnoefer HANNES.WALLNOEFER at ORACLE.COM
Thu Jul 16 14:43:19 UTC 2020


Please review:

JBS: https://bugs.openjdk.java.net/browse/JDK-8248566
Webrev: http://cr.openjdk.java.net/~hannesw/8248566/webrev.01/
API docs: http://cr.openjdk.java.net/~hannesw/8248566/api.01/

This is by no means a complete solution to all problems of API docs on small browsers, but it is a first step to make the documentation more usable on mobile devices. You can test the API docs either on a desktop browser by reducing the size of your browser window, using a mobile device emulator in your browser’s web developer tools, or by simply viewing the docs on a tablet or phone browser.

This patch consists mostly of CSS media queries that apply when viewing documentation in smaller browsers or on smaller devices, using screen/browser width as criterion. The following adjustments are made:

 - Slightly reduce font sizes and paddings in navigation bar
 - Make search input narrower 
 - Reduce padding around main content area

There are also some changes to existing CSS rules. These should not affect layout in desktop browsers, their purpose is merely to allow the layout to shrink in a controlled way:

 - change main navigation bar height definition from fixed to minimum height (height -> min-height) to allow the navigation bar to grow when its content does not fit into a single line
- change the CSS rules for the about-language label and the main navigation links  in order to let them merge together when space gets tight. The order of main navigation links and about-language label is also reversed in HTML for the same reason.

There is also a HTML META tag added to every page that tells the browser that the document is aware of and responsive to small displays and does not need to be scaled down from a desktop size. 

The generated API docs use the verbose two-line draft language version. In order to be able to view the layout with the single line, no-draft version info I have uploaded the pages in java.util with that configuration:

http://cr.openjdk.java.net/~hannesw/8248566/api.01/java.base/java/util/package-summary.html

Let me know what you think and whether or not pages look ok on your devices.

Hannes



More information about the javadoc-dev mailing list