JDK-4753126 : stddoclet: Fix technically invalid HTML styles that display fine (W3C validator)
  • Type: Bug
  • Component: tools
  • Sub-Component: javadoc(tool)
  • Affected Version: 1.4.0
  • Priority: P4
  • Status: Closed
  • Resolution: Duplicate
  • OS: other
  • CPU: generic
  • Submitted: 2002-09-25
  • Updated: 2014-05-05
  • Resolved: 2011-02-11
The Version table provides details related to the release that this issue/RFE will be addressed.

Unresolved : Release in which this issue/RFE will be addressed.
Resolved: Release in which this issue/RFE has been resolved.
Fixed : Release in which this issue/RFE has been fixed. The release containing this fix may be available for download as an Early Access Release or a General Availability Release.

To download the current JDK release, click here.
JDK 7
7Resolved
Related Reports
Duplicate :  
Description
Running the W3C validator (http://validator.w3.org) on javadoc output causes
the following errors that are due to styles being used in ways that 
display properly but are technically invalid.  Errors below are in a class page.

---
  Error: element "NOSCRIPT" not allowed here; possible cause is an inline 
  element containing a block-level element 

  Probably due to <NOSCRIPT> being inside a <FONT> element:

  184: <TD BGCOLOR="white" CLASS="NavBarCell2"><FONT SIZE="-2">
  185:   <A HREF="../index.html" TARGET="_top"><B>FRAMES</B></A>  &nbsp;
  186: &nbsp;<A HREF="C.html" TARGET="_top"><B>NO FRAMES</B></A>  &nbsp;
  187: &nbsp;
  188: <SCRIPT type="text/javascript">
  189:   <!--
  190:   if(window==top) {
  191:     document.writeln('<A HREF="../allclasses-noframe.html" 
                TARGET=""><B>All Classes</B></A>');
  192:   }
  193:   //-->
  194: </SCRIPT>
  195: <NOSCRIPT>
  196: <A HREF="../allclasses-noframe.html" TARGET=""><B>All Classes</B></A>
  197: </NOSCRIPT>
  198: </FONT></TD>
  199: </TR>

  Perhaps this could be solved by removing the <FONT SIZE> tag and assigning 
  it to the CLASS=NavBarCell2 attribute.

---
  Error: end tag for element "B" which is not open; try removing the end 
  tag or check for improper nesting of elements
   ... allclasses-noframe.html" TARGET=""><B>All Classes</B></A>');
                                                           ^

  This error seems to occur only in four places -- at the "All Classes"
  link inside the <SCRIPT> and <NOSCRIPT> elements in the top and bottom
  navigation bars.

  Probably due to <B> element inside <A> element, which is not allowed.
  However, notice that <A><FONT SIZE="-2"><B> (which is deprecated, but 
  occurs elsewhere in the same page) is considered valid.
  Perhaps this could be solved by removing the <B> tag and adding it to a 
  style attribute of <A STYLE="font-weight: bold">

---
  Error: element "IMG" not allowed here; check which elements this element 
  may be contained within 

  <IMG SRC="../resources/inherit.gif" ALT="extended by"><B>p1.C</B>
                                                       ^
  Probably due to <IMG> inside a <PRE> element.
  Perhaps this could be solved by removing the <PRE> element and 
  adding "margin-left" indent attribute to the image:

  <IMG style="margin-left: 2em">

---
  The following does not show up as a validation error, but is specified
  by the HTML 4.01 specification.

  14.2.1 Setting the default style sheet language

  Authors must specify the style sheet language of style information 
  associated with an HTML document.

  Authors should use the META element to set the default style sheet 
  language for a document. For example, to set the default to CSS, authors
  should put the following declaration in the HEAD of their documents:

     <META http-equiv="Content-Style-Type" content="text/css">

  If no such tag is present, the default style sheet language is "text/css". 

  Documents that include elements that set the style attribute but which 
  don't define a default style sheet language are incorrect. Authoring tools
  should generate default style sheet language information (typically a META 
  declaration) so that user agents do not have to rely on a default of
  "text/css".

  Source:
  http://www.w3.org/TR/REC-html40/present/styles.html#default-style

  Perhaps this can be solved by adding the above META element to any 
  page that contains the STYLE attribute.  I wonder if the following
  link to stylesheet.css that already exists is sufficent to satisfy
  the above requirement:

 <LINK REL ="stylesheet" TYPE="text/css" HREF="../stylesheet.css" TITLE="Style">

Comments
EVALUATION This bug is fixed as a part of 6851834. A HTML document generation tree is implemented within the doclet. Aslso as a part of this fix, the HTML validation and accessibility issues have been resolved.
11-02-2011

CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: dragon
14-06-2004

EVALUATION Both Netscape and Internet Explorer display these properly. Implement fixes for this bug when we deem that browsers of interest support the STYLE attribute for font-weight and left-margin (indent) and the CLASS attribute for style sheets. ###@###.### 2002-09-25
25-09-2002