United StatesChange Country, Oracle Worldwide Web Sites Communities I am a... I want to...
Bug ID: JDK-6661232 Can't dynamically set applet's width and height in Firefox 3
JDK-6661232 : Can't dynamically set applet's width and height in Firefox 3

Details
Type:
Bug
Submit Date:
2008-02-09
Status:
Closed
Updated Date:
2010-09-08
Project Name:
JDK
Resolved Date:
2008-06-16
Component:
deploy
OS:
generic
Sub-Component:
plugin
CPU:
generic
Priority:
P3
Resolution:
Fixed
Affected Versions:
6u10
Fixed Versions:
6u10 (b13)

Related Reports

Sub Tasks

Description
Due to the conversion from the OJI to the NPRuntime as the scripting interface for the new Java Plug-In in Firefox 3, and due to the fact that the OJI apparently had special-case handling for this, we can not dynamically set the size of applets in Firefox 3 with the new plug-in. 

In the NPRuntime, the browser queries our scriptable NPObject whenever it tries to access a field or method. If our NPObject indicates that it does have this field or method, then the browser delegates its handling to us. This allows plugins to override the handling of properties in the DOM hierarchy and is apparently standard, longstanding behavior.

The browser queries our scriptable NPObject (which also mirrors the applet tag in the DOM hierarchy) to see whether it has fields like "width" and "height". Unfortunately due to the fact that java.awt.Applet implements ImageObserver, ImageObserver's WIDTH and HEIGHT static final fields are visible to the JavaScript engine, we claim that we have them, and this prevents our being able to set them in the DOM since we don't want to override the browser's behavior when changing them. Currently we raise a JSException because the width and height are final fields and therefore can not be set.

                                    

Comments
SUGGESTED FIX

http://sa.sfbay.sun.com/projects/deployment_data/6u10/6661232.0
testcase: http://j2se.east.sun.com/deployment/www/tests/1.6.0_10/6661232
                                     
2008-02-12
EVALUATION

Explicitly declare that we do not have either the "width" or "height"
field on the applet object, so that we do not accidentally override
the handling of these when manipulating the DOM object for the applet.
                                     
2008-02-12



Hardware and Software, Engineered to Work Together