inconsistent key classes in MutableAttributeSet from html.parser

XMLWordPrintable

    • Type: Bug
    • Resolution: Duplicate
    • Priority: P4
    • None
    • Affects Version/s: 1.2.1
    • Component/s: client-libs



      Name: vi73552 Date: 05/04/99


      The MutableAttributeSet parameter passed to HTMLEditorKit.ParserCallback.handleStartTag() is inconsistent in what classes to use for AttributeSet key names. For example, when a HTML.Tag.FONT is passed to the handleStartTag() method, the color and size attribute keys in the MutableAttributeSet parameter are of type HTML.Attribute. However, the face attribute key is of type String, even though there is a HTML.Attribute.FACE.

      This inconsistency causes problems in 2 ways: programs either hard-code knowledge of the key types, and may break with each new release of the swing libraries; or suffer a performance hit by calling AttributeSet.getAttributeNames() and manipulating the enumerator to get the correct key class for the attribute you want.

      Also, one might expect the StyleConstants.get???(AttributeSet) methods to work on the MutableAttributeSet passed to the ParserCallback, but they don't -- they just return the defaults.

      Alternatively, documentation on what key types are used by the javax.swing.text.html.parser.ParserDelegator and it's ilk for tag attributes would have saved several hours to poking around.
      (Review ID: 57752)
      ======================================================================

            Assignee:
            Scott Violet (Inactive)
            Reporter:
            Vassili Igouchkine (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: