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

Unsupported <object> elements turn into red question marks with HTMLEditorKit

    Details

      Description

      A DESCRIPTION OF THE PROBLEM :
      When viewing an HTML document with HTMLEditorKit, if the page contains an <object> element with an unsupported classid, the element is turned into two red question marks "??". This is annoying because it prevents the usage of a fallback mechanism like this:

      <object data="duke.svg" type="image/svg+xml">
        <img src="duke.png">
      </object>

      In this case HTMLEditorKit properly renders the fallback image, but the question marks are still displayed.

      It's possible to work around this issue by specifying the class name of a Swing component in the classid attribute:

      <object data="duke.svg" type="image/svg+xml" classid="javax.swing.JLabel">
        <img src="duke.png">
      </object>

      This removes the question marks, but now the object won't load in a standard browser supporting SVG images.

      I'd suggest removing the red question marks, i.e. modify rgz getUnloadableRepresentation() method in javax.swing.text.html.ObjectView to return an empty JLabel.


      FREQUENCY : always


        Attachments

          Activity

            People

            • Assignee:
              bvaidya Balchandra Vaidya
              Reporter:
              webbuggrp Webbug Group
            • Votes:
              0 Vote for this issue
              Watchers:
              5 Start watching this issue

              Dates

              • Created:
                Updated: