https://bugs.webkit.org/show_bug.cgi?id=75194
Source/WebCore:
XMLHttpRequest.withCredentials attribute should be modifiable prior to the OPENED state per
the W3C spec. See http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-withcredentials-attribute
Reviewed by Alexey Proskuryakov.
Test: fast/xmlhttprequest/xmlhttprequest-withcredentials-before-open.html
* xml/XMLHttpRequest.cpp:
(WebCore::XMLHttpRequest::setWithCredentials):
Prevent setting the value only after the OPENED state.
LayoutTests:
Reviewed by Alexey Proskuryakov.
* fast/xmlhttprequest/xmlhttprequest-withcredentials-before-open-expected.txt: Added.
* fast/xmlhttprequest/xmlhttprequest-withcredentials-before-open.html: Added.
Validate that XMLHttpRequest.withCredentials can be set prior to a call to open().
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@103661
268f45cc-cd09-0410-ab3c-
d52691b4dbfc
+2011-12-24 Jarred Nicholls <jarred@sencha.com>
+
+ Allow XMLHttpRequest withCredentials to be set prior to a call to open()
+ https://bugs.webkit.org/show_bug.cgi?id=75194
+
+ Reviewed by Alexey Proskuryakov.
+
+ * fast/xmlhttprequest/xmlhttprequest-withcredentials-before-open-expected.txt: Added.
+ * fast/xmlhttprequest/xmlhttprequest-withcredentials-before-open.html: Added.
+ Validate that XMLHttpRequest.withCredentials can be set prior to a call to open().
+
2011-12-24 Ryosuke Niwa <rniwa@webkit.org>
Chromium CG Mac rebaseline after r103651.
--- /dev/null
+This tests that the XMLHttpRequest withCredentials attribute is modifiable prior to being in the OPENED state.
+
+On success, you will see a series of "PASS" messages, followed by "TEST COMPLETE".
+
+
+xhr.withCredentials = true;
+xhr.open('GET', 'http://mydomain');
+PASS xhr.withCredentials is true
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
--- /dev/null
+<!DOCTYPE html>
+<html>
+<head>
+ <script src="../js/resources/js-test-pre.js"></script>
+ <script>
+ description('This tests that the XMLHttpRequest withCredentials attribute is modifiable prior to being in the OPENED state.');
+ var xhr;
+
+ xhr = new XMLHttpRequest();
+ evalAndLog("xhr.withCredentials = true;");
+ evalAndLog("xhr.open('GET', 'http://mydomain');");
+ shouldBeTrue('xhr.withCredentials');
+ </script>
+ <script src="../js/resources/js-test-post.js"></script>
+</head>
+<body>
+ <div id="description"></div>
+ <div id="console"></div>
+</body>
+</html>
+2011-12-24 Jarred Nicholls <jarred@sencha.com>
+
+ Allow XMLHttpRequest withCredentials to be set prior to a call to open()
+ https://bugs.webkit.org/show_bug.cgi?id=75194
+
+ XMLHttpRequest.withCredentials attribute should be modifiable prior to the OPENED state per
+ the W3C spec. See http://dvcs.w3.org/hg/xhr/raw-file/tip/Overview.html#the-withcredentials-attribute
+
+ Reviewed by Alexey Proskuryakov.
+
+ Test: fast/xmlhttprequest/xmlhttprequest-withcredentials-before-open.html
+
+ * xml/XMLHttpRequest.cpp:
+ (WebCore::XMLHttpRequest::setWithCredentials):
+ Prevent setting the value only after the OPENED state.
+
2011-12-24 Andreas Kling <awesomekling@apple.com>
Remove empty inline RenderStyle destructor.
void XMLHttpRequest::setWithCredentials(bool value, ExceptionCode& ec)
{
- if (m_state != OPENED || m_loader) {
+ if (m_state > OPENED || m_loader) {
ec = INVALID_STATE_ERR;
return;
}