changeset 2994:0eb91327db5a jdk9-b61

Merge
author lana
date Fri, 17 Apr 2015 10:23:49 -0700
parents 35c897f16852 4348bf94591c
children a6ee059ed168 82672154f339
files test/tools/javac/varargs/T8049075/VarargsAndWildcardParameterizedTypeTest.java
diffstat 151 files changed, 6305 insertions(+), 773 deletions(-) [+]
line wrap: on
line diff
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/Checker.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -108,6 +108,7 @@
     public enum Flag {
         TABLE_HAS_CAPTION,
         HAS_ELEMENT,
+        HAS_HEADING,
         HAS_INLINE_TAG,
         HAS_TEXT,
         REPORTED_BAD_INLINE
@@ -282,6 +283,8 @@
         final HtmlTag t = HtmlTag.get(treeName);
         if (t == null) {
             env.messages.error(HTML, tree, "dc.tag.unknown", treeName);
+        } else if (t.allowedVersion != HtmlVersion.ALL && t.allowedVersion != env.htmlVersion) {
+            env.messages.error(HTML, tree, "dc.tag.not.supported", treeName);
         } else {
             boolean done = false;
             for (TagStackItem tsi: tagStack) {
@@ -345,6 +348,12 @@
                             parent.flags.add(Flag.TABLE_HAS_CAPTION);
                         break;
 
+                    case H1: case H2: case H3: case H4: case H5: case H6:
+                        if (parent != null && (parent.tag == HtmlTag.SECTION || parent.tag == HtmlTag.ARTICLE)) {
+                            parent.flags.add(Flag.HAS_HEADING);
+                        }
+                        break;
+
                     case IMG:
                         if (!top.attrs.contains(HtmlTag.Attr.ALT))
                             env.messages.error(ACCESSIBILITY, tree, "dc.no.alt.attr.for.image");
@@ -460,6 +469,14 @@
                                 env.messages.error(ACCESSIBILITY, tree,
                                         "dc.no.summary.or.caption.for.table");
                             }
+                            break;
+
+                        case SECTION:
+                        case ARTICLE:
+                            if (env.htmlVersion == HtmlVersion.HTML5 && !top.flags.contains(Flag.HAS_HEADING)) {
+                                env.messages.error(HTML, tree, "dc.tag.requires.heading", treeName);
+                            }
+                            break;
                     }
                     warnIfEmpty(top, tree);
                     tagStack.pop();
@@ -519,25 +536,21 @@
             Name name = tree.getName();
             HtmlTag.Attr attr = currTag.getAttr(name);
             if (attr != null) {
+                if (env.htmlVersion == HtmlVersion.HTML4 && attr.name().contains("-")) {
+                    env.messages.error(HTML, tree, "dc.attr.not.supported.html4", name);
+                }
                 boolean first = tagStack.peek().attrs.add(attr);
                 if (!first)
                     env.messages.error(HTML, tree, "dc.attr.repeated", name);
             }
             AttrKind k = currTag.getAttrKind(name);
-            switch (k) {
-                case OK:
+            switch (env.htmlVersion) {
+                case HTML4:
+                    validateHtml4Attrs(tree, name, k);
                     break;
 
-                case INVALID:
-                    env.messages.error(HTML, tree, "dc.attr.unknown", name);
-                    break;
-
-                case OBSOLETE:
-                    env.messages.warning(ACCESSIBILITY, tree, "dc.attr.obsolete", name);
-                    break;
-
-                case USE_CSS:
-                    env.messages.warning(ACCESSIBILITY, tree, "dc.attr.obsolete.use.css", name);
+                case HTML5:
+                    validateHtml5Attrs(tree, name, k);
                     break;
             }
 
@@ -590,6 +603,20 @@
                             }
                         }
                         break;
+
+                    case BORDER:
+                        if (currTag == HtmlTag.TABLE) {
+                            String v = getAttrValue(tree);
+                            try {
+                                if (env.htmlVersion == HtmlVersion.HTML5
+                                        && (v == null || (!v.isEmpty() && Integer.parseInt(v) != 1))) {
+                                    env.messages.error(HTML, tree, "dc.attr.table.border.html5", attr);
+                                }
+                            } catch (NumberFormatException ex) {
+                                env.messages.error(HTML, tree, "dc.attr.table.border.html5", attr);
+                            }
+                        }
+                        break;
                 }
             }
         }
@@ -599,6 +626,45 @@
         return super.visitAttribute(tree, ignore);
     }
 
+    private void validateHtml4Attrs(AttributeTree tree, Name name, AttrKind k) {
+        switch (k) {
+            case ALL:
+            case HTML4:
+                break;
+
+            case INVALID:
+                env.messages.error(HTML, tree, "dc.attr.unknown", name);
+                break;
+
+            case OBSOLETE:
+                env.messages.warning(ACCESSIBILITY, tree, "dc.attr.obsolete", name);
+                break;
+
+            case USE_CSS:
+                env.messages.warning(ACCESSIBILITY, tree, "dc.attr.obsolete.use.css", name);
+                break;
+
+            case HTML5:
+                env.messages.error(HTML, tree, "dc.attr.not.supported.html4", name);
+                break;
+        }
+    }
+
+    private void validateHtml5Attrs(AttributeTree tree, Name name, AttrKind k) {
+        switch (k) {
+            case ALL:
+            case HTML5:
+                break;
+
+            case INVALID:
+            case OBSOLETE:
+            case USE_CSS:
+            case HTML4:
+                env.messages.error(HTML, tree, "dc.attr.not.supported.html5", name);
+                break;
+        }
+    }
+
     private boolean checkAnchor(String name) {
         Element e = getEnclosingPackageOrClass(env.currElement);
         if (e == null)
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/DocLint.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -80,6 +80,7 @@
     private static final String STATS = "-stats";
     public static final String XIMPLICIT_HEADERS = "-XimplicitHeaders:";
     public static final String XCUSTOM_TAGS_PREFIX = "-XcustomTags:";
+    public static final String XHTML_VERSION_PREFIX = "-XhtmlVersion:";
     public static final String XCHECK_PACKAGE = "-XcheckPackage:";
     public static final String SEPARATOR = ",";
 
@@ -210,6 +211,14 @@
                 env.messages.setOptions(arg.substring(arg.indexOf(":") + 1));
             } else if (arg.startsWith(XCUSTOM_TAGS_PREFIX)) {
                 env.setCustomTags(arg.substring(arg.indexOf(":") + 1));
+            } else if (arg.startsWith(XHTML_VERSION_PREFIX)) {
+                String argsVersion = arg.substring(arg.indexOf(":") + 1);
+                HtmlVersion htmlVersion = HtmlVersion.getHtmlVersion(argsVersion);
+                if (htmlVersion != null) {
+                    env.setHtmlVersion(htmlVersion);
+                } else {
+                    throw new BadArgs("dc.bad.value.for.option", arg, argsVersion);
+                }
             } else if (arg.equals("-h") || arg.equals("-help") || arg.equals("--help")
                     || arg.equals("-?") || arg.equals("-usage")) {
                 needHelp = true;
@@ -274,6 +283,14 @@
                 env.setImplicitHeaders(Character.digit(ch, 10));
             } else if (arg.startsWith(XCUSTOM_TAGS_PREFIX)) {
                 env.setCustomTags(arg.substring(arg.indexOf(":") + 1));
+            } else if (arg.startsWith(XHTML_VERSION_PREFIX)) {
+                String argsVersion = arg.substring(arg.indexOf(":") + 1);
+                HtmlVersion htmlVersion = HtmlVersion.getHtmlVersion(argsVersion);
+                if (htmlVersion != null) {
+                    env.setHtmlVersion(htmlVersion);
+                } else {
+                    throw new IllegalArgumentException(argsVersion);
+                }
             } else if (arg.startsWith(XCHECK_PACKAGE)) {
                 env.setCheckPackages(arg.substring(arg.indexOf(":") + 1));
             } else
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/Env.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/Env.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2015, 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
@@ -99,6 +99,8 @@
     Set<Pattern> includePackages;
     Set<Pattern> excludePackages;
 
+    HtmlVersion htmlVersion = HtmlVersion.HTML4;
+
     // Utility classes
     DocTrees trees;
     Elements elements;
@@ -193,6 +195,10 @@
         return true;
     }
 
+    void setHtmlVersion(HtmlVersion version) {
+        htmlVersion = version;
+    }
+
     /** Set the current declaration and its doc comment. */
     void setCurrent(TreePath path, DocCommentTree comment) {
         currPath = path;
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlTag.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -51,26 +51,37 @@
  *
  * @see <a href="http://www.w3.org/TR/REC-html40/">HTML 4.01 Specification</a>
  * @see <a href="http://www.w3.org/TR/html5/">HTML 5 Specification</a>
+ * @see <a href="http://www.w3.org/TR/wai-aria/ ">WAI-ARIA Specification</a>
+ * @see <a href="http://www.w3.org/TR/aria-in-html/#recommendations-table">WAI-ARIA Recommendations Table</a>
  * @author Bhavesh Patel
  * @author Jonathan Gibbons (revised)
  */
 public enum HtmlTag {
     A(BlockType.INLINE, EndKind.REQUIRED,
-            attrs(AttrKind.OK, HREF, TARGET, NAME)),
+            attrs(AttrKind.ALL, HREF, TARGET, ID),
+            attrs(AttrKind.HTML4, REV, CHARSET, SHAPE, COORDS, NAME)),
 
     ABBR(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
 
-    ACRONYM(BlockType.INLINE, EndKind.REQUIRED,
+    ACRONYM(HtmlVersion.HTML4, BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
 
     ADDRESS(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
 
+    ARTICLE(HtmlVersion.HTML5, BlockType.BLOCK, EndKind.REQUIRED,
+            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)),
+
+    ASIDE(HtmlVersion.HTML5, BlockType.BLOCK, EndKind.REQUIRED,
+            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)),
+
     B(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
 
-    BIG(BlockType.INLINE, EndKind.REQUIRED,
+    BDI(HtmlVersion.HTML5, BlockType.INLINE, EndKind.REQUIRED),
+
+    BIG(HtmlVersion.HTML4, BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT)),
 
     BLOCKQUOTE(BlockType.BLOCK, EndKind.REQUIRED,
@@ -82,9 +93,10 @@
             attrs(AttrKind.USE_CSS, CLEAR)),
 
     CAPTION(BlockType.TABLE_ITEM, EndKind.REQUIRED,
-            EnumSet.of(Flag.ACCEPTS_INLINE, Flag.EXPECT_CONTENT)),
+            EnumSet.of(Flag.ACCEPTS_INLINE, Flag.EXPECT_CONTENT),
+            attrs(AttrKind.USE_CSS, ALIGN)),
 
-    CENTER(BlockType.BLOCK, EndKind.REQUIRED,
+    CENTER(HtmlVersion.HTML4, BlockType.BLOCK, EndKind.REQUIRED,
             EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)),
 
     CITE(BlockType.INLINE, EndKind.REQUIRED,
@@ -93,18 +105,30 @@
     CODE(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
 
+    COL(BlockType.TABLE_ITEM, EndKind.NONE,
+            attrs(AttrKind.HTML4, ALIGN, CHAR, CHAROFF, VALIGN, WIDTH)),
+
+    COLGROUP(BlockType.TABLE_ITEM, EndKind.REQUIRED,
+            attrs(AttrKind.HTML4, ALIGN, CHAR, CHAROFF, VALIGN, WIDTH)) {
+        @Override
+        public boolean accepts(HtmlTag t) {
+            return (t == COL);
+        }
+    },
+
     DD(BlockType.LIST_ITEM, EndKind.OPTIONAL,
             EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE, Flag.EXPECT_CONTENT)),
 
     DEL(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST),
-            attrs(AttrKind.OK, Attr.CITE, Attr.DATETIME)),
+            attrs(AttrKind.ALL, Attr.CITE, Attr.DATETIME)),
 
     DFN(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
 
     DIV(BlockType.BLOCK, EndKind.REQUIRED,
-            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)),
+            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE),
+            attrs(AttrKind.USE_CSS, ALIGN)),
 
     DL(BlockType.BLOCK, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT),
@@ -121,49 +145,95 @@
     EM(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.NO_NEST)),
 
-    FONT(BlockType.INLINE, EndKind.REQUIRED, // tag itself is deprecated
+    FONT(HtmlVersion.HTML4, BlockType.INLINE, EndKind.REQUIRED, // tag itself is deprecated
             EnumSet.of(Flag.EXPECT_CONTENT),
             attrs(AttrKind.USE_CSS, SIZE, COLOR, FACE)),
 
-    FRAME(BlockType.OTHER, EndKind.NONE),
+    FOOTER(HtmlVersion.HTML5, BlockType.BLOCK, EndKind.REQUIRED,
+            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)) {
+        @Override
+        public boolean accepts(HtmlTag t) {
+            switch (t) {
+                case HEADER: case FOOTER: case MAIN:
+                    return false;
+                default:
+                    return (t.blockType == BlockType.BLOCK) || (t.blockType == BlockType.INLINE);
+            }
+        }
+    },
 
-    FRAMESET(BlockType.OTHER, EndKind.REQUIRED),
+    FIGURE(HtmlVersion.HTML5, BlockType.BLOCK, EndKind.REQUIRED,
+            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)),
 
-    H1(BlockType.BLOCK, EndKind.REQUIRED),
-    H2(BlockType.BLOCK, EndKind.REQUIRED),
-    H3(BlockType.BLOCK, EndKind.REQUIRED),
-    H4(BlockType.BLOCK, EndKind.REQUIRED),
-    H5(BlockType.BLOCK, EndKind.REQUIRED),
-    H6(BlockType.BLOCK, EndKind.REQUIRED),
+    FIGCAPTION(HtmlVersion.HTML5, BlockType.BLOCK, EndKind.REQUIRED),
+
+    FRAME(HtmlVersion.HTML4, BlockType.OTHER, EndKind.NONE),
+
+    FRAMESET(HtmlVersion.HTML4, BlockType.OTHER, EndKind.REQUIRED),
+
+    H1(BlockType.BLOCK, EndKind.REQUIRED,
+            attrs(AttrKind.USE_CSS, ALIGN)),
+    H2(BlockType.BLOCK, EndKind.REQUIRED,
+            attrs(AttrKind.USE_CSS, ALIGN)),
+    H3(BlockType.BLOCK, EndKind.REQUIRED,
+            attrs(AttrKind.USE_CSS, ALIGN)),
+    H4(BlockType.BLOCK, EndKind.REQUIRED,
+            attrs(AttrKind.USE_CSS, ALIGN)),
+    H5(BlockType.BLOCK, EndKind.REQUIRED,
+            attrs(AttrKind.USE_CSS, ALIGN)),
+    H6(BlockType.BLOCK, EndKind.REQUIRED,
+            attrs(AttrKind.USE_CSS, ALIGN)),
 
     HEAD(BlockType.OTHER, EndKind.REQUIRED),
 
+    HEADER(HtmlVersion.HTML5, BlockType.BLOCK, EndKind.REQUIRED,
+            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)) {
+        @Override
+        public boolean accepts(HtmlTag t) {
+            switch (t) {
+                case HEADER: case FOOTER: case MAIN:
+                    return false;
+                default:
+                    return (t.blockType == BlockType.BLOCK) || (t.blockType == BlockType.INLINE);
+            }
+        }
+    },
+
     HR(BlockType.BLOCK, EndKind.NONE,
-            attrs(AttrKind.OK, WIDTH)), // OK in 4.01; not allowed in 5
+            attrs(AttrKind.HTML4, WIDTH),
+            attrs(AttrKind.USE_CSS, ALIGN, NOSHADE, SIZE)),
 
     HTML(BlockType.OTHER, EndKind.REQUIRED),
 
     I(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
 
+    IFRAME(BlockType.OTHER, EndKind.REQUIRED),
+
     IMG(BlockType.INLINE, EndKind.NONE,
-            attrs(AttrKind.OK, SRC, ALT, HEIGHT, WIDTH),
+            attrs(AttrKind.ALL, SRC, ALT, HEIGHT, WIDTH),
+            attrs(AttrKind.HTML5, CROSSORIGIN),
             attrs(AttrKind.OBSOLETE, NAME),
             attrs(AttrKind.USE_CSS, ALIGN, HSPACE, VSPACE, BORDER)),
 
     INS(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST),
-            attrs(AttrKind.OK, Attr.CITE, Attr.DATETIME)),
+            attrs(AttrKind.ALL, Attr.CITE, Attr.DATETIME)),
 
     KBD(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
 
     LI(BlockType.LIST_ITEM, EndKind.OPTIONAL,
             EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE),
-            attrs(AttrKind.OK, VALUE)),
+            attrs(AttrKind.ALL, VALUE),
+            attrs(AttrKind.USE_CSS, TYPE)),
 
     LINK(BlockType.OTHER, EndKind.NONE),
 
+    MAIN(HtmlVersion.HTML5, BlockType.OTHER, EndKind.REQUIRED),
+
+    MARK(HtmlVersion.HTML5, BlockType.INLINE, EndKind.REQUIRED),
+
     MENU(BlockType.BLOCK, EndKind.REQUIRED) {
         @Override
         public boolean accepts(HtmlTag t) {
@@ -173,13 +243,18 @@
 
     META(BlockType.OTHER, EndKind.NONE),
 
-    NOFRAMES(BlockType.OTHER, EndKind.REQUIRED),
+    NAV(HtmlVersion.HTML5, BlockType.BLOCK, EndKind.REQUIRED,
+            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)),
+
+    NOFRAMES(HtmlVersion.HTML4, BlockType.OTHER, EndKind.REQUIRED),
 
     NOSCRIPT(BlockType.BLOCK, EndKind.REQUIRED),
 
     OL(BlockType.BLOCK, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT),
-            attrs(AttrKind.OK, START, TYPE)) {
+            attrs(AttrKind.ALL, START, TYPE),
+            attrs(AttrKind.HTML5, REVERSED),
+            attrs(AttrKind.USE_CSS, COMPACT)) {
         @Override
         public boolean accepts(HtmlTag t) {
             return (t == LI);
@@ -191,7 +266,8 @@
             attrs(AttrKind.USE_CSS, ALIGN)),
 
     PRE(BlockType.BLOCK, EndKind.REQUIRED,
-            EnumSet.of(Flag.EXPECT_CONTENT)) {
+            EnumSet.of(Flag.EXPECT_CONTENT),
+            attrs(AttrKind.USE_CSS, WIDTH)) {
         @Override
         public boolean accepts(HtmlTag t) {
             switch (t) {
@@ -214,13 +290,16 @@
 
     SCRIPT(BlockType.OTHER, EndKind.REQUIRED),
 
+    SECTION(HtmlVersion.HTML5, BlockType.BLOCK, EndKind.REQUIRED,
+            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)),
+
     SMALL(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT)),
 
     SPAN(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT)),
 
-    STRIKE(BlockType.INLINE, EndKind.REQUIRED,
+    STRIKE(HtmlVersion.HTML4, BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT)),
 
     STRONG(BlockType.INLINE, EndKind.REQUIRED,
@@ -234,13 +313,14 @@
 
     TABLE(BlockType.BLOCK, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT),
-            attrs(AttrKind.OK, SUMMARY, Attr.FRAME, RULES, BORDER,
-                CELLPADDING, CELLSPACING, WIDTH), // width OK in 4.01; not allowed in 5
+            attrs(AttrKind.ALL, BORDER),
+            attrs(AttrKind.HTML4, SUMMARY, CELLPADDING, CELLSPACING, Attr.FRAME, RULES, WIDTH),
             attrs(AttrKind.USE_CSS, ALIGN, BGCOLOR)) {
         @Override
         public boolean accepts(HtmlTag t) {
             switch (t) {
                 case CAPTION:
+                case COLGROUP:
                 case THEAD: case TBODY: case TFOOT:
                 case TR: // HTML 3.2
                     return true;
@@ -252,7 +332,8 @@
 
     TBODY(BlockType.TABLE_ITEM, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT),
-            attrs(AttrKind.OK, ALIGN, CHAR, CHAROFF, VALIGN)) {
+            attrs(AttrKind.ALL, VALIGN),
+            attrs(AttrKind.HTML4, ALIGN, CHAR, CHAROFF)) {
         @Override
         public boolean accepts(HtmlTag t) {
             return (t == TR);
@@ -261,12 +342,16 @@
 
     TD(BlockType.TABLE_ITEM, EndKind.OPTIONAL,
             EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE),
-            attrs(AttrKind.OK, COLSPAN, ROWSPAN, HEADERS, SCOPE, Attr.ABBR, AXIS,
-                ALIGN, CHAR, CHAROFF, VALIGN),
+            attrs(AttrKind.ALL, COLSPAN, ROWSPAN, HEADERS, VALIGN),
+            attrs(AttrKind.HTML4, AXIS, Attr.ABBR, SCOPE, ALIGN, CHAR, CHAROFF),
             attrs(AttrKind.USE_CSS, WIDTH, BGCOLOR, HEIGHT, NOWRAP)),
 
+    TEMPLATE(HtmlVersion.HTML5, BlockType.BLOCK, EndKind.REQUIRED,
+            EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE)),
+
     TFOOT(BlockType.TABLE_ITEM, EndKind.REQUIRED,
-            attrs(AttrKind.OK, ALIGN, CHAR, CHAROFF, VALIGN)) {
+            attrs(AttrKind.ALL, VALIGN),
+            attrs(AttrKind.HTML4, ALIGN, CHAR, CHAROFF)) {
         @Override
         public boolean accepts(HtmlTag t) {
             return (t == TR);
@@ -275,22 +360,27 @@
 
     TH(BlockType.TABLE_ITEM, EndKind.OPTIONAL,
             EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE),
-            attrs(AttrKind.OK, COLSPAN, ROWSPAN, HEADERS, SCOPE, Attr.ABBR, AXIS,
-                ALIGN, CHAR, CHAROFF, VALIGN),
+            attrs(AttrKind.ALL, COLSPAN, ROWSPAN, HEADERS, SCOPE, Attr.ABBR,
+                VALIGN),
+            attrs(AttrKind.HTML4, AXIS, ALIGN, CHAR, CHAROFF),
             attrs(AttrKind.USE_CSS, WIDTH, BGCOLOR, HEIGHT, NOWRAP)),
 
     THEAD(BlockType.TABLE_ITEM, EndKind.REQUIRED,
-            attrs(AttrKind.OK, ALIGN, CHAR, CHAROFF, VALIGN)) {
+            attrs(AttrKind.ALL, VALIGN),
+            attrs(AttrKind.HTML4, ALIGN, CHAR, CHAROFF)) {
         @Override
         public boolean accepts(HtmlTag t) {
             return (t == TR);
         }
     },
 
+    TIME(HtmlVersion.HTML5, BlockType.INLINE, EndKind.REQUIRED),
+
     TITLE(BlockType.OTHER, EndKind.REQUIRED),
 
     TR(BlockType.TABLE_ITEM, EndKind.OPTIONAL,
-            attrs(AttrKind.OK, ALIGN, CHAR, CHAROFF, VALIGN),
+            attrs(AttrKind.ALL, VALIGN),
+            attrs(AttrKind.HTML4, ALIGN, CHAR, CHAROFF),
             attrs(AttrKind.USE_CSS, BGCOLOR)) {
         @Override
         public boolean accepts(HtmlTag t) {
@@ -298,7 +388,7 @@
         }
     },
 
-    TT(BlockType.INLINE, EndKind.REQUIRED,
+    TT(HtmlVersion.HTML4, BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
 
     U(BlockType.INLINE, EndKind.REQUIRED,
@@ -306,13 +396,15 @@
 
     UL(BlockType.BLOCK, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT),
-            attrs(AttrKind.OK, COMPACT, TYPE)) { // OK in 4.01; not allowed in 5
+            attrs(AttrKind.HTML4, COMPACT, TYPE)) {
         @Override
         public boolean accepts(HtmlTag t) {
             return (t == LI);
         }
     },
 
+    WBR(HtmlVersion.HTML5, BlockType.INLINE, EndKind.REQUIRED),
+
     VAR(BlockType.INLINE, EndKind.REQUIRED);
 
     /**
@@ -345,34 +437,66 @@
     public static enum Attr {
         ABBR,
         ALIGN,
+        ALINK,
         ALT,
+        ARIA_ACTIVEDESCENDANT,
+        ARIA_CONTROLS,
+        ARIA_DESCRIBEDBY,
+        ARIA_EXPANDED,
+        ARIA_LABEL,
+        ARIA_LABELLEDBY,
+        ARIA_LEVEL,
+        ARIA_MULTISELECTABLE,
+        ARIA_OWNS,
+        ARIA_POSINSET,
+        ARIA_SETSIZE,
+        ARIA_READONLY,
+        ARIA_REQUIRED,
+        ARIA_SELECTED,
+        ARIA_SORT,
         AXIS,
+        BACKGROUND,
         BGCOLOR,
         BORDER,
         CELLSPACING,
         CELLPADDING,
         CHAR,
         CHAROFF,
+        CHARSET,
         CITE,
         CLEAR,
         CLASS,
         COLOR,
         COLSPAN,
         COMPACT,
+        COORDS,
+        CROSSORIGIN,
         DATETIME,
         FACE,
         FRAME,
+        FRAMEBORDER,
         HEADERS,
         HEIGHT,
         HREF,
         HSPACE,
         ID,
+        LINK,
+        LONGDESC,
+        MARGINHEIGHT,
+        MARGINWIDTH,
         NAME,
+        NOSHADE,
         NOWRAP,
+        PROFILE,
+        REV,
         REVERSED,
+        ROLE,
         ROWSPAN,
         RULES,
+        SCHEME,
         SCOPE,
+        SCROLLING,
+        SHAPE,
         SIZE,
         SPACE,
         SRC,
@@ -380,14 +504,23 @@
         STYLE,
         SUMMARY,
         TARGET,
+        TEXT,
         TYPE,
         VALIGN,
         VALUE,
+        VERSION,
+        VLINK,
         VSPACE,
         WIDTH;
 
+        private final String name;
+
+        Attr() {
+            name = StringUtils.toLowerCase(name().replace("_", "-"));
+        }
+
         public String getText() {
-            return StringUtils.toLowerCase(name());
+            return name;
         }
 
         static final Map<String,Attr> index = new HashMap<>();
@@ -399,10 +532,12 @@
     }
 
     public static enum AttrKind {
+        HTML4,
+        HTML5,
         INVALID,
         OBSOLETE,
         USE_CSS,
-        OK
+        ALL
     }
 
     // This class exists to avoid warnings from using parameterized vararg type
@@ -415,25 +550,52 @@
     }
 
 
+    public final HtmlVersion allowedVersion;
     public final BlockType blockType;
     public final EndKind endKind;
     public final Set<Flag> flags;
     private final Map<Attr,AttrKind> attrs;
 
     HtmlTag(BlockType blockType, EndKind endKind, AttrMap... attrMaps) {
-        this(blockType, endKind, Collections.<Flag>emptySet(), attrMaps);
+        this(HtmlVersion.ALL, blockType, endKind, Collections.<Flag>emptySet(), attrMaps);
+    }
+
+    HtmlTag(HtmlVersion allowedVersion, BlockType blockType, EndKind endKind, AttrMap... attrMaps) {
+        this(allowedVersion, blockType, endKind, Collections.<Flag>emptySet(), attrMaps);
     }
 
     HtmlTag(BlockType blockType, EndKind endKind, Set<Flag> flags, AttrMap... attrMaps) {
+        this(HtmlVersion.ALL, blockType, endKind, flags, attrMaps);
+    }
+
+    HtmlTag(HtmlVersion allowedVersion, BlockType blockType, EndKind endKind, Set<Flag> flags, AttrMap... attrMaps) {
+        this.allowedVersion = allowedVersion;
         this.blockType = blockType;
         this.endKind = endKind;
         this.flags = flags;
         this.attrs = new EnumMap<>(Attr.class);
         for (Map<Attr,AttrKind> m: attrMaps)
             this.attrs.putAll(m);
-        attrs.put(Attr.CLASS, AttrKind.OK);
-        attrs.put(Attr.ID, AttrKind.OK);
-        attrs.put(Attr.STYLE, AttrKind.OK);
+        attrs.put(Attr.CLASS, AttrKind.ALL);
+        attrs.put(Attr.ID, AttrKind.ALL);
+        attrs.put(Attr.STYLE, AttrKind.ALL);
+        attrs.put(Attr.ROLE, AttrKind.HTML5);
+        // for now, assume that all ARIA attributes are allowed on all tags.
+        attrs.put(Attr.ARIA_ACTIVEDESCENDANT, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_CONTROLS, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_DESCRIBEDBY, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_EXPANDED, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_LABEL, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_LABELLEDBY, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_LEVEL, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_MULTISELECTABLE, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_OWNS, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_POSINSET, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_READONLY, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_REQUIRED, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_SELECTED, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_SETSIZE, AttrKind.HTML5);
+        attrs.put(Attr.ARIA_SORT, AttrKind.HTML5);
     }
 
     public boolean accepts(HtmlTag t) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/HtmlVersion.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2015, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 com.sun.tools.doclint;
+
+/**
+ * Enum representing HTML version of the documentation comment.
+ *
+ * @author Bhavesh Patel
+ */
+public enum HtmlVersion {
+
+    HTML4,
+    HTML5,
+    ALL;
+
+    public static HtmlVersion getHtmlVersion(String argsVersion) {
+        switch (argsVersion) {
+            case "html4":
+                return HtmlVersion.HTML4;
+            case "html5":
+                return HtmlVersion.HTML5;
+            default:
+                return null;
+        }
+    }
+}
--- a/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint.properties	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/doclint/resources/doclint.properties	Fri Apr 17 10:23:49 2015 -0700
@@ -27,9 +27,12 @@
 dc.anchor.value.missing = no value given for anchor
 dc.attr.lacks.value = attribute lacks value
 dc.attr.not.number = attribute value is not a number
+dc.attr.not.supported.html4 = attribute not supported in HTML4: {0}
+dc.attr.not.supported.html5 = attribute not supported in HTML5: {0}
 dc.attr.obsolete = attribute obsolete: {0}
 dc.attr.obsolete.use.css = attribute obsolete, use CSS instead: {0}
 dc.attr.repeated = repeated attribute: {0}
+dc.attr.table.border.html5 = attribute border for table only accepts "" or "1", use CSS instead: {0}
 dc.attr.unknown = unknown attribute: {0}
 dc.bad.option = bad option: {0}
 dc.bad.value.for.option = bad value for option: {0} {1}
@@ -63,9 +66,11 @@
 dc.tag.not.allowed.inline.other = block element not allowed here: {0}
 dc.tag.not.closed= element not closed: {0}
 dc.tag.p.in.pre= unexpected use of <p> inside <pre> element
+dc.tag.requires.heading = heading not found for </{0}>
 dc.tag.self.closing = self-closing element not allowed
 dc.tag.start.unmatched = end tag missing: </{0}>
 dc.tag.unknown = unknown tag: {0}
+dc.tag.not.supported = tag not supported in the generated HTML version: {0}
 dc.text.not.allowed = text not allowed in <{0}> element
 dc.type.arg.not.allowed = type arguments not allowed here
 dc.unexpected.comment=documentation comment not expected here
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Annotate.java	Fri Apr 17 10:23:49 2015 -0700
@@ -31,6 +31,7 @@
 import com.sun.tools.javac.code.Scope.WriteableScope;
 import com.sun.tools.javac.code.Symbol.*;
 import com.sun.tools.javac.code.TypeMetadata.Entry.Kind;
+import com.sun.tools.javac.resources.CompilerProperties.Errors;
 import com.sun.tools.javac.tree.JCTree;
 import com.sun.tools.javac.tree.JCTree.*;
 import com.sun.tools.javac.tree.TreeInfo;
@@ -778,9 +779,10 @@
                 Attribute.Compound c = new Attribute.Compound(targetContainerType, List.of(p));
                 JCAnnotation annoTree = m.Annotation(c);
 
-                if (!chk.annotationApplicable(annoTree, on))
-                    log.error(annoTree.pos(), "invalid.repeatable.annotation.incompatible.target",
-                            targetContainerType, origAnnoType);
+                if (!chk.annotationApplicable(annoTree, on)) {
+                    log.error(annoTree.pos(),
+                              Errors.InvalidRepeatableAnnotationNotApplicable(targetContainerType, on));
+                }
 
                 if (!chk.validateAnnotationDeferErrors(annoTree))
                     log.error(annoTree.pos(), "duplicate.annotation.invalid.repeated", origAnnoType);
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Attr.java	Fri Apr 17 10:23:49 2015 -0700
@@ -4657,7 +4657,7 @@
             for (JCAnnotation ai : annotations) {
                 if (!ai.type.isErroneous() &&
                         typeAnnotations.annotationTargetType(ai.attribute, sym) == TypeAnnotations.AnnotationType.DECLARATION) {
-                    log.error(ai.pos(), "annotation.type.not.applicable");
+                    log.error(ai.pos(), Errors.AnnotationTypeNotApplicableToType(ai.type));
                 }
             }
         }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Check.java	Fri Apr 17 10:23:49 2015 -0700
@@ -2783,7 +2783,7 @@
         if (a.hasTag(TYPE_ANNOTATION) &&
                 !a.annotationType.type.isErroneous() &&
                 !isTypeAnnotation(a, isTypeParameter)) {
-            log.error(a.pos(), "annotation.type.not.applicable");
+            log.error(a.pos(), Errors.AnnotationTypeNotApplicableToType(a.type));
         }
     }
 
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/comp/Resolve.java	Fri Apr 17 10:23:49 2015 -0700
@@ -833,20 +833,19 @@
                                     List<Type> formals,
                                     Warner warn) {
             super.argumentsAcceptable(env, deferredAttrContext, argtypes, formals, warn);
-            //should we expand formals?
+            // should we check varargs element type accessibility?
             if (deferredAttrContext.phase.isVarargsRequired()) {
-                Type typeToCheck = null;
-                if (!checkVarargsAccessAfterResolution) {
-                    typeToCheck = types.elemtype(formals.last());
-                } else if (deferredAttrContext.mode == AttrMode.CHECK) {
-                    typeToCheck = types.erasure(types.elemtype(formals.last()));
-                }
-                if (typeToCheck != null) {
-                    varargsAccessible(env, typeToCheck, deferredAttrContext.inferenceContext);
+                if (deferredAttrContext.mode == AttrMode.CHECK || !checkVarargsAccessAfterResolution) {
+                    varargsAccessible(env, types.elemtype(formals.last()), deferredAttrContext.inferenceContext);
                 }
             }
         }
 
+        /**
+         * Test that the runtime array element type corresponding to 't' is accessible.  't' should be the
+         * varargs element type of either the method invocation type signature (after inference completes)
+         * or the method declaration signature (before inference completes).
+         */
         private void varargsAccessible(final Env<AttrContext> env, final Type t, final InferenceContext inferenceContext) {
             if (inferenceContext.free(t)) {
                 inferenceContext.addFreeTypeListener(List.of(t), new FreeTypeListener() {
@@ -856,7 +855,7 @@
                     }
                 });
             } else {
-                if (!isAccessible(env, t)) {
+                if (!isAccessible(env, types.erasure(t))) {
                     Symbol location = env.enclClass.sym;
                     reportMC(env.tree, MethodCheckDiag.INACCESSIBLE_VARARGS, inferenceContext, t, Kinds.kindName(location), location);
                 }
--- a/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.compiler/share/classes/com/sun/tools/javac/resources/compiler.properties	Fri Apr 17 10:23:49 2015 -0700
@@ -123,6 +123,10 @@
 compiler.err.annotation.type.not.applicable=\
     annotation type not applicable to this kind of declaration
 
+# 0: type
+compiler.err.annotation.type.not.applicable.to.type=\
+    annotation @{0} not applicable in this type context
+
 compiler.err.annotation.value.must.be.annotation=\
     annotation value must be an annotation
 
@@ -406,6 +410,10 @@
 compiler.err.invalid.repeatable.annotation.repeated.and.container.present=\
     container {0} must not be present at the same time as the element it contains
 
+# 0: type, 1: symbol
+compiler.err.invalid.repeatable.annotation.not.applicable=\
+    container {0} is not applicable to element {1}
+
 # 0: name
 compiler.err.duplicate.class=\
     duplicate class: {0}
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractMemberWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -415,8 +415,10 @@
     protected void addDeprecatedAPI(List<Doc> deprmembers, String headingKey,
             String tableSummary, String[] tableHeader, Content contentTree) {
         if (deprmembers.size() > 0) {
-            Content table = HtmlTree.TABLE(HtmlStyle.deprecatedSummary, 0, 3, 0, tableSummary,
-                writer.getTableCaption(configuration.getResource(headingKey)));
+            Content caption = writer.getTableCaption(configuration.getResource(headingKey));
+            Content table = (configuration.isOutputHtml5())
+                    ? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption)
+                    : HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption);
             table.addContent(writer.getSummaryTableHeader(tableHeader, "col"));
             Content tbody = new HtmlTree(HtmlTag.TBODY);
             for (int i = 0; i < deprmembers.size(); i++) {
@@ -455,8 +457,10 @@
         List<? extends ProgramElementDoc> members = mems;
         boolean printedUseTableHeader = false;
         if (members.size() > 0) {
-            Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, tableSummary,
-                    writer.getTableCaption(heading));
+            Content caption = writer.getTableCaption(heading);
+            Content table = (configuration.isOutputHtml5())
+                    ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
+                    : HtmlTree.TABLE(HtmlStyle.useSummary, tableSummary, caption);
             Content tbody = new HtmlTree(HtmlTag.TBODY);
             Iterator<? extends ProgramElementDoc> it = members.iterator();
             for (int i = 0; it.hasNext(); i++) {
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractPackageIndexWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -149,13 +149,17 @@
     protected void addIndexContents(Collection<PackageDoc> packages, String text,
             String tableSummary, Content body) {
         if (!packages.isEmpty()) {
-            HtmlTree div = new HtmlTree(HtmlTag.DIV);
-            div.addStyle(HtmlStyle.indexHeader);
-            addAllClassesLink(div);
+            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV))
+                    ? HtmlTree.NAV()
+                    : new HtmlTree(HtmlTag.DIV);
+            htmlTree.addStyle(HtmlStyle.indexNav);
+            HtmlTree ul = new HtmlTree(HtmlTag.UL);
+            addAllClassesLink(ul);
             if (configuration.showProfiles) {
-                addAllProfilesLink(div);
+                addAllProfilesLink(ul);
             }
-            body.addContent(div);
+            htmlTree.addContent(ul);
+            body.addContent(htmlTree);
             if (configuration.showProfiles && configuration.profilePackages.size() > 0) {
                 Content profileSummary = configuration.getResource("doclet.Profiles");
                 addProfilesList(profileSummary, body);
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractProfileIndexWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractProfileIndexWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015 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
@@ -194,11 +194,15 @@
     protected void addIndexContents(Profiles profiles, String text,
             String tableSummary, Content body) {
         if (profiles.getProfileCount() > 0) {
-            HtmlTree div = new HtmlTree(HtmlTag.DIV);
-            div.addStyle(HtmlStyle.indexHeader);
-            addAllClassesLink(div);
-            addAllPackagesLink(div);
-            body.addContent(div);
+            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV))
+                    ? HtmlTree.NAV()
+                    : new HtmlTree(HtmlTag.DIV);
+            htmlTree.addStyle(HtmlStyle.indexNav);
+            HtmlTree ul = new HtmlTree(HtmlTag.UL);
+            addAllClassesLink(ul);
+            addAllPackagesLink(ul);
+            htmlTree.addContent(ul);
+            body.addContent(htmlTree);
             addProfilesList(profiles, text, tableSummary, body);
         }
     }
@@ -215,12 +219,16 @@
      */
     protected void addProfilePackagesIndexContents(Profiles profiles, String text,
             String tableSummary, Content body, String profileName) {
-        HtmlTree div = new HtmlTree(HtmlTag.DIV);
-        div.addStyle(HtmlStyle.indexHeader);
-        addAllClassesLink(div);
-        addAllPackagesLink(div);
-        addAllProfilesLink(div);
-        body.addContent(div);
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.NAV))
+                ? HtmlTree.NAV()
+                : new HtmlTree(HtmlTag.DIV);
+        htmlTree.addStyle(HtmlStyle.indexNav);
+        HtmlTree ul = new HtmlTree(HtmlTag.UL);
+        addAllClassesLink(ul);
+        addAllPackagesLink(ul);
+        addAllProfilesLink(ul);
+        htmlTree.addContent(ul);
+        body.addContent(htmlTree);
         addProfilePackagesList(profiles, text, tableSummary, body, profileName);
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AbstractTreeWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -53,8 +53,6 @@
      */
     protected final ClassTree classtree;
 
-    private static final String LI_CIRCLE  = "circle";
-
     /**
      * Constructor initializes classtree variable. This constructor will be used
      * while generating global tree file "overview-tree.html".
@@ -88,7 +86,7 @@
             Content ul = new HtmlTree(HtmlTag.UL);
             for (ClassDoc local : list) {
                 HtmlTree li = new HtmlTree(HtmlTag.LI);
-                li.addAttr(HtmlAttr.TYPE, LI_CIRCLE);
+                li.addStyle(HtmlStyle.circle);
                 addPartialInfo(local, li);
                 addExtendsImplements(parent, local, li);
                 addLevelInfo(local, classtree.subs(local, isEnum),
@@ -108,14 +106,24 @@
      * @param heading heading for the tree
      * @param div the content tree to which the tree will be added
      */
-    protected void addTree(SortedSet<ClassDoc> list, String heading, Content div) {
+    protected void addTree(SortedSet<ClassDoc> list, String heading, HtmlTree div) {
         if (!list.isEmpty()) {
             ClassDoc firstClassDoc = list.first();
             Content headingContent = getResource(heading);
-            div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
-                    headingContent));
+            Content sectionHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
+                    headingContent);
+            HtmlTree htmlTree;
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                htmlTree = HtmlTree.SECTION(sectionHeading);
+            } else {
+                div.addContent(sectionHeading);
+                htmlTree = div;
+            }
             addLevelInfo(!firstClassDoc.isInterface()? firstClassDoc : null,
-                    list, list == classtree.baseEnums(), div);
+                    list, list == classtree.baseEnums(), htmlTree);
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                div.addContent(htmlTree);
+            }
         }
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AllClassesFrameWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -119,8 +119,10 @@
         Content ul = new HtmlTree(HtmlTag.UL);
         // Generate the class links and add it to the tdFont tree.
         addAllClasses(ul, wantFrames);
-        Content div = HtmlTree.DIV(HtmlStyle.indexContainer, ul);
-        body.addContent(div);
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
+                ? HtmlTree.MAIN(HtmlStyle.indexContainer, ul)
+                : HtmlTree.DIV(HtmlStyle.indexContainer, ul);
+        body.addContent(htmlTree);
         printHtmlDocument(null, false, body);
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeFieldWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015 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
@@ -77,6 +77,13 @@
     /**
      * {@inheritDoc}
      */
+    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
+        writer.addMemberTree(memberSummaryTree, memberTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public void addAnnotationFieldDetailsMarker(Content memberDetails) {
         memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_FIELD_DETAILS);
     }
@@ -156,6 +163,10 @@
      * {@inheritDoc}
      */
     public Content getAnnotationDetails(Content annotationDetailsTree) {
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree));
+            return htmlTree;
+        }
         return getMemberTree(annotationDetailsTree);
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeOptionalMemberWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -72,6 +72,13 @@
     /**
      * {@inheritDoc}
      */
+    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
+        writer.addMemberTree(memberSummaryTree, memberTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public void addDefaultValueInfo(MemberDoc member, Content annotationDocTree) {
         if (((AnnotationTypeElementDoc) member).defaultValue() != null) {
             Content dt = HtmlTree.DT(writer.getResource("doclet.Default"));
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeRequiredMemberWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -78,6 +78,13 @@
     /**
      * {@inheritDoc}
      */
+    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
+        writer.addMemberTree(memberSummaryTree, memberTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public void addAnnotationDetailsMarker(Content memberDetails) {
         memberDetails.addContent(HtmlConstants.START_OF_ANNOTATION_TYPE_DETAILS);
     }
@@ -158,6 +165,10 @@
      * {@inheritDoc}
      */
     public Content getAnnotationDetails(Content annotationDetailsTree) {
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(annotationDetailsTree));
+            return htmlTree;
+        }
         return getMemberTree(annotationDetailsTree);
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/AnnotationTypeWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -151,9 +151,15 @@
         String pkgname = (annotationType.containingPackage() != null)?
             annotationType.containingPackage().name(): "";
         String clname = annotationType.name();
-        Content bodyTree = getBody(true, getWindowTitle(clname));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(clname));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.addStyle(HtmlStyle.header);
@@ -169,7 +175,11 @@
                 HtmlStyle.title, headerContent);
         heading.addContent(getTypeParameterLinks(linkInfo));
         div.addContent(heading);
-        bodyTree.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(div);
+        } else {
+            bodyTree.addContent(div);
+        }
         return bodyTree;
     }
 
@@ -185,8 +195,14 @@
      */
     public void addFooter(Content contentTree) {
         contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
-        addNavLinks(false, contentTree);
-        addBottom(contentTree);
+        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : contentTree;
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            contentTree.addContent(htmlTree);
+        }
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassUseWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -91,6 +91,11 @@
     final String constructorUseTableSummary;
 
     /**
+     * The HTML tree for main tag.
+     */
+    protected HtmlTree mainTree = HtmlTree.MAIN();
+
+    /**
      * Constructor.
      *
      * @param filename the file to be generated.
@@ -222,7 +227,7 @@
      * Generate the class use list.
      */
     protected void generateClassUseFile() throws IOException {
-        Content body = getClassUseHeader();
+        HtmlTree body = getClassUseHeader();
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.addStyle(HtmlStyle.classUseContainer);
         if (pkgSet.size() > 0) {
@@ -231,9 +236,20 @@
             div.addContent(getResource("doclet.ClassUse_No.usage.of.0",
                     classdoc.qualifiedName()));
         }
-        body.addContent(div);
-        addNavLinks(false, body);
-        addBottom(body);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(div);
+            body.addContent(mainTree);
+        } else {
+            body.addContent(div);
+        }
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : body;
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            body.addContent(htmlTree);
+        }
         printHtmlDocument(null, true, body);
     }
 
@@ -259,11 +275,12 @@
      * @param contentTree the content tree to which the packages list will be added
      */
     protected void addPackageList(Content contentTree) throws IOException {
-        Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary,
-                getTableCaption(configuration.getResource(
+        Content caption = getTableCaption(configuration.getResource(
                 "doclet.ClassUse_Packages.that.use.0",
-                getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc
-                )))));
+                getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc))));
+        Content table = (configuration.isOutputHtml5())
+                ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
+                : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption);
         table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
         Content tbody = new HtmlTree(HtmlTag.TBODY);
         Iterator<PackageDoc> it = pkgSet.iterator();
@@ -294,11 +311,13 @@
                 pkgToPackageAnnotations.isEmpty()) {
             return;
         }
-        Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary,
-                getTableCaption(configuration.getResource(
+        Content caption = getTableCaption(configuration.getResource(
                 "doclet.ClassUse_PackageAnnotation",
                 getLink(new LinkInfoImpl(configuration,
-                        LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc)))));
+                                LinkInfoImpl.Kind.CLASS_USE_HEADER, classdoc))));
+        Content table = (configuration.isOutputHtml5())
+                ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
+                : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption);
         table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
         Content tbody = new HtmlTree(HtmlTag.TBODY);
         Iterator<PackageDoc> it = pkgToPackageAnnotations.iterator();
@@ -333,15 +352,22 @@
         HtmlTree ul = new HtmlTree(HtmlTag.UL);
         ul.addStyle(HtmlStyle.blockList);
         for (PackageDoc pkg : pkgSet) {
-            Content li = HtmlTree.LI(HtmlStyle.blockList, getMarkerAnchor(getPackageAnchorName(pkg)));
+            Content markerAnchor = getMarkerAnchor(getPackageAnchorName(pkg));
+            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                    ? HtmlTree.SECTION(markerAnchor)
+                    : HtmlTree.LI(HtmlStyle.blockList, markerAnchor);
             Content link = getResource("doclet.ClassUse_Uses.of.0.in.1",
                                        getLink(new LinkInfoImpl(configuration, LinkInfoImpl.Kind.CLASS_USE_HEADER,
                                                                 classdoc)),
                                        getPackageLink(pkg, utils.getPackageName(pkg)));
             Content heading = HtmlTree.HEADING(HtmlConstants.SUMMARY_HEADING, link);
-            li.addContent(heading);
-            addClassUse(pkg, li);
-            ul.addContent(li);
+            htmlTree.addContent(heading);
+            addClassUse(pkg, htmlTree);
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+            } else {
+                ul.addContent(htmlTree);
+            }
         }
         Content li = HtmlTree.LI(HtmlStyle.blockList, ul);
         contentTree.addContent(li);
@@ -443,15 +469,21 @@
      *
      * @return a content tree representing the class use header
      */
-    protected Content getClassUseHeader() {
+    protected HtmlTree getClassUseHeader() {
         String cltype = configuration.getText(classdoc.isInterface()?
             "doclet.Interface":"doclet.Class");
         String clname = classdoc.qualifiedName();
         String title = configuration.getText("doclet.Window_ClassUse_Header",
                 cltype, clname);
-        Content bodyTree = getBody(true, getWindowTitle(title));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(title));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         ContentBuilder headContent = new ContentBuilder();
         headContent.addContent(getResource("doclet.ClassUse_Title", cltype));
         headContent.addContent(new HtmlTree(HtmlTag.BR));
@@ -459,7 +491,11 @@
         Content heading = HtmlTree.HEADING(HtmlConstants.CLASS_PAGE_HEADING,
                 true, HtmlStyle.title, headContent);
         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
-        bodyTree.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(div);
+        } else {
+            bodyTree.addContent(div);
+        }
         return bodyTree;
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ClassWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -35,6 +35,7 @@
 import com.sun.tools.doclets.internal.toolkit.builders.*;
 import com.sun.tools.doclets.internal.toolkit.taglets.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
+
 import java.io.IOException;
 
 /**
@@ -160,9 +161,15 @@
         String pkgname = (classDoc.containingPackage() != null)?
             classDoc.containingPackage().name(): "";
         String clname = classDoc.name();
-        Content bodyTree = getBody(true, getWindowTitle(clname));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(clname));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         bodyTree.addContent(HtmlConstants.START_OF_CLASS_DATA);
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.addStyle(HtmlStyle.header);
@@ -194,7 +201,11 @@
                 HtmlStyle.title, headerContent);
         heading.addContent(getTypeParameterLinks(linkInfo));
         div.addContent(heading);
-        bodyTree.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(div);
+        } else {
+            bodyTree.addContent(div);
+        }
         return bodyTree;
     }
 
@@ -210,8 +221,14 @@
      */
     public void addFooter(Content contentTree) {
         contentTree.addContent(HtmlConstants.END_OF_CLASS_DATA);
-        addNavLinks(false, contentTree);
-        addBottom(contentTree);
+        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : contentTree;
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            contentTree.addContent(htmlTree);
+        }
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConfigurationImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -31,7 +31,7 @@
 import javax.tools.JavaFileManager;
 
 import com.sun.javadoc.*;
-import com.sun.tools.doclets.formats.html.markup.ContentBuilder;
+import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
 import com.sun.tools.doclets.internal.toolkit.util.*;
 import com.sun.tools.doclint.DocLint;
@@ -176,6 +176,11 @@
     public boolean createoverview = false;
 
     /**
+     * This is the HTML version of the generated pages. HTML 4.01 is the default output version.
+     */
+    public HtmlVersion htmlVersion = HtmlVersion.HTML4;
+
+    /**
      * Collected set of doclint options
      */
     public Set<String> doclintOpts = new LinkedHashSet<>();
@@ -279,6 +284,10 @@
                 nooverview = true;
             } else if (opt.equals("-overview")) {
                 overview = true;
+            } else if (opt.equals("-html4")) {
+                htmlVersion = HtmlVersion.HTML4;
+            } else if (opt.equals("-html5")) {
+                htmlVersion = HtmlVersion.HTML5;
             } else if (opt.equals("-xdoclint")) {
                 doclintOpts.add(null);
             } else if (opt.startsWith("-xdoclint:")) {
@@ -300,7 +309,8 @@
         setTopFile(root);
 
         if (root instanceof RootDocImpl) {
-            ((RootDocImpl) root).initDocLint(doclintOpts, tagletManager.getCustomTagNames());
+            ((RootDocImpl) root).initDocLint(doclintOpts, tagletManager.getCustomTagNames(),
+                    StringUtils.toLowerCase(htmlVersion.name()));
         }
     }
 
@@ -336,6 +346,8 @@
             option.equals("-use") ||
             option.equals("-nonavbar") ||
             option.equals("-nooverview") ||
+            option.equals("-html4") ||
+            option.equals("-html5") ||
             option.equals("-xdoclint") ||
             option.startsWith("-xdoclint:")) {
             return 1;
@@ -471,6 +483,20 @@
     }
 
     /**
+     * Return true if the generated output is HTML5.
+     */
+    public boolean isOutputHtml5() {
+        return htmlVersion == HtmlVersion.HTML5;
+    }
+
+    /**
+     * Return true if the tag is allowed for this specific version of HTML.
+     */
+    public boolean allowTag(HtmlTag htmlTag) {
+        return htmlTag.allowTag(this.htmlVersion);
+    }
+
+    /**
      * {@inheritDoc}
      */
     @Override
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstantsSummaryWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -63,6 +63,16 @@
     private final String[] constantsTableHeader;
 
     /**
+     * The HTML tree for main tag.
+     */
+    private HtmlTree mainTree = HtmlTree.MAIN();
+
+    /**
+     * The HTML tree for constant values summary.
+     */
+    private HtmlTree summaryTree;
+
+    /**
      * Construct a ConstantsSummaryWriter.
      * @param configuration the configuration used in this run
      *        of the standard doclet.
@@ -85,9 +95,15 @@
      */
     public Content getHeader() {
         String label = configuration.getText("doclet.Constants_Summary");
-        Content bodyTree = getBody(true, getWindowTitle(label));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(label));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         return bodyTree;
     }
 
@@ -123,7 +139,7 @@
     /**
      * {@inheritDoc}
      */
-    public Content getContentsList(Content contentListTree) {
+    public void addContentsList(Content contentTree, Content contentListTree) {
         Content titleContent = getResource(
                 "doclet.Constants_Summary");
         Content pHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
@@ -131,10 +147,18 @@
         Content div = HtmlTree.DIV(HtmlStyle.header, pHeading);
         Content headingContent = getResource(
                 "doclet.Contents");
-        div.addContent(HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
-                headingContent));
-        div.addContent(contentListTree);
-        return div;
+        Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING, true,
+                headingContent);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            HtmlTree section = HtmlTree.SECTION(heading);
+            section.addContent(contentListTree);
+            div.addContent(section);
+            mainTree.addContent(div);
+        } else {
+            div.addContent(heading);
+            div.addContent(contentListTree);
+            contentTree.addContent(div);
+        }
     }
 
     /**
@@ -149,9 +173,11 @@
     /**
      * {@inheritDoc}
      */
-    public void addPackageName(PackageDoc pkg, String parsedPackageName,
-            Content summariesTree) {
+    public void addPackageName(String parsedPackageName, Content summariesTree, boolean first) {
         Content pkgNameContent;
+        if (!first && configuration.allowTag(HtmlTag.SECTION)) {
+            summariesTree.addContent(summaryTree);
+        }
         if (parsedPackageName.length() == 0) {
             summariesTree.addContent(getMarkerAnchor(
                     SectionName.UNNAMED_PACKAGE_ANCHOR));
@@ -165,7 +191,11 @@
         Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
                 pkgNameContent);
         heading.addContent(headingContent);
-        summariesTree.addContent(heading);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            summaryTree = HtmlTree.SECTION(heading);
+        } else {
+            summariesTree.addContent(heading);
+        }
     }
 
     /**
@@ -178,6 +208,17 @@
     }
 
     /**
+     * {@inheritDoc}
+     */
+    public void addClassConstant(Content summariesTree, Content classConstantTree) {
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            summaryTree.addContent(classConstantTree);
+        } else {
+            summariesTree.addContent(classConstantTree);
+        }
+    }
+
+    /**
      * Get the table caption and header for the constant summary table
      *
      * @param cd classdoc to be documented
@@ -208,8 +249,10 @@
      * @return the table caption and header
      */
     protected Content getClassName(Content classStr) {
-        Content table = HtmlTree.TABLE(HtmlStyle.constantsSummary, 0, 3, 0, constantsTableSummary,
-                getTableCaption(classStr));
+        Content caption = getTableCaption(classStr);
+        Content table = (configuration.isOutputHtml5())
+                ? HtmlTree.TABLE(HtmlStyle.constantsSummary, caption)
+                : HtmlTree.TABLE(HtmlStyle.constantsSummary, constantsTableSummary, caption);
         table.addContent(getSummaryTableHeader(constantsTableHeader, "col"));
         return table;
     }
@@ -300,9 +343,30 @@
     /**
      * {@inheritDoc}
      */
+    public void addConstantSummaries(Content contentTree, Content summariesTree) {
+        if (configuration.allowTag(HtmlTag.SECTION) && summaryTree != null) {
+            summariesTree.addContent(summaryTree);
+        }
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(summariesTree);
+            contentTree.addContent(mainTree);
+        } else {
+            contentTree.addContent(summariesTree);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public void addFooter(Content contentTree) {
-        addNavLinks(false, contentTree);
-        addBottom(contentTree);
+        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : contentTree;
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            contentTree.addContent(htmlTree);
+        }
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ConstructorWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -92,6 +92,13 @@
     /**
      * {@inheritDoc}
      */
+    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
+        writer.addMemberTree(memberSummaryTree, memberTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public Content getConstructorDetailsTreeHeader(ClassDoc classDoc,
             Content memberDetailsTree) {
         memberDetailsTree.addContent(HtmlConstants.START_OF_CONSTRUCTOR_DETAILS);
@@ -177,6 +184,10 @@
      * {@inheritDoc}
      */
     public Content getConstructorDetails(Content constructorDetailsTree) {
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(constructorDetailsTree));
+            return htmlTree;
+        }
         return getMemberTree(constructorDetailsTree);
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/DeprecatedListWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -138,8 +138,11 @@
      */
     protected void generateDeprecatedListFile(DeprecatedAPIListBuilder deprapi)
             throws IOException {
-        Content body = getHeader();
-        body.addContent(getContentsList(deprapi));
+        HtmlTree body = getHeader();
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
+                ? HtmlTree.MAIN()
+                : body;
+        htmlTree.addContent(getContentsList(deprapi));
         String memberTableSummary;
         String[] memberTableHeader = new String[1];
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
@@ -164,9 +167,20 @@
                             HEADING_KEYS[i], memberTableSummary, memberTableHeader, div);
             }
         }
-        body.addContent(div);
-        addNavLinks(false, body);
-        addBottom(body);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            htmlTree.addContent(div);
+            body.addContent(htmlTree);
+        } else {
+            body.addContent(div);
+        }
+        htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : body;
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            body.addContent(htmlTree);
+        }
         printHtmlDocument(null, true, body);
     }
 
@@ -226,11 +240,17 @@
      *
      * @return a content tree for the header
      */
-    public Content getHeader() {
+    public HtmlTree getHeader() {
         String title = configuration.getText("doclet.Window_Deprecated_List");
-        Content bodyTree = getBody(true, getWindowTitle(title));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(title));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         return bodyTree;
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/EnumConstantWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -69,6 +69,13 @@
     /**
      * {@inheritDoc}
      */
+    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
+        writer.addMemberTree(memberSummaryTree, memberTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public Content getEnumConstantsDetailsTreeHeader(ClassDoc classDoc,
             Content memberDetailsTree) {
         memberDetailsTree.addContent(HtmlConstants.START_OF_ENUM_CONSTANT_DETAILS);
@@ -140,6 +147,10 @@
      * {@inheritDoc}
      */
     public Content getEnumConstantsDetails(Content enumConstantsDetailsTree) {
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(enumConstantsDetailsTree));
+            return htmlTree;
+        }
         return getMemberTree(enumConstantsDetailsTree);
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FieldWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -70,6 +70,13 @@
     /**
      * {@inheritDoc}
      */
+    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
+        writer.addMemberTree(memberSummaryTree, memberTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public Content getFieldDetailsTreeHeader(ClassDoc classDoc,
             Content memberDetailsTree) {
         memberDetailsTree.addContent(HtmlConstants.START_OF_FIELD_DETAILS);
@@ -161,6 +168,10 @@
      * {@inheritDoc}
      */
     public Content getFieldDetails(Content fieldDetailsTree) {
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(fieldDetailsTree));
+            return htmlTree;
+        }
         return getMemberTree(fieldDetailsTree);
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/FrameOutputWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -96,7 +96,12 @@
     protected void generateFrameFile() throws IOException {
         Content frame = getFrameDetails();
         HtmlTree body = new HtmlTree(HtmlTag.BODY);
-        body.addContent(frame);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            HtmlTree main = HtmlTree.MAIN(frame);
+            body.addContent(main);
+        } else {
+            body.addContent(frame);
+        }
         if (configuration.windowtitle.length() > 0) {
             printFramesDocument(configuration.windowtitle, configuration,
                     body);
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HelpWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -44,6 +44,8 @@
  */
 public class HelpWriter extends HtmlDocletWriter {
 
+    HtmlTree mainTree = HtmlTree.MAIN();
+
     /**
      * Constructor to construct HelpWriter object.
      * @param filename File to be generated.
@@ -81,12 +83,24 @@
      */
     protected void generateHelpFile() throws IOException {
         String title = configuration.getText("doclet.Window_Help_title");
-        Content body = getBody(true, getWindowTitle(title));
-        addTop(body);
-        addNavLinks(true, body);
+        HtmlTree body = getBody(true, getWindowTitle(title));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : body;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            body.addContent(htmlTree);
+        }
         addHelpFileContents(body);
-        addNavLinks(false, body);
-        addBottom(body);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            htmlTree = HtmlTree.FOOTER();
+        }
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            body.addContent(htmlTree);
+        }
         printHtmlDocument(null, true, body);
     }
 
@@ -105,26 +119,39 @@
         Content line2 = HtmlTree.DIV(HtmlStyle.subTitle,
                 getResource("doclet.Help_line_2"));
         div.addContent(line2);
-        contentTree.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(div);
+        } else {
+            contentTree.addContent(div);
+        }
+        HtmlTree htmlTree;
         HtmlTree ul = new HtmlTree(HtmlTag.UL);
         ul.addStyle(HtmlStyle.blockList);
         if (configuration.createoverview) {
             Content overviewHeading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 getResource("doclet.Overview"));
-            Content liOverview = HtmlTree.LI(HtmlStyle.blockList, overviewHeading);
+            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                    ? HtmlTree.SECTION(overviewHeading)
+                    : HtmlTree.LI(HtmlStyle.blockList, overviewHeading);
             Content line3 = getResource("doclet.Help_line_3",
                     getHyperLink(DocPaths.OVERVIEW_SUMMARY,
                     configuration.getText("doclet.Overview")));
             Content overviewPara = HtmlTree.P(line3);
-            liOverview.addContent(overviewPara);
-            ul.addContent(liOverview);
+            htmlTree.addContent(overviewPara);
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+            } else {
+                ul.addContent(htmlTree);
+            }
         }
         Content packageHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 getResource("doclet.Package"));
-        Content liPackage = HtmlTree.LI(HtmlStyle.blockList, packageHead);
+        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.SECTION(packageHead)
+                : HtmlTree.LI(HtmlStyle.blockList, packageHead);
         Content line4 = getResource("doclet.Help_line_4");
         Content packagePara = HtmlTree.P(line4);
-        liPackage.addContent(packagePara);
+        htmlTree.addContent(packagePara);
         HtmlTree ulPackage = new HtmlTree(HtmlTag.UL);
         ulPackage.addContent(HtmlTree.LI(
                 getResource("doclet.Interfaces_Italic")));
@@ -138,14 +165,20 @@
                 getResource("doclet.Errors")));
         ulPackage.addContent(HtmlTree.LI(
                 getResource("doclet.AnnotationTypes")));
-        liPackage.addContent(ulPackage);
-        ul.addContent(liPackage);
+        htmlTree.addContent(ulPackage);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+        } else {
+            ul.addContent(htmlTree);
+        }
         Content classHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 getResource("doclet.Help_line_5"));
-        Content liClass = HtmlTree.LI(HtmlStyle.blockList, classHead);
+        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.SECTION(classHead)
+                : HtmlTree.LI(HtmlStyle.blockList, classHead);
         Content line6 = getResource("doclet.Help_line_6");
         Content classPara = HtmlTree.P(line6);
-        liClass.addContent(classPara);
+        htmlTree.addContent(classPara);
         HtmlTree ul1 = new HtmlTree(HtmlTag.UL);
         ul1.addContent(HtmlTree.LI(
                 getResource("doclet.Help_line_7")));
@@ -159,7 +192,7 @@
                 getResource("doclet.Help_line_11")));
         ul1.addContent(HtmlTree.LI(
                 getResource("doclet.Help_line_12")));
-        liClass.addContent(ul1);
+        htmlTree.addContent(ul1);
         HtmlTree ul2 = new HtmlTree(HtmlTag.UL);
         ul2.addContent(HtmlTree.LI(
                 getResource("doclet.Nested_Class_Summary")));
@@ -169,7 +202,7 @@
                 getResource("doclet.Constructor_Summary")));
         ul2.addContent(HtmlTree.LI(
                 getResource("doclet.Method_Summary")));
-        liClass.addContent(ul2);
+        htmlTree.addContent(ul2);
         HtmlTree ul3 = new HtmlTree(HtmlTag.UL);
         ul3.addContent(HtmlTree.LI(
                 getResource("doclet.Field_Detail")));
@@ -177,18 +210,24 @@
                 getResource("doclet.Constructor_Detail")));
         ul3.addContent(HtmlTree.LI(
                 getResource("doclet.Method_Detail")));
-        liClass.addContent(ul3);
+        htmlTree.addContent(ul3);
         Content line13 = getResource("doclet.Help_line_13");
         Content para = HtmlTree.P(line13);
-        liClass.addContent(para);
-        ul.addContent(liClass);
+        htmlTree.addContent(para);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+        } else {
+            ul.addContent(htmlTree);
+        }
         //Annotation Types
         Content aHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 getResource("doclet.AnnotationType"));
-        Content liAnnotation = HtmlTree.LI(HtmlStyle.blockList, aHead);
+        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.SECTION(aHead)
+                : HtmlTree.LI(HtmlStyle.blockList, aHead);
         Content aline1 = getResource("doclet.Help_annotation_type_line_1");
         Content aPara = HtmlTree.P(aline1);
-        liAnnotation.addContent(aPara);
+        htmlTree.addContent(aPara);
         HtmlTree aul = new HtmlTree(HtmlTag.UL);
         aul.addContent(HtmlTree.LI(
                 getResource("doclet.Help_annotation_type_line_2")));
@@ -200,15 +239,21 @@
                 getResource("doclet.Annotation_Type_Optional_Member_Summary")));
         aul.addContent(HtmlTree.LI(
                 getResource("doclet.Annotation_Type_Member_Detail")));
-        liAnnotation.addContent(aul);
-        ul.addContent(liAnnotation);
+        htmlTree.addContent(aul);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+        } else {
+            ul.addContent(htmlTree);
+        }
         //Enums
         Content enumHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 getResource("doclet.Enum"));
-        Content liEnum = HtmlTree.LI(HtmlStyle.blockList, enumHead);
+        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.SECTION(enumHead)
+                : HtmlTree.LI(HtmlStyle.blockList, enumHead);
         Content eline1 = getResource("doclet.Help_enum_line_1");
         Content enumPara = HtmlTree.P(eline1);
-        liEnum.addContent(enumPara);
+        htmlTree.addContent(enumPara);
         HtmlTree eul = new HtmlTree(HtmlTag.UL);
         eul.addContent(HtmlTree.LI(
                 getResource("doclet.Help_enum_line_2")));
@@ -218,46 +263,68 @@
                 getResource("doclet.Enum_Constant_Summary")));
         eul.addContent(HtmlTree.LI(
                 getResource("doclet.Enum_Constant_Detail")));
-        liEnum.addContent(eul);
-        ul.addContent(liEnum);
+        htmlTree.addContent(eul);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+        } else {
+            ul.addContent(htmlTree);
+        }
         if (configuration.classuse) {
             Content useHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                     getResource("doclet.Help_line_14"));
-            Content liUse = HtmlTree.LI(HtmlStyle.blockList, useHead);
+            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                    ? HtmlTree.SECTION(useHead)
+                    : HtmlTree.LI(HtmlStyle.blockList, useHead);
             Content line15 = getResource("doclet.Help_line_15");
             Content usePara = HtmlTree.P(line15);
-            liUse.addContent(usePara);
-            ul.addContent(liUse);
+            htmlTree.addContent(usePara);
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+            } else {
+                ul.addContent(htmlTree);
+            }
         }
         if (configuration.createtree) {
             Content treeHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                     getResource("doclet.Help_line_16"));
-            Content liTree = HtmlTree.LI(HtmlStyle.blockList, treeHead);
+            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                    ? HtmlTree.SECTION(treeHead)
+                    : HtmlTree.LI(HtmlStyle.blockList, treeHead);
             Content line17 = getResource("doclet.Help_line_17_with_tree_link",
                     getHyperLink(DocPaths.OVERVIEW_TREE,
                     configuration.getText("doclet.Class_Hierarchy")),
                     HtmlTree.CODE(new StringContent("java.lang.Object")));
             Content treePara = HtmlTree.P(line17);
-            liTree.addContent(treePara);
+            htmlTree.addContent(treePara);
             HtmlTree tul = new HtmlTree(HtmlTag.UL);
             tul.addContent(HtmlTree.LI(
                     getResource("doclet.Help_line_18")));
             tul.addContent(HtmlTree.LI(
                     getResource("doclet.Help_line_19")));
-            liTree.addContent(tul);
-            ul.addContent(liTree);
+            htmlTree.addContent(tul);
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+            } else {
+                ul.addContent(htmlTree);
+            }
         }
         if (!(configuration.nodeprecatedlist ||
                   configuration.nodeprecated)) {
             Content dHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                     getResource("doclet.Deprecated_API"));
-            Content liDeprecated = HtmlTree.LI(HtmlStyle.blockList, dHead);
+            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                    ? HtmlTree.SECTION(dHead)
+                    : HtmlTree.LI(HtmlStyle.blockList, dHead);
             Content line20 = getResource("doclet.Help_line_20_with_deprecated_api_link",
                     getHyperLink(DocPaths.DEPRECATED_LIST,
                     configuration.getText("doclet.Deprecated_API")));
             Content dPara = HtmlTree.P(line20);
-            liDeprecated.addContent(dPara);
-            ul.addContent(liDeprecated);
+            htmlTree.addContent(dPara);
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+            } else {
+                ul.addContent(htmlTree);
+            }
         }
         if (configuration.createindex) {
             Content indexlink;
@@ -270,55 +337,96 @@
             }
             Content indexHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                     getResource("doclet.Help_line_21"));
-            Content liIndex = HtmlTree.LI(HtmlStyle.blockList, indexHead);
+            htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                    ? HtmlTree.SECTION(indexHead)
+                    : HtmlTree.LI(HtmlStyle.blockList, indexHead);
             Content line22 = getResource("doclet.Help_line_22", indexlink);
             Content indexPara = HtmlTree.P(line22);
-            liIndex.addContent(indexPara);
-            ul.addContent(liIndex);
+            htmlTree.addContent(indexPara);
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+            } else {
+                ul.addContent(htmlTree);
+            }
         }
         Content prevHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 getResource("doclet.Help_line_23"));
-        Content liPrev = HtmlTree.LI(HtmlStyle.blockList, prevHead);
+        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.SECTION(prevHead)
+                : HtmlTree.LI(HtmlStyle.blockList, prevHead);
         Content line24 = getResource("doclet.Help_line_24");
         Content prevPara = HtmlTree.P(line24);
-        liPrev.addContent(prevPara);
-        ul.addContent(liPrev);
+        htmlTree.addContent(prevPara);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+        } else {
+            ul.addContent(htmlTree);
+        }
         Content frameHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 getResource("doclet.Help_line_25"));
-        Content liFrame = HtmlTree.LI(HtmlStyle.blockList, frameHead);
+        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.SECTION(frameHead)
+                : HtmlTree.LI(HtmlStyle.blockList, frameHead);
         Content line26 = getResource("doclet.Help_line_26");
         Content framePara = HtmlTree.P(line26);
-        liFrame.addContent(framePara);
-        ul.addContent(liFrame);
+        htmlTree.addContent(framePara);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+        } else {
+            ul.addContent(htmlTree);
+        }
         Content allclassesHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 getResource("doclet.All_Classes"));
-        Content liAllClasses = HtmlTree.LI(HtmlStyle.blockList, allclassesHead);
+        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.SECTION(allclassesHead)
+                : HtmlTree.LI(HtmlStyle.blockList, allclassesHead);
         Content line27 = getResource("doclet.Help_line_27",
                 getHyperLink(DocPaths.ALLCLASSES_NOFRAME,
                 configuration.getText("doclet.All_Classes")));
         Content allclassesPara = HtmlTree.P(line27);
-        liAllClasses.addContent(allclassesPara);
-        ul.addContent(liAllClasses);
+        htmlTree.addContent(allclassesPara);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+        } else {
+            ul.addContent(htmlTree);
+        }
         Content sHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 getResource("doclet.Serialized_Form"));
-        Content liSerial = HtmlTree.LI(HtmlStyle.blockList, sHead);
+        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.SECTION(sHead)
+                : HtmlTree.LI(HtmlStyle.blockList, sHead);
         Content line28 = getResource("doclet.Help_line_28");
         Content serialPara = HtmlTree.P(line28);
-        liSerial.addContent(serialPara);
-        ul.addContent(liSerial);
+        htmlTree.addContent(serialPara);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+        } else {
+            ul.addContent(htmlTree);
+        }
         Content constHead = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                 getResource("doclet.Constants_Summary"));
-        Content liConst = HtmlTree.LI(HtmlStyle.blockList, constHead);
+        htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.SECTION(constHead)
+                : HtmlTree.LI(HtmlStyle.blockList, constHead);
         Content line29 = getResource("doclet.Help_line_29",
                 getHyperLink(DocPaths.CONSTANT_VALUES,
                 configuration.getText("doclet.Constants_Summary")));
         Content constPara = HtmlTree.P(line29);
-        liConst.addContent(constPara);
-        ul.addContent(liConst);
+        htmlTree.addContent(constPara);
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            ul.addContent(HtmlTree.LI(HtmlStyle.blockList, htmlTree));
+        } else {
+            ul.addContent(htmlTree);
+        }
         Content divContent = HtmlTree.DIV(HtmlStyle.contentContainer, ul);
         Content line30 = HtmlTree.SPAN(HtmlStyle.emphasizedPhrase, getResource("doclet.Help_line_30"));
         divContent.addContent(line30);
-        contentTree.addContent(divContent);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(divContent);
+            contentTree.addContent(mainTree);
+        } else {
+            contentTree.addContent(divContent);
+        }
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlDocletWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -183,8 +183,7 @@
      * @return a content tree for the script
      */
     public Content getAllClassesLinkScript(String id) {
-        HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
-        script.addAttr(HtmlAttr.TYPE, "text/javascript");
+        HtmlTree script = HtmlTree.SCRIPT();
         String scriptCode = "<!--" + DocletConstants.NL +
                 "  allClassesLink = document.getElementById(\"" + id + "\");" + DocletConstants.NL +
                 "  if(window==top) {" + DocletConstants.NL +
@@ -197,6 +196,9 @@
         Content scriptContent = new RawHtml(scriptCode);
         script.addContent(scriptContent);
         Content div = HtmlTree.DIV(script);
+        Content div_noscript = HtmlTree.DIV(getResource("doclet.No_Script_Message"));
+        Content noScript = HtmlTree.NOSCRIPT(div_noscript);
+        div.addContent(noScript);
         return div;
     }
 
@@ -342,8 +344,9 @@
         if(classes.length > 0) {
             Arrays.sort(classes);
             Content caption = getTableCaption(new RawHtml(label));
-            Content table = HtmlTree.TABLE(HtmlStyle.typeSummary, 0, 3, 0,
-                    tableSummary, caption);
+            Content table = (configuration.isOutputHtml5())
+                    ? HtmlTree.TABLE(HtmlStyle.typeSummary, caption)
+                    : HtmlTree.TABLE(HtmlStyle.typeSummary, tableSummary, caption);
             table.addContent(getSummaryTableHeader(tableHeader, "col"));
             Content tbody = new HtmlTree(HtmlTag.TBODY);
             for (int i = 0; i < classes.length; i++) {
@@ -393,7 +396,9 @@
      */
     public void printHtmlDocument(String[] metakeywords, boolean includeScript,
             Content body) throws IOException {
-        Content htmlDocType = DocType.TRANSITIONAL;
+        Content htmlDocType = configuration.isOutputHtml5()
+                ? DocType.HTML5
+                : DocType.TRANSITIONAL;
         Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
         Content head = new HtmlTree(HtmlTag.HEAD);
         head.addContent(getGeneratedBy(!configuration.notimestamp));
@@ -404,7 +409,9 @@
         head.addContent(meta);
         if (!configuration.notimestamp) {
             SimpleDateFormat dateFormat = new SimpleDateFormat("yyyy-MM-dd");
-            meta = HtmlTree.META("date", dateFormat.format(new Date()));
+            meta = HtmlTree.META(configuration.isOutputHtml5()
+                    ? "dc.created"
+                    : "date", dateFormat.format(new Date()));
             head.addContent(meta);
         }
         if (metakeywords != null) {
@@ -459,38 +466,41 @@
     /**
      * Adds the user specified top.
      *
-     * @param body the content tree to which user specified top will be added
+     * @param htmlTree the content tree to which user specified top will be added
      */
-    public void addTop(Content body) {
+    public void addTop(Content htmlTree) {
         Content top = new RawHtml(replaceDocRootDir(configuration.top));
-        body.addContent(top);
+        htmlTree.addContent(top);
     }
 
     /**
      * Adds the user specified bottom.
      *
-     * @param body the content tree to which user specified bottom will be added
+     * @param htmlTree the content tree to which user specified bottom will be added
      */
-    public void addBottom(Content body) {
+    public void addBottom(Content htmlTree) {
         Content bottom = new RawHtml(replaceDocRootDir(configuration.bottom));
         Content small = HtmlTree.SMALL(bottom);
         Content p = HtmlTree.P(HtmlStyle.legalCopy, small);
-        body.addContent(p);
+        htmlTree.addContent(p);
     }
 
     /**
      * Adds the navigation bar for the Html page at the top and and the bottom.
      *
      * @param header If true print navigation bar at the top of the page else
-     * @param body the HtmlTree to which the nav links will be added
+     * @param htmlTree the HtmlTree to which the nav links will be added
      */
-    protected void addNavLinks(boolean header, Content body) {
+    protected void addNavLinks(boolean header, Content htmlTree) {
         if (!configuration.nonavbar) {
+            Content tree = (configuration.allowTag(HtmlTag.NAV))
+                    ? HtmlTree.NAV()
+                    : htmlTree;
             String allClassesId = "allclasses_";
             HtmlTree navDiv = new HtmlTree(HtmlTag.DIV);
             Content skipNavLinks = configuration.getResource("doclet.Skip_navigation_links");
             if (header) {
-                body.addContent(HtmlConstants.START_OF_TOP_NAVBAR);
+                tree.addContent(HtmlConstants.START_OF_TOP_NAVBAR);
                 navDiv.addStyle(HtmlStyle.topNav);
                 allClassesId += "navbar_top";
                 Content a = getMarkerAnchor(SectionName.NAVBAR_TOP);
@@ -501,7 +511,7 @@
                     skipNavLinks.toString(), ""));
                 navDiv.addContent(skipLinkContent);
             } else {
-                body.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR);
+                tree.addContent(HtmlConstants.START_OF_BOTTOM_NAVBAR);
                 navDiv.addStyle(HtmlStyle.bottomNav);
                 allClassesId += "navbar_bottom";
                 Content a = getMarkerAnchor(SectionName.NAVBAR_BOTTOM);
@@ -548,7 +558,7 @@
             navDiv.addContent(navList);
             Content aboutDiv = HtmlTree.DIV(HtmlStyle.aboutLanguage, getUserHeaderFooter(header));
             navDiv.addContent(aboutDiv);
-            body.addContent(navDiv);
+            tree.addContent(navDiv);
             Content ulNav = HtmlTree.UL(HtmlStyle.navList, getNavLinkPrevious());
             ulNav.addContent(getNavLinkNext());
             Content subDiv = HtmlTree.DIV(HtmlStyle.subNav, ulNav);
@@ -562,12 +572,15 @@
             addSummaryDetailLinks(subDiv);
             if (header) {
                 subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_TOP));
-                body.addContent(subDiv);
-                body.addContent(HtmlConstants.END_OF_TOP_NAVBAR);
+                tree.addContent(subDiv);
+                tree.addContent(HtmlConstants.END_OF_TOP_NAVBAR);
             } else {
                 subDiv.addContent(getMarkerAnchor(SectionName.SKIP_NAVBAR_BOTTOM));
-                body.addContent(subDiv);
-                body.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR);
+                tree.addContent(subDiv);
+                tree.addContent(HtmlConstants.END_OF_BOTTOM_NAVBAR);
+            }
+            if (configuration.allowTag(HtmlTag.NAV)) {
+                htmlTree.addContent(tree);
             }
         }
     }
@@ -904,7 +917,7 @@
     public Content getMarkerAnchor(String anchorName, Content anchorContent) {
         if (anchorContent == null)
             anchorContent = new Comment(" ");
-        Content markerAnchor = HtmlTree.A_NAME(anchorName, anchorContent);
+        Content markerAnchor = HtmlTree.A_ID(anchorName, anchorContent);
         return markerAnchor;
     }
 
@@ -942,8 +955,10 @@
     protected void addPackageDeprecatedAPI(List<Doc> deprPkgs, String headingKey,
             String tableSummary, String[] tableHeader, Content contentTree) {
         if (deprPkgs.size() > 0) {
-            Content table = HtmlTree.TABLE(HtmlStyle.deprecatedSummary, 0, 3, 0, tableSummary,
-                    getTableCaption(configuration.getResource(headingKey)));
+            Content caption = getTableCaption(configuration.getResource(headingKey));
+            Content table = (configuration.isOutputHtml5())
+                    ? HtmlTree.TABLE(HtmlStyle.deprecatedSummary, caption)
+                    : HtmlTree.TABLE(HtmlStyle.deprecatedSummary, tableSummary, caption);
             table.addContent(getSummaryTableHeader(tableHeader, "col"));
             Content tbody = new HtmlTree(HtmlTag.TBODY);
             for (int i = 0; i < deprPkgs.size(); i++) {
@@ -1829,8 +1844,7 @@
      * @return an HtmlTree for the Script tag which provides the JavaScript location
      */
     public HtmlTree getScriptProperties() {
-        HtmlTree script = HtmlTree.SCRIPT("text/javascript",
-                pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath());
+        HtmlTree script = HtmlTree.SCRIPT(pathToRoot.resolve(DocPaths.JAVASCRIPT).getPath());
         return script;
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/HtmlSerialMethodWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -150,7 +150,7 @@
             writer.getTagletWriterInstance(false), tagContent);
         Content dlTags = new HtmlTree(HtmlTag.DL);
         dlTags.addContent(tagContent);
-        methodsContentTree.addContent(dlTags);  // TODO: what if empty?
+        methodsContentTree.addContent(dlTags);
         MethodDoc method = member;
         if (method.name().compareTo("writeExternal") == 0
                 && method.tags("serialData").length == 0) {
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/MethodWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -82,6 +82,13 @@
     /**
      * {@inheritDoc}
      */
+    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
+        writer.addMemberTree(memberSummaryTree, memberTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public Content getMethodDetailsTreeHeader(ClassDoc classDoc,
             Content memberDetailsTree) {
         memberDetailsTree.addContent(HtmlConstants.START_OF_METHOD_DETAILS);
@@ -182,6 +189,10 @@
      * {@inheritDoc}
      */
     public Content getMethodDetails(Content methodDetailsTree) {
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(methodDetailsTree));
+            return htmlTree;
+        }
         return getMemberTree(methodDetailsTree);
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/NestedClassWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -69,6 +69,13 @@
     }
 
     /**
+     * {@inheritDoc}
+     */
+    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
+        writer.addMemberTree(memberSummaryTree, memberTree);
+    }
+
+    /**
      * Close the writer.
      */
     public void close() throws IOException {
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageFrameWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -93,15 +93,21 @@
         try {
             packgen = new PackageFrameWriter(configuration, packageDoc);
             String pkgName = configuration.utils.getPackageName(packageDoc);
-            Content body = packgen.getBody(false, packgen.getWindowTitle(pkgName));
+            HtmlTree body = packgen.getBody(false, packgen.getWindowTitle(pkgName));
             Content pkgNameContent = new StringContent(pkgName);
+            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
+                    ? HtmlTree.MAIN()
+                    : body;
             Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
                     packgen.getTargetPackageLink(packageDoc, "classFrame", pkgNameContent));
-            body.addContent(heading);
+            htmlTree.addContent(heading);
             HtmlTree div = new HtmlTree(HtmlTag.DIV);
             div.addStyle(HtmlStyle.indexContainer);
             packgen.addClassListing(div);
-            body.addContent(div);
+            htmlTree.addContent(div);
+            if (configuration.allowTag(HtmlTag.MAIN)) {
+                body.addContent(htmlTree);
+            }
             packgen.printHtmlDocument(
                     configuration.metakeywords.getMetaKeywords(packageDoc), false, body);
             packgen.close();
@@ -120,7 +126,7 @@
      *
      * @param contentTree the content tree to which the listing will be added
      */
-    protected void addClassListing(Content contentTree) {
+    protected void addClassListing(HtmlTree contentTree) {
         Configuration config = configuration;
         if (packageDoc.isIncluded()) {
             addClassKindListing(packageDoc.interfaces(),
@@ -160,11 +166,14 @@
      * @param contentTree the content tree to which the class kind listing will be added
      */
     protected void addClassKindListing(ClassDoc[] arr, Content labelContent,
-            Content contentTree) {
+            HtmlTree contentTree) {
         arr = utils.filterOutPrivateClasses(arr, configuration.javafx);
         if(arr.length > 0) {
             Arrays.sort(arr);
             boolean printedHeader = false;
+            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                    ? HtmlTree.SECTION()
+                    : contentTree;
             HtmlTree ul = new HtmlTree(HtmlTag.UL);
             ul.setTitle(labelContent);
             for (ClassDoc classDoc : arr) {
@@ -177,7 +186,7 @@
                 if (!printedHeader) {
                     Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                                                        true, labelContent);
-                    contentTree.addContent(heading);
+                    htmlTree.addContent(heading);
                     printedHeader = true;
                 }
                 Content arr_i_name = new StringContent(classDoc.name());
@@ -188,7 +197,10 @@
                 Content li = HtmlTree.LI(link);
                 ul.addContent(li);
             }
-            contentTree.addContent(ul);
+            htmlTree.addContent(ul);
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                contentTree.addContent(htmlTree);
+            }
         }
     }
 }
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexFrameWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -83,7 +83,9 @@
             String tableSummary, Content body) {
         Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true,
                 packagesLabel);
-        Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
+                ? HtmlTree.MAIN(HtmlStyle.indexContainer, heading)
+                : HtmlTree.DIV(HtmlStyle.indexContainer, heading);
         HtmlTree ul = new HtmlTree(HtmlTag.UL);
         ul.setTitle(packagesLabel);
         for (PackageDoc aPackage : packages) {
@@ -94,8 +96,8 @@
                 ul.addContent(getPackage(aPackage));
             }
         }
-        div.addContent(ul);
-        body.addContent(div);
+        htmlTree.addContent(ul);
+        body.addContent(htmlTree);
     }
 
     /**
@@ -146,26 +148,26 @@
      * Adds "All Classes" link for the top of the left-hand frame page to the
      * documentation tree.
      *
-     * @param div the Content object to which the all classes link should be added
+     * @param ul the Content object to which the "All Classes" link should be added
      */
-    protected void addAllClassesLink(Content div) {
+    protected void addAllClassesLink(Content ul) {
         Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME,
                 allclassesLabel, "", "packageFrame");
-        Content span = HtmlTree.SPAN(linkContent);
-        div.addContent(span);
+        Content li = HtmlTree.LI(linkContent);
+        ul.addContent(li);
     }
 
     /**
      * Adds "All Profiles" link for the top of the left-hand frame page to the
      * documentation tree.
      *
-     * @param div the Content object to which the all profiles link should be added
+     * @param ul the Content object to which the "All Profiles" link should be added
      */
-    protected void addAllProfilesLink(Content div) {
+    protected void addAllProfilesLink(Content ul) {
         Content linkContent = getHyperLink(DocPaths.PROFILE_OVERVIEW_FRAME,
                 allprofilesLabel, "", "packageListFrame");
-        Content span = HtmlTree.SPAN(linkContent);
-        div.addContent(span);
+        Content li = HtmlTree.LI(linkContent);
+        ul.addContent(li);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageIndexWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -67,6 +67,11 @@
     private List<String> groupList;
 
     /**
+     * HTML tree for main tag.
+     */
+    private HtmlTree htmlTree = HtmlTree.MAIN();
+
+    /**
      * Construct the PackageIndexWriter. Also constructs the grouping
      * information as provided on the command line by "-group" option. Stores
      * the order of groups specified by the user.
@@ -140,7 +145,11 @@
         }
         profilesDiv.addContent(ul);
         Content div = HtmlTree.DIV(HtmlStyle.contentContainer, profilesDiv);
-        body.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            htmlTree.addContent(div);
+        } else {
+            body.addContent(div);
+        }
     }
 
     /**
@@ -148,14 +157,19 @@
      */
     protected void addPackagesList(Collection<PackageDoc> packages, String text,
             String tableSummary, Content body) {
-        Content table = HtmlTree.TABLE(HtmlStyle.overviewSummary, 0, 3, 0, tableSummary,
-                getTableCaption(new RawHtml(text)));
+        Content table = (configuration.isOutputHtml5())
+                ? HtmlTree.TABLE(HtmlStyle.overviewSummary, getTableCaption(new RawHtml(text)))
+                : HtmlTree.TABLE(HtmlStyle.overviewSummary, tableSummary, getTableCaption(new RawHtml(text)));
         table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
         Content tbody = new HtmlTree(HtmlTag.TBODY);
         addPackagesList(packages, tbody);
         table.addContent(tbody);
         Content div = HtmlTree.DIV(HtmlStyle.contentContainer, table);
-        body.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            htmlTree.addContent(div);
+        } else {
+            body.addContent(div);
+        }
     }
 
     /**
@@ -192,6 +206,7 @@
      * @param body the documentation tree to which the overview header will be added
      */
     protected void addOverviewHeader(Content body) {
+        addConfigurationTitle(body);
         if (root.inlineTags().length > 0) {
             HtmlTree subTitleDiv = new HtmlTree(HtmlTag.DIV);
             subTitleDiv.addStyle(HtmlStyle.subTitle);
@@ -205,7 +220,11 @@
                     descriptionLabel, "", "");
             descPara.addContent(descLink);
             div.addContent(descPara);
-            body.addContent(div);
+            if (configuration.allowTag(HtmlTag.MAIN)) {
+                htmlTree.addContent(div);
+            } else {
+                body.addContent(div);
+            }
         }
     }
 
@@ -235,7 +254,12 @@
         div.addStyle(HtmlStyle.contentContainer);
         addOverviewComment(div);
         addTagsInfo(root, div);
-        body.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            htmlTree.addContent(div);
+            body.addContent(htmlTree);
+        } else {
+            body.addContent(div);
+        }
     }
 
     /**
@@ -246,9 +270,14 @@
      * @body the documentation tree to which the navigation bar header will be added
      */
     protected void addNavigationBarHeader(Content body) {
-        addTop(body);
-        addNavLinks(true, body);
-        addConfigurationTitle(body);
+        Content htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : body;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            body.addContent(htmlTree);
+        }
     }
 
     /**
@@ -258,7 +287,13 @@
      * @param body the documentation tree to which the navigation bar footer will be added
      */
     protected void addNavigationBarFooter(Content body) {
-        addNavLinks(false, body);
-        addBottom(body);
+        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : body;
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            body.addContent(htmlTree);
+        }
     }
 }
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageTreeWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -113,7 +113,10 @@
      * Generate a separate tree file for each package.
      */
     protected void generatePackageTreeFile() throws IOException {
-        Content body = getPackageTreeHeader();
+        HtmlTree body = getPackageTreeHeader();
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
+                ? HtmlTree.MAIN()
+                : body;
         Content headContent = getResource("doclet.Hierarchy_For_Package",
                 utils.getPackageName(packagedoc));
         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false,
@@ -122,16 +125,25 @@
         if (configuration.packages.size() > 1) {
             addLinkToMainTree(div);
         }
-        body.addContent(div);
+        htmlTree.addContent(div);
         HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
         divTree.addStyle(HtmlStyle.contentContainer);
         addTree(classtree.baseclasses(), "doclet.Class_Hierarchy", divTree);
         addTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy", divTree);
         addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree);
         addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree);
-        body.addContent(divTree);
-        addNavLinks(false, body);
-        addBottom(body);
+        htmlTree.addContent(divTree);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            body.addContent(htmlTree);
+        }
+        HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : body;
+        addNavLinks(false, tree);
+        addBottom(tree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            body.addContent(tree);
+        }
         printHtmlDocument(null, true, body);
     }
 
@@ -140,12 +152,18 @@
      *
      * @return a content tree for the header
      */
-    protected Content getPackageTreeHeader() {
+    protected HtmlTree getPackageTreeHeader() {
         String title = packagedoc.name() + " " +
                 configuration.getText("doclet.Window_Class_Hierarchy");
-        Content bodyTree = getBody(true, getWindowTitle(title));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(title));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         return bodyTree;
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageUseWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -48,6 +48,7 @@
 
     final PackageDoc pkgdoc;
     final SortedMap<String,Set<ClassDoc>> usingPackageToUsedClasses = new TreeMap<>();
+    protected HtmlTree mainTree = HtmlTree.MAIN();
 
     /**
      * Constructor.
@@ -112,7 +113,7 @@
      * Generate the package use list.
      */
     protected void generatePackageUseFile() throws IOException {
-        Content body = getPackageUseHeader();
+        HtmlTree body = getPackageUseHeader();
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.addStyle(HtmlStyle.contentContainer);
         if (usingPackageToUsedClasses.isEmpty()) {
@@ -121,9 +122,20 @@
         } else {
             addPackageUse(div);
         }
-        body.addContent(div);
-        addNavLinks(false, body);
-        addBottom(body);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(div);
+            body.addContent(mainTree);
+        } else {
+            body.addContent(div);
+        }
+        HtmlTree tree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : body;
+        addNavLinks(false, tree);
+        addBottom(tree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            body.addContent(tree);
+        }
         printHtmlDocument(null, true, body);
     }
 
@@ -148,10 +160,12 @@
      * @param contentTree the content tree to which the package list will be added
      */
     protected void addPackageList(Content contentTree) throws IOException {
-        Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, useTableSummary,
-                getTableCaption(configuration.getResource(
+        Content caption = getTableCaption(configuration.getResource(
                 "doclet.ClassUse_Packages.that.use.0",
-                getPackageLink(pkgdoc, utils.getPackageName(pkgdoc)))));
+                getPackageLink(pkgdoc, utils.getPackageName(pkgdoc))));
+        Content table = (configuration.isOutputHtml5())
+                ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
+                : HtmlTree.TABLE(HtmlStyle.useSummary, useTableSummary, caption);
         table.addContent(getSummaryTableHeader(packageTableHeader, "col"));
         Content tbody = new HtmlTree(HtmlTag.TBODY);
         Iterator<String> it = usingPackageToUsedClasses.keySet().iterator();
@@ -191,11 +205,13 @@
             }
             String tableSummary = configuration.getText("doclet.Use_Table_Summary",
                                                         configuration.getText("doclet.classes"));
-            Content table = HtmlTree.TABLE(HtmlStyle.useSummary, 0, 3, 0, tableSummary,
-                                           getTableCaption(configuration.getResource(
-                                                   "doclet.ClassUse_Classes.in.0.used.by.1",
-                                                   getPackageLink(pkgdoc, utils.getPackageName(pkgdoc)),
-                                                   getPackageLink(usingPackage, utils.getPackageName(usingPackage)))));
+            Content caption = getTableCaption(configuration.getResource(
+                    "doclet.ClassUse_Classes.in.0.used.by.1",
+                    getPackageLink(pkgdoc, utils.getPackageName(pkgdoc)),
+                    getPackageLink(usingPackage, utils.getPackageName(usingPackage))));
+            Content table = (configuration.isOutputHtml5())
+                    ? HtmlTree.TABLE(HtmlStyle.useSummary, caption)
+                    : HtmlTree.TABLE(HtmlStyle.useSummary, tableSummary, caption);
             table.addContent(getSummaryTableHeader(classTableHeader, "col"));
             Content tbody = new HtmlTree(HtmlTag.TBODY);
             Iterator<ClassDoc> itc =
@@ -259,14 +275,20 @@
      *
      * @return a content tree representing the package use header
      */
-    protected Content getPackageUseHeader() {
+    protected HtmlTree getPackageUseHeader() {
         String packageText = configuration.getText("doclet.Package");
         String name = pkgdoc.name();
         String title = configuration.getText("doclet.Window_ClassUse_Header",
                 packageText, name);
-        Content bodyTree = getBody(true, getWindowTitle(title));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(title));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         ContentBuilder headContent = new ContentBuilder();
         headContent.addContent(getResource("doclet.ClassUse_Title", packageText));
         headContent.addContent(new HtmlTree(HtmlTag.BR));
@@ -274,7 +296,11 @@
         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
                 HtmlStyle.title, headContent);
         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
-        bodyTree.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(div);
+        } else {
+            bodyTree.addContent(div);
+        }
         return bodyTree;
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PackageWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -65,6 +65,16 @@
     protected PackageDoc packageDoc;
 
     /**
+     * The HTML tree for main tag.
+     */
+    protected HtmlTree mainTree = HtmlTree.MAIN();
+
+    /**
+     * The HTML tree for section tag.
+     */
+    protected HtmlTree sectionTree = HtmlTree.SECTION();
+
+    /**
      * Constructor to construct PackageWriter object and to generate
      * "package-summary.html" file in the respective package directory.
      * For example for package "java.lang" this will generate file
@@ -90,9 +100,15 @@
      * {@inheritDoc}
      */
     public Content getPackageHeader(String heading) {
-        Content bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageDoc)));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageDoc)));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.addStyle(HtmlStyle.header);
         Content annotationContent = new HtmlTree(HtmlTag.P);
@@ -117,7 +133,11 @@
             Content descPara = new HtmlTree(HtmlTag.P, seeLabel, space, descLink);
             div.addContent(descPara);
         }
-        bodyTree.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(div);
+        } else {
+            bodyTree.addContent(div);
+        }
         return bodyTree;
     }
 
@@ -169,8 +189,9 @@
         if(classes.length > 0) {
             Arrays.sort(classes);
             Content caption = getTableCaption(new RawHtml(label));
-            Content table = HtmlTree.TABLE(HtmlStyle.typeSummary, 0, 3, 0,
-                    tableSummary, caption);
+            Content table = (configuration.isOutputHtml5())
+                    ? HtmlTree.TABLE(HtmlStyle.typeSummary, caption)
+                    : HtmlTree.TABLE(HtmlStyle.typeSummary, tableSummary, caption);
             table.addContent(getSummaryTableHeader(tableHeader, "col"));
             Content tbody = new HtmlTree(HtmlTag.TBODY);
             for (int i = 0; i < classes.length; i++) {
@@ -216,9 +237,14 @@
             Content h2Content = new StringContent(
                     configuration.getText("doclet.Package_Description",
                     packageDoc.name()));
-            packageContentTree.addContent(HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING,
-                    true, h2Content));
-            addInlineComment(packageDoc, packageContentTree);
+            Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, h2Content);
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                sectionTree.addContent(heading);
+                addInlineComment(packageDoc, sectionTree);
+            } else {
+                packageContentTree.addContent(heading);
+                addInlineComment(packageDoc, packageContentTree);
+            }
         }
     }
 
@@ -226,15 +252,37 @@
      * {@inheritDoc}
      */
     public void addPackageTags(Content packageContentTree) {
-        addTagsInfo(packageDoc, packageContentTree);
+        Content htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? sectionTree
+                : packageContentTree;
+        addTagsInfo(packageDoc, htmlTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addPackageContent(Content contentTree, Content packageContentTree) {
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            packageContentTree.addContent(sectionTree);
+            mainTree.addContent(packageContentTree);
+            contentTree.addContent(mainTree);
+        } else {
+            contentTree.addContent(packageContentTree);
+        }
     }
 
     /**
      * {@inheritDoc}
      */
     public void addPackageFooter(Content contentTree) {
-        addNavLinks(false, contentTree);
-        addBottom(contentTree);
+        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : contentTree;
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            contentTree.addContent(htmlTree);
+        }
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfileIndexFrameWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfileIndexFrameWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -85,7 +85,9 @@
             String tableSummary, Content body) {
         Content heading = HtmlTree.HEADING(HtmlConstants.PROFILE_HEADING, true,
                 profilesLabel);
-        Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
+                ? HtmlTree.MAIN(HtmlStyle.indexContainer, heading)
+                : HtmlTree.DIV(HtmlStyle.indexContainer, heading);
         HtmlTree ul = new HtmlTree(HtmlTag.UL);
         ul.setTitle(profilesLabel);
         String profileName;
@@ -96,8 +98,8 @@
             if (configuration.shouldDocumentProfile(profileName))
                 ul.addContent(getProfile(profileName));
         }
-        div.addContent(ul);
-        body.addContent(div);
+        htmlTree.addContent(ul);
+        body.addContent(htmlTree);
     }
 
     /**
@@ -141,26 +143,26 @@
      * Adds "All Classes" link for the top of the left-hand frame page to the
      * documentation tree.
      *
-     * @param div the Content object to which the all classes link should be added
+     * @param ul the Content object to which the all classes link should be added
      */
-    protected void addAllClassesLink(Content div) {
+    protected void addAllClassesLink(Content ul) {
         Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME,
                 allclassesLabel, "", "packageFrame");
-        Content span = HtmlTree.SPAN(linkContent);
-        div.addContent(span);
+        Content li = HtmlTree.LI(linkContent);
+        ul.addContent(li);
     }
 
     /**
      * Adds "All Packages" link for the top of the left-hand frame page to the
      * documentation tree.
      *
-     * @param div the Content object to which the all packages link should be added
+     * @param ul the Content object to which the all packages link should be added
      */
-    protected void addAllPackagesLink(Content div) {
+    protected void addAllPackagesLink(Content ul) {
         Content linkContent = getHyperLink(DocPaths.OVERVIEW_FRAME,
                 allpackagesLabel, "", "packageListFrame");
-        Content span = HtmlTree.SPAN(linkContent);
-        div.addContent(span);
+        Content li = HtmlTree.LI(linkContent);
+        ul.addContent(li);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageFrameWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -93,21 +93,27 @@
             winTitle.append(sep);
             String pkgName = configuration.utils.getPackageName(packageDoc);
             winTitle.append(pkgName);
-            Content body = profpackgen.getBody(false,
+            HtmlTree body = profpackgen.getBody(false,
                     profpackgen.getWindowTitle(winTitle.toString()));
             Content profName = new StringContent(profileName);
             Content sepContent = new StringContent(sep);
             Content pkgNameContent = new RawHtml(pkgName);
+            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
+                    ? HtmlTree.MAIN()
+                    : body;
             Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, HtmlStyle.bar,
                     profpackgen.getTargetProfileLink("classFrame", profName, profileName));
             heading.addContent(sepContent);
             heading.addContent(profpackgen.getTargetProfilePackageLink(packageDoc,
                     "classFrame", pkgNameContent, profileName));
-            body.addContent(heading);
+            htmlTree.addContent(heading);
             HtmlTree div = new HtmlTree(HtmlTag.DIV);
             div.addStyle(HtmlStyle.indexContainer);
             profpackgen.addClassListing(div, profileValue);
-            body.addContent(div);
+            htmlTree.addContent(div);
+            if (configuration.allowTag(HtmlTag.MAIN)) {
+                body.addContent(htmlTree);
+            }
             profpackgen.printHtmlDocument(
                     configuration.metakeywords.getMetaKeywords(packageDoc), false, body);
             profpackgen.close();
@@ -127,7 +133,7 @@
      * @param contentTree the content tree to which the listing will be added
      * @param profileValue the value of the profile being documented
      */
-    protected void addClassListing(Content contentTree, int profileValue) {
+    protected void addClassListing(HtmlTree contentTree, int profileValue) {
         if (packageDoc.isIncluded()) {
             addClassKindListing(packageDoc.interfaces(),
                 getResource("doclet.Interfaces"), contentTree, profileValue);
@@ -153,10 +159,13 @@
      * @param profileValue the value of the profile being documented
      */
     protected void addClassKindListing(ClassDoc[] arr, Content labelContent,
-            Content contentTree, int profileValue) {
+            HtmlTree contentTree, int profileValue) {
         if(arr.length > 0) {
             Arrays.sort(arr);
             boolean printedHeader = false;
+            HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                    ? HtmlTree.SECTION()
+                    : contentTree;
             HtmlTree ul = new HtmlTree(HtmlTag.UL);
             ul.setTitle(labelContent);
             for (ClassDoc classDoc : arr) {
@@ -170,7 +179,7 @@
                 if (!printedHeader) {
                     Content heading = HtmlTree.HEADING(HtmlConstants.CONTENT_HEADING,
                                                        true, labelContent);
-                    contentTree.addContent(heading);
+                    htmlTree.addContent(heading);
                     printedHeader = true;
                 }
                 Content arr_i_name = new StringContent(classDoc.name());
@@ -181,7 +190,10 @@
                 Content li = HtmlTree.LI(link);
                 ul.addContent(li);
             }
-            contentTree.addContent(ul);
+            htmlTree.addContent(ul);
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                contentTree.addContent(htmlTree);
+            }
         }
     }
 }
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageIndexFrameWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -90,7 +90,9 @@
                 getTargetProfileLink("classFrame", profNameContent, profileName));
         heading.addContent(getSpace());
         heading.addContent(packagesLabel);
-        Content div = HtmlTree.DIV(HtmlStyle.indexContainer, heading);
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
+                ? HtmlTree.MAIN(HtmlStyle.indexContainer, heading)
+                : HtmlTree.DIV(HtmlStyle.indexContainer, heading);
         HtmlTree ul = new HtmlTree(HtmlTag.UL);
         ul.setTitle(packagesLabel);
         List<PackageDoc> packages = configuration.profilePackages.get(profileName);
@@ -99,8 +101,8 @@
                 ul.addContent(getPackage(packageDoc, profileName));
             }
         }
-        div.addContent(ul);
-        body.addContent(div);
+        htmlTree.addContent(ul);
+        body.addContent(htmlTree);
     }
 
     /**
@@ -156,39 +158,39 @@
      * Adds "All Classes" link for the top of the left-hand frame page to the
      * documentation tree.
      *
-     * @param div the Content object to which the all classes link should be added
+     * @param ul the Content object to which the all classes link should be added
      */
-    protected void addAllClassesLink(Content div) {
+    protected void addAllClassesLink(Content ul) {
         Content linkContent = getHyperLink(DocPaths.ALLCLASSES_FRAME,
                 allclassesLabel, "", "packageFrame");
-        Content span = HtmlTree.SPAN(linkContent);
-        div.addContent(span);
+        Content li = HtmlTree.LI(linkContent);
+        ul.addContent(li);
     }
 
     /**
      * Adds "All Packages" link for the top of the left-hand frame page to the
      * documentation tree.
      *
-     * @param div the Content object to which the all packages link should be added
+     * @param ul the Content object to which the all packages link should be added
      */
-    protected void addAllPackagesLink(Content div) {
+    protected void addAllPackagesLink(Content ul) {
         Content linkContent = getHyperLink(DocPaths.OVERVIEW_FRAME,
                 allpackagesLabel, "", "packageListFrame");
-        Content span = HtmlTree.SPAN(linkContent);
-        div.addContent(span);
+        Content li = HtmlTree.LI(linkContent);
+        ul.addContent(li);
     }
 
     /**
      * Adds "All Profiles" link for the top of the left-hand frame page to the
      * documentation tree.
      *
-     * @param div the Content object to which the all profiles link should be added
+     * @param ul the Content object to which the all profiles link should be added
      */
-    protected void addAllProfilesLink(Content div) {
+    protected void addAllProfilesLink(Content ul) {
         Content linkContent = getHyperLink(DocPaths.PROFILE_OVERVIEW_FRAME,
                 allprofilesLabel, "", "packageListFrame");
-        Content span = HtmlTree.SPAN(linkContent);
-        div.addContent(span);
+        Content li = HtmlTree.LI(linkContent);
+        ul.addContent(li);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfilePackageWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -74,6 +74,16 @@
     protected int profileValue;
 
     /**
+     * The HTML tree for main tag.
+     */
+    protected HtmlTree mainTree = HtmlTree.MAIN();
+
+    /**
+     * The HTML tree for section tag.
+     */
+    protected HtmlTree sectionTree = HtmlTree.SECTION();
+
+    /**
      * Constructor to construct ProfilePackageWriter object and to generate
      * "profilename-package-summary.html" file in the respective package directory.
      * For example for profile compact1 and package "java.lang" this will generate file
@@ -103,9 +113,15 @@
      * {@inheritDoc}
      */
     public Content getPackageHeader(String heading) {
-        Content bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageDoc)));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(utils.getPackageName(packageDoc)));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.addStyle(HtmlStyle.header);
         Content profileContent = new StringContent(profileName);
@@ -133,7 +149,11 @@
             Content descPara = new HtmlTree(HtmlTag.P, seeLabel, space, descLink);
             div.addContent(descPara);
         }
-        bodyTree.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(div);
+        } else {
+            bodyTree.addContent(div);
+        }
         return bodyTree;
     }
 
@@ -199,9 +219,14 @@
             Content h2Content = new StringContent(
                     configuration.getText("doclet.Package_Description",
                     packageDoc.name()));
-            packageContentTree.addContent(HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING,
-                    true, h2Content));
-            addInlineComment(packageDoc, packageContentTree);
+            Content heading = HtmlTree.HEADING(HtmlConstants.PACKAGE_HEADING, true, h2Content);
+            if (configuration.allowTag(HtmlTag.SECTION)) {
+                sectionTree.addContent(heading);
+                addInlineComment(packageDoc, sectionTree);
+            } else {
+                packageContentTree.addContent(heading);
+                addInlineComment(packageDoc, packageContentTree);
+            }
         }
     }
 
@@ -209,15 +234,37 @@
      * {@inheritDoc}
      */
     public void addPackageTags(Content packageContentTree) {
-        addTagsInfo(packageDoc, packageContentTree);
+        Content htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? sectionTree
+                : packageContentTree;
+        addTagsInfo(packageDoc, htmlTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addPackageContent(Content contentTree, Content packageContentTree) {
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            packageContentTree.addContent(sectionTree);
+            mainTree.addContent(packageContentTree);
+            contentTree.addContent(mainTree);
+        } else {
+            contentTree.addContent(packageContentTree);
+        }
     }
 
     /**
      * {@inheritDoc}
      */
     public void addPackageFooter(Content contentTree) {
-        addNavLinks(false, contentTree);
-        addBottom(contentTree);
+        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : contentTree;
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            contentTree.addContent(htmlTree);
+        }
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/ProfileWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -65,6 +65,11 @@
     protected Profile profile;
 
     /**
+     * The HTML tree for main tag.
+     */
+    protected HtmlTree mainTree = HtmlTree.MAIN();
+
+    /**
      * Constructor to construct ProfileWriter object and to generate
      * "profileName-summary.html" file.
      *
@@ -87,9 +92,15 @@
      */
     public Content getProfileHeader(String heading) {
         String profileName = profile.name;
-        Content bodyTree = getBody(true, getWindowTitle(profileName));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(profileName));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         HtmlTree div = new HtmlTree(HtmlTag.DIV);
         div.addStyle(HtmlStyle.header);
         Content tHeading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
@@ -98,7 +109,11 @@
         Content profileHead = new RawHtml(heading);
         tHeading.addContent(profileHead);
         div.addContent(tHeading);
-        bodyTree.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(div);
+        } else {
+            bodyTree.addContent(div);
+        }
         return bodyTree;
     }
 
@@ -133,20 +148,29 @@
      * {@inheritDoc}
      */
     public Content getPackageSummaryHeader(PackageDoc pkg) {
-        Content pkgName = getTargetProfilePackageLink(pkg,
-                    "classFrame", new StringContent(pkg.name()), profile.name);
-        Content heading = HtmlTree.HEADING(HtmlTag.H3, pkgName);
-        HtmlTree li = HtmlTree.LI(HtmlStyle.blockList, heading);
-        addPackageDeprecationInfo(li, pkg);
-        return li;
+        Content pkgName = new StringContent(pkg.name());
+        Content pkgNameLink = getTargetProfilePackageLink(pkg,
+                    "classFrame", pkgName, profile.name);
+        Content heading = HtmlTree.HEADING(HtmlTag.H3, pkgNameLink);
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.SECTION(heading)
+                : HtmlTree.LI(HtmlStyle.blockList, heading);
+        addPackageDeprecationInfo(htmlTree, pkg);
+        return htmlTree;
     }
 
     /**
      * {@inheritDoc}
      */
     public Content getPackageSummaryTree(Content packageSummaryContentTree) {
-        HtmlTree ul = HtmlTree.UL(HtmlStyle.blockList, packageSummaryContentTree);
-        return ul;
+        HtmlTree htmlTree;
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            htmlTree = HtmlTree.UL(HtmlStyle.blockList,
+                    HtmlTree.LI(HtmlStyle.blockList, packageSummaryContentTree));
+        } else {
+            htmlTree = HtmlTree.UL(HtmlStyle.blockList, packageSummaryContentTree);
+        }
+        return htmlTree;
     }
 
     /**
@@ -161,9 +185,27 @@
     /**
      * {@inheritDoc}
      */
+    public void addProfileContent(Content contentTree, Content profileContentTree) {
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(profileContentTree);
+            contentTree.addContent(mainTree);
+        } else {
+            contentTree.addContent(profileContentTree);
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public void addProfileFooter(Content contentTree) {
-        addNavLinks(false, contentTree);
-        addBottom(contentTree);
+        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : contentTree;
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            contentTree.addContent(htmlTree);
+        }
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/PropertyWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -66,6 +66,13 @@
     /**
      * {@inheritDoc}
      */
+    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
+        writer.addMemberTree(memberSummaryTree, memberTree);
+    }
+
+    /**
+     * {@inheritDoc}
+     */
     public Content getPropertyDetailsTreeHeader(ClassDoc classDoc,
             Content memberDetailsTree) {
         memberDetailsTree.addContent(HtmlConstants.START_OF_PROPERTY_DETAILS);
@@ -157,6 +164,10 @@
      * {@inheritDoc}
      */
     public Content getPropertyDetails(Content propertyDetailsTree) {
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(propertyDetailsTree));
+            return htmlTree;
+        }
         return getMemberTree(propertyDetailsTree);
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SerializedFormWriterImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -27,6 +27,7 @@
 
 import java.io.*;
 import java.util.*;
+
 import com.sun.javadoc.*;
 import com.sun.tools.doclets.formats.html.markup.*;
 import com.sun.tools.doclets.internal.toolkit.*;
@@ -49,6 +50,11 @@
     List<ClassDoc> visibleClasses;
 
     /**
+     * HTML tree for main tag.
+     */
+    private HtmlTree mainTree = HtmlTree.MAIN();
+
+    /**
      * @param configuration the configuration data for the doclet
      * @throws IOException
      * @throws DocletAbortException
@@ -66,14 +72,24 @@
      * @return the body content tree
      */
     public Content getHeader(String header) {
-        Content bodyTree = getBody(true, getWindowTitle(header));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(header));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         Content h1Content = new StringContent(header);
         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, true,
                 HtmlStyle.title, h1Content);
         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
-        bodyTree.addContent(div);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(div);
+        } else {
+            bodyTree.addContent(div);
+        }
         return bodyTree;
     }
 
@@ -94,9 +110,14 @@
      * @return the package serialized form header tree
      */
     public Content getPackageSerializedHeader() {
-        HtmlTree li = new HtmlTree(HtmlTag.LI);
-        li.addStyle(HtmlStyle.blockList);
-        return li;
+        HtmlTree htmlTree;
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            htmlTree = HtmlTree.SECTION();
+        } else {
+            htmlTree = new HtmlTree(HtmlTag.LI);
+            htmlTree.addStyle(HtmlStyle.blockList);
+        }
+        return htmlTree;
     }
 
     /**
@@ -211,9 +232,24 @@
      * @return a div content tree
      */
     public Content getSerializedContent(Content serializedTreeContent) {
-        Content divContent = HtmlTree.DIV(HtmlStyle.serializedFormContainer,
+        HtmlTree divContent = HtmlTree.DIV(HtmlStyle.serializedFormContainer,
                 serializedTreeContent);
-        return divContent;
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(divContent);
+            return mainTree;
+        } else {
+            return divContent;
+        }
+    }
+
+    /**
+     * {@inheritDoc}
+     */
+    public void addPackageSerializedTree(Content serializedSummariesTree,
+            Content packageSerializedTree) {
+        serializedSummariesTree.addContent((configuration.allowTag(HtmlTag.SECTION))
+                ? HtmlTree.LI(HtmlStyle.blockList, packageSerializedTree)
+                : packageSerializedTree);
     }
 
     /**
@@ -222,8 +258,14 @@
      * @param serializedTree the serialized tree to be added
      */
     public void addFooter(Content serializedTree) {
-        addNavLinks(false, serializedTree);
-        addBottom(serializedTree);
+        Content htmlTree = (configuration.allowTag(HtmlTag.FOOTER))
+                ? HtmlTree.FOOTER()
+                : serializedTree;
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            serializedTree.addContent(htmlTree);
+        }
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SingleIndexWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -89,9 +89,15 @@
      */
     protected void generateIndexFile() throws IOException {
         String title = configuration.getText("doclet.Window_Single_Index");
-        Content body = getBody(true, getWindowTitle(title));
-        addTop(body);
-        addNavLinks(true, body);
+        HtmlTree body = getBody(true, getWindowTitle(title));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : body;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            body.addContent(htmlTree);
+        }
         HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
         divTree.addStyle(HtmlStyle.contentContainer);
         addLinksForIndexes(divTree);
@@ -100,9 +106,17 @@
             addContents(unicode, indexbuilder.getMemberList(unicode), divTree);
         }
         addLinksForIndexes(divTree);
-        body.addContent(divTree);
-        addNavLinks(false, body);
-        addBottom(body);
+        body.addContent((configuration.allowTag(HtmlTag.MAIN))
+                ? HtmlTree.MAIN(divTree)
+                : divTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            htmlTree = HtmlTree.FOOTER();
+        }
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            body.addContent(htmlTree);
+        }
         printHtmlDocument(null, true, body);
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SourceToHTMLConverter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2001, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2001, 2015, 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
@@ -176,7 +176,7 @@
             }
             addBlankLines(pre);
             Content div = HtmlTree.DIV(HtmlStyle.sourceContainer, pre);
-            body.addContent(div);
+            body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(div) : div);
             writeToFile(body, outputdir.resolve(DocPath.forClass(cd)));
         } catch (IOException e) {
             e.printStackTrace();
@@ -190,7 +190,9 @@
      * @param path the path for the file.
      */
     private void writeToFile(Content body, DocPath path) throws IOException {
-        Content htmlDocType = DocType.TRANSITIONAL;
+        Content htmlDocType = configuration.isOutputHtml5()
+                ? DocType.HTML5
+                : DocType.TRANSITIONAL;
         Content head = new HtmlTree(HtmlTag.HEAD);
         head.addContent(HtmlTree.TITLE(new StringContent(
                 configuration.getText("doclet.Window_Source_title"))));
@@ -262,8 +264,8 @@
      */
     private void addLine(Content pre, String line, int currentLineNo) {
         if (line != null) {
-            pre.addContent(utils.replaceTabs(configuration, line));
-            Content anchor = HtmlTree.A_NAME("line." + Integer.toString(currentLineNo));
+            Content anchor = HtmlTree.A_ID("line." + Integer.toString(currentLineNo),
+                    new StringContent(utils.replaceTabs(configuration, line)));
             pre.addContent(anchor);
             pre.addContent(NEW_LINE);
         }
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SplitIndexWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1998, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1998, 2015, 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
@@ -116,17 +116,29 @@
     protected void generateIndexFile(Character unicode) throws IOException {
         String title = configuration.getText("doclet.Window_Split_Index",
                 unicode.toString());
-        Content body = getBody(true, getWindowTitle(title));
-        addTop(body);
-        addNavLinks(true, body);
+        HtmlTree body = getBody(true, getWindowTitle(title));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : body;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            body.addContent(htmlTree);
+        }
         HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
         divTree.addStyle(HtmlStyle.contentContainer);
         addLinksForIndexes(divTree);
         addContents(unicode, indexbuilder.getMemberList(unicode), divTree);
         addLinksForIndexes(divTree);
-        body.addContent(divTree);
-        addNavLinks(false, body);
-        addBottom(body);
+        body.addContent((configuration.allowTag(HtmlTag.MAIN)) ? HtmlTree.MAIN(divTree) : divTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            htmlTree = HtmlTree.FOOTER();
+        }
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            body.addContent(htmlTree);
+        }
         printHtmlDocument(null, true, body);
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/SubWriterHolderWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -55,6 +55,11 @@
  */
 public abstract class SubWriterHolderWriter extends HtmlDocletWriter {
 
+    /**
+     * The HTML tree for main tag.
+     */
+    protected HtmlTree mainTree = HtmlTree.MAIN();
+
     public SubWriterHolderWriter(ConfigurationImpl configuration, DocPath filename)
             throws IOException {
         super(configuration, filename);
@@ -92,8 +97,9 @@
         else {
             caption = getTableCaption(mw.getCaption());
         }
-        Content table = HtmlTree.TABLE(HtmlStyle.memberSummary, 0, 3, 0,
-                mw.getTableSummary(), caption);
+        Content table = (configuration.isOutputHtml5())
+                ? HtmlTree.TABLE(HtmlStyle.memberSummary, caption)
+                : HtmlTree.TABLE(HtmlStyle.memberSummary, mw.getTableSummary(), caption);
         table.addContent(getSummaryTableHeader(mw.getSummaryTableHeader(cd), "col"));
         for (Content tableContent : tableContents) {
             table.addContent(tableContent);
@@ -261,6 +267,31 @@
     }
 
     /**
+     * Add the class content tree.
+     *
+     * @param contentTree content tree to which the class content will be added
+     * @param classContentTree class content tree which will be added to the content tree
+     */
+    public void addClassContentTree(Content contentTree, Content classContentTree) {
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            mainTree.addContent(classContentTree);
+            contentTree.addContent(mainTree);
+        } else {
+            contentTree.addContent(classContentTree);
+        }
+    }
+
+    /**
+     * Add the annotation content tree.
+     *
+     * @param contentTree content tree to which the annotation content will be added
+     * @param annotationContentTree annotation content tree which will be added to the content tree
+     */
+    public void addAnnotationContentTree(Content contentTree, Content annotationContentTree) {
+        addClassContentTree(contentTree, annotationContentTree);
+    }
+
+    /**
      * Get the member header tree
      *
      * @return a content tree the member header
@@ -272,6 +303,21 @@
     }
 
     /**
+     * Add the member tree.
+     *
+     * @param memberSummaryTree the content tree representing the member summary
+     * @param memberTree the content tree representing the member
+     */
+    public void addMemberTree(Content memberSummaryTree, Content memberTree) {
+        if (configuration.allowTag(HtmlTag.SECTION)) {
+            HtmlTree htmlTree = HtmlTree.SECTION(getMemberTree(memberTree));
+            memberSummaryTree.addContent(htmlTree);
+        } else {
+            memberSummaryTree.addContent(getMemberTree(memberTree));
+        }
+    }
+
+    /**
      * Get the member tree
      *
      * @param contentTree the tree used to generate the complete member tree
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/TreeWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 1997, 2015, 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
@@ -101,22 +101,36 @@
      * Generate the interface hierarchy and class hierarchy.
      */
     public void generateTreeFile() throws IOException {
-        Content body = getTreeHeader();
+        HtmlTree body = getTreeHeader();
         Content headContent = getResource("doclet.Hierarchy_For_All_Packages");
         Content heading = HtmlTree.HEADING(HtmlConstants.TITLE_HEADING, false,
                 HtmlStyle.title, headContent);
         Content div = HtmlTree.DIV(HtmlStyle.header, heading);
         addPackageTreeLinks(div);
-        body.addContent(div);
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.MAIN))
+                ? HtmlTree.MAIN()
+                : body;
+        htmlTree.addContent(div);
         HtmlTree divTree = new HtmlTree(HtmlTag.DIV);
         divTree.addStyle(HtmlStyle.contentContainer);
         addTree(classtree.baseclasses(), "doclet.Class_Hierarchy", divTree);
         addTree(classtree.baseinterfaces(), "doclet.Interface_Hierarchy", divTree);
         addTree(classtree.baseAnnotationTypes(), "doclet.Annotation_Type_Hierarchy", divTree);
         addTree(classtree.baseEnums(), "doclet.Enum_Hierarchy", divTree);
-        body.addContent(divTree);
-        addNavLinks(false, body);
-        addBottom(body);
+        htmlTree.addContent(divTree);
+        if (configuration.allowTag(HtmlTag.MAIN)) {
+            body.addContent(htmlTree);
+        }
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            htmlTree = HtmlTree.FOOTER();
+        } else {
+            htmlTree = body;
+        }
+        addNavLinks(false, htmlTree);
+        addBottom(htmlTree);
+        if (configuration.allowTag(HtmlTag.FOOTER)) {
+            body.addContent(htmlTree);
+        }
         printHtmlDocument(null, true, body);
     }
 
@@ -164,11 +178,17 @@
      *
      * @return a content tree for the tree header
      */
-    protected Content getTreeHeader() {
+    protected HtmlTree getTreeHeader() {
         String title = configuration.getText("doclet.Window_Class_Hierarchy");
-        Content bodyTree = getBody(true, getWindowTitle(title));
-        addTop(bodyTree);
-        addNavLinks(true, bodyTree);
+        HtmlTree bodyTree = getBody(true, getWindowTitle(title));
+        HtmlTree htmlTree = (configuration.allowTag(HtmlTag.HEADER))
+                ? HtmlTree.HEADER()
+                : bodyTree;
+        addTop(htmlTree);
+        addNavLinks(true, htmlTree);
+        if (configuration.allowTag(HtmlTag.HEADER)) {
+            bodyTree.addContent(htmlTree);
+        }
         return bodyTree;
     }
 
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/DocType.java	Fri Apr 17 10:23:49 2015 -0700
@@ -48,10 +48,13 @@
     public static final DocType TRANSITIONAL =
             new DocType("Transitional", "http://www.w3.org/TR/html4/loose.dtd");
 
+    public static final DocType HTML5 = new DocType();
+
     /**
      * Constructor to construct a DocType object.
      *
      * @param type the doctype to be added
+     * @param dtd the dtd of the doctype
      */
     private DocType(String type, String dtd) {
         docType = "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 " + type +
@@ -59,6 +62,13 @@
     }
 
     /**
+     * Constructor to construct a DocType object.
+     */
+    private DocType() {
+        docType = "<!DOCTYPE HTML>" + DocletConstants.NL;
+    }
+
+    /**
      * This method is not supported by the class.
      *
      * @param content content that needs to be added
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlAttr.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -39,9 +39,6 @@
  */
 public enum HtmlAttr {
     ALT,
-    BORDER,
-    CELLPADDING,
-    CELLSPACING,
     CLASS,
     CLEAR,
     COLS,
@@ -53,6 +50,7 @@
     NAME,
     ONLOAD,
     REL,
+    ROLE,
     ROWS,
     SCOPE,
     SCROLLING,
@@ -65,6 +63,25 @@
 
     private final String value;
 
+    public enum Role {
+
+        BANNER,
+        CONTENTINFO,
+        MAIN,
+        NAVIGATION,
+        REGION;
+
+        private final String role;
+
+        Role() {
+            role = StringUtils.toLowerCase(name());
+        }
+
+        public String toString() {
+            return role;
+        }
+    }
+
     HtmlAttr() {
         this.value = StringUtils.toLowerCase(name());
     }
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlDocWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -307,11 +307,13 @@
      *
      * @param title Title of this HTML document
      * @param configuration the configuration object
-     * @param frame the frame content tree to be added to the HTML document
+     * @param body the body content tree to be added to the HTML document
      */
     public void printFramesDocument(String title, ConfigurationImpl configuration,
             HtmlTree body) throws IOException {
-        Content htmlDocType = DocType.TRANSITIONAL;
+        Content htmlDocType = configuration.isOutputHtml5()
+                ? DocType.HTML5
+                : DocType.TRANSITIONAL;
         Content htmlComment = new Comment(configuration.getText("doclet.New_Page"));
         Content head = new HtmlTree(HtmlTag.HEAD);
         head.addContent(getGeneratedBy(!configuration.notimestamp));
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlStyle.java	Fri Apr 17 10:23:49 2015 -0700
@@ -44,6 +44,7 @@
     blockList,
     blockListLast,
     bottomNav,
+    circle,
     classUseContainer,
     colFirst,
     colLast,
@@ -64,7 +65,7 @@
     horizontal,
     footer,
     indexContainer,
-    indexHeader,
+    indexNav,
     inheritance,
     interfaceName,
     leftContainer,
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTag.java	Fri Apr 17 10:23:49 2015 -0700
@@ -43,15 +43,16 @@
     BODY(BlockType.OTHER, EndTag.END),
     BR(BlockType.INLINE, EndTag.NOEND),
     CAPTION,
-    CENTER,
+    CENTER(HtmlVersion.HTML4),
     CODE(BlockType.INLINE, EndTag.END),
     DD,
-    DIR,
+    DIR(HtmlVersion.HTML4),
     DIV,
     DL,
     DT,
     EM(BlockType.INLINE, EndTag.END),
-    FONT(BlockType.INLINE, EndTag.END),
+    FONT(HtmlVersion.HTML4, BlockType.INLINE, EndTag.END),
+    FOOTER(HtmlVersion.HTML5),
     H1,
     H2,
     H3,
@@ -59,6 +60,7 @@
     H5,
     H6,
     HEAD(BlockType.OTHER, EndTag.END),
+    HEADER(HtmlVersion.HTML5),
     HR(BlockType.BLOCK, EndTag.NOEND),
     HTML(BlockType.OTHER, EndTag.END),
     I(BlockType.INLINE, EndTag.END),
@@ -67,14 +69,16 @@
     LI,
     LISTING,
     LINK(BlockType.OTHER, EndTag.NOEND),
+    MAIN(HtmlVersion.HTML5),
     MENU,
     META(BlockType.OTHER, EndTag.NOEND),
-    NOFRAMES(BlockType.OTHER, EndTag.END),
+    NAV(HtmlVersion.HTML5),
     NOSCRIPT(BlockType.OTHER, EndTag.END),
     OL,
     P,
     PRE,
     SCRIPT(BlockType.OTHER, EndTag.END),
+    SECTION(HtmlVersion.HTML5),
     SMALL(BlockType.INLINE, EndTag.END),
     SPAN(BlockType.INLINE, EndTag.END),
     STRONG(BlockType.INLINE, EndTag.END),
@@ -85,12 +89,13 @@
     TH,
     TITLE(BlockType.OTHER, EndTag.END),
     TR,
-    TT(BlockType.INLINE, EndTag.END),
+    TT(HtmlVersion.HTML4, BlockType.INLINE, EndTag.END),
     UL;
 
     public final BlockType blockType;
     public final EndTag endTag;
     public final String value;
+    public final HtmlVersion htmlVersion;
 
     /**
      * Enum representing the type of HTML element.
@@ -110,10 +115,19 @@
     }
 
     HtmlTag() {
-        this(BlockType.BLOCK, EndTag.END);
+        this(HtmlVersion.ALL, BlockType.BLOCK, EndTag.END);
+    }
+
+    HtmlTag(HtmlVersion htmlVersion) {
+        this(htmlVersion, BlockType.BLOCK, EndTag.END);
     }
 
     HtmlTag(BlockType blockType, EndTag endTag ) {
+        this(HtmlVersion.ALL, blockType, endTag);
+    }
+
+    HtmlTag(HtmlVersion htmlVersion, BlockType blockType, EndTag endTag ) {
+        this.htmlVersion = htmlVersion;
         this.blockType = blockType;
         this.endTag = endTag;
         this.value = StringUtils.toLowerCase(name());
@@ -129,6 +143,16 @@
         return (endTag == EndTag.END);
     }
 
+    /**
+     * Returns true if the tag is allowed in the output HTML version of this javadoc run.
+     *
+     * @param htmlVer the output HTML version for this javadoc run
+     * @return true if the tag is allowed
+     */
+    public boolean allowTag(HtmlVersion htmlVer) {
+        return (this.htmlVersion == HtmlVersion.ALL || this.htmlVersion == htmlVer);
+    }
+
     public String toString() {
         return value;
     }
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlTree.java	Fri Apr 17 10:23:49 2015 -0700
@@ -32,6 +32,7 @@
 
 import com.sun.tools.doclets.internal.toolkit.Content;
 import com.sun.tools.doclets.internal.toolkit.util.*;
+import com.sun.tools.doclets.formats.html.markup.HtmlAttr.Role;
 
 /**
  * Class for generating HTML tree for javadoc output.
@@ -87,6 +88,10 @@
         addAttr(HtmlAttr.TITLE, stripHtml(body));
     }
 
+    public void setRole(Role role) {
+        addAttr(HtmlAttr.ROLE, role.toString());
+    }
+
     /**
      * Adds a style for the HTML tag.
      *
@@ -221,31 +226,20 @@
     }
 
     /**
-     * Generates an HTML anchor tag with name attribute and content.
+     * Generates an HTML anchor tag with id attribute and content.
      *
-     * @param name name for the anchor tag
+     * @param id id for the anchor tag
      * @param body content for the anchor tag
      * @return an HtmlTree object
      */
-    public static HtmlTree A_NAME(String name, Content body) {
-        HtmlTree htmltree = HtmlTree.A_NAME(name);
+    public static HtmlTree A_ID(String id, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.A);
+        htmltree.addAttr(HtmlAttr.ID, nullCheck(id));
         htmltree.addContent(nullCheck(body));
         return htmltree;
     }
 
     /**
-     * Generates an HTML anchor tag with name attribute.
-     *
-     * @param name name for the anchor tag
-     * @return an HtmlTree object
-     */
-    public static HtmlTree A_NAME(String name) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.A);
-        htmltree.addAttr(HtmlAttr.NAME, nullCheck(name));
-        return htmltree;
-    }
-
-    /**
      * Generates a CAPTION tag with some content.
      *
      * @param body content for the tag
@@ -326,18 +320,24 @@
     }
 
     /**
-     * Generates a IFRAME tag.
+     * Generates a FOOTER tag with role attribute.
      *
-     * @param src the url of the document to be shown in the frame
-     * @param name specifies the name of the frame
-     * @param title the title for the frame
-     * @return an HtmlTree object for the IFRAME tag
+     * @return an HtmlTree object for the FOOTER tag
      */
-    public static HtmlTree IFRAME(String src, String name, String title) {
-        HtmlTree htmltree = new HtmlTree(HtmlTag.IFRAME);
-        htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
-        htmltree.addAttr(HtmlAttr.NAME, nullCheck(name));
-        htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title));
+    public static HtmlTree FOOTER() {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.FOOTER);
+        htmltree.setRole(Role.CONTENTINFO);
+        return htmltree;
+    }
+
+    /**
+     * Generates a HEADER tag with role attribute.
+     *
+     * @return an HtmlTree object for the HEADER tag
+     */
+    public static HtmlTree HEADER() {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.HEADER);
+        htmltree.setRole(Role.BANNER);
         return htmltree;
     }
 
@@ -414,6 +414,22 @@
     }
 
     /**
+     * Generates a IFRAME tag.
+     *
+     * @param src the url of the document to be shown in the frame
+     * @param name specifies the name of the frame
+     * @param title the title for the frame
+     * @return an HtmlTree object for the IFRAME tag
+     */
+    public static HtmlTree IFRAME(String src, String name, String title) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.IFRAME);
+        htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
+        htmltree.addAttr(HtmlAttr.NAME, nullCheck(name));
+        htmltree.addAttr(HtmlAttr.TITLE, nullCheck(title));
+        return htmltree;
+    }
+
+    /**
      * Generates a LI tag with some content.
      *
      * @param body content for the tag
@@ -456,6 +472,44 @@
     }
 
     /**
+     * Generates a MAIN tag with role attribute.
+     *
+     * @return an HtmlTree object for the MAIN tag
+     */
+    public static HtmlTree MAIN() {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.MAIN);
+        htmltree.setRole(Role.MAIN);
+        return htmltree;
+    }
+
+    /**
+     * Generates a MAIN tag with role attribute and some content.
+     *
+     * @param body content of the MAIN tag
+     * @return an HtmlTree object for the MAIN tag
+     */
+    public static HtmlTree MAIN(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.MAIN, nullCheck(body));
+        htmltree.setRole(Role.MAIN);
+        return htmltree;
+    }
+
+    /**
+     * Generates a MAIN tag with role attribute, style attribute and some content.
+     *
+     * @param styleClass style of the MAIN tag
+     * @param body content of the MAIN tag
+     * @return an HtmlTree object for the MAIN tag
+     */
+    public static HtmlTree MAIN(HtmlStyle styleClass, Content body) {
+        HtmlTree htmltree = HtmlTree.MAIN(body);
+        if (styleClass != null) {
+            htmltree.addStyle(styleClass);
+        }
+        return htmltree;
+    }
+
+    /**
      * Generates a META tag with the http-equiv, content and charset attributes.
      *
      * @param httpEquiv http equiv attribute for the META tag
@@ -486,6 +540,17 @@
     }
 
     /**
+     * Generates a NAV tag with the role attribute.
+     *
+     * @return an HtmlTree object for the NAV tag
+     */
+    public static HtmlTree NAV() {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.NAV);
+        htmltree.setRole(Role.NAVIGATION);
+        return htmltree;
+    }
+
+    /**
      * Generates a NOSCRIPT tag with some content.
      *
      * @param body content of the noscript tag
@@ -527,10 +592,43 @@
      * @param src the path for the script
      * @return an HtmlTree object for the SCRIPT tag
      */
-    public static HtmlTree SCRIPT(String type, String src) {
+    public static HtmlTree SCRIPT(String src) {
+        HtmlTree htmltree = HtmlTree.SCRIPT();
+        htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
+        return htmltree;
+    }
+
+    /**
+     * Generates a SCRIPT tag with the type attribute.
+     *
+     * @return an HtmlTree object for the SCRIPT tag
+     */
+    public static HtmlTree SCRIPT() {
         HtmlTree htmltree = new HtmlTree(HtmlTag.SCRIPT);
-        htmltree.addAttr(HtmlAttr.TYPE, nullCheck(type));
-        htmltree.addAttr(HtmlAttr.SRC, nullCheck(src));
+        htmltree.addAttr(HtmlAttr.TYPE, "text/javascript");
+        return htmltree;
+    }
+
+    /**
+     * Generates a SECTION tag with role attribute.
+     *
+     * @return an HtmlTree object for the SECTION tag
+     */
+    public static HtmlTree SECTION() {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.SECTION);
+        htmltree.setRole(Role.REGION);
+        return htmltree;
+    }
+
+    /**
+     * Generates a SECTION tag with role attribute and some content.
+     *
+     * @param body content of the section tag
+     * @return an HtmlTree object for the SECTION tag
+     */
+    public static HtmlTree SECTION(Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.SECTION, nullCheck(body));
+        htmltree.setRole(Role.REGION);
         return htmltree;
     }
 
@@ -587,30 +685,37 @@
     }
 
     /**
-     * Generates a Table tag with style class, border, cell padding,
-     * cellspacing and summary attributes and some content.
+     * Generates a Table tag with style class and summary attributes and some content.
      *
      * @param styleClass style of the table
-     * @param border border for the table
-     * @param cellPadding cell padding for the table
-     * @param cellSpacing cell spacing for the table
      * @param summary summary for the table
      * @param body content for the table
      * @return an HtmlTree object for the TABLE tag
      */
-    public static HtmlTree TABLE(HtmlStyle styleClass, int border, int cellPadding,
-            int cellSpacing, String summary, Content body) {
+    public static HtmlTree TABLE(HtmlStyle styleClass, String summary, Content body) {
         HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body));
         if (styleClass != null)
             htmltree.addStyle(styleClass);
-        htmltree.addAttr(HtmlAttr.BORDER, Integer.toString(border));
-        htmltree.addAttr(HtmlAttr.CELLPADDING, Integer.toString(cellPadding));
-        htmltree.addAttr(HtmlAttr.CELLSPACING, Integer.toString(cellSpacing));
         htmltree.addAttr(HtmlAttr.SUMMARY, nullCheck(summary));
         return htmltree;
     }
 
     /**
+     * Generates a Table tag with style class attribute and some content.
+     *
+     * @param styleClass style of the table
+     * @param body content for the table
+     * @return an HtmlTree object for the TABLE tag
+     */
+    public static HtmlTree TABLE(HtmlStyle styleClass, Content body) {
+        HtmlTree htmltree = new HtmlTree(HtmlTag.TABLE, nullCheck(body));
+        if (styleClass != null) {
+            htmltree.addStyle(styleClass);
+        }
+        return htmltree;
+    }
+
+    /**
      * Generates a TD tag with style class attribute and some content.
      *
      * @param styleClass style for the tag
@@ -741,7 +846,7 @@
     public boolean isValid() {
         switch (htmlTag) {
             case A :
-                return (hasAttr(HtmlAttr.NAME) || (hasAttr(HtmlAttr.HREF) && hasContent()));
+                return (hasAttr(HtmlAttr.ID) || (hasAttr(HtmlAttr.HREF) && hasContent()));
             case BR :
                 return (!hasContent() && (!hasAttrs() || hasAttr(HtmlAttr.CLEAR)));
             case IFRAME :
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlVersion.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 com.sun.tools.doclets.formats.html.markup;
+
+/**
+ * Enum representing the version of HTML generated by javadoc.
+ *
+ * @author Bhavesh Patel
+ */
+public enum HtmlVersion {
+    HTML4,
+    HTML5,
+    ALL
+}
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/markup/HtmlWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -306,9 +306,8 @@
      * @return an HtmlTree for the SCRIPT tag
      */
     protected HtmlTree getWinTitleScript(){
-        HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
+        HtmlTree script = HtmlTree.SCRIPT();
         if(winTitle != null && winTitle.length() > 0) {
-            script.addAttr(HtmlAttr.TYPE, "text/javascript");
             String scriptCode = "<!--" + DocletConstants.NL +
                     "    try {" + DocletConstants.NL +
                     "        if (location.href.indexOf('is-external=true') == -1) {" + DocletConstants.NL +
@@ -377,8 +376,7 @@
      * @return a content for the SCRIPT tag
      */
     protected Content getFramesJavaScript() {
-        HtmlTree script = new HtmlTree(HtmlTag.SCRIPT);
-        script.addAttr(HtmlAttr.TYPE, "text/javascript");
+        HtmlTree script = HtmlTree.SCRIPT();
         String scriptCode = DocletConstants.NL +
                 "    targetPage = \"\" + window.location.search;" + DocletConstants.NL +
                 "    if (targetPage != \"\" && targetPage != \"undefined\")" + DocletConstants.NL +
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/formats/html/resources/standard.properties	Fri Apr 17 10:23:49 2015 -0700
@@ -192,6 +192,8 @@
 \  -windowtitle <text>              Browser window title for the documentation\n\
 \  -doctitle <html-code>            Include title for the overview page\n\
 \  -header <html-code>              Include header text for each page\n\
+\  -html4                           Generate HTML 4.01 output\n\
+\  -html5                           Generate HTML 5 output\n\
 \  -footer <html-code>              Include footer text for each page\n\
 \  -top    <html-code>              Include top text for each page\n\
 \  -bottom <html-code>              Include bottom text for each page\n\
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/AnnotationTypeWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -111,6 +111,14 @@
     public Content getMemberTreeHeader();
 
     /**
+     * Add the annotation content tree to the documentation content tree.
+     *
+     * @param contentTree content tree to which the annotation content will be added
+     * @param annotationContentTree annotation content tree which will be added to the content tree
+     */
+    public void addAnnotationContentTree(Content contentTree, Content annotationContentTree);
+
+    /**
      * Get the member tree.
      *
      * @param memberTree the content tree that will be modified and returned
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ClassWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -176,6 +176,14 @@
     public Content getMemberTreeHeader();
 
     /**
+     * Add the class content tree.
+     *
+     * @param contentTree content tree to which the class content will be added
+     * @param classContentTree class content tree which will be added to the content tree
+     */
+    public void addClassContentTree(Content contentTree, Content classContentTree);
+
+    /**
      * Add the footer of the page.
      *
      * @param contentTree content tree to which the footer will be added
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ConstantsSummaryWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -81,12 +81,12 @@
         Set<String> WriteedPackageHeaders, Content contentListTree);
 
     /**
-     * Get the content list to be added to the documentation tree.
+     * Add the content list to the documentation tree.
      *
+     * @param contentTree the tree to which the contents list will be added
      * @param contentListTree the content that will be added to the list
-     * @return content list that will be added to the documentation tree
      */
-    public abstract Content getContentsList(Content contentListTree);
+    public abstract void addContentsList(Content contentTree, Content contentListTree);
 
     /**
      * Get the constant summaries for the document.
@@ -98,16 +98,15 @@
     /**
      * Adds the given package name.
      *
-     * @param pkg the {@link PackageDoc} to index.
      * @param parsedPackageName the parsed package name.  We only Write the
      *                          first 2 directory levels of the package
      *                          name. For example, java.lang.ref would be
      *                          indexed as java.lang.*.
-     * @param summariesTree the documentation tree to which the package name will
+     * @param summariesTree the summaries documentation tree
+     * @param first true if the first package is listed
      *                    be written
      */
-    public abstract void addPackageName(PackageDoc pkg,
-        String parsedPackageName, Content summariesTree);
+    public abstract void addPackageName(String parsedPackageName, Content summariesTree, boolean first);
 
     /**
      * Get the class summary header for the constants summary.
@@ -117,6 +116,14 @@
     public abstract Content getClassConstantHeader();
 
     /**
+     * Add the content list to the documentation summaries tree.
+     *
+     * @param summariesTree the tree to which the class constants list will be added
+     * @param classConstantTree the class constant tree that will be added to the list
+     */
+    public abstract void addClassConstant(Content summariesTree, Content classConstantTree);
+
+    /**
      * Adds the constant member table to the documentation tree.
      *
      * @param cd the class whose constants are being documented.
@@ -128,6 +135,14 @@
             Content classConstantTree);
 
     /**
+     * Add the summaries list to the content tree.
+     *
+     * @param contentTree the tree to which the summaries list will be added
+     * @param summariesTree the summaries content tree that will be added to the list
+     */
+    public abstract void addConstantSummaries(Content contentTree, Content summariesTree);
+
+    /**
      * Adds the footer for the summary documentation.
      *
      * @param contentTree content tree to which the footer will be added
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/MemberSummaryWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -100,14 +100,22 @@
     /**
      * Get inherited summary links.
      *
-     * @return a content tree conatining the inherited summary links
+     * @return a content tree containing the inherited summary links
      */
     public Content getInheritedSummaryLinksTree();
 
     /**
+     * Add the member tree to the member summary tree.
+     *
+     * @param memberSummaryTree the content tree representing the member summary
+     * @param memberTree the content tree representing the member
+     */
+    public void addMemberTree(Content memberSummaryTree, Content memberTree);
+
+    /**
      * Get the member tree.
      *
-     * @param memberTree the content tree representating the member
+     * @param memberTree the content tree representing the member
      * @return a content tree for the member
      */
     public Content getMemberTree(Content memberTree);
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/PackageSummaryWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -97,6 +97,15 @@
     public abstract void addPackageTags(Content packageContentTree);
 
     /**
+     * Adds the tag information from the "packages.html" or "package-info.java" file to the
+     * documentation tree.
+     *
+     * @param contentTree the content tree to which the package content tree will be added
+     * @param packageContentTree the package content tree to be added
+     */
+    public abstract void addPackageContent(Content contentTree, Content packageContentTree);
+
+    /**
      * Adds the footer to the documentation tree.
      *
      * @param contentTree the tree to which the footer will be added
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ProfilePackageSummaryWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ProfilePackageSummaryWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015 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
@@ -95,6 +95,15 @@
     public abstract void addPackageTags(Content packageContentTree);
 
     /**
+     * Adds the tag information from the "packages.html" or "package-info.java" file to the
+     * documentation tree.
+     *
+     * @param contentTree the content tree to which the package content tree will be added
+     * @param packageContentTree the package content tree to be added
+     */
+    public abstract void addPackageContent(Content contentTree, Content packageContentTree);
+
+    /**
      * Adds the footer to the documentation tree.
      *
      * @param contentTree the tree to which the footer will be added
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ProfileSummaryWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/ProfileSummaryWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015 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
@@ -99,6 +99,14 @@
             String tableSummary, String[] tableHeader, Content packageSummaryContentTree);
 
     /**
+     * Adds the profile content tree to the documentation tree.
+     *
+     * @param contentTree the tree to which the profile content tree will be added
+     * @param profileContentTree the content tree that will be added
+     */
+    public abstract void addProfileContent(Content contentTree, Content profileContentTree);
+
+    /**
      * Adds the footer to the documentation tree.
      *
      * @param contentTree the tree to which the footer will be added
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/SerializedFormWriter.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -66,6 +66,14 @@
     public Content getPackageSerializedHeader();
 
     /**
+     * Add the serialized tree per package to the serialized summaries tree.
+     *
+     * @param serializedSummariesTree the serialized tree to which the package serialized tree will be added
+     * @param packageSerializedTree the serialized tree per package that needs to be added
+     */
+    public void addPackageSerializedTree(Content serializedSummariesTree, Content packageSerializedTree);
+
+    /**
      * Get the given package header.
      *
      * @param packageName the package header to write
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/AnnotationTypeBuilder.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -118,7 +118,7 @@
                 " " + annotationTypeDoc.name());
          Content annotationContentTree = writer.getAnnotationContentHeader();
          buildChildren(node, annotationContentTree);
-         contentTree.addContent(annotationContentTree);
+         writer.addAnnotationContentTree(contentTree, annotationContentTree);
          writer.addFooter(contentTree);
          writer.printDocument(contentTree);
          writer.close();
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ClassBuilder.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -144,7 +144,7 @@
                  classDoc.name());
          Content classContentTree = writer.getClassContentHeader();
          buildChildren(node, classContentTree);
-         contentTree.addContent(classContentTree);
+         writer.addClassContentTree(contentTree, classContentTree);
          writer.addFooter(contentTree);
          writer.printDocument(contentTree);
          writer.close();
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ConstantsSummaryBuilder.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -88,6 +88,11 @@
     private Content contentTree;
 
     /**
+     * True if first package is listed.
+     */
+    private boolean first = true;
+
+    /**
      * Construct a new ConstantsSummaryBuilder.
      *
      * @param context       the build context.
@@ -159,7 +164,7 @@
                                                printedPackageHeaders, contentListTree);
             }
         }
-        contentTree.addContent(writer.getContentsList(contentListTree));
+        writer.addContentsList(contentTree, contentListTree);
     }
 
     /**
@@ -176,9 +181,10 @@
                 currentPackage = aPackage;
                 //Build the documentation for the current package.
                 buildChildren(node, summariesTree);
+                first = false;
             }
         }
-        contentTree.addContent(summariesTree);
+        writer.addConstantSummaries(contentTree, summariesTree);
     }
 
     /**
@@ -190,8 +196,7 @@
     public void buildPackageHeader(XMLNode node, Content summariesTree) {
         String parsedPackageName = parsePackageName(currentPackage.name());
         if (! printedPackageHeaders.contains(parsedPackageName)) {
-            writer.addPackageName(currentPackage,
-                parsePackageName(currentPackage.name()), summariesTree);
+            writer.addPackageName(parsePackageName(currentPackage.name()), summariesTree, first);
             printedPackageHeaders.add(parsedPackageName);
         }
     }
@@ -218,7 +223,7 @@
             //Build the documentation for the current class.
             buildChildren(node, classConstantTree);
         }
-        summariesTree.addContent(classConstantTree);
+        writer.addClassConstant(summariesTree, classConstantTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/MemberSummaryBuilder.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -524,7 +524,7 @@
             for (Content aSummaryTreeList : summaryTreeList) {
                 memberTree.addContent(aSummaryTreeList);
             }
-            memberSummaryTree.addContent(writer.getMemberTree(memberTree));
+            writer.addMemberTree(memberSummaryTree, memberTree);
         }
     }
 }
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/PackageSummaryBuilder.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -137,7 +137,7 @@
     public void buildContent(XMLNode node, Content contentTree) {
         Content packageContentTree = packageWriter.getContentHeader();
         buildChildren(node, packageContentTree);
-        contentTree.addContent(packageContentTree);
+        packageWriter.addPackageContent(contentTree, packageContentTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfilePackageSummaryBuilder.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfilePackageSummaryBuilder.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -153,7 +153,7 @@
     public void buildContent(XMLNode node, Content contentTree) {
         Content packageContentTree = profilePackageWriter.getContentHeader();
         buildChildren(node, packageContentTree);
-        contentTree.addContent(packageContentTree);
+        profilePackageWriter.addPackageContent(contentTree, packageContentTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/ProfileSummaryBuilder.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -142,7 +142,7 @@
     public void buildContent(XMLNode node, Content contentTree) {
         Content profileContentTree = profileWriter.getContentHeader();
         buildChildren(node, profileContentTree);
-        contentTree.addContent(profileContentTree);
+        profileWriter.addProfileContent(contentTree, profileContentTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/builders/SerializedFormBuilder.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -190,7 +190,7 @@
             return;
         }
         buildChildren(node, packageSerializedTree);
-        serializedSummariesTree.addContent(packageSerializedTree);
+        writer.addPackageSerializedTree(serializedSummariesTree, packageSerializedTree);
     }
 
     /**
--- a/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/doclets/internal/toolkit/resources/stylesheet.css	Fri Apr 17 10:23:49 2015 -0700
@@ -214,14 +214,20 @@
     margin:0 20px;
     padding:5px 0 0 0;
 }
-.indexHeader {
+.indexNav {
     margin:10px;
     position:relative;
 }
-.indexHeader span{
-    margin-right:15px;
+.indexNav ul {
+    padding:0;
+    margin:0;
 }
-.indexHeader h1 {
+.indexNav ul li {
+    display:inline;
+    list-style-type:none;
+    padding-right:10px;
+}
+.indexNav h1 {
     font-size:13px;
 }
 .title {
@@ -314,6 +320,9 @@
 /*
 List styles
 */
+li.circle {
+    list-style:circle;
+}
 ul.horizontal li {
     display:inline;
     font-size:0.9em;
@@ -370,6 +379,7 @@
 */
 .overviewSummary, .memberSummary, .typeSummary, .useSummary, .constantsSummary, .deprecatedSummary {
     width:100%;
+    border-spacing:0;
     border-left:1px solid #EEE; 
     border-right:1px solid #EEE; 
     border-bottom:1px solid #EEE; 
@@ -638,3 +648,9 @@
     overflow:visible;
     margin-bottom:30px;
 }
+/*
+HTML5 specific styles
+*/
+main, nav, header, footer, section {
+    display:block;
+}
--- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/DocEnv.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/DocEnv.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2000, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2000, 2015, 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
@@ -814,7 +814,7 @@
         return result;
     }
 
-    void initDoclint(Collection<String> opts, Collection<String> customTagNames) {
+    void initDoclint(Collection<String> opts, Collection<String> customTagNames, String htmlVersion) {
         ArrayList<String> doclintOpts = new ArrayList<>();
 
         for (String opt: opts) {
@@ -836,6 +836,7 @@
             sep = DocLint.SEPARATOR;
         }
         doclintOpts.add(DocLint.XCUSTOM_TAGS_PREFIX + customTags.toString());
+        doclintOpts.add(DocLint.XHTML_VERSION_PREFIX + htmlVersion);
 
         JavacTask t = BasicJavacTask.instance(context);
         doclint = new DocLint();
--- a/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/RootDocImpl.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/src/jdk.javadoc/share/classes/com/sun/tools/javadoc/RootDocImpl.java	Fri Apr 17 10:23:49 2015 -0700
@@ -377,8 +377,9 @@
         return env.fileManager;
     }
 
-    public void initDocLint(Collection<String> opts, Collection<String> customTagNames) {
-        env.initDoclint(opts, customTagNames);
+    public void initDocLint(Collection<String> opts, Collection<String> customTagNames,
+            String htmlVersion) {
+        env.initDoclint(opts, customTagNames, htmlVersion);
     }
 
     public boolean isFunctionalInterface(AnnotationDesc annotationDesc) {
--- a/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/test/com/sun/javadoc/AccessSkipNav/AccessSkipNav.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2002, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2002, 2015, 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
@@ -49,14 +49,14 @@
         checkOutput("p1/C1.html", true,
                 // Top navbar <a href>
                 "<a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a>",
-                // Top navbar <a name>
-                "<a name=\"skip.navbar.top\">\n"
+                // Top navbar <a id>
+                "<a id=\"skip.navbar.top\">\n"
                 + "<!--   -->\n"
                 + "</a>",
                 // Bottom navbar <a href>
                 "<a href=\"#skip.navbar.bottom\" title=\"Skip navigation links\">Skip navigation links</a>",
-                // Bottom navbar <a name>
-                "<a name=\"skip.navbar.bottom\">\n"
+                // Bottom navbar <a id>
+                "<a id=\"skip.navbar.bottom\">\n"
                 + "<!--   -->\n"
                 + "</a>");
 
--- a/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/test/com/sun/javadoc/testAnchorNames/TestAnchorNames.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -53,15 +53,15 @@
 
         // Test some section markers and links to these markers
         checkOutput("pkg1/RegClass.html", true,
-                "<a name=\"skip.navbar.top\">",
+                "<a id=\"skip.navbar.top\">",
                 "<a href=\"#skip.navbar.top\" title=\"Skip navigation links\">",
-                "<a name=\"nested.class.summary\">",
+                "<a id=\"nested.class.summary\">",
                 "<a href=\"#nested.class.summary\">",
-                "<a name=\"method.summary\">",
+                "<a id=\"method.summary\">",
                 "<a href=\"#method.summary\">",
-                "<a name=\"field.detail\">",
+                "<a id=\"field.detail\">",
                 "<a href=\"#field.detail\">",
-                "<a name=\"constructor.detail\">",
+                "<a id=\"constructor.detail\">",
                 "<a href=\"#constructor.detail\">");
 
         // Test some members and link to these members
@@ -72,59 +72,59 @@
 
         // Test some fields
         checkOutput("pkg1/RegClass.html", true,
-                "<a name=\"Z:Z_\">",
+                "<a id=\"Z:Z_\">",
                 "<a href=\"../pkg1/RegClass.html#Z:Z_\">",
-                "<a name=\"Z:Z_:D\">",
+                "<a id=\"Z:Z_:D\">",
                 "<a href=\"../pkg1/RegClass.html#Z:Z_:D\">",
-                "<a name=\"Z:Z:D_\">",
+                "<a id=\"Z:Z:D_\">",
                 "<a href=\"../pkg1/RegClass.html#Z:Z:D_\">",
-                "<a name=\"Z:Z:Dfield\">",
+                "<a id=\"Z:Z:Dfield\">",
                 "<a href=\"../pkg1/RegClass.html#Z:Z:Dfield\">",
-                "<a name=\"fieldInCla:D:D\">",
+                "<a id=\"fieldInCla:D:D\">",
                 "<a href=\"../pkg1/RegClass.html#fieldInCla:D:D\">",
-                "<a name=\"S_:D:D:D:D:DINT\">",
+                "<a id=\"S_:D:D:D:D:DINT\">",
                 "<a href=\"../pkg1/RegClass.html#S_:D:D:D:D:DINT\">",
-                "<a name=\"method:D:D\">",
+                "<a id=\"method:D:D\">",
                 "<a href=\"../pkg1/RegClass.html#method:D:D\">");
 
         checkOutput("pkg1/DeprMemClass.html", true,
-                "<a name=\"Z:Z_field_In_Class\">",
+                "<a id=\"Z:Z_field_In_Class\">",
                 "<a href=\"../pkg1/DeprMemClass.html#Z:Z_field_In_Class\">");
 
         // Test constructor
         checkOutput("pkg1/RegClass.html", true,
-                "<a name=\"RegClass-java.lang.String-int-\">",
+                "<a id=\"RegClass-java.lang.String-int-\">",
                 "<a href=\"../pkg1/RegClass.html#RegClass-java.lang.String-int-\">");
 
         // Test some methods
         checkOutput("pkg1/RegClass.html", true,
-                "<a name=\"Z:Z_methodInClass-java.lang.String-\">",
+                "<a id=\"Z:Z_methodInClass-java.lang.String-\">",
                 "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClass-java.lang.String-\">",
-                "<a name=\"method--\">",
+                "<a id=\"method--\">",
                 "<a href=\"../pkg1/RegClass.html#method--\">",
-                "<a name=\"foo-java.util.Map-\">",
+                "<a id=\"foo-java.util.Map-\">",
                 "<a href=\"../pkg1/RegClass.html#foo-java.util.Map-\">",
-                "<a name=\"methodInCla:Ds-java.lang.String:A-\">",
+                "<a id=\"methodInCla:Ds-java.lang.String:A-\">",
                 "<a href=\"../pkg1/RegClass.html#methodInCla:Ds-java.lang.String:A-\">",
-                "<a name=\"Z:Z_methodInClas:D-java.lang.String-int-\">",
+                "<a id=\"Z:Z_methodInClas:D-java.lang.String-int-\">",
                 "<a href=\"../pkg1/RegClass.html#Z:Z_methodInClas:D-java.lang.String-int-\">",
-                "<a name=\"methodD-pkg1.RegClass.:DA-\">",
+                "<a id=\"methodD-pkg1.RegClass.:DA-\">",
                 "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.:DA-\">",
-                "<a name=\"methodD-pkg1.RegClass.D:A-\">",
+                "<a id=\"methodD-pkg1.RegClass.D:A-\">",
                 "<a href=\"../pkg1/RegClass.html#methodD-pkg1.RegClass.D:A-\">");
 
         checkOutput("pkg1/DeprMemClass.html", true,
-                "<a name=\"Z:Z:Dmethod_In_Class--\">",
+                "<a id=\"Z:Z:Dmethod_In_Class--\">",
                 "<a href=\"../pkg1/DeprMemClass.html#Z:Z:Dmethod_In_Class--\">");
 
         // Test enum
         checkOutput("pkg1/RegClass.Te$t_Enum.html", true,
-                "<a name=\"Z:Z:DFLD2\">",
+                "<a id=\"Z:Z:DFLD2\">",
                 "<a href=\"../pkg1/RegClass.Te$t_Enum.html#Z:Z:DFLD2\">");
 
         // Test nested class
         checkOutput("pkg1/RegClass._NestedClas$.html", true,
-                "<a name=\"Z:Z_NestedClas:D--\">",
+                "<a id=\"Z:Z_NestedClas:D--\">",
                 "<a href=\"../pkg1/RegClass._NestedClas$.html#Z:Z_NestedClas:D--\">");
 
         // Test class use page
@@ -143,11 +143,11 @@
         // Test serialized form page
         checkOutput("serialized-form.html", true,
                 //This is the marker for the link that appears in the pkg1.RegClass.html page
-                "<a name=\"pkg1.RegClass\">");
+                "<a id=\"pkg1.RegClass\">");
 
         // Test member name index page
         checkOutput("index-all.html", true,
-                "<a name=\"I:Z:Z:D\">",
+                "<a id=\"I:Z:Z:D\">",
                 "<a href=\"#I:Z:Z:D\">$",
                 "<a href=\"#I:Z:Z_\">_");
 
--- a/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/test/com/sun/javadoc/testAnnotationOptional/TestAnnotationOptional.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, 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
@@ -47,6 +47,6 @@
         checkExit(Exit.OK);
 
         checkOutput("pkg/AnnotationOptional.html", true,
-            "<a name=\"annotation.type.element.detail\">");
+            "<a id=\"annotation.type.element.detail\">");
     }
 }
--- a/test/com/sun/javadoc/testClassTree/TestClassTree.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/test/com/sun/javadoc/testClassTree/TestClassTree.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2004, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2004, 2015, 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
@@ -50,22 +50,22 @@
 
         checkOutput("pkg/package-tree.html", true,
                 "<ul>\n"
-                + "<li type=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" "
+                + "<li class=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" "
                 + "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a>",
                 "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n"
                 + "<ul>\n"
-                + "<li type=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" "
+                + "<li class=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" "
                 + "title=\"annotation in pkg\"><span class=\"typeNameLink\">AnnotationType</span></a> "
                 + "(implements java.lang.annotation.Annotation)</li>\n"
                 + "</ul>",
                 "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>\n"
                 + "<ul>\n"
-                + "<li type=\"circle\">java.lang.Object\n"
+                + "<li class=\"circle\">java.lang.Object\n"
                 + "<ul>\n"
-                + "<li type=\"circle\">java.lang.Enum&lt;E&gt; (implements java.lang."
+                + "<li class=\"circle\">java.lang.Enum&lt;E&gt; (implements java.lang."
                 + "Comparable&lt;T&gt;, java.io.Serializable)\n"
                 + "<ul>\n"
-                + "<li type=\"circle\">pkg.<a href=\"../pkg/Coin.html\" "
+                + "<li class=\"circle\">pkg.<a href=\"../pkg/Coin.html\" "
                 + "title=\"enum in pkg\"><span class=\"typeNameLink\">Coin</span></a></li>\n"
                 + "</ul>\n"
                 + "</li>\n"
@@ -74,7 +74,7 @@
                 + "</ul>");
 
         checkOutput("pkg/package-tree.html", false,
-                "<li type=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" "
+                "<li class=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" "
                 + "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a></li>");
     }
 }
--- a/test/com/sun/javadoc/testConstructors/TestConstructors.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/test/com/sun/javadoc/testConstructors/TestConstructors.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -58,21 +58,21 @@
                 + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>"
                 + "NestedInner(int)</code></a>",
                 "<a href=\"../pkg1/Outer.html#Outer--\">Outer</a></span>()",
-                "<a name=\"Outer--\">",
+                "<a id=\"Outer--\">",
                 "<a href=\"../pkg1/Outer.html#Outer-int-\">Outer</a></span>(int&nbsp;i)",
-                "<a name=\"Outer-int-\">");
+                "<a id=\"Outer-int-\">");
 
         checkOutput("pkg1/Outer.Inner.html", true,
                 "<a href=\"../pkg1/Outer.Inner.html#Inner--\">Inner</a></span>()",
-                "<a name=\"Inner--\">",
+                "<a id=\"Inner--\">",
                 "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\">Inner</a></span>(int&nbsp;i)",
-                "<a name=\"Inner-int-\">");
+                "<a id=\"Inner-int-\">");
 
         checkOutput("pkg1/Outer.Inner.NestedInner.html", true,
                 "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\">NestedInner</a></span>()",
-                "<a name=\"NestedInner--\">",
+                "<a id=\"NestedInner--\">",
                 "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\">NestedInner</a></span>(int&nbsp;i)",
-                "<a name=\"NestedInner-int-\">");
+                "<a id=\"NestedInner-int-\">");
 
         checkOutput("pkg1/Outer.Inner.html", false,
                 "Outer.Inner--",
--- a/test/com/sun/javadoc/testHref/TestHref.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/test/com/sun/javadoc/testHref/TestHref.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2003, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2003, 2015, 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
@@ -53,11 +53,11 @@
                 //Member summary table link.
                 "href=\"../pkg/C1.html#method-int-int-java.util.ArrayList-\"",
                 //Anchor test.
-                "<a name=\"method-int-int-java.util.ArrayList-\">\n"
+                "<a id=\"method-int-int-java.util.ArrayList-\">\n"
                 + "<!--   -->\n"
                 + "</a>",
                 //Backward compatibility anchor test."pkg/C1.html",
-                "<a name=\"method-int-int-java.util.ArrayList-\">\n"
+                "<a id=\"method-int-int-java.util.ArrayList-\">\n"
                 + "<!--   -->\n"
                 + "</a>");
 
--- a/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/test/com/sun/javadoc/testHtmlDocument/TestHtmlDocument.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2015, 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
@@ -113,7 +113,7 @@
         // Test another version of A tag.
         HtmlTree anchor = new HtmlTree(HtmlTag.A);
         anchor.addAttr(HtmlAttr.HREF, "testLink.html");
-        anchor.addAttr(HtmlAttr.NAME, "Another version of a tag");
+        anchor.addAttr(HtmlAttr.ID, "Another version of a tag");
         p1.addContent(anchor);
         body.addContent(p1);
         // Test for empty tags.
--- a/test/com/sun/javadoc/testHtmlDocument/testMarkup.html	Fri Apr 17 09:59:49 2015 -0700
+++ b/test/com/sun/javadoc/testHtmlDocument/testMarkup.html	Fri Apr 17 10:23:49 2015 -0700
@@ -9,7 +9,7 @@
 <body>
 <!-- ======== START OF PARAGRAPH ======== -->
 <p>This document is generated from sample source code and HTML files with examples of a wide variety of Java language constructs: packages, subclasses, subinterfaces, nested classes, nested interfaces,inheriting from other packages, constructors, fields,methods, and so forth. <a href="testLink.html">Click Here</a> to &lt;test&gt; out a link.</p>
-<p><a href="testLink.html" name="Another version of a tag"></a></p>
+<p><a href="testLink.html" id="Another version of a tag"></a></p>
 <dl>
 <dd>Test DD</dd>
 </dl>
--- a/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/test/com/sun/javadoc/testHtmlTableStyles/TestHtmlTableStyles.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2013, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2013, 2015, 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
@@ -48,37 +48,30 @@
 
         checkOutput("pkg1/TestTable.html", true,
                 "<table summary=\"Summary\" border cellpadding=3 cellspacing=1>",
-                "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Field Summary table, listing fields, "
+                "<table class=\"memberSummary\" summary=\"Field Summary table, listing fields, "
                 + "and an explanation\">",
-                "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Constructor Summary table, listing "
+                "<table class=\"memberSummary\" summary=\"Constructor Summary table, listing "
                 + "constructors, and an explanation\">",
-                "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Method Summary table, listing methods, "
+                "<table class=\"memberSummary\" summary=\"Method Summary table, listing methods, "
                 + "and an explanation\">");
 
         checkOutput("pkg1/package-summary.html", true,
-                "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Class Summary table, listing classes, "
+                "<table class=\"typeSummary\" summary=\"Class Summary table, listing classes, "
                 + "and an explanation\">");
 
         checkOutput("pkg1/class-use/TestTable.html", true,
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Use table, listing fields, and an explanation\">");
+                "<table class=\"useSummary\" summary=\"Use table, listing fields, and an explanation\">");
 
         checkOutput("overview-summary.html", true,
-                "<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Packages table, listing packages, and an explanation\">");
+                "<table class=\"overviewSummary\" "
+                + "summary=\"Packages table, listing packages, and an explanation\">");
 
         checkOutput("deprecated-list.html", true,
-            "<table class=\"deprecatedSummary\" border=\"0\" cellpadding=\"3\" " +
-            "cellspacing=\"0\" summary=\"Deprecated Methods table, listing " +
+            "<table class=\"deprecatedSummary\" summary=\"Deprecated Methods table, listing " +
             "deprecated methods, and an explanation\">");
 
         checkOutput("constant-values.html", true,
-            "<table class=\"constantsSummary\" border=\"0\" cellpadding=\"3\" " +
-            "cellspacing=\"0\" summary=\"Constant Field Values table, listing " +
+            "<table class=\"constantsSummary\" summary=\"Constant Field Values table, listing " +
             "constant fields, and values\">");
     }
 }
--- a/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java	Fri Apr 17 09:59:49 2015 -0700
+++ b/test/com/sun/javadoc/testHtmlTableTags/TestHtmlTableTags.java	Fri Apr 17 10:23:49 2015 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2009, 2015, 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
@@ -63,111 +63,85 @@
     void checkHtmlTableSummaries() {
         //Package summary
         checkOutput("pkg1/package-summary.html", true,
-                "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\""
-                + " cellspacing=\"0\" summary=\"Class Summary table, "
+                "<table class=\"typeSummary\" summary=\"Class Summary table, "
                 + "listing classes, and an explanation\">",
-                "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\""
-                + " cellspacing=\"0\" summary=\"Interface Summary table, "
+                "<table class=\"typeSummary\" summary=\"Interface Summary table, "
                 + "listing interfaces, and an explanation\">");
 
         checkOutput("pkg2/package-summary.html", true,
-                "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\""
-                + " cellspacing=\"0\" summary=\"Enum Summary table, "
+                "<table class=\"typeSummary\" summary=\"Enum Summary table, "
                 + "listing enums, and an explanation\">",
-                "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\""
-                + " cellspacing=\"0\" summary=\"Annotation Types Summary table, "
+                "<table class=\"typeSummary\" summary=\"Annotation Types Summary table, "
                 + "listing annotation types, and an explanation\">");
 
         // Class documentation
         checkOutput("pkg1/C1.html", true,
-                "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Field Summary table, listing fields, "
+                "<table class=\"memberSummary\" summary=\"Field Summary table, listing fields, "
                 + "and an explanation\">",
-                "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Method Summary table, listing methods, "
+                "<table class=\"memberSummary\" summary=\"Method Summary table, listing methods, "
                 + "and an explanation\">");
 
         checkOutput("pkg2/C2.html", true,
-                "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Nested Class Summary table, listing "
+                "<table class=\"memberSummary\" summary=\"Nested Class Summary table, listing "
                 + "nested classes, and an explanation\">",
-                "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Constructor Summary table, listing "
+                "<table class=\"memberSummary\" summary=\"Constructor Summary table, listing "
                 + "constructors, and an explanation\">");
 
         checkOutput("pkg2/C2.ModalExclusionType.html", true,
-                "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Enum Constant Summary table, listing "
+                "<table class=\"memberSummary\" summary=\"Enum Constant Summary table, listing "
                 + "enum constants, and an explanation\">");
 
         checkOutput("pkg2/C3.html", true,
-                "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Required Element Summary table, "
+                "<table class=\"memberSummary\" summary=\"Required Element Summary table, "
                 + "listing required elements, and an explanation\">");
 
         checkOutput("pkg2/C4.html", true,
-                "<table class=\"memberSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Optional Element Summary table, "
+                "<table class=\"memberSummary\" summary=\"Optional Element Summary table, "
                 + "listing optional elements, and an explanation\">");
 
         // Class use documentation
         checkOutput("pkg1/class-use/I1.html", true,
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use "
-                + "table, listing packages, and an explanation\">");
+                "<table class=\"useSummary\" summary=\"Use table, listing packages, and an explanation\">");
 
         checkOutput("pkg1/class-use/C1.html", true,
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use "
-                + "table, listing fields, and an explanation\">",
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use "
-                + "table, listing methods, and an explanation\">");
+                "<table class=\"useSummary\" summary=\"Use table, listing fields, and an explanation\">",
+                "<table class=\"useSummary\" summary=\"Use table, listing methods, and an explanation\">");
 
         checkOutput("pkg2/class-use/C2.html", true,
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use "
-                + "table, listing fields, and an explanation\">",
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use "
-                + "table, listing methods, and an explanation\">");
+                "<table class=\"useSummary\" summary=\"Use table, listing fields, and an explanation\">",
+                "<table class=\"useSummary\" summary=\"Use table, listing methods, and an explanation\">");
 
         checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true,
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use "
-                + "table, listing packages, and an explanation\">");
+                "<table class=\"useSummary\" summary=\"Use table, listing packages, and an explanation\">");
 
         checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true,
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use "
-                + "table, listing methods, and an explanation\">");
+                "<table class=\"useSummary\" summary=\"Use table, listing methods, and an explanation\">");
 
         // Package use documentation
         checkOutput("pkg1/package-use.html", true,
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use "
-                + "table, listing packages, and an explanation\">",
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use "
-                + "table, listing classes, and an explanation\">");
+                "<table class=\"useSummary\" summary=\"Use table, listing packages, and an explanation\">",
+                "<table class=\"useSummary\" summary=\"Use table, listing classes, and an explanation\">");
 
         checkOutput("pkg2/package-use.html", true,
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use "
-                + "table, listing packages, and an explanation\">",
-                "<table class=\"useSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" summary=\"Use "
-                + "table, listing classes, and an explanation\">");
+                "<table class=\"useSummary\" summary=\"Use table, listing packages, and an explanation\">",
+                "<table class=\"useSummary\" summary=\"Use table, listing classes, and an explanation\">");
 
         // Deprecated
         checkOutput("deprecated-list.html", true,
-                "<table class=\"deprecatedSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" "
-                + "summary=\"Deprecated Fields table, listing deprecated fields, "
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Fields table, listing deprecated fields, "
                 + "and an explanation\">",
-                "<table class=\"deprecatedSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" "
-                + "summary=\"Deprecated Methods table, listing deprecated methods, "
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Methods table, listing deprecated methods, "
                 + "and an explanation\">");
 
         // Constant values
         checkOutput("constant-values.html", true,
-                "<table class=\"constantsSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" "
-                + "summary=\"Constant Field Values table, listing "
+                "<table class=\"constantsSummary\" summary=\"Constant Field Values table, listing "
                 + "constant fields, and values\">");
 
         // Overview Summary
         checkOutput("overview-summary.html", true,
-                "<table class=\"overviewSummary\" border=\"0\" cellpadding=\"3\" "
-                + "cellspacing=\"0\" summary=\"Packages table, "
-                + "listing packages, and an explanation\">");
+                "<table class=\"overviewSummary\" "
+                + "summary=\"Packages table, listing packages, and an explanation\">");
     }
 
     /*
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/TestHtmlVersion.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,2158 @@
+/*
+ * Copyright (c) 2015, 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 8072945
+ * @summary Test the version of HTML generated by the javadoc tool.
+ * @author bpatel
+ * @library ../lib
+ * @build JavadocTester
+ * @run main TestHtmlVersion
+ */
+
+public class TestHtmlVersion extends JavadocTester {
+
+    public static void main(String... args) throws Exception {
+        TestHtmlVersion tester = new TestHtmlVersion();
+        tester.runTests();
+    }
+
+    @Test
+    void test1() {
+        javadoc("-d", "out-1", "-private", "-linksource", "-html5",
+                "-Xprofilespath", testSrc("profile-rtjar-includes.txt"),
+                "-sourcepath", testSrc,
+                "-use",
+                "pkg", "pkg1", "pkg2", "pkg3");
+        checkExit(Exit.OK);
+
+        html5Output();
+        html5NegatedOutput();
+    }
+
+    @Test
+    void test2() {
+        javadoc("-d", "out-2", "-private", "-linksource", "-html4",
+                "-Xprofilespath", testSrc("profile-rtjar-includes.txt"),
+                "-sourcepath", testSrc,
+                "-use",
+                "pkg", "pkg1", "pkg2", "pkg3");
+        checkExit(Exit.OK);
+
+        html4Output();
+        html4NegatedOutput();
+    }
+
+    @Test
+    void test3() {
+        javadoc("-d", "out-3", "-private", "-linksource",
+                "-Xprofilespath", testSrc("profile-rtjar-includes.txt"),
+                "-sourcepath", testSrc,
+                "-use",
+                "pkg", "pkg1", "pkg2", "pkg3");
+        checkExit(Exit.OK);
+
+        html4Output();
+        html4NegatedOutput();
+    }
+
+    @Test
+    void test4() {
+        javadoc("-d", "out-4", "-private", "-linksource", "-html5",
+                "-sourcepath", testSrc,
+                "-use",
+                "pkg3");
+        checkExit(Exit.OK);
+    }
+
+    void html5Output() {
+        // Test for overview-frame page
+        checkOutput("overview-frame.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<nav role=\"navigation\" class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<main role=\"main\" class=\"indexContainer\">\n"
+                + "<h2 title=\"Packages\">Packages</h2>");
+
+        // Test for allclasses-frame page
+        checkOutput("allclasses-frame.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<main role=\"main\" class=\"indexContainer\">\n"
+                + "<ul>\n"
+                + "<li>");
+
+        // Test for allclasses-noframe page
+        checkOutput("allclasses-noframe.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<main role=\"main\" class=\"indexContainer\">\n"
+                + "<ul>\n"
+                + "<li>");
+
+        // Test for profile-overview-frame page
+        checkOutput("profile-overview-frame.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<nav role=\"navigation\" class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<main role=\"main\" class=\"indexContainer\">\n"
+                + "<h2 title=\"Profiles\">Profiles</h2>");
+
+        // Test for <profile-name>-frame page
+        checkOutput("compact1-frame.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<nav role=\"navigation\" class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<main role=\"main\" class=\"indexContainer\">\n"
+                + "<h2 title=\"compact1\"><a href=\"compact1-summary.html\" target=\"classFrame\">compact1</a>&nbsp;Packages</h2>");
+
+        // Test for overview-summary page
+        checkOutput("overview-summary.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"overviewSummary\">\n"
+                + "<caption>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div>\n"
+                + "<h2>Profiles</h2>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for package-frame page
+        checkOutput("pkg/package-frame.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<main role=\"main\">\n"
+                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Interfaces\">Interfaces</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Classes\">Classes</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Enums\">Enums</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Exceptions\">Exceptions</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Errors\">Errors</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Annotation Types\">Annotation Types</h2>");
+
+        // Test for package-summary page
+        checkOutput("pkg/package-summary.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Package pkg Description\">Package pkg Description</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for package-tree page
+        checkOutput("pkg/package-tree.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<li class=\"circle\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for package-use page
+        checkOutput("pkg1/package-use.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"useSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for <profile-name>-package-frame page
+        checkOutput("pkg/compact1-package-frame.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<main role=\"main\">\n"
+                + "<h1 class=\"bar\"><a href=\"../compact1-summary.html\" target=\"classFrame\">"
+                + "compact1</a> - <a href=\"../pkg/compact1-package-summary.html\" target=\"classFrame\">pkg</a></h1>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Interfaces\">Interfaces</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Classes\">Classes</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Enums\">Enums</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Exceptions\">Exceptions</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Errors\">Errors</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Annotation Types\">Annotation Types</h2>");
+
+        // Test for <profile-name>-package-summary page
+        checkOutput("pkg/compact1-package-summary.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Package pkg Description\">Package pkg Description</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for <profile-name>-summary page
+        checkOutput("compact1-summary.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\">\n"
+                + "<section role=\"region\">\n"
+                + "<h3><a href=\"pkg/compact1-package-summary.html\" target=\"classFrame\">pkg</a></h3>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for constant-values page
+        checkOutput("constant-values.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"constantsSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Contents\">Contents</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"pkg\">pkg.*</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for deprecated-list page
+        checkOutput("deprecated-list.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"deprecatedSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for serialized-form page
+        checkOutput("serialized-form.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Package\">Package&nbsp;pkg</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for overview-tree page
+        checkOutput("overview-tree.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<li class=\"circle\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for index-all page
+        checkOutput("index-all.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "</header>\n"
+                + "<main role=\"main\">",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for src-html page
+        checkOutput("src-html/pkg/AnotherClass.html", true,
+                "<!DOCTYPE HTML>",
+                "<main role=\"main\">\n"
+                + "<div class=\"sourceContainer\">");
+
+        // Test for help-doc page
+        checkOutput("help-doc.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2>Overview</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2>Package</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2>Class/Interface</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for a regular class page and members (nested class, field, constructore and method)
+        checkOutput("pkg/AnotherClass.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"nested.class.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Nested Class Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"field.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Field Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"field.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Field Detail</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for enum page
+        checkOutput("pkg/AnotherClass.ModalExclusionType.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"enum.constant.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Enum Constant Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"enum.constant.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Enum Constant Detail</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for interface page
+        checkOutput("pkg2/Interface.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for error page
+        checkOutput("pkg/TestError.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for exception page
+        checkOutput("pkg/TestException.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for annotation page
+        checkOutput("pkg2/TestAnnotationType.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"annotation.type.required.element.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Required Element Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"annotation.type.optional.element.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Optional Element Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"annotation.type.element.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Element Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for class use page
+        checkOutput("pkg1/class-use/RegClass.html", true,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<table class=\"useSummary\">",
+                "<section role=\"region\"><a id=\"pkg\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "<table class=\"useSummary\">",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Test for main index page
+        checkOutput("index.html", true,
+                "<!DOCTYPE HTML>",
+                "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">",
+                "<body>\n"
+                + "<main role=\"main\">\n"
+                + "<div class=\"mainContainer\">\n"
+                + "<div class=\"leftContainer\">\n"
+                + "<div class=\"leftTop\">\n"
+                + "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>\n"
+                + "</div>");
+    }
+
+    void html5NegatedOutput() {
+        // Negated test for overview-frame page
+        checkOutput("overview-frame.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<div class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<div class=\"indexContainer\">\n"
+                + "<h2 title=\"Packages\">Packages</h2>");
+
+        // Negated test for allclasses-frame page
+        checkOutput("allclasses-frame.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<div class=\"indexContainer\">\n"
+                + "<ul>\n"
+                + "<li>");
+
+        // Negated test for allclasses-noframe page
+        checkOutput("allclasses-noframe.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<div class=\"indexContainer\">\n"
+                + "<ul>\n"
+                + "<li>");
+
+        // Negated test for profile-overview-frame page
+        checkOutput("profile-overview-frame.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<div class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<div class=\"indexContainer\">\n"
+                + "<h2 title=\"Profiles\">Profiles</h2>");
+
+        // Negated test for <profile-name>-frame page
+        checkOutput("compact1-frame.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<div class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<div class=\"indexContainer\">\n"
+                + "<h2 title=\"compact1\"><a href=\"compact1-summary.html\" target=\"classFrame\">compact1</a>&nbsp;Packages</h2>");
+
+        // Negated test for overview-summary page
+        checkOutput("overview-summary.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
+                + "<caption>",
+                "</noscript>\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div>\n"
+                + "<h2>Profiles</h2>");
+
+        // Negated test for package-frame page
+        checkOutput("pkg/package-frame.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<body>\n"
+                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>");
+
+        // Negated test for package-summary page
+        checkOutput("pkg/package-summary.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\" summary=\"Interface Summary table, listing interfaces, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Class Summary table, listing classes, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Enum Summary table, listing enums, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Exception Summary table, listing exceptions, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Error Summary table, listing errors, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Annotation Types Summary table, listing annotation types, and an explanation\">");
+
+        // Negated test for package-tree page
+        checkOutput("pkg/package-tree.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>");
+
+        // Negated test for package-use page
+        checkOutput("pkg1/package-use.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"useSummary\" summary=\"Use table, listing packages, and an explanation\">");
+
+        // Negated test for <profile-name>-package-frame page
+        checkOutput("pkg/compact1-package-frame.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<body>\n"
+                + "<h1 class=\"bar\"><a href=\"../compact1-summary.html\" target=\"classFrame\">"
+                + "compact1</a> - <a href=\"../pkg/compact1-package-summary.html\" target=\"classFrame\">pkg</a></h1>");
+
+        // Negated test for <profile-name>-package-summary page
+        checkOutput("pkg/compact1-package-summary.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\" summary=\"Interface Summary table, listing interfaces, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Class Summary table, listing classes, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Enum Summary table, listing enums, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Exception Summary table, listing exceptions, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Error Summary table, listing errors, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Annotation Types Summary table, listing annotation types, and an explanation\">");
+
+        // Negated test for <profile-name>-summary page
+        checkOutput("compact1-summary.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\" summary=\"Interface Summary table, listing interfaces, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Class Summary table, listing classes, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Enum Summary table, listing enums, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Exception Summary table, listing exceptions, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Error Summary table, listing errors, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Annotation Types Summary table, listing annotation types, and an explanation\">");
+
+        // Negated test for constant-values page
+        checkOutput("constant-values.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">",
+                "<table class=\"constantsSummary\" summary=\"Constant Field Values table, listing constant fields, and values\">");
+
+        // Negated test for deprecated-list page
+        checkOutput("deprecated-list.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">\n"
+                + "<h1 title=\"Deprecated API\" class=\"title\">Deprecated API</h1>\n"
+                + "<h2 title=\"Contents\">Contents</h2>",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Classes table, listing deprecated classes, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Enums table, listing deprecated enums, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Exceptions table, listing deprecated exceptions, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Errors table, listing deprecated errors, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Annotation Types table, listing deprecated annotation types, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Fields table, listing deprecated fields, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Methods table, listing deprecated methods, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Constructors table, listing deprecated constructors, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Enum Constants table, listing deprecated enum constants, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Annotation Type Elements table, listing deprecated annotation type elements, and an explanation\">");
+
+        // Negated test for serialized-form page
+        checkOutput("serialized-form.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">",
+                "<li class=\"blockList\">\n"
+                + "<h2 title=\"Package\">Package&nbsp;pkg</h2>");
+
+        // Negated test for overview-tree page
+        checkOutput("overview-tree.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">",
+                "<div class=\"contentContainer\">\n"
+                + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>",
+                "</ul>\n"
+                + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>",
+                "</ul>\n"
+                + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>");
+
+        // Negated test for index-all page
+        checkOutput("index-all.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"contentContainer\">");
+
+        // Negated test for src-html page
+        checkOutput("src-html/pkg/AnotherClass.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<body>\n"
+                + "<div class=\"sourceContainer\">");
+
+        // Negated test for help-doc page
+        checkOutput("help-doc.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">",
+                "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\">\n"
+                + "<h2>Overview</h2>",
+                "<li class=\"blockList\">\n"
+                + "<h2>Package</h2>",
+                "<li class=\"blockList\">\n"
+                + "<h2>Class/Interface</h2>");
+
+        // Negated test for a regular class page and members (nested class, field, constructore and method)
+        checkOutput("pkg/AnotherClass.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- ======== NESTED CLASS SUMMARY ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"nested.class.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Nested Class Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Nested Class Summary table, listing nested classes, and an explanation\">",
+                "<!-- =========== FIELD SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"field.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Field Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Field Summary table, listing fields, and an explanation\">",
+                "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Constructor Summary table, listing constructors, and an explanation\">",
+                "<!-- ========== METHOD SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Method Summary table, listing methods, and an explanation\">",
+                "<!-- ============ FIELD DETAIL =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"field.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Field Detail</h3>",
+                "<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>",
+                "<!-- ============ METHOD DETAIL ========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>");
+
+        // Negated test for enum page
+        checkOutput("pkg/AnotherClass.ModalExclusionType.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- =========== ENUM CONSTANT SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"enum.constant.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Enum Constant Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Enum Constant Summary table, listing enum constants, and an explanation\">",
+                "<!-- ========== METHOD SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Method Summary table, listing methods, and an explanation\">",
+                "<!-- ============ ENUM CONSTANT DETAIL =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"enum.constant.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Enum Constant Detail</h3>",
+                "<!-- ============ METHOD DETAIL ========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>");
+
+        // Negated test for interface page
+        checkOutput("pkg2/Interface.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- ========== METHOD SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Method Summary table, listing methods, and an explanation\">",
+                "<!-- ============ METHOD DETAIL ========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>");
+
+        // Negated test for error page
+        checkOutput("pkg/TestError.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>",
+                "<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>");
+
+        // Negated test for exception page
+        checkOutput("pkg/TestException.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>",
+                "<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>");
+
+        // Negated test for annotation page
+        checkOutput("pkg2/TestAnnotationType.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"annotation.type.required.element.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Required Element Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Required Element Summary table, listing required elements, and an explanation\">",
+                "<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"annotation.type.optional.element.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Optional Element Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Optional Element Summary table, listing optional elements, and an explanation\">",
+                "<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"annotation.type.element.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Element Detail</h3>");
+
+        // Negated test for class use page
+        checkOutput("pkg1/class-use/RegClass.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">",
+                "<table class=\"useSummary\" summary=\"Use table, listing packages, and an explanation\">",
+                "<li class=\"blockList\"><a name=\"pkg\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "<table class=\"useSummary\" summary=\"Use table, listing fields, and an explanation\">");
+
+        // Negated test for main index page
+        checkOutput("index.html", false,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<body>\n"
+                + "<div class=\"mainContainer\">\n");
+    }
+
+    void html4Output() {
+        // Test for overview-frame page
+        checkOutput("overview-frame.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<div class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<div class=\"indexContainer\">\n"
+                + "<h2 title=\"Packages\">Packages</h2>");
+
+        // Test for allclasses-frame page
+        checkOutput("allclasses-frame.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<div class=\"indexContainer\">\n"
+                + "<ul>\n"
+                + "<li>");
+
+        // Test for allclasses-noframe page
+        checkOutput("allclasses-noframe.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<div class=\"indexContainer\">\n"
+                + "<ul>\n"
+                + "<li>");
+
+        // Test for profile-overview-frame page
+        checkOutput("profile-overview-frame.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<div class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<div class=\"indexContainer\">\n"
+                + "<h2 title=\"Profiles\">Profiles</h2>");
+
+        // Test for <profile-name>-frame page
+        checkOutput("compact1-frame.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<div class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<div class=\"indexContainer\">\n"
+                + "<h2 title=\"compact1\"><a href=\"compact1-summary.html\" target=\"classFrame\">compact1</a>&nbsp;Packages</h2>");
+
+        // Test for overview-summary page
+        checkOutput("overview-summary.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
+                + "<caption>",
+                "</noscript>\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<div class=\"contentContainer\">\n"
+                + "<div>\n"
+                + "<h2>Profiles</h2>");
+
+        // Test for package-frame page
+        checkOutput("pkg/package-frame.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<body>\n"
+                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>");
+
+        // Test for package-summary page
+        checkOutput("pkg/package-summary.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\" summary=\"Interface Summary table, listing interfaces, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Class Summary table, listing classes, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Enum Summary table, listing enums, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Exception Summary table, listing exceptions, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Error Summary table, listing errors, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Annotation Types Summary table, listing annotation types, and an explanation\">");
+
+        // Test for package-tree page
+        checkOutput("pkg/package-tree.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<li class=\"circle\">");
+
+        // Test for package-use page
+        checkOutput("pkg1/package-use.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"useSummary\" summary=\"Use table, listing packages, and an explanation\">");
+
+        // Test for <profile-name>-package-frame page
+        checkOutput("pkg/compact1-package-frame.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<body>\n"
+                + "<h1 class=\"bar\"><a href=\"../compact1-summary.html\" target=\"classFrame\">"
+                + "compact1</a> - <a href=\"../pkg/compact1-package-summary.html\" target=\"classFrame\">pkg</a></h1>");
+
+        // Test for <profile-name>-package-summary page
+        checkOutput("pkg/compact1-package-summary.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\" summary=\"Interface Summary table, listing interfaces, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Class Summary table, listing classes, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Enum Summary table, listing enums, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Exception Summary table, listing exceptions, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Error Summary table, listing errors, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Annotation Types Summary table, listing annotation types, and an explanation\">");
+
+        // Test for <profile-name>-summary page
+        checkOutput("compact1-summary.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\" summary=\"Interface Summary table, listing interfaces, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Class Summary table, listing classes, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Enum Summary table, listing enums, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Exception Summary table, listing exceptions, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Error Summary table, listing errors, and an explanation\">",
+                "<table class=\"typeSummary\" summary=\"Annotation Types Summary table, listing annotation types, and an explanation\">");
+
+        // Test for constant-values page
+        checkOutput("constant-values.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">",
+                "<table class=\"constantsSummary\" summary=\"Constant Field Values table, listing constant fields, and values\">");
+
+        // Test for deprecated-list page
+        checkOutput("deprecated-list.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">\n"
+                + "<h1 title=\"Deprecated API\" class=\"title\">Deprecated API</h1>\n"
+                + "<h2 title=\"Contents\">Contents</h2>",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Classes table, listing deprecated classes, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Enums table, listing deprecated enums, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Exceptions table, listing deprecated exceptions, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Errors table, listing deprecated errors, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Annotation Types table, listing deprecated annotation types, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Fields table, listing deprecated fields, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Methods table, listing deprecated methods, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Constructors table, listing deprecated constructors, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Enum Constants table, listing deprecated enum constants, and an explanation\">",
+                "<table class=\"deprecatedSummary\" summary=\"Deprecated Annotation Type Elements table, listing deprecated annotation type elements, and an explanation\">");
+
+        // Test for serialized-form page
+        checkOutput("serialized-form.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">",
+                "<li class=\"blockList\">\n"
+                + "<h2 title=\"Package\">Package&nbsp;pkg</h2>");
+
+        // Test for overview-tree page
+        checkOutput("overview-tree.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<li class=\"circle\">",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">",
+                "<h1 class=\"title\">Hierarchy For All Packages</h1>\n"
+                + "<span class=\"packageHierarchyLabel\">Package Hierarchies:</span>",
+                "<div class=\"contentContainer\">\n"
+                + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>",
+                "</ul>\n"
+                + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>",
+                "</ul>\n"
+                + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>");
+
+        // Test for index-all page
+        checkOutput("index-all.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"contentContainer\">");
+
+        // Test for src-html page
+        checkOutput("src-html/pkg/AnotherClass.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<body>\n"
+                + "<div class=\"sourceContainer\">");
+
+        // Test for help-doc page
+        checkOutput("help-doc.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">",
+                "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\">\n"
+                + "<h2>Overview</h2>",
+                "<li class=\"blockList\">\n"
+                + "<h2>Package</h2>",
+                "<li class=\"blockList\">\n"
+                + "<h2>Class/Interface</h2>");
+
+        // Test for a regular class page and members (nested class, field, constructore and method)
+        checkOutput("pkg/AnotherClass.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- ======== NESTED CLASS SUMMARY ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"nested.class.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Nested Class Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Nested Class Summary table, listing nested classes, and an explanation\">",
+                "<!-- =========== FIELD SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"field.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Field Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Field Summary table, listing fields, and an explanation\">",
+                "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Constructor Summary table, listing constructors, and an explanation\">",
+                "<!-- ========== METHOD SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Method Summary table, listing methods, and an explanation\">",
+                "<!-- ============ FIELD DETAIL =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"field.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Field Detail</h3>",
+                "<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>",
+                "<!-- ============ METHOD DETAIL ========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>");
+
+        // Test for enum page
+        checkOutput("pkg/AnotherClass.ModalExclusionType.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- =========== ENUM CONSTANT SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"enum.constant.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Enum Constant Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Enum Constant Summary table, listing enum constants, and an explanation\">",
+                "<!-- ========== METHOD SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Method Summary table, listing methods, and an explanation\">",
+                "<!-- ============ ENUM CONSTANT DETAIL =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"enum.constant.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Enum Constant Detail</h3>",
+                "<!-- ============ METHOD DETAIL ========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>");
+
+        // Test for interface page
+        checkOutput("pkg2/Interface.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- ========== METHOD SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Method Summary table, listing methods, and an explanation\">",
+                "<!-- ============ METHOD DETAIL ========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>");
+
+        // Test for error page
+        checkOutput("pkg/TestError.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>",
+                "<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>");
+
+        // Test for exception page
+        checkOutput("pkg/TestException.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- ======== CONSTRUCTOR SUMMARY ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>",
+                "<!-- ========= CONSTRUCTOR DETAIL ======== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>");
+
+        // Test for annotation page
+        checkOutput("pkg2/TestAnnotationType.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ======== START OF CLASS DATA ======== -->\n"
+                + "<div class=\"header\">",
+                "<!-- =========== ANNOTATION TYPE REQUIRED MEMBER SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"annotation.type.required.element.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Required Element Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Required Element Summary table, listing required elements, and an explanation\">",
+                "<!-- =========== ANNOTATION TYPE OPTIONAL MEMBER SUMMARY =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"annotation.type.optional.element.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Optional Element Summary</h3>\n"
+                + "<table class=\"memberSummary\" summary=\"Optional Element Summary table, listing optional elements, and an explanation\">",
+                "<!-- ============ ANNOTATION TYPE MEMBER DETAIL =========== -->\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a id=\"annotation.type.element.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Element Detail</h3>");
+
+        // Test for class use page
+        checkOutput("pkg1/class-use/RegClass.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<meta name=\"date\"",
+                "<a id=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<!-- ========= END OF TOP NAVBAR ========= -->\n"
+                + "<div class=\"header\">",
+                "<table class=\"useSummary\" summary=\"Use table, listing packages, and an explanation\">",
+                "<li class=\"blockList\"><a id=\"pkg\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "<table class=\"useSummary\" summary=\"Use table, listing fields, and an explanation\">");
+
+        // Test for main index page
+        checkOutput("index.html", true,
+                "<!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.01 Transitional//EN\" \"http://www.w3.org/TR/html4/loose.dtd\">",
+                "<link rel=\"stylesheet\" type=\"text/css\" href=\"stylesheet.css\" title=\"Style\">",
+                "<body>\n"
+                + "<div class=\"mainContainer\">\n"
+                + "<div class=\"leftContainer\">\n"
+                + "<div class=\"leftTop\">\n"
+                + "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>\n"
+                + "</div>");
+    }
+
+    void html4NegatedOutput() {
+        // Negated test for overview-frame page
+        checkOutput("overview-frame.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<nav role=\"navigation\" class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<main role=\"main\" class=\"indexContainer\">\n"
+                + "<h2 title=\"Packages\">Packages</h2>");
+
+        // Negated test for allclasses-frame page
+        checkOutput("allclasses-frame.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<main role=\"main\" class=\"indexContainer\">\n"
+                + "<ul>\n"
+                + "<li>");
+
+        // Negated test for allclasses-noframe page
+        checkOutput("allclasses-noframe.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<main role=\"main\" class=\"indexContainer\">\n"
+                + "<ul>\n"
+                + "<li>");
+
+        // Negated test for profile-overview-frame page
+        checkOutput("profile-overview-frame.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<nav role=\"navigation\" class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<main role=\"main\" class=\"indexContainer\">\n"
+                + "<h2 title=\"Profiles\">Profiles</h2>");
+
+        // Negated test for <profile-name>-frame page
+        checkOutput("compact1-frame.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<nav role=\"navigation\" class=\"indexNav\">\n"
+                + "<ul>\n"
+                + "<li><a href=\"allclasses-frame.html\" target=\"packageFrame\">All&nbsp;Classes</a></li>",
+                "<main role=\"main\" class=\"indexContainer\">\n"
+                + "<h2 title=\"compact1\"><a href=\"compact1-summary.html\" target=\"classFrame\">compact1</a>&nbsp;Packages</h2>");
+
+        // Negated test for overview-summary page
+        checkOutput("overview-summary.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"overviewSummary\">\n"
+                + "<caption>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"contentContainer\">\n"
+                + "<div>\n"
+                + "<h2>Profiles</h2>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for package-frame page
+        checkOutput("pkg/package-frame.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<main role=\"main\">\n"
+                + "<h1 class=\"bar\"><a href=\"../pkg/package-summary.html\" target=\"classFrame\">pkg</a></h1>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Interfaces\">Interfaces</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Classes\">Classes</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Enums\">Enums</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Exceptions\">Exceptions</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Errors\">Errors</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Annotation Types\">Annotation Types</h2>");
+
+        // Negated test for package-summary page
+        checkOutput("pkg/package-summary.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Package pkg Description\">Package pkg Description</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for package-tree page
+        checkOutput("pkg/package-tree.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for package-use page
+        checkOutput("pkg1/package-use.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"useSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for <profile-name>-package-frame page
+        checkOutput("pkg/compact1-package-frame.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<main role=\"main\">\n"
+                + "<h1 class=\"bar\"><a href=\"../compact1-summary.html\" target=\"classFrame\">"
+                + "compact1</a> - <a href=\"../pkg/compact1-package-summary.html\" target=\"classFrame\">pkg</a></h1>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Interfaces\">Interfaces</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Classes\">Classes</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Enums\">Enums</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Exceptions\">Exceptions</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Errors\">Errors</h2>",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Annotation Types\">Annotation Types</h2>");
+
+        // Negated test for <profile-name>-package-summary page
+        checkOutput("pkg/compact1-package-summary.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Package pkg Description\">Package pkg Description</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for <profile-name>-summary page
+        checkOutput("compact1-summary.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"typeSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\">\n"
+                + "<section role=\"region\">\n"
+                + "<h3><a href=\"pkg/compact1-package-summary.html\" target=\"classFrame\">pkg</a></h3>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for constant-values page
+        checkOutput("constant-values.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"constantsSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Contents\">Contents</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"pkg\">pkg.*</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for deprecated-list page
+        checkOutput("deprecated-list.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<table class=\"deprecatedSummary\">",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for serialized-form page
+        checkOutput("serialized-form.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Package\">Package&nbsp;pkg</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for overview-tree page
+        checkOutput("overview-tree.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Class Hierarchy\">Class Hierarchy</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Interface Hierarchy\">Interface Hierarchy</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for index-all page
+        checkOutput("index-all.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "</header>\n"
+                + "<main role=\"main\">",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for src-html page
+        checkOutput("src-html/pkg/AnotherClass.html", false,
+                "<!DOCTYPE HTML>",
+                "<main role=\"main\">\n"
+                + "<div class=\"sourceContainer\">");
+
+        // Negated test for help-doc page
+        checkOutput("help-doc.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<h2>Overview</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2>Package</h2>\n",
+                "<section role=\"region\">\n"
+                + "<h2>Class/Interface</h2>\n",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for a regular class page and members (nested class, field, constructore and method)
+        checkOutput("pkg/AnotherClass.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"nested.class.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Nested Class Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"field.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Field Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"field.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Field Detail</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for enum page
+        checkOutput("pkg/AnotherClass.ModalExclusionType.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"enum.constant.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Enum Constant Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"enum.constant.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Enum Constant Detail</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for interface page
+        checkOutput("pkg2/Interface.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"method.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Method Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for error page
+        checkOutput("pkg/TestError.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for exception page
+        checkOutput("pkg/TestException.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Summary</h3>",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"constructor.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Constructor Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for annotation page
+        checkOutput("pkg2/TestAnnotationType.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"annotation.type.required.element.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Required Element Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"annotation.type.optional.element.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Optional Element Summary</h3>\n"
+                + "<table class=\"memberSummary\">",
+                "<section role=\"region\">\n"
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\"><a name=\"annotation.type.element.detail\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Element Detail</h3>",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for class use page
+        checkOutput("pkg1/class-use/RegClass.html", false,
+                "<!DOCTYPE HTML>",
+                "<meta name=\"dc.created\"",
+                "<a name=\"navbar.top.firstrow\">\n"
+                + "<!--   -->\n"
+                + "</a>",
+                "<header role=\"banner\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ========= START OF TOP NAVBAR ======= -->",
+                "<main role=\"main\">\n"
+                + "<div class=\"header\">",
+                "<table class=\"useSummary\">",
+                "<section role=\"region\"><a name=\"pkg\">\n"
+                + "<!--   -->\n"
+                + "</a>\n"
+                + "<h3>Uses of <a href=\"../../pkg1/RegClass.html\" title=\"class in pkg1\">RegClass</a> in <a href=\"../../pkg/package-summary.html\">pkg</a></h3>\n"
+                + "\n"
+                + "<table class=\"useSummary\">",
+                "<footer role=\"contentinfo\">\n"
+                + "<nav role=\"navigation\">\n"
+                + "<!-- ======= START OF BOTTOM NAVBAR ====== -->");
+
+        // Negated test for main index page
+        checkOutput("index.html", false,
+                "<!DOCTYPE HTML>",
+                "<body>\n"
+                + "<main role=\"main\">\n"
+                + "<div class=\"mainContainer\">\n");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg/AnnotationType.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,36 @@
+/*
+ * Copyright (c) 2015, 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;
+
+import java.lang.annotation.*;
+
+/**
+ * This is a test annotation type.
+ *
+ * @author Bhavesh Patel.
+ * @since 9
+ */
+@Documented public @interface AnnotationType {
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg/AnotherClass.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,78 @@
+/*
+ * Copyright (c) 2015, 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;
+
+import pkg1.*;
+
+/**
+ * Another test class.
+ *
+ * @author Bhavesh Patel
+ */
+public class AnotherClass {
+
+    /**
+     * A test field.
+     */
+    public RegClass field;
+
+    /**
+     * Constant field.
+     */
+    public static final String CONSTANT_FIELD_3 = "constant";
+
+    /**
+     * @deprecated don't use this field anymore.
+     */
+    public RegClass dep_field;
+
+    /**
+     * A sample enum.
+     */
+    public static enum ModalExclusionType {
+        /**
+         * Test comment.
+         */
+        NO_EXCLUDE,
+        /**
+         * Another comment.
+         */
+        APPLICATION_EXCLUDE
+    };
+
+    /**
+     * A string constant.
+     */
+    public static final String CONSTANT1 = "C2";
+
+    /**
+     * A sample method.
+     *
+     * @param param some parameter.
+     * @return a test object.
+     */
+    public Class method(pkg1.RegClass param) {
+        return param;
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg/TestError.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2015, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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;
+
+/**
+ * Error class.
+ */
+public class TestError extends Error {
+
+    /**
+     * Constructs a test error.
+     */
+    public TestError() {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg/TestException.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2015, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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;
+
+/**
+ * Thrown when a TestException occurs.
+ */
+public class TestException extends Exception {
+
+    /**
+     * Constructs a {@code TestException} with no detail message.
+     */
+    public TestException() {
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg/TestInterface.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2015, 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;
+
+/**
+ * This is a description for an Interface.
+ */
+
+public interface TestInterface {
+
+    public void method();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg/package-info.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,27 @@
+/*
+ * Copyright (c) 2015, 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 package.
+ */
+package pkg;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg1/NestedInnerClass.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 pkg1;
+
+import java.io.*;
+
+/**
+ * A test class where the outer class is package private and the inner class is private
+ * and a nested inner class is protected.
+ *
+ * @author      Bhavesh Patel
+ */
+
+class NestedInnerClass {
+
+    private static class InnerClass {
+
+        protected static class ProNestedInnerClass implements java.io.Serializable {
+
+            public final int SERIALIZABLE_CONSTANT2 = 1;
+
+            /**
+             * @param s ObjectInputStream.
+             * @throws IOException when there is an I/O error.
+             * @serial
+             */
+            private void readObject(ObjectInputStream s) throws IOException {
+            }
+
+            /**
+             * @param s ObjectOutputStream.
+             * @throws IOException when there is an I/O error.
+             * @serial
+             */
+            private void writeObject(ObjectOutputStream s) throws IOException {
+            }
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg1/PrivateIncludeInnerClass.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 pkg1;
+
+import java.io.*;
+
+/**
+ * A test class where the outer class is package private and inner class
+ * is private which is included using the tag.
+ *
+ * @author      Bhavesh Patel
+ */
+
+class PrivateIncludeInnerClass {
+
+    /**
+     * @serial include
+     */
+    private static class PriInnerClass implements java.io.Serializable {
+
+        public final int SERIALIZABLE_CONSTANT = 1;
+
+        /**
+         * @param s ObjectInputStream.
+         * @throws IOException when there is an I/O error.
+         * @serial
+         */
+        private void readObject(ObjectInputStream s) throws IOException {
+        }
+
+        /**
+         * @param s ObjectOutputStream.
+         * @throws IOException when there is an I/O error.
+         * @serial
+         */
+        private void writeObject(ObjectOutputStream s) throws IOException {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg1/ProtectedInnerClass.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,59 @@
+/*
+ * Copyright (c) 2015, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 pkg1;
+
+import java.io.*;
+
+/**
+ * A test class where outer class is package private and the inner class is
+ * protected.
+ *
+ * @author      Bhavesh Patel
+ */
+
+class ProtectedInnerClass {
+
+    protected static class ProInnerClass implements java.io.Serializable {
+
+        public final int SERIALIZABLE_CONSTANT1 = 1;
+
+        /**
+         * @param s ObjectInputStream.
+         * @throws IOException when there is an I/O error.
+         * @serial
+         */
+        private void readObject(ObjectInputStream s) throws IOException {
+        }
+
+        /**
+         * @param s ObjectOutputStream.
+         * @throws IOException when there is an I/O error.
+         * @serial
+         */
+        private void writeObject(ObjectOutputStream s) throws IOException {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg1/PublicExcludeInnerClass.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,62 @@
+/*
+ * Copyright (c) 2015, 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.  Oracle designates this
+ * particular file as subject to the "Classpath" exception as provided
+ * by Oracle in the LICENSE file that accompanied this code.
+ *
+ * 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 pkg1;
+
+import java.io.*;
+
+/**
+ * A test class where the outer class is package private and inner class
+ * is public which is excluded using the tag.
+ *
+ * @author      Bhavesh Patel
+ */
+
+class PublicExcludeInnerClass {
+
+    /**
+     * @serial exclude
+     */
+    public static class PubInnerClass implements java.io.Serializable {
+
+        public final int SERIALIZABLE_CONSTANT3 = 1;
+
+        /**
+         * @param s ObjectInputStream.
+         * @throws IOException when there is an I/O error.
+         * @serial
+         */
+        private void readObject(ObjectInputStream s) throws IOException {
+        }
+
+        /**
+         * @param s ObjectOutputStream.
+         * @throws IOException when there is an I/O error.
+         * @serial
+         */
+        private void writeObject(ObjectOutputStream s) throws IOException {
+        }
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg1/RegClass.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2015, 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 pkg1;
+
+/**
+ *This is a description for Class.
+ */
+
+public class RegClass {
+
+    /**
+     * Constant field.
+     */
+    public static final String CONSTANT_FIELD_1 = "constant";
+
+    /**
+     * Another constant field.
+     */
+    public static final int CONSTANT_FIELD_2 = 1;
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg2/DeprecatedClassByAnnotation.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2015, 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 pkg2;
+
+@Deprecated()
+public class DeprecatedClassByAnnotation {
+
+    @Deprecated()
+    public int field;
+
+    @Deprecated()
+    public DeprecatedClassByAnnotation() {}
+
+    @Deprecated()
+    public void method() {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg2/Interface.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,33 @@
+/*
+ * Copyright (c) 2015, 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 pkg2;
+
+/**
+ * This is a description for an Interface.
+ */
+
+public interface Interface {
+
+    public void method1();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg2/TestAnnotationType.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2015, 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 pkg2;
+
+import java.lang.annotation.*;
+
+/**
+ * @deprecated annotation_test1 passes.
+ */
+@Documented public @interface TestAnnotationType {
+
+    /**
+     * @deprecated annotation_test2 passes.
+     */
+    String optional() default "unknown";
+
+   /**
+     * @deprecated annotation_test3 passes.
+     */
+    int required();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg2/TestClass.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,50 @@
+/*
+ * Copyright (c) 2015, 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 pkg2;
+
+/**
+ * @deprecated class_test1 passes.
+ */
+public class TestClass {
+
+    /**
+     * @deprecated class_test2 passes.
+     */
+    public int field;
+
+    /**
+     * @deprecated constant field.
+     */
+    public static final int CONSTANT_FIELD = 2;
+
+    /**
+     * @deprecated class_test3 passes.
+     */
+    public TestClass() {}
+
+    /**
+     * @deprecated class_test4 passes.
+     */
+    public void method() {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg2/TestEnum.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,35 @@
+/*
+ * Copyright (c) 2015, 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 pkg2;
+
+/**
+ * @deprecated enum_test1 passes.
+ */
+public enum TestEnum {
+
+    /**
+     * @deprecated enum_test2 passes.
+     */
+    ONE, TWO, THREE;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg2/TestError.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, 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 pkg2;
+
+/**
+ * @deprecated error_test1 passes.
+ */
+public class TestError extends Error {
+
+    /**
+     * @deprecated error_test2 passes.
+     */
+    public int field;
+
+    /**
+     * @deprecated error_test3 passes.
+     */
+    public TestError() {}
+
+    /**
+     * @deprecated error_test4 passes.
+     */
+    public void method() {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg2/TestException.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, 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 pkg2;
+
+/**
+ * @deprecated exception_test1 passes.
+ */
+public class TestException extends Exception {
+
+    /**
+     * @deprecated exception_test2 passes.
+     */
+    public int field;
+
+    /**
+     * @deprecated exception_test3 passes.
+     */
+    public TestException() {}
+
+    /**
+     * @deprecated exception_test4 passes.
+     */
+    public void method() {}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/test/com/sun/javadoc/testHtmlVersion/pkg2/TestInterface.java	Fri Apr 17 10:23:49 2015 -0700
@@ -0,0 +1,45 @@
+/*
+ * Copyright (c) 2015, 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