RFR: 8012675: Javadoc for javax.swing.text.html.parser.Parser.handleComment() needs to be updated [v3]
Damon Nguyen
dnguyen at openjdk.java.net
Wed May 25 19:17:41 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
I have re-opened this PR. I added a test to show script tag's current behavior that can be manually passed or failed.
I have confirmed that the unsupported tags are handled by HiddenTagView, which creates JTextFields for the unsupported tags and creates JTextAreas for the contents within the tags. This is what is being displayed when an unsupported tag is encountered, with script tags being one of them.
The parseScript method identifies the script tags and extracts its contents to a buffer. The chars in this buffer are then being used for handleComment. The parser uses this comment as the text to display in the JTextArea, and the tags are displayed in the JTextField with HiddenTagView. This is further confirmed when the handleComment line in parseContent is removed, the contents of the tag are no longer shown. This behavior is consistent regardless of the strict flag being true or false since that flag mainly deals with syntax and spacing issues.
As such, I believe this java doc update still needs to happen as I do not see this behavior documented anywhere. I believe it's better suited for the class's doc rather than specifically parse's doc.
-------------
PR: https://git.openjdk.java.net/jdk/pull/7446
More information about the client-libs-dev
mailing list