changeset 1975:b77381d99056

8022173: Relax some warnings in doclint Reviewed-by: darcy
author jjg
date Thu, 22 Aug 2013 12:41:20 -0700
parents 1ab22e60a738
children 60f156c653d3
files src/share/classes/com/sun/tools/doclint/HtmlTag.java test/tools/doclint/html/ListTagsTest.java test/tools/doclint/html/OtherTagsTest.java test/tools/doclint/html/OtherTagsTest.out test/tools/doclint/html/TableTagsTest.java
diffstat 5 files changed, 19 insertions(+), 13 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Thu Aug 22 12:47:46 2013 -0400
+++ b/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Thu Aug 22 12:41:20 2013 -0700
@@ -42,12 +42,14 @@
  *
  * The intent of this class is to embody the semantics of W3C HTML 4.01
  * to the extent supported/used by javadoc.
+ * In time, we may wish to transition javadoc and doclint to using HTML 5.
  *
  * This is derivative of com.sun.tools.doclets.formats.html.markup.HtmlTag.
  * Eventually, these two should be merged back together, and possibly made
  * public.
  *
  * @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>
  * @author Bhavesh Patel
  * @author Jonathan Gibbons (revised)
  */
@@ -119,7 +121,8 @@
 
     HEAD(BlockType.OTHER, EndKind.REQUIRED),
 
-    HR(BlockType.BLOCK, EndKind.NONE),
+    HR(BlockType.BLOCK, EndKind.NONE,
+            attrs(AttrKind.OK, WIDTH)), // OK in 4.01; not allowed in 5
 
     HTML(BlockType.OTHER, EndKind.REQUIRED),
 
@@ -152,7 +155,7 @@
 
     OL(BlockType.BLOCK, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT),
-            attrs(AttrKind.USE_CSS, START, TYPE)){
+            attrs(AttrKind.OK, START, TYPE)) {
         @Override
         public boolean accepts(HtmlTag t) {
             return (t == LI);
@@ -196,8 +199,8 @@
     TABLE(BlockType.BLOCK, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT),
             attrs(AttrKind.OK, SUMMARY, Attr.FRAME, RULES, BORDER,
-                CELLPADDING, CELLSPACING),
-            attrs(AttrKind.USE_CSS, ALIGN, WIDTH, BGCOLOR)) {
+                CELLPADDING, CELLSPACING, WIDTH), // width OK in 4.01; not allowed in 5
+            attrs(AttrKind.USE_CSS, ALIGN, BGCOLOR)) {
         @Override
         public boolean accepts(HtmlTag t) {
             switch (t) {
@@ -267,7 +270,7 @@
 
     UL(BlockType.BLOCK, EndKind.REQUIRED,
             EnumSet.of(Flag.EXPECT_CONTENT),
-            attrs(AttrKind.USE_CSS, COMPACT, TYPE)){
+            attrs(AttrKind.OK, COMPACT, TYPE)) { // OK in 4.01; not allowed in 5
         @Override
         public boolean accepts(HtmlTag t) {
             return (t == LI);
--- a/test/tools/doclint/html/ListTagsTest.java	Thu Aug 22 12:47:46 2013 -0400
+++ b/test/tools/doclint/html/ListTagsTest.java	Thu Aug 22 12:41:20 2013 -0700
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8006251 8013405
+ * @bug 8006251 8013405 8022173
  * @summary test list tags
  * @library ..
  * @build DocLintTester
@@ -15,6 +15,7 @@
      *  <ol> <li value="1"> abc </ol>
      *  <ol> <li value> bad </ol>
      *  <ol> <li value="a"> bad </ol>
+     *  <ol type="a"> <li> bad </ol>
      *  <ul> <li> abc </ul>
      */
     public void supportedTags() { }
--- a/test/tools/doclint/html/OtherTagsTest.java	Thu Aug 22 12:47:46 2013 -0400
+++ b/test/tools/doclint/html/OtherTagsTest.java	Thu Aug 22 12:41:20 2013 -0700
@@ -1,6 +1,6 @@
 /*
  * @test /nodynamiccopyright/
- * @bug 8006251
+ * @bug 8006251 8022173
  * @summary test other tags
  * @library ..
  * @build DocLintTester
@@ -14,6 +14,7 @@
      *  <frame>
      *  <frameset> </frameset>
      *  <head> </head>
+     *  <hr width="50%">
      *  <link>
      *  <meta>
      *  <noframes> </noframes>
--- a/test/tools/doclint/html/OtherTagsTest.out	Thu Aug 22 12:47:46 2013 -0400
+++ b/test/tools/doclint/html/OtherTagsTest.out	Thu Aug 22 12:41:20 2013 -0700
@@ -10,19 +10,19 @@
 OtherTagsTest.java:16: error: element not allowed in documentation comments: <head>
      *  <head> </head>
         ^
-OtherTagsTest.java:17: error: element not allowed in documentation comments: <link>
+OtherTagsTest.java:18: error: element not allowed in documentation comments: <link>
      *  <link>
         ^
-OtherTagsTest.java:18: error: element not allowed in documentation comments: <meta>
+OtherTagsTest.java:19: error: element not allowed in documentation comments: <meta>
      *  <meta>
         ^
-OtherTagsTest.java:19: error: element not allowed in documentation comments: <noframes>
+OtherTagsTest.java:20: error: element not allowed in documentation comments: <noframes>
      *  <noframes> </noframes>
         ^
-OtherTagsTest.java:20: error: element not allowed in documentation comments: <script>
+OtherTagsTest.java:21: error: element not allowed in documentation comments: <script>
      *  <script> </script>
         ^
-OtherTagsTest.java:21: error: element not allowed in documentation comments: <title>
+OtherTagsTest.java:22: error: element not allowed in documentation comments: <title>
      *  <title> </title>
         ^
 9 errors
--- a/test/tools/doclint/html/TableTagsTest.java	Thu Aug 22 12:47:46 2013 -0400
+++ b/test/tools/doclint/html/TableTagsTest.java	Thu Aug 22 12:41:20 2013 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8006251
+ * @bug 8006251 8022173
  * @summary test table tags
  * @library ..
  * @build DocLintTester
@@ -39,6 +39,7 @@
      *  <table summary="abc"> <thead> <tr> </thead> <tr> <td> </table>
      *  <table summary="abc"> <tbody> <tr> <td> </tbody> </table>
      *  <table summary="abc"> <tr> <td> <tfoot> <tr> </tfoot></table>
+     *  <table summary="abc" width="50%"> <tr> <td> <tfoot> <tr> </tfoot></table>
      */
     public void supportedTags() { }
 }