Bug 83866

Summary: [BlackBerry] Missing readyState 2 when a XMLHttpRequest calls xmlhttp.open("HEAD","notExist.html",true).
Product: WebKit Reporter: Jason Liu <jasonliuwebkit>
Component: WebKit BlackBerryAssignee: Nobody <webkit-unassigned>
Status: RESOLVED FIXED    
Severity: Normal CC: tonikitoo, webkit.review.bot
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Other   
Bug Depends on: 84016    
Bug Blocks:    
Attachments:
Description Flags
Patch none

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.