JDK-8064291 : org.w3c.dom.html, css, stylesheets visible but not accessible
  • Type: Sub-task
  • Component: xml
  • Sub-Component: jaxp
  • Affected Version: 9
  • Priority: P2
  • Status: Closed
  • Resolution: Fixed
  • Submitted: 2014-11-07
  • Updated: 2017-05-11
  • Resolved: 2015-04-21
Related Reports
Relates :  
JAXP has a copy of org.w3c.dom.{html, css, stylesheets} packages that are not part of JAXP technology and hence they are not exported in the java.xml module.  

These APIs will become inaccessible when we add the module boundaries.

This issue is to re-examine whether these packages should be removed from JAXP or they should be exported from java.xml.
JDK-8042244 has been resolved.

From Maven Central search on 314206 artifacts, here are the statistics using these org.w3c.dom API. Target Package #JARs #Class org.w3c.dom.css 213 512 org.w3c.dom.html 177 499 org.w3c.dom.stylesheets 92 49 These dependencies come from ~95 unique artifacts. There are maven artifacts distributing these W3C APIs. JDK doesn't use them. They are DOM Level 3 API. If they are not accessible or removed in JDK 9, existing code will need to ensure that org.w3c.dom.* types are from another source on their classpath. One other option is to ship these 3 W3C packages in JDK-specific module that we don't provide the implementation but included in JRE. It's a convenience for customers.

Previously these packages may be needed by JAXP implementation. A recent patch switching to use Xalan serializer implementation removed dependency to any of these css, html and stylesheets package from JAXP implementation. JAXP implementation has one remaining dependency to org.w3c.dom.html.HTMLDocument. It can be eliminated that would need to refactor com.sun.org.apache.xml.internal.serialize.OutputFormat to remove the dependency on import org.w3c.dom.html.HTMLDocument. On the other hand, these W3C packages are used by JavaFX webkit implementation classes but not part of the JavaFX API dependency.