RFR: 8012675: Javadoc for javax.swing.text.html.parser.Parser.handleComment() needs to be updated [v3]

Phil Race prr at openjdk.java.net
Tue May 31 20:06:43 UTC 2022


On Wed, 25 May 2022 19:11:47 GMT, Damon Nguyen <dnguyen at openjdk.org> wrote:

>> Updated Parser class doc by appending to the doc regarding lack of support for HTML script tags. Adding this information to the "parse" function did not seem as consistent for formatting as adding it to the Parser class doc.
>
> Damon Nguyen has updated the pull request incrementally with three additional commits since the last revision:
> 
>  - Updated java doc for clarity. Added test to show behavior.
>  - Merge branch '8012675/htmlTagParserDocChange' of github.com:DamonGuy/jdk into 8012675/htmlTagParserDocChange
>  - Added debugging statements to better trace handleComments

src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java line 73:

> 71:  * <p>
> 72:  * Unsupported tags, such as script tags, will be handled by HiddenTagView. The
> 73:  * tags and its contents will be displayed as editable JTextFields and JTextAreas.

HiddenTagView is a JDK internal class.
It doesn't appear anywhere in the specification of Java SE.
So, whatever it is you need to say, can't be written like this.

Also I am not sure that the PARSER has any say in the display does it ? It just hands it off to something else to decide what to do .. doesn't it ? So can it be correct to mention JTextField here ?

Furthermore, the mention of "editable" is pertinent.
I think (haven't verified) that if you are viewing a document then comments etc are hidden, but when editing it, they are visible, and that is when handleComment() matters.


Perhaps you want
Unsupported tags, such as script tags,  will be treated similarly to comments and so will be handled in the same way as these by the editor. For example it might be invisible when reviewing the document, and raw editable text when editing it.

You need to fact check my assumptions ..

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

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



More information about the client-libs-dev mailing list