Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8281670

javax.swing.JEditorPane is unclear on the handling of unsupported HTML script tags

XMLWordPrintable

    • Icon: CSR CSR
    • Resolution: Approved
    • Icon: P3 P3
    • 20
    • client-libs
    • None
    • low
    • doc only change
    • Java API
    • SE

      Summary

      Update HTMLEditorKit.HTMLFactory javadoc to state the handling of unknown and unsupported HTML tags.

      Problem

      JEditorPane can edit and view various content types including HTML. However it does not provide full HTML support and notably does not support scripting. The current docs have no information regarding the handling of any unsupported HTML tags.

      Solution

      HTMLEditorKit.HTMLFactory returns Views which perform the rendering for all the script tags. Append text to the javadoc for HTMLEditorKit.HTMLFactory to inform users of the handling of unknown and unsupported tags. Since other implementations might support these tags, make it an @implNote.

      Specification

      Add the following text to the class javadoc of javax.swing.text.html.HTMLEditorKit.HTMLFactory

      +     *
      +     * @implNote
      +     * Parsed tags that are unrecognized or are recognized but unsupported are
      +     * handled differently by the editor.
      +     *
      +     * <ul>
      +     * <li>When the container is editable:
      +     *     <ul>
      +     *         <li>The tags will be displayed as editable text fields with the
      +     *         tag name.</li>
      +     *         <li>The content within the tags will be handled by the editor as
      +     *         regular text.</li>
      +     *     </ul>
      +     * </li>
      +     * <li>When the container is not editable:
      +     *     <ul>
      +     *         <li>If the tag is recognized but not supported, such as script tags,
      +     *         the tag and its contents will be hidden.</li>
      +     *         <li>If the tag is unknown, the tag will be hidden but its contents
      +     *         will display as regular text.</li>
      +     *     </ul>
      +     * </li>
      +     * </ul>
      

            dnguyen Damon Nguyen
            dmarkov Dmitry Markov
            Alexey Ivanov, Philip Race
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: