diff --git a/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java index b555f1e7f7fc19546822b89ec89f276ccde4aa13..3ccd20ca6d260cce95fee82c0ede9acfb8e71657 100644 --- a/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java +++ b/src/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 2003, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 2003, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -154,8 +154,8 @@ public class AnnotationTypeWriterImpl extends SubWriterHolderWriter div.addStyle(HtmlStyle.header); if (pkgname.length() > 0) { Content pkgNameContent = new StringContent(pkgname); - Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent); - div.addContent(pkgNamePara); + Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent); + div.addContent(pkgNameDiv); } LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER, annotationType, false); diff --git a/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java b/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java index 306331866d45330e7a4461e9b5765c80dfefd263..474a75ec08086cf9f9f59a000e72795eb10292de 100644 --- a/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java +++ b/src/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -161,8 +161,8 @@ public class ClassWriterImpl extends SubWriterHolderWriter div.addStyle(HtmlStyle.header); if (pkgname.length() > 0) { Content pkgNameContent = new StringContent(pkgname); - Content pkgNamePara = HtmlTree.P(HtmlStyle.subTitle, pkgNameContent); - div.addContent(pkgNamePara); + Content pkgNameDiv = HtmlTree.DIV(HtmlStyle.subTitle, pkgNameContent); + div.addContent(pkgNameDiv); } LinkInfoImpl linkInfo = new LinkInfoImpl( LinkInfoImpl.CONTEXT_CLASS_HEADER, classDoc, false); diff --git a/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java b/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java index ba6f921e61cdac0e689a3238f2198a37dfafc7ef..7bc17858762076489887a2a6a3a10ce69517d837 100644 --- a/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java +++ b/src/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1998, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1998, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -96,7 +96,7 @@ public class HelpWriter extends HtmlDocletWriter { Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false, HtmlStyle.title, getResource("doclet.Help_line_1")); Content div = HtmlTree.DIV(HtmlStyle.header, heading); - Content line2 = HtmlTree.P(HtmlStyle.subTitle, + Content line2 = HtmlTree.DIV(HtmlStyle.subTitle, getResource("doclet.Help_line_2")); div.addContent(line2); contentTree.addContent(div); diff --git a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java index 9529d025a482dabf55ac689a3f2986bd95bb2244..aad8d13595b7f468b3973a2626ae60b5c922301c 100644 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -163,10 +163,10 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter { */ protected void addOverviewHeader(Content body) { if (root.inlineTags().length > 0) { - HtmlTree p = new HtmlTree(HtmlTag.P); - p.addStyle(HtmlStyle.subTitle); - addSummaryComment(root, p); - Content div = HtmlTree.DIV(HtmlStyle.header, p); + HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV); + subTitleDiv.addStyle(HtmlStyle.subTitle); + addSummaryComment(root, subTitleDiv); + Content div = HtmlTree.DIV(HtmlStyle.header, subTitleDiv); Content see = seeLabel; see.addContent(" "); Content descPara = HtmlTree.P(see); @@ -188,10 +188,10 @@ public class PackageIndexWriter extends AbstractPackageIndexWriter { protected void addOverviewComment(Content htmltree) { if (root.inlineTags().length > 0) { htmltree.addContent(getMarkerAnchor("overview_description")); - HtmlTree p = new HtmlTree(HtmlTag.P); - p.addStyle(HtmlStyle.subTitle); - addInlineComment(root, p); - htmltree.addContent(p); + HtmlTree div = new HtmlTree(HtmlTag.DIV); + div.addStyle(HtmlStyle.subTitle); + addInlineComment(root, div); + htmltree.addContent(div); } } diff --git a/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java b/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java index d74d994d0394cbc61997e1cfa6f8687705ad500b..bd56ab5764fc533c0767bf8c636c1f976e1bc029 100644 --- a/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java +++ b/src/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java @@ -1,5 +1,5 @@ /* - * Copyright (c) 1997, 2010, Oracle and/or its affiliates. All rights reserved. + * Copyright (c) 1997, 2011, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it @@ -115,10 +115,10 @@ public class PackageWriterImpl extends HtmlDocletWriter tHeading.addContent(packageHead); div.addContent(tHeading); if (packageDoc.inlineTags().length > 0 && ! configuration.nocomment) { - HtmlTree p = new HtmlTree(HtmlTag.P); - p.addStyle(HtmlStyle.subTitle); - addSummaryComment(packageDoc, p); - div.addContent(p); + HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV); + subTitleDiv.addStyle(HtmlStyle.subTitle); + addSummaryComment(packageDoc, subTitleDiv); + div.addContent(subTitleDiv); Content space = getSpace(); Content descLink = getHyperLink("", "package_description", descriptionLabel, "", ""); diff --git a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css index 1f8fd6a2eaa25e7a9a7cb6992d428f9bd437ccaa..2552218754229726f78ca0cbd464bdda25311da4 100644 --- a/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css +++ b/src/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css @@ -183,8 +183,6 @@ Page header and footer styles .subTitle { margin:0; padding-top:10px; - font-size:0.75em; - font-weight:bold; } /* Page layout container styles diff --git a/test/com/sun/javadoc/testSubTitle/TestSubTitle.java b/test/com/sun/javadoc/testSubTitle/TestSubTitle.java new file mode 100644 index 0000000000000000000000000000000000000000..ddbf07a4a21629bb6355f68f3eba3e2eae09b2ca --- /dev/null +++ b/test/com/sun/javadoc/testSubTitle/TestSubTitle.java @@ -0,0 +1,83 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +/* + * @test + * @bug 7010342 + * @summary Test for correct sub title generation. + * @author Bhavesh Patel + * @library ../lib/ + * @build JavadocTester + * @build TestSubTitle + * @run main TestSubTitle + */ + +public class TestSubTitle extends JavadocTester { + + private static final String BUG_ID = "7010342"; + private static final String[][] TEST = { + {BUG_ID + FS + "pkg" + FS + "package-summary.html", + "
" + NL + "
pkg
" + } + }; + private static final String[] ARGS = new String[]{ + "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" + }; + + /** + * The entry point of the test. + * @param args the array of command line arguments. + */ + public static void main(String[] args) { + TestSubTitle tester = new TestSubTitle(); + run(tester, ARGS, TEST, NEG_TEST); + tester.printSummary(); + } + + /** + * {@inheritDoc} + */ + public String getBugId() { + return BUG_ID; + } + + /** + * {@inheritDoc} + */ + public String getBugName() { + return getClass().getName(); + } +} diff --git a/test/com/sun/javadoc/testSubTitle/pkg/C.java b/test/com/sun/javadoc/testSubTitle/pkg/C.java new file mode 100644 index 0000000000000000000000000000000000000000..d24a6e7b6335e26d60186da63aa0e3c472a951c2 --- /dev/null +++ b/test/com/sun/javadoc/testSubTitle/pkg/C.java @@ -0,0 +1,30 @@ +/* + * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved. + * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. + * + * This code is free software; you can redistribute it and/or modify it + * under the terms of the GNU General Public License version 2 only, as + * published by the Free Software Foundation. + * + * This code is distributed in the hope that it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + * version 2 for more details (a copy is included in the LICENSE file that + * accompanied this code). + * + * You should have received a copy of the GNU General Public License version + * 2 along with this work; if not, write to the Free Software Foundation, + * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. + * + * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA + * or visit www.oracle.com if you need additional information or have any + * questions. + */ + +package pkg; + +/** + * Source file for C + */ +public class C { +} diff --git a/test/com/sun/javadoc/testSubTitle/pkg/package.html b/test/com/sun/javadoc/testSubTitle/pkg/package.html new file mode 100644 index 0000000000000000000000000000000000000000..87866aa78897c1725f68e2dd1a9e40136fac8324 --- /dev/null +++ b/test/com/sun/javadoc/testSubTitle/pkg/package.html @@ -0,0 +1,8 @@ + + +