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

Damon Nguyen dnguyen at openjdk.org
Fri Jun 17 17:44:02 UTC 2022


On Fri, 17 Jun 2022 15:29:47 GMT, Alexey Ivanov <aivanov at openjdk.org> wrote:

>> Damon Nguyen has updated the pull request incrementally with one additional commit since the last revision:
>> 
>>   Fixed list format. Removed p.
>
> src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java line 1310:
> 
>> 1308:      * <li>When the container using HTML tags is editable:
>> 1309:      *     <ul>
>> 1310:      *         <li>Tags display the tag text as editable text fields.</li>
> 
> Suggestion:
> 
>      *         <li>The tags will be displayed as editable text fields with the tag name.</li>

Incorporated both of the suggested changes for clarification.

> src/java.desktop/share/classes/javax/swing/text/html/HTMLEditorKit.java line 1312:
> 
>> 1310:      *         <li>Tags display the tag text as editable text fields.</li>
>> 1311:      *         <li>The content within the tags will be handled by the editor as
>> 1312:      *         regular text.</li>
> 
> This is not how `<script>` is handled though: the content is displayed in a text field. The text in the unknown tag is displayed directly.
> 
> The content of `<script>` tag is handled as if it's a comment.
> <a href="https://urldefense.com/v3/__https://github.com/openjdk/jdk/blob/ae2504b4692a5298b5835727b04a44e1edc8a4d6/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java*L2176-L2177__;Iw!!ACWV5N9M2RV99hQ!PnVrjBcKvJKsl9fX2K3YCtM24LMYsgrkK8FME1loi_CnL-s9xVe-pJaoBehKau9VcSJb84q6JAKerMNBFZOPyeckCA$">https://github.com/openjdk/jdk/blob/ae2504b4692a5298b5835727b04a44e1edc8a4d6/src/java.desktop/share/classes/javax/swing/text/html/parser/Parser.java#L2176-L2177</a>

I tried to cover this in earlier commits where I differentiate known but unsupported tags, such as script tags, and completely unknown tags. In conversation and testing, HTMLEditorKit.HTMLFactory has a create method that creates HiddenTagViews for unknown tags and for a small list of tags (title, script, param, etc.). In the end, these are all treated the same, so I grouped script tags in this javadoc change. Script tags do have a special case in the Parser where it is handled as a comment but being handled as a comment doesn't change the behavior and still displays the content.

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

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



More information about the client-libs-dev mailing list