Changeset 123194 in webkit


Ignore:
Timestamp:
Jul 20, 2012 1:41:16 AM (12 years ago)
Author:
kinuko@chromium.org
Message:

If value for responseType defined as type that not supported, it should not throw an exception in XHR 2
https://bugs.webkit.org/show_bug.cgi?id=90976

Reviewed by Alexey Proskuryakov.

Source/WebCore:

http://www.w3.org/TR/XMLHttpRequest2/#the-responsetype-attribute
The spec does not say it should throw an exception when a non-supported
type is set, and other browsers do not throw it either.

Test: fast/xmlhttprequest/xmlhttprequest-responsetype-set-type.html

  • xml/XMLHttpRequest.cpp:

(WebCore::XMLHttpRequest::setResponseType): Stop throwing an exception when non-supported type is given.

LayoutTests:

Adding tests to see if setting invalid responseType does not throw an exception and does not change the value.

  • fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype-expected.txt: Added.
  • fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype.html: Added.
  • fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer-expected.txt:
  • fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer.html: Removed a line which tries to set invalid type (since we now have a separate test)
Location:
trunk
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r123193 r123194  
     12012-07-17  Kinuko Yasuda  <kinuko@chromium.org>
     2
     3        If value for responseType defined as type that not supported, it should not throw an exception in XHR 2
     4        https://bugs.webkit.org/show_bug.cgi?id=90976
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        Adding tests to see if setting invalid responseType does not throw an exception and does not change the value.
     9
     10        * fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype-expected.txt: Added.
     11        * fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype.html: Added.
     12        * fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer-expected.txt:
     13        * fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer.html: Removed a line which tries to set invalid type (since we now have a separate test)
     14
    1152012-07-20  Matt Falkenhagen  <falken@chromium.org>
    216
  • trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer-expected.txt

    r72626 r123194  
    1111PASS xhr.responseType has been correctly set to 'document'.
    1212PASS xhr.responseType has been correctly set to 'arraybuffer'.
    13 PASS exception correctly thrown when xhr.responseType is set to invalid value : Error: SYNTAX_ERR: DOM Exception 12.
    1413PASS 'arraybuffer' .response does not exist when .readyState is 2.
    1514PASS 'arraybuffer' .response does not exist when .readyState is 3.
  • trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer.html

    r98407 r123194  
    139139            testFailed("unable to set xhr.responseType to a valid value " + e + ".");
    140140        }
    141 
    142         // Make sure exception is thrown if responseType is set to invalid value.
    143         try {
    144             xhr.responseType = "dkjdfkjdfkj";
    145         } catch(e) {
    146             testPassed("exception correctly thrown when xhr.responseType is set to invalid value : " + e + ".");
    147         }
    148141    } catch(e) {
    149142        testFailed("Caught exception " + e + ".");
  • trunk/Source/WebCore/ChangeLog

    r123193 r123194  
     12012-07-17  Kinuko Yasuda  <kinuko@chromium.org>
     2
     3        If value for responseType defined as type that not supported, it should not throw an exception in XHR 2
     4        https://bugs.webkit.org/show_bug.cgi?id=90976
     5
     6        Reviewed by Alexey Proskuryakov.
     7
     8        http://www.w3.org/TR/XMLHttpRequest2/#the-responsetype-attribute
     9        The spec does not say it should throw an exception when a non-supported
     10        type is set, and other browsers do not throw it either.
     11
     12        Test: fast/xmlhttprequest/xmlhttprequest-responsetype-set-type.html
     13
     14        * xml/XMLHttpRequest.cpp:
     15        (WebCore::XMLHttpRequest::setResponseType): Stop throwing an exception when non-supported type is given.
     16
    1172012-07-20  Matt Falkenhagen  <falken@chromium.org>
    218
  • trunk/Source/WebCore/xml/XMLHttpRequest.cpp

    r122074 r123194  
    355355        m_responseTypeCode = ResponseTypeArrayBuffer;
    356356    else
    357         ec = SYNTAX_ERR;
     357        logConsoleError(scriptExecutionContext(), "XMLHttpRequest.responseType \"" + responseType + "\" is not supported.");
    358358}
    359359
Note: See TracChangeset for help on using the changeset viewer.