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

Introduce new factory method HtmlTree.IMG

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Fixed
    • Icon: P4 P4
    • 25
    • 25
    • tools

      A review comment in JDK-8351881 suggested adding a new factory method HtmlTree.IMG to avoid running into future bugs where the "alt" attribute is missing for images.

      A certain pattern emerges when looking at uses of HtmlTag.IMG, we will clearly benefit from having a new static helper method.

      They all look very similar to the following:
      ```
      HtmlTree.of(HtmlTag.IMG)
                                      .put(HtmlAttr.SRC, pathToRoot.resolve(DocPaths.RESOURCE_FILES)
                                              .resolve(DocPaths.CLIPBOARD_SVG).getPath())
                                      .put(HtmlAttr.ALT, copyUrlText)
      ```

      No tests are required as part of this change, it has no impact on the JDK doc build at present.

            nbenalla Nizar Benalla
            nbenalla Nizar Benalla
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: