RFR: 8253117: Replace HTML tables in javadoc summaries with CSS grid elements [v3]

Jonathan Gibbons jjg at openjdk.java.net
Wed Oct 7 00:13:19 UTC 2020


On Mon, 28 Sep 2020 17:46:31 GMT, Hannes Wallnöfer <hannesw at openjdk.org> wrote:

>> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/ClassUseWriter.java line 147:
>> 
>>> 145:         methodSubWriter = new MethodWriterImpl(this);
>>> 146:         constrSubWriter = new ConstructorWriterImpl(this);
>>> 147:         constrSubWriter.setFoundNonPubConstructor(true);
>> 
>> is this related?  or was it a previous omission/oversight?
>
> Yes, it is related. Member tables in the class-use page generally have three columns, while the constructor tables used
> to have only two (no modifier column). This is to make sure the tables for constructors also consistently have three
> columns.   I have to admit I took the short path here by changing the number of columns displayed for constructor
> class-use tables, because keeping it at two columns would have required to override all or parts of the
> AbstractMemberWriter#addUseInfo method in ConstructorWriterImpl. I could still do that, but I didn't think it was worth
> the effort.   Would it be ok if I added a comment to explain the reason for the line added above?

Thanks for the info

>> src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/toolkit/resources/stylesheet.css line 416:
>> 
>>> 414:     display: grid;
>>> 415:     grid-template-columns: minmax(10%, max-content) minmax(10%, max-content) minmax(10%, max-content) minmax(10%,
>>> auto); 416: }
>> 
>> I like the minmax values and mostly like the effect on the generated docs ... although it is still slightly weird (to
>> me) that the column widths can change when switching tabs in the same table.
>
> I agree. I did try to make column width more uniform, but it is nearly impossible to do that while fitting all possible
> use cases. Content lengths vary very much even within the same type of summary table.

ok

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

PR: https://git.openjdk.java.net/jdk/pull/253


More information about the javadoc-dev mailing list