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

Rendering / caret errors with HTMLDocument

XMLWordPrintable

    • b38

        There is an inconsistency in HTMLDocument.

        code1 = {JEditorPane.setText("<p id='ab'>ab</p>c");} and
        code2 = {JEditorPane.setText("<p id='ab'>ab</p>"); HTMLDocument.insertAfterEnd(doc.getElement("ab"), "c");} produce the same HTML code, but not the same document structure. This results in different rendering.

        Also, with code2, when clicking behind the end of a line the caret is set one character earlier than expected. The content that is inserted using insertAfterEnd() doesn't make a difference. This behaviour is reproducible with text, paragraphs and images. Please find source code and steps to reproduce in the comments.

              dmarkov Dmitry Markov
              shadowbug Shadow Bug
              Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

                Created:
                Updated:
                Resolved: