JDK-6618978 : Plugin2: Some of the CommonDOM functionality is broken in new design
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 6u5
  • Priority: P4
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows
  • CPU: generic
  • Submitted: 2007-10-19
  • Updated: 2010-09-08
  • Resolved: 2008-04-03
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 6
6u10 b21Fixed
Related Reports
Relates :  
Description
Some of the CommonDOM  functionality is broken with new design on all browsers. Behavior is correct with old plug-in e.g.
 Document.getElementsByTagName("body") will throw following exception on IE
netscape.javascript.JSException: No such method or property "tagName" on JavaScript object
	at sun.plugin2.main.client.MessagePassingJSObject.newJSException(Unknown Source)
	at sun.plugin2.main.client.MessagePassingJSObject.waitForReply(Unknown Source)
	at sun.plugin2.main.client.MessagePassingJSObject.doMemberOp(Unknown Source)
	at sun.plugin2.main.client.MessagePassingJSObject.getMember(Unknown Source)
	at sun.plugin.dom.DOMObject.getMember(Unknown Source)
	at sun.plugin.dom.DOMObjectFactory.getRealClassByTagName(Unknown Source)
	at sun.plugin.dom.DOMObjectFactory.createHTMLObject(Unknown Source)
	at sun.plugin.dom.DOMObjectFactory.createHTMLObject(Unknown Source)
	at sun.plugin.dom.html.HTMLDocument.getElementsByTagName(Unknown Source)
	at CDOMCreateElemSimple$1.run(CDOMCreateElemSimple.java:40)
	at sun.plugin.dom.DOMService.invokeAndWait(Unknown Source)
	at CDOMCreateElemSimple.createNewElement(CDOMCreateElemSimple.java:32)
	at CDOMCreateElemSimple.start(CDOMCreateElemSimple.java:18)
	at sun.plugin2.applet.Applet2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)
java.lang.NullPointerException
	at CDOMCreateElemSimple$1.run(CDOMCreateElemSimple.java:40)
	at sun.plugin.dom.DOMService.invokeAndWait(Unknown Source)
	at CDOMCreateElemSimple.createNewElement(CDOMCreateElemSimple.java:32)
	at CDOMCreateElemSimple.start(CDOMCreateElemSimple.java:18)
	at sun.plugin2.applet.Applet2Manager$AppletExecutionRunnable.run(Unknown Source)
	at java.lang.Thread.run(Unknown Source)

On Firefox3 it successfully inserts on element but inserting elements after the first insert fails subsequently.
Test Applet Link:
http://sqeweb.sfbay.sun.com/deployment2/jitu/plug-bug/CommonDOM/src/CDOMCreateElemSimple.html

Comments
SUGGESTED FIX http://sa.sfbay.sun.com/projects/deployment_data/6u10/6618978.0 testcase: http://j2se.east.sun.com/deployment/www/tests/1.6.0_10/6618978/
14-03-2008

EVALUATION The current Common DOM implementation in the Java Plug-In relies on being able to infer the type of all HTML-related JavaScript objects by calling toString on them and parsing the result. On IE there was a significant amount of mysterious and undocumented native code for this purpose which was dropped in the new Java Plug-In. It has now come to light that this code was present in support of the Common DOM implementation. Adding in these kinds of hacks to the new Java Plug-In is undesirable. Because of the structure of the underlying JavaScript DOM API, it is possible to know which kinds of objects are being returned in certain situations, and use JavaScript APIs, like "tagName" on an HTML element or "type" on a CSS rule, to deduce which Java object types to use to wrap the underlying JavaScript APIs. This has been done in a couple of key places needed to make the given test cases work. Examination of the Common DOM implementation indicates that it is severely deficient and requires an almost complete rewrite. 6674870 has been filed to track this follow-on work, which will be targeted at subsequent 6u10 builds.
14-03-2008