<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.webkit.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.4.1"
          urlbase="https://bugs.webkit.org/"
          
          maintainer="admin@webkit.org"
>

    <bug>
          <bug_id>85546</bug_id>
          
          <creation_ts>2012-05-03 14:56:37 -0700</creation_ts>
          <short_desc>An image is not loaded and/or displayed while waiting for synchronous XMLHttpRequest</short_desc>
          <delta_ts>2012-05-10 15:54:51 -0700</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>1</classification_id>
          <classification>Unclassified</classification>
          <product>WebKit</product>
          <component>Page Loading</component>
          <version>528+ (Nightly build)</version>
          <rep_platform>Unspecified</rep_platform>
          <op_sys>Unspecified</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>WONTFIX</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>InRadar</keywords>
          <priority>P2</priority>
          <bug_severity>Major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Teo">teoteoteoteo87</reporter>
          <assigned_to name="Nobody">webkit-unassigned</assigned_to>
          <cc>ap</cc>
          

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>615663</commentid>
    <comment_count>0</comment_count>
    <who name="Teo">teoteoteoteo87</who>
    <bug_when>2012-05-03 14:56:37 -0700</bug_when>
    <thetext>Javascript doesn&apos;t do nothing before the end of the entire script!

If I try to execute the function prova() from the following simple code, it prints only the variable &quot;risultato&quot; without showing people the image attendi.gif!
In other browser, like Mozilla, it shows the image during the XmlHttpObject ... waiting, and when it receives the result it substitutes the image with the result!

function GetXmlHttpObject()
{
	var objXMLHttp=null;
	if (window.XMLHttpRequest)
	{
		objXMLHttp=new XMLHttpRequest();
	}
	else if (window.ActiveXObject)
	{
		objXMLHttp=new ActiveXObject(&quot;Microsoft.XMLHTTP&quot;);
	}
	return objXMLHttp;
}

function prova()
{
	var newdiv = document.createElement(&quot;div&quot;);
		newdiv.setAttribute(&apos;id&apos;, &apos;extra&apos;);
		var vecchio = document.getElementById(&apos;extra&apos;);
		vecchio.parentNode.replaceChild(newdiv,vecchio);
	
				var newimg = document.createElement(&quot;img&quot;);
				var src=&apos;images/attendi.gif?&apos;+variab;newimg.setAttribute(&apos;src&apos;, src);
				newimg.setAttribute(&apos;alt&apos;, &apos;Attendi ...&apos;);
				document.getElementById(&apos;extra&apos;).appendChild(newimg);
	}
	var xmlHttp = GetXmlHttpObject();
	var i=0;

	var url=&quot;http://www.mysite.com/script.php&quot;;

		if (!xmlHttp)
		{
			alert (&quot;Browser does not support HTTP Request&quot;);
			return;
		}
		xmlHttp.open(&quot;GET&quot;, url, false);
		xmlHttp.send(null);
		var risposta=xmlHttp.responseText;
		risposta = risposta.replace(&quot;&amp;lt;&quot;,&quot;&lt;&quot;);
		risposta = risposta.replace(&quot;&amp;gt;&quot;,&quot;&gt;&quot;);
		if (risposta==&apos;bye&apos;)
		{
			risultato=&quot;YES&quot;;
		}
		else
		{
			risultato=&quot;NO&quot;;
		}

		var newdiv = document.createElement(&quot;div&quot;);
		newdiv.setAttribute(&apos;id&apos;, &apos;extra&apos;);
		var vecchio = document.getElementById(&apos;extra&apos;);
		vecchio.parentNode.replaceChild(newdiv,vecchio);
		var newgrassetto = document.createElement(&quot;b&quot;);
		newgrassetto.setAttribute(&quot;style&quot;,&quot;color:red;&quot;);
		newgrassetto.innerHTML=risultato;
		document.getElementById(&quot;extra&quot;).appendChild(newgrassetto);

}</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>615773</commentid>
    <comment_count>1</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-05-03 16:28:56 -0700</bug_when>
    <thetext>Please don&apos;t use synchronous XMLHttpRequest.

The Mozilla behavior where it only partially freezes the browser causes a lot of other bugs, so we do not intend to do the same.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>615774</commentid>
    <comment_count>2</comment_count>
    <who name="Alexey Proskuryakov">ap</who>
    <bug_when>2012-05-03 16:33:13 -0700</bug_when>
    <thetext>For Apple employees: this is &lt;rdar://problem/6653209&gt;.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>621082</commentid>
    <comment_count>3</comment_count>
    <who name="Teo">teoteoteoteo87</who>
    <bug_when>2012-05-10 15:54:51 -0700</bug_when>
    <thetext>*** Bug 84032 has been marked as a duplicate of this bug. ***</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>