[OpenLayers-Commits] r10966 - in trunk/openlayers: lib/OpenLayers tests

commits-20090109 at openlayers.org commits-20090109 at openlayers.org
Wed Dec 15 02:52:00 EST 2010


Author: erilem
Date: 2010-12-14 23:52:00 -0800 (Tue, 14 Dec 2010)
New Revision: 10966

Modified:
   trunk/openlayers/lib/OpenLayers/Request.js
   trunk/openlayers/tests/Request.html
Log:
make Request rely on standard XMLHttpRequest interfaces, p=jorix, r=me (References #2913)

Modified: trunk/openlayers/lib/OpenLayers/Request.js
===================================================================
--- trunk/openlayers/lib/OpenLayers/Request.js	2010-12-15 07:51:50 UTC (rev 10965)
+++ trunk/openlayers/lib/OpenLayers/Request.js	2010-12-15 07:52:00 UTC (rev 10966)
@@ -169,7 +169,7 @@
             request.send(config.data);
         } else {
             window.setTimeout(function(){
-                if (request._aborted !== true) {
+                if (request.readyState !== 0) { // W3C: 0-UNSENT
                     request.send(config.data);
                 }
             }, 0);

Modified: trunk/openlayers/tests/Request.html
===================================================================
--- trunk/openlayers/tests/Request.html	2010-12-15 07:51:50 UTC (rev 10965)
+++ trunk/openlayers/tests/Request.html	2010-12-15 07:52:00 UTC (rev 10966)
@@ -409,6 +409,21 @@
         });
     }
 
+    function test_abort2(t) {
+        t.plan(0);
+        var fail = false;
+        OpenLayers.Request.XMLHttpRequest.onsend = function(args) {
+            fail = true;
+        }
+        t.delay_call(0.5, function() {
+            if (fail === true) {
+                t.fail("Send should not be called because request is aborted");
+            }
+            OpenLayers.Request.XMLHttpRequest.onsend = null;
+        });
+        var req = OpenLayers.Request.GET();
+        req.abort();
+    }
     </script>
 </head>
 <body>



More information about the Commits mailing list