--- old/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java 2020-01-07 15:24:13.000000000 +0100 +++ new/src/jdk.javadoc/share/classes/jdk/javadoc/internal/doclets/formats/html/markup/HtmlTree.java 2020-01-07 15:24:12.000000000 +0100 @@ -103,6 +103,17 @@ } /** + * Sets the "id" attribute for this tag. + * + * @param id the value for the id attribute + * @return this object + */ + public HtmlTree setId(String id) { + put(HtmlAttr.ID, id); + return this; + } + + /** * Sets the "title" attribute for this tag. * Any HTML tags in the content will be removed. * @@ -268,35 +279,6 @@ } /** - * Generates an HTML anchor tag with id attribute and a body. - * - * @param id id for the anchor tag - * @param body body for the anchor tag - * @return an HtmlTree object - */ - public static HtmlTree A_ID(String id, Content body) { - HtmlTree htmltree = new HtmlTree(HtmlTag.A); - htmltree.put(HtmlAttr.ID, nullCheck(id)); - htmltree.add(nullCheck(body)); - return htmltree; - } - - /** - * Generates an HTML anchor tag with a style class, id attribute and a body. - * - * @param styleClass stylesheet class for the tag - * @param id id for the anchor tag - * @param body body for the anchor tag - * @return an HtmlTree object - */ - public static HtmlTree A_ID(HtmlStyle styleClass, String id, Content body) { - HtmlTree htmltree = A_ID(id, body); - if (styleClass != null) - htmltree.setStyle(styleClass); - return htmltree; - } - - /** * Generates a CAPTION tag with some content. * * @param body content for the tag @@ -733,6 +715,19 @@ } /** + * Generates an SPAN tag with id attribute and a body. + * + * @param id id for the tag + * @param body body for the tag + * @return an HtmlTree object for the SPAN tag + */ + public static HtmlTree SPAN_ID(String id, Content body) { + HtmlTree htmltree = new HtmlTree(HtmlTag.SPAN, nullCheck(body)); + htmltree.put(HtmlAttr.ID, nullCheck(id)); + return htmltree; + } + + /** * Generates a SPAN tag with id and style class attributes. It also encloses * a content. * @@ -946,6 +941,8 @@ case SCRIPT : return ((hasAttr(HtmlAttr.TYPE) && hasAttr(HtmlAttr.SRC) && !hasContent()) || (hasAttr(HtmlAttr.TYPE) && hasContent())); + case SPAN : + return (hasAttr(HtmlAttr.ID) || hasContent()); default : return hasContent(); }