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

Rendering / caret errors with HTMLDocument

    Details

    • Subcomponent:
    • Resolved In Build:
      b38

      Backports

        Description

        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.

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  • Created:
                    Updated:
                    Resolved: