JDK-5024379 : REGRESSION: isActive call from Javascript no longer works in IE
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 1.4.2
  • Priority: P3
  • Status: Resolved
  • Resolution: Fixed
  • OS: windows_xp
  • CPU: x86
  • Submitted: 2004-03-31
  • Updated: 2004-10-13
  • Resolved: 2004-10-13
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.
Other JDK 6
5.0u3Fixed 6 b08Fixed
Description
Name: gm110360			Date: 03/31/2004


FULL PRODUCT VERSION :
java version "1.4.2_04"
Java(TM) 2 Runtime Environment, Standard Edition (build 1.4.2_04-b05)
Java HotSpot(TM) Client VM (build 1.4.2_04-b05, mixed mode)

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 5.2.3790]

A DESCRIPTION OF THE PROBLEM :
Calling typeof(document.applets[0].isActive) from javascript now results in the value being "undefined".  Was fine in previous versions of the plugin.

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
1. Create a basic applet (mine was just a label on the applet itself)
2. The HTML is as follows:-
<HTML>
<HEAD>
<TITLE>Applet Test</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function resize()
{
	if ( document.applets.length == 0 )
	{
		alert("Applets Length = 0");
		setTimeout("resize()", 200);
		return;
	}
	else if ( typeof(document.applets[0].isActive) == "undefined" )
	{
		window.open("error.html","_parent");
		return;
	}
	else
	{
		alert("Ok");
	}
}
window.onresize = resize;
</SCRIPT>
</HEAD>
<BODY onResize="resize()">
<APPLET CODE="TestApplet" NAME="testing" WIDTH=200 HEIGHT=200>
</BODY>
</HTML>
3. After the applet loads, resize IE, the page will redirect to the error page

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
No page redirection
ACTUAL -
isActive was undefined, thus redirecting the page in the example above.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
import java.applet.Applet;
import java.awt.*;

public class TestApplet extends Applet
{
  public TestApplet()
  {
    Label l = new Label("Testing");
    setLayout(new BorderLayout());
    add(l, BorderLayout.CENTER);
  }
}

plus the following HTML
<HTML>
<HEAD>
<TITLE>Applet Test</TITLE>
<SCRIPT LANGUAGE="JavaScript">
function resize()
{
	if ( document.applets.length == 0 )
	{
		alert("Applets Length = 0");
		setTimeout("resize()", 200);
		return;
	}
	else if ( typeof(document.applets[0].isActive) == "undefined" )
	{
		window.open("error.html","_parent");
		return;
	}
	else
	{
		alert("Ok");
	}
}
window.onresize = resize;
</SCRIPT>
</HEAD>
<BODY onResize="resize()">
<APPLET CODE="TestApplet" NAME="testing" WIDTH=200 HEIGHT=200>
</BODY>
</HTML>

---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
No test to see if the applet is active... not possible in the full production case we are using.

Release Regression From : 1.4.2
The above release value was the last known release where this 
bug was known to work. Since then there has been a regression.

(Incident Review ID: 245694) 
======================================================================

Comments
CONVERTED DATA BugTraq+ Release Management Values COMMIT TO FIX: mustang
17-09-2004

EVALUATION In the html page, method isActive() is invoked on a applet as a property access. This is not supported by the JS->Java module. ###@###.### 2004-04-14
14-04-2004