Reviewers: jtamplin, cromwellian,

Message:
Follow-up to https://gwt-code-reviews.appspot.com/1820806

See http://code.google.com/p/google-web-toolkit/issues/detail?id=7386#c8

Description:
Add a getter for XHR's responseType.

Issue 7386


Please review this at https://gwt-code-reviews.appspot.com/1830803/

Affected files:
  M user/src/com/google/gwt/xhr/client/XMLHttpRequest.java


Index: user/src/com/google/gwt/xhr/client/XMLHttpRequest.java
diff --git a/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java b/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java index d35d1964cb30c4a3f1c895bdce2db50665f3e32f..aedb80697b26f086391ef305c24a0571c05855bc 100644
--- a/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java
+++ b/user/src/com/google/gwt/xhr/client/XMLHttpRequest.java
@@ -162,8 +162,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Aborts the current request.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#abort";
-   * >http://www.w3.org/TR/XMLHttpRequest/#abort</a>.
+   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-abort-method";
+   * >http://www.w3.org/TR/XMLHttpRequest/#the-abort-method</a>.
    */
   public final native void abort() /*-{
     this.abort();
@@ -172,8 +172,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Clears the {@link ReadyStateChangeHandler}.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange";
-   * >http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange</a>.
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onreadystatechange"; + *
http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onreadystatechange</a>.
    *
    * @see #clearOnReadyStateChange()
    */
@@ -189,8 +189,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Gets all the HTTP response headers, as a single string.
    * <p>
- * See <a href="http://www.w3.org/TR/XMLHttpRequest/#getallresponseheaders";
-   * >http://www.w3.org/TR/XMLHttpRequest/#getallresponseheaders</a>.
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders-method"; + *
http://www.w3.org/TR/XMLHttpRequest/#the-getallresponseheaders-method</a>.
    *
    * @return the response headers.
    */
@@ -201,8 +201,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Get's the current ready-state.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#readystate";
-   * >http://www.w3.org/TR/XMLHttpRequest/#readystate</a>.
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-readystate";
+   * >http://www.w3.org/TR/XMLHttpRequest/#dom-xmlhttprequest-state</a>.
    *
    * @return the ready-state constant
    */
@@ -223,8 +223,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Gets an HTTP response header.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#getresponseheader";
-   * >http://www.w3.org/TR/XMLHttpRequest/#getresponseheader</a>.
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader-method"; + *
http://www.w3.org/TR/XMLHttpRequest/#the-getresponseheader-method</a>.
    *
    * @param header the response header to be retrieved
    * @return the header value
@@ -236,8 +236,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Gets the response text.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#responsetext";
-   * >http://www.w3.org/TR/XMLHttpRequest/#responsetext</a>.
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute";
+   * >http://www.w3.org/TR/XMLHttpRequest/#the-responsetext-attribute</a>.
    *
    * @return the response text
    */
@@ -246,10 +246,22 @@ public class XMLHttpRequest extends JavaScriptObject {
   }-*/;

   /**
+   * Gets the response type.
+   * <p>
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-responsetype-attribute";
+   * >http://www.w3.org/TR/XMLHttpRequest/#the-responsetype-attribute</a>
+   *
+   * @return the response type
+   */
+  public final native String getResponseType() /*-{
+    return this.responseType || "";
+  }-*/;
+
+  /**
    * Gets the status code.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#status";
-   * >http://www.w3.org/TR/XMLHttpRequest/#status</a>.
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-status-attribute";
+   * >http://www.w3.org/TR/XMLHttpRequest/#the-status-attribute</a>.
    *
    * @return the status code
    */
@@ -260,8 +272,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Gets the status text.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#statustext";
-   * >http://www.w3.org/TR/XMLHttpRequest/#statustext</a>.
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-statustext-attribute";
+   * >http://www.w3.org/TR/XMLHttpRequest/#the-statustext-attribute</a>.
    *
    * @return the status text
    */
@@ -272,8 +284,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Opens an asynchronous connection.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#open";
-   * >http://www.w3.org/TR/XMLHttpRequest/#open</a>.
+   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-open-method";
+   * >http://www.w3.org/TR/XMLHttpRequest/#the-open-method</a>.
    *
    * @param httpMethod the HTTP method to use
    * @param url the URL to be opened
@@ -285,8 +297,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Opens an asynchronous connection.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#open";
-   * >http://www.w3.org/TR/XMLHttpRequest/#open</a>.
+   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-open-method";
+   * >http://www.w3.org/TR/XMLHttpRequest/#the-open-method</a>.
    *
    * @param httpMethod the HTTP method to use
    * @param url the URL to be opened
@@ -299,8 +311,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Opens an asynchronous connection.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#open";
-   * >http://www.w3.org/TR/XMLHttpRequest/#open</a>.
+   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-open-method";
+   * >http://www.w3.org/TR/XMLHttpRequest/#the-open-method</a>.
    *
    * @param httpMethod the HTTP method to use
    * @param url the URL to be opened
@@ -324,8 +336,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Initiates a request with data.  If there is no data, specify null.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#send";
-   * >http://www.w3.org/TR/XMLHttpRequest/#send</a>.
+   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-send-method";
+   * >http://www.w3.org/TR/XMLHttpRequest/#the-send-method</a>.
    *
    * @param requestData the data to be sent with the request
    */
@@ -337,8 +349,8 @@ public class XMLHttpRequest extends JavaScriptObject {
* Sets the {@link ReadyStateChangeHandler} to be notified when the object's
    * ready-state changes.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange";
-   * >http://www.w3.org/TR/XMLHttpRequest/#onreadystatechange</a>.
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onreadystatechange"; + *
http://www.w3.org/TR/XMLHttpRequest/#handler-xhr-onreadystatechange</a>.
    *
    * <p>
* Note: Applications <em>must</em> call {@link #clearOnReadyStateChange()}
@@ -361,8 +373,8 @@ public class XMLHttpRequest extends JavaScriptObject {
   /**
    * Sets a request header.
    * <p>
-   * See <a href="http://www.w3.org/TR/XMLHttpRequest/#setrequestheader";
-   * >http://www.w3.org/TR/XMLHttpRequest/#setrequestheader</a>.
+ * See <a href="http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader-method";
+   * >http://www.w3.org/TR/XMLHttpRequest/#the-setrequestheader-method</a>.
    *
    * @param header the header to be set
    * @param value the header's value


--
http://groups.google.com/group/Google-Web-Toolkit-Contributors

Reply via email to