8022173: Relax some warnings in doclint

Thu, 22 Aug 2013 12:41:20 -0700

author
jjg
date
Thu, 22 Aug 2013 12:41:20 -0700
changeset 1976
b77381d99056
parent 1975
1ab22e60a738
child 1977
60f156c653d3

8022173: Relax some warnings in doclint
Reviewed-by: darcy

src/share/classes/com/sun/tools/doclint/HtmlTag.java file | annotate | diff | comparison | revisions
test/tools/doclint/html/ListTagsTest.java file | annotate | diff | comparison | revisions
test/tools/doclint/html/OtherTagsTest.java file | annotate | diff | comparison | revisions
test/tools/doclint/html/OtherTagsTest.out file | annotate | diff | comparison | revisions
test/tools/doclint/html/TableTagsTest.java file | annotate | diff | comparison | revisions
     1.1 --- a/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Thu Aug 22 12:47:46 2013 -0400
     1.2 +++ b/src/share/classes/com/sun/tools/doclint/HtmlTag.java	Thu Aug 22 12:41:20 2013 -0700
     1.3 @@ -42,12 +42,14 @@
     1.4   *
     1.5   * The intent of this class is to embody the semantics of W3C HTML 4.01
     1.6   * to the extent supported/used by javadoc.
     1.7 + * In time, we may wish to transition javadoc and doclint to using HTML 5.
     1.8   *
     1.9   * This is derivative of com.sun.tools.doclets.formats.html.markup.HtmlTag.
    1.10   * Eventually, these two should be merged back together, and possibly made
    1.11   * public.
    1.12   *
    1.13   * @see <a href="http://www.w3.org/TR/REC-html40/">HTML 4.01 Specification</a>
    1.14 + * @see <a href="http://www.w3.org/TR/html5/">HTML 5 Specification</a>
    1.15   * @author Bhavesh Patel
    1.16   * @author Jonathan Gibbons (revised)
    1.17   */
    1.18 @@ -119,7 +121,8 @@
    1.19  
    1.20      HEAD(BlockType.OTHER, EndKind.REQUIRED),
    1.21  
    1.22 -    HR(BlockType.BLOCK, EndKind.NONE),
    1.23 +    HR(BlockType.BLOCK, EndKind.NONE,
    1.24 +            attrs(AttrKind.OK, WIDTH)), // OK in 4.01; not allowed in 5
    1.25  
    1.26      HTML(BlockType.OTHER, EndKind.REQUIRED),
    1.27  
    1.28 @@ -152,7 +155,7 @@
    1.29  
    1.30      OL(BlockType.BLOCK, EndKind.REQUIRED,
    1.31              EnumSet.of(Flag.EXPECT_CONTENT),
    1.32 -            attrs(AttrKind.USE_CSS, START, TYPE)){
    1.33 +            attrs(AttrKind.OK, START, TYPE)) {
    1.34          @Override
    1.35          public boolean accepts(HtmlTag t) {
    1.36              return (t == LI);
    1.37 @@ -196,8 +199,8 @@
    1.38      TABLE(BlockType.BLOCK, EndKind.REQUIRED,
    1.39              EnumSet.of(Flag.EXPECT_CONTENT),
    1.40              attrs(AttrKind.OK, SUMMARY, Attr.FRAME, RULES, BORDER,
    1.41 -                CELLPADDING, CELLSPACING),
    1.42 -            attrs(AttrKind.USE_CSS, ALIGN, WIDTH, BGCOLOR)) {
    1.43 +                CELLPADDING, CELLSPACING, WIDTH), // width OK in 4.01; not allowed in 5
    1.44 +            attrs(AttrKind.USE_CSS, ALIGN, BGCOLOR)) {
    1.45          @Override
    1.46          public boolean accepts(HtmlTag t) {
    1.47              switch (t) {
    1.48 @@ -267,7 +270,7 @@
    1.49  
    1.50      UL(BlockType.BLOCK, EndKind.REQUIRED,
    1.51              EnumSet.of(Flag.EXPECT_CONTENT),
    1.52 -            attrs(AttrKind.USE_CSS, COMPACT, TYPE)){
    1.53 +            attrs(AttrKind.OK, COMPACT, TYPE)) { // OK in 4.01; not allowed in 5
    1.54          @Override
    1.55          public boolean accepts(HtmlTag t) {
    1.56              return (t == LI);
     2.1 --- a/test/tools/doclint/html/ListTagsTest.java	Thu Aug 22 12:47:46 2013 -0400
     2.2 +++ b/test/tools/doclint/html/ListTagsTest.java	Thu Aug 22 12:41:20 2013 -0700
     2.3 @@ -1,6 +1,6 @@
     2.4  /*
     2.5   * @test /nodynamiccopyright/
     2.6 - * @bug 8006251 8013405
     2.7 + * @bug 8006251 8013405 8022173
     2.8   * @summary test list tags
     2.9   * @library ..
    2.10   * @build DocLintTester
    2.11 @@ -15,6 +15,7 @@
    2.12       *  <ol> <li value="1"> abc </ol>
    2.13       *  <ol> <li value> bad </ol>
    2.14       *  <ol> <li value="a"> bad </ol>
    2.15 +     *  <ol type="a"> <li> bad </ol>
    2.16       *  <ul> <li> abc </ul>
    2.17       */
    2.18      public void supportedTags() { }
     3.1 --- a/test/tools/doclint/html/OtherTagsTest.java	Thu Aug 22 12:47:46 2013 -0400
     3.2 +++ b/test/tools/doclint/html/OtherTagsTest.java	Thu Aug 22 12:41:20 2013 -0700
     3.3 @@ -1,6 +1,6 @@
     3.4  /*
     3.5   * @test /nodynamiccopyright/
     3.6 - * @bug 8006251
     3.7 + * @bug 8006251 8022173
     3.8   * @summary test other tags
     3.9   * @library ..
    3.10   * @build DocLintTester
    3.11 @@ -14,6 +14,7 @@
    3.12       *  <frame>
    3.13       *  <frameset> </frameset>
    3.14       *  <head> </head>
    3.15 +     *  <hr width="50%">
    3.16       *  <link>
    3.17       *  <meta>
    3.18       *  <noframes> </noframes>
     4.1 --- a/test/tools/doclint/html/OtherTagsTest.out	Thu Aug 22 12:47:46 2013 -0400
     4.2 +++ b/test/tools/doclint/html/OtherTagsTest.out	Thu Aug 22 12:41:20 2013 -0700
     4.3 @@ -10,19 +10,19 @@
     4.4  OtherTagsTest.java:16: error: element not allowed in documentation comments: <head>
     4.5       *  <head> </head>
     4.6          ^
     4.7 -OtherTagsTest.java:17: error: element not allowed in documentation comments: <link>
     4.8 +OtherTagsTest.java:18: error: element not allowed in documentation comments: <link>
     4.9       *  <link>
    4.10          ^
    4.11 -OtherTagsTest.java:18: error: element not allowed in documentation comments: <meta>
    4.12 +OtherTagsTest.java:19: error: element not allowed in documentation comments: <meta>
    4.13       *  <meta>
    4.14          ^
    4.15 -OtherTagsTest.java:19: error: element not allowed in documentation comments: <noframes>
    4.16 +OtherTagsTest.java:20: error: element not allowed in documentation comments: <noframes>
    4.17       *  <noframes> </noframes>
    4.18          ^
    4.19 -OtherTagsTest.java:20: error: element not allowed in documentation comments: <script>
    4.20 +OtherTagsTest.java:21: error: element not allowed in documentation comments: <script>
    4.21       *  <script> </script>
    4.22          ^
    4.23 -OtherTagsTest.java:21: error: element not allowed in documentation comments: <title>
    4.24 +OtherTagsTest.java:22: error: element not allowed in documentation comments: <title>
    4.25       *  <title> </title>
    4.26          ^
    4.27  9 errors
     5.1 --- a/test/tools/doclint/html/TableTagsTest.java	Thu Aug 22 12:47:46 2013 -0400
     5.2 +++ b/test/tools/doclint/html/TableTagsTest.java	Thu Aug 22 12:41:20 2013 -0700
     5.3 @@ -23,7 +23,7 @@
     5.4  
     5.5  /*
     5.6   * @test
     5.7 - * @bug 8006251
     5.8 + * @bug 8006251 8022173
     5.9   * @summary test table tags
    5.10   * @library ..
    5.11   * @build DocLintTester
    5.12 @@ -39,6 +39,7 @@
    5.13       *  <table summary="abc"> <thead> <tr> </thead> <tr> <td> </table>
    5.14       *  <table summary="abc"> <tbody> <tr> <td> </tbody> </table>
    5.15       *  <table summary="abc"> <tr> <td> <tfoot> <tr> </tfoot></table>
    5.16 +     *  <table summary="abc" width="50%"> <tr> <td> <tfoot> <tr> </tfoot></table>
    5.17       */
    5.18      public void supportedTags() { }
    5.19  }

mercurial