提交 91a355d4 编写于 作者: J jjg

8022173: Relax some warnings in doclint

Reviewed-by: darcy
上级 9ffecb3b
......@@ -42,12 +42,14 @@ import static com.sun.tools.doclint.HtmlTag.Attr.*;
*
* 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 @@ public enum HtmlTag {
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 @@ public enum HtmlTag {
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 @@ public enum HtmlTag {
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 @@ public enum HtmlTag {
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);
......
/*
* @test /nodynamiccopyright/
* @bug 8006251 8013405
* @bug 8006251 8013405 8022173
* @summary test list tags
* @library ..
* @build DocLintTester
......@@ -15,6 +15,7 @@ public class ListTagsTest {
* <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() { }
......
/*
* @test /nodynamiccopyright/
* @bug 8006251
* @bug 8006251 8022173
* @summary test other tags
* @library ..
* @build DocLintTester
......@@ -14,6 +14,7 @@ public class OtherTagsTest {
* <frame>
* <frameset> </frameset>
* <head> </head>
* <hr width="50%">
* <link>
* <meta>
* <noframes> </noframes>
......
......@@ -10,19 +10,19 @@ OtherTagsTest.java:15: error: element not allowed in documentation comments: <fr
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
......@@ -23,7 +23,7 @@
/*
* @test
* @bug 8006251
* @bug 8006251 8022173
* @summary test table tags
* @library ..
* @build DocLintTester
......@@ -39,6 +39,7 @@ public class TableTagsTest {
* <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() { }
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册