Bug 83866 - [BlackBerry] Missing readyState 2 when a XMLHttpRequest calls xmlhttp.open("HEAD","notExist.html",true).
Summary: [BlackBerry] Missing readyState 2 when a XMLHttpRequest calls xmlhttp.open("...
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: WebKit BlackBerry (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Other
: P2 Normal
Assignee: Nobody
URL:
Keywords:
Depends on: 84016
Blocks:
  Show dependency treegraph
 
Reported: 2012-04-13 00:25 PDT by Jason Liu
Modified: 2012-04-16 03:05 PDT (History)
2 users (show)

See Also:


Attachments
Patch (4.68 KB, patch)
2012-04-16 00:17 PDT, Jason Liu
no flags Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Jason Liu 2012-04-13 00:25:26 PDT
<html>
<head>
<script type="text/javascript">
response =0;
function loadXMLDoc()
{
var xmlhttp;
if (window.XMLHttpRequest)
  {// code for IE7+, Firefox, Chrome, Opera, Safari
  xmlhttp=new XMLHttpRequest();

  }
else
  {// code for IE6, IE5
  xmlhttp=new ActiveXObject("Microsoft.XMLHTTP");
  }
xmlhttp.onreadystatechange=function()
  {
  if (xmlhttp.readyState)
    
  	  console.log(xmlhttp);
  	response++;
       document.getElementById("myDiv").innerHTML+=xmlhttp.readyState;

    
  }

xmlhttp.open("HEAD","empty.txt",true);
xmlhttp.setRequestHeader("Empty-Header", "");
xmlhttp.send();
}
</script>
</head>
<body>
This is what 2.0.1 and desktop get <br/>
1: server connection established<br/>
2: request received <br/>
4: request finished and response is ready<br/>
<br/>
2.1.0 on generates this<br/>

1: server connection established<br/>
4: request finished and response is ready<br/>
<div id="myDiv"><h2>Requests</h2></div>
<button type="button" onclick="loadXMLDoc()">Test Me</button>

</body>
</html>



expected: 
1: server connection established
2: request received 
4: request finished and response is ready

actual:
2.1.0  generates this
1: server connection established
4: request finished and response is ready
Comment 1 Jason Liu 2012-04-16 00:17:57 PDT
Created attachment 137292 [details]
Patch
Comment 2 WebKit Review Bot 2012-04-16 02:04:56 PDT
Comment on attachment 137292 [details]
Patch

Clearing flags on attachment: 137292

Committed r114235: <http://trac.webkit.org/changeset/114235>
Comment 3 WebKit Review Bot 2012-04-16 02:05:01 PDT
All reviewed patches have been landed.  Closing bug.