changeset 3475:e1689786eba3

8048806: Javadoc errors out on some valid HTML tags Reviewed-by: bpatel
author jjg
date Fri, 11 Jul 2014 18:51:32 -0700
parents 33bfb7b328f1
children 396ae17eb5a2
files src/share/classes/com/sun/tools/doclint/HtmlTag.java test/tools/doclint/ValidTest.java
diffstat 2 files changed, 72 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Fri Jul 11 13:57:32 2014 -0700
+++ b/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Fri Jul 11 18:51:32 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2010, 2014, 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
@@ -30,12 +30,12 @@
 import java.util.EnumMap;
 import java.util.EnumSet;
 import java.util.HashMap;
-import java.util.Locale;
 import java.util.Map;
 
 import javax.lang.model.element.Name;
 
 import static com.sun.tools.doclint.HtmlTag.Attr.*;
+
 import com.sun.tools.javac.util.StringUtils;
 
 /**
@@ -58,6 +58,15 @@
     A(BlockType.INLINE, EndKind.REQUIRED,
             attrs(AttrKind.OK, HREF, TARGET, NAME)),
 
+    ABBR(BlockType.INLINE, EndKind.REQUIRED,
+            EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
+    ACRONYM(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)),
+
     B(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
 
@@ -87,6 +96,10 @@
     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)),
+
     DFN(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
 
@@ -138,6 +151,13 @@
             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)),
+
+    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)),
@@ -183,6 +203,15 @@
         }
     },
 
+    Q(BlockType.INLINE, EndKind.REQUIRED,
+            EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
+    S(BlockType.INLINE, EndKind.REQUIRED,
+            EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
+    SAMP(BlockType.INLINE, EndKind.REQUIRED,
+            EnumSet.of(Flag.EXPECT_CONTENT, Flag.NO_NEST)),
+
     SCRIPT(BlockType.OTHER, EndKind.REQUIRED),
 
     SMALL(BlockType.INLINE, EndKind.REQUIRED,
@@ -191,6 +220,9 @@
     SPAN(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT)),
 
+    STRIKE(BlockType.INLINE, EndKind.REQUIRED,
+            EnumSet.of(Flag.EXPECT_CONTENT)),
+
     STRONG(BlockType.INLINE, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT)),
 
@@ -229,7 +261,7 @@
 
     TD(BlockType.TABLE_ITEM, EndKind.OPTIONAL,
             EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE),
-            attrs(AttrKind.OK, COLSPAN, ROWSPAN, HEADERS, SCOPE, ABBR, AXIS,
+            attrs(AttrKind.OK, COLSPAN, ROWSPAN, HEADERS, SCOPE, Attr.ABBR, AXIS,
                 ALIGN, CHAR, CHAROFF, VALIGN),
             attrs(AttrKind.USE_CSS, WIDTH, BGCOLOR, HEIGHT, NOWRAP)),
 
@@ -243,7 +275,7 @@
 
     TH(BlockType.TABLE_ITEM, EndKind.OPTIONAL,
             EnumSet.of(Flag.ACCEPTS_BLOCK, Flag.ACCEPTS_INLINE),
-            attrs(AttrKind.OK, COLSPAN, ROWSPAN, HEADERS, SCOPE, ABBR, AXIS,
+            attrs(AttrKind.OK, COLSPAN, ROWSPAN, HEADERS, SCOPE, Attr.ABBR, AXIS,
                 ALIGN, CHAR, CHAROFF, VALIGN),
             attrs(AttrKind.USE_CSS, WIDTH, BGCOLOR, HEIGHT, NOWRAP)),
 
@@ -321,11 +353,13 @@
         CELLPADDING,
         CHAR,
         CHAROFF,
+        CITE,
         CLEAR,
         CLASS,
         COLOR,
         COLSPAN,
         COMPACT,
+        DATETIME,
         FACE,
         FRAME,
         HEADERS,
--- a/test/tools/doclint/ValidTest.java	Fri Jul 11 13:57:32 2014 -0700
+++ b/test/tools/doclint/ValidTest.java	Fri Jul 11 18:51:32 2014 -0700
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
+ * Copyright (c) 2012, 2014, 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
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8004832
+ * @bug 8004832 8048806
  * @summary Add new doclint package
  * @build DocLintTester
  * @run main DocLintTester ValidTest.java
@@ -36,6 +36,38 @@
     void entities() { }
 
     /**
+     * <abbr>abbreviation<abbr>
+     * <acronym>ABC</acronym>
+     * <cite>citation</cite>
+     * <code>code</code>
+     * <dfn>defining instance</dfn>
+     * <em>emphasis</em>
+     * <kbd>keyboard<kbd>
+     * <samp>sample</samp>
+     * <var>variable</var>
+     * <strong>strong</strong>
+     */
+    void phraseElements() { }
+
+    /**
+     * <address>1 Main St., USA</address>
+     */
+    void address() { }
+
+    /**
+     * <del>deleted</del>
+     * <ins>inserted</del>
+     */
+    void docChanges() {}
+
+    /**
+     * <blockquote>
+     * A fine thing.
+     * </blockquote>
+     * <q>A fine thing.</q>
+     */
+
+    /**
      * <h1> ... </h1>
      * <h2> ... </h2>
      * <h3> ... </h3>