JDK-8144986 : 20 seconds delay when inserting dynamically an applet in a html page
  • Type: Bug
  • Component: deploy
  • Sub-Component: plugin
  • Affected Version: 8u65
  • Priority: P3
  • Status: Closed
  • Resolution: Duplicate
  • OS: windows_7
  • CPU: x86_64
  • Submitted: 2015-11-05
  • Updated: 2016-04-21
  • Resolved: 2016-04-21
Related Reports
Duplicate :  
Description
FULL PRODUCT VERSION :
Java Plug-in 11.65.2.17
Using JRE version 1.8.0_65-b17 Java HotSpot(TM) Client VM

ADDITIONAL OS VERSION INFORMATION :
Microsoft Windows [Version 6.1.7601]

A DESCRIPTION OF THE PROBLEM :
When adding dynamically an applet on an html page on a button click, using the tag object, a 20 seconds delay appears on ie before anything happens.
This does not occur when the applet is included directly in the page, or when the applet is added by inline script.

REGRESSION.  Last worked in version 8u51

ADDITIONAL REGRESSION INFORMATION: 
Java Plug-in 11.51.2.16
Using JRE version 1.8.0_51-b16 Java HotSpot(TM) Client VM

STEPS TO FOLLOW TO REPRODUCE THE PROBLEM :
Open in ie11 the html page provided as source code.
Click on the "Show applet" button

EXPECTED VERSUS ACTUAL BEHAVIOR :
EXPECTED -
The function f should execute immediately.
In the console, we should have t1 and t2 nearly equal.
The applet should show immediately.
Note: to make a shorter example, the applet nor the jnlp are included here, so the applet will not show, but anyway the execution should be immediate.
the exact same problem is reproduced with an existing applet.
ACTUAL -
There is a 20 seconds delay between t1 and t2.
The delay is always the same.
Nothing happens during these 20 seconds.

ERROR MESSAGES/STACK TRACES THAT OCCUR :
No message.
The ie profiler shows that time is spend in innerHTML.
Note: we have the same result if we create DOM elements instead of using innerHTML.

REPRODUCIBILITY :
This bug can be reproduced always.

---------- BEGIN SOURCE ----------
<!DOCTYPE html>
<html>
<title>Test applet</title>
</head>
<body>
	<div id="appletPlaceHolder"></div>
<script>
function f(){
// same behavior (delay) with a valid jnlp file or if the jnlp file does not exist
var applet=
'<object classid="clsid:8AD9C840-044E-11D1-B3E9-00805F499D93" width="200" height="200">'+
'<param name="jnlp_href" value="dummy.jnlp"/>'+
'</object>';

	console.log("t1: "+new Date());
	document.getElementById("appletPlaceHolder").innerHTML=applet;
	
	// t2 is 20 seconds after t1 on ie11 with java 1.8.0_65-b17
	// Same behavior with java 1.8.0_60-b27
	console.log("t2: "+new Date());
}

</script>
<button onClick="f()">Show applet</button>
</body></html>
---------- END SOURCE ----------

CUSTOMER SUBMITTED WORKAROUND :
Using the tag applet works  with 1.8.0_65-b17, but not correctly with 1.8.0_60-b27


Comments
It was fixed by JDK-8136759.
21-04-2016

On a windows 7 (32-bit), checked this for versions 8u51, 8u60, 8u65/8u66 and could confirm the reported issue. To verifiy, run the attached file (TestApplet.html) in IE 11, and click on buttom "Show Applet". Observe that there is a 20 seconds delay before further action is initiated. This issue does not appear with 8u60. 8u60: OK 8u65: FAIL 8u66 ea b18: OK 8u72 ea b11: OK 9 ea b95: OK Written back to the submitter requesting check with versions 8u66 b18, 8u72 ea.
07-12-2015