+2006-10-17 Adam Roben <aroben@apple.com>
+
+ Reviewed by Adele.
+
+ Fixes http://bugs.webkit.org/show_bug.cgi?id=11214
+ http/tests/xmlhttprequest/exceptions.html needs new results
+
+ Updating results after r16794.
+
+ * http/tests/xmlhttprequest/exceptions-expected.txt:
+ * http/tests/xmlhttprequest/exceptions.html: Add comments about why we
+ don't follow the XHR spec.
+
2006-10-16 Justin Garcia <justin.garcia@apple.com>
Reviewed by harrison
Test that XMLHttpRequest raises exceptions when it should.
new XMLHttpRequest()
-PASS: req.setRequestHeader("Foo", "bar") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS: req.send(null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS: req.open("GET", "http://www.apple.com/", true) threw exception Error: Permission denied.
open()
PASS: req.statusText() threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
send()
PASS: req.send(null) threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
-PASS: req.setRequestHeader("Foo", "bar") threw exception Error: INVALID_STATE_ERR: DOM Exception 11.
PASS: req.getResponseHeader() threw exception SyntaxError: Not enough arguments.
}
log("new XMLHttpRequest()");
- shouldThrow('req.setRequestHeader("Foo", "bar")');
+ // According to the XHR spec, this should throw INVALID_STATE_ERR. However,
+ // widgets exist that depend on WebKit not throwing an exception here, and
+ // to make them keep working we have to go against spec and support this
+ // legacy behavior. See <rdar://problem/4758577> "REGRESSION: Business and
+ // People widgets fails to complete search query" for more details.
+ req.setRequestHeader("Foo", "bar");
+
shouldThrow('req.send(null)');
shouldThrow('req.open("GET", "http://www.apple.com/", true)');
shouldThrow('req.send(null)');
- shouldThrow('req.setRequestHeader("Foo", "bar")');
+ // According to the XHR spec, this should throw INVALID_STATE_ERR. However,
+ // widgets exist that depend on WebKit not throwing an exception here, and
+ // to make them keep working we have to go against spec and support this
+ // legacy behavior. See <rdar://problem/4758577> "REGRESSION: Business and
+ // People widgets fails to complete search query" for more details.
+ req.setRequestHeader("Foo", "bar");
shouldThrow('req.getResponseHeader()');