Title: [123194] trunk
- Revision
- 123194
- Author
- [email protected]
- Date
- 2012-07-20 01:41:16 -0700 (Fri, 20 Jul 2012)
Log 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)
Modified Paths
Added Paths
Diff
Modified: trunk/LayoutTests/ChangeLog (123193 => 123194)
--- trunk/LayoutTests/ChangeLog 2012-07-20 08:28:37 UTC (rev 123193)
+++ trunk/LayoutTests/ChangeLog 2012-07-20 08:41:16 UTC (rev 123194)
@@ -1,3 +1,17 @@
+2012-07-17 Kinuko Yasuda <[email protected]>
+
+ 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.
+
+ 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)
+
2012-07-20 Matt Falkenhagen <[email protected]>
Show or hide <dialog> depending on the open attribute
Modified: trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer-expected.txt (123193 => 123194)
--- trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer-expected.txt 2012-07-20 08:28:37 UTC (rev 123193)
+++ trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer-expected.txt 2012-07-20 08:41:16 UTC (rev 123194)
@@ -10,7 +10,6 @@
PASS xhr.responseType has been correctly set to 'text'.
PASS xhr.responseType has been correctly set to 'document'.
PASS xhr.responseType has been correctly set to 'arraybuffer'.
-PASS exception correctly thrown when xhr.responseType is set to invalid value : Error: SYNTAX_ERR: DOM Exception 12.
PASS 'arraybuffer' .response does not exist when .readyState is 2.
PASS 'arraybuffer' .response does not exist when .readyState is 3.
PASS 'arraybuffer' .response exists when .readyState is 4.
Modified: trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer.html (123193 => 123194)
--- trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer.html 2012-07-20 08:28:37 UTC (rev 123193)
+++ trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-arraybuffer.html 2012-07-20 08:41:16 UTC (rev 123194)
@@ -138,13 +138,6 @@
} catch(e) {
testFailed("unable to set xhr.responseType to a valid value " + e + ".");
}
-
- // Make sure exception is thrown if responseType is set to invalid value.
- try {
- xhr.responseType = "dkjdfkjdfkj";
- } catch(e) {
- testPassed("exception correctly thrown when xhr.responseType is set to invalid value : " + e + ".");
- }
} catch(e) {
testFailed("Caught exception " + e + ".");
}
Added: trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype-expected.txt (0 => 123194)
--- trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype-expected.txt (rev 0)
+++ trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype-expected.txt 2012-07-20 08:41:16 UTC (rev 123194)
@@ -0,0 +1,12 @@
+CONSOLE MESSAGE: XMLHttpRequest.responseType "dkjdfkjdfkj" is not supported.
+CONSOLE MESSAGE: XMLHttpRequest.responseType "asdfasdfasd" is not supported.
+This test checks if setting non-supported type does not throw an exception
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+PASS xhr.responseType = "dkjdfkjdfkj" did not throw exception.
+PASS xhr.responseType = "text"; xhr.responseType = "asdfasdfasd"; xhr.responseType is "text"
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
Property changes on: trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype-expected.txt
___________________________________________________________________
Added: svn:eol-style
Added: trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype.html (0 => 123194)
--- trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype.html (rev 0)
+++ trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype.html 2012-07-20 08:41:16 UTC (rev 123194)
@@ -0,0 +1,20 @@
+<html>
+<body>
+<div id="description"></div>
+<div id="console"></div>
+<script src=""
+<script>
+description('This test checks if setting non-supported type does not throw an exception');
+
+var xhr = new XMLHttpRequest();
+xhr.open('GET', 'resources/plist.app', true);
+
+// Setting invalid type should not throw an exception.
+shouldNotThrow('xhr.responseType = "dkjdfkjdfkj"');
+
+// Setting invalid type doesn not change the responseType value.
+shouldBeEqualToString('xhr.responseType = "text"; xhr.responseType = "asdfasdfasd"; xhr.responseType', 'text');
+
+</script>
+<script src=""
+</body>
Property changes on: trunk/LayoutTests/fast/xmlhttprequest/xmlhttprequest-responsetype-set-invalidtype.html
___________________________________________________________________
Added: svn:eol-style
Modified: trunk/Source/WebCore/ChangeLog (123193 => 123194)
--- trunk/Source/WebCore/ChangeLog 2012-07-20 08:28:37 UTC (rev 123193)
+++ trunk/Source/WebCore/ChangeLog 2012-07-20 08:41:16 UTC (rev 123194)
@@ -1,3 +1,19 @@
+2012-07-17 Kinuko Yasuda <[email protected]>
+
+ 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.
+
+ 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.
+
2012-07-20 Matt Falkenhagen <[email protected]>
Show or hide <dialog> depending on the open attribute
Modified: trunk/Source/WebCore/xml/XMLHttpRequest.cpp (123193 => 123194)
--- trunk/Source/WebCore/xml/XMLHttpRequest.cpp 2012-07-20 08:28:37 UTC (rev 123193)
+++ trunk/Source/WebCore/xml/XMLHttpRequest.cpp 2012-07-20 08:41:16 UTC (rev 123194)
@@ -354,7 +354,7 @@
else if (responseType == "arraybuffer")
m_responseTypeCode = ResponseTypeArrayBuffer;
else
- ec = SYNTAX_ERR;
+ logConsoleError(scriptExecutionContext(), "XMLHttpRequest.responseType \"" + responseType + "\" is not supported.");
}
String XMLHttpRequest::responseType()
_______________________________________________
webkit-changes mailing list
[email protected]
http://lists.webkit.org/mailman/listinfo/webkit-changes