Bug 1712930 - Part 3: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSEXML; r=smaug
☠☠ backed out by a8c952dcf428 ☠ ☠
authorEdgar Chen <echen@mozilla.com>
Mon, 31 May 2021 12:57:16 +0000
changeset 653970 dd0ab5fc70a0dac907e535006460d5819d5a2d74
parent 653969 ab9bb2ee0c987f5d4580fb4b9c072c0854cdf130
child 653971 b117c37b1e7e54dc36fd6941919a5e482cb10f49
push id2623
push userffxbld-merge
push dateMon, 02 Aug 2021 14:47:51 +0000
treeherdermozilla-release@8500ce65f7c6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssmaug
bugs1712930
milestone90.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1712930 - Part 3: Get rid of NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSEXML; r=smaug Differential Revision: https://phabricator.services.mozilla.com/D116077
devtools/server/actors/network-monitor/utils/network-utils.js
dom/base/domerr.msg
dom/xhr/XMLHttpRequestMainThread.cpp
xpcom/base/ErrorList.py
--- a/devtools/server/actors/network-monitor/utils/network-utils.js
+++ b/devtools/server/actors/network-monitor/utils/network-utils.js
@@ -297,17 +297,16 @@ const ErrorCodes = {
   NS_ERROR_UNCATCHABLE_EXCEPTION: 0x805303f7,
   NS_ERROR_DOM_MALFORMED_URI: 0x805303f8,
   NS_ERROR_DOM_INVALID_HEADER_NAME: 0x805303f9,
   NS_ERROR_DOM_INVALID_STATE_XHR_HAS_INVALID_CONTEXT: 0x805303fa,
   NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED: 0x805303fb,
   NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_SENDING: 0x805303fc,
   NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_LOADING_OR_DONE_RESPONSE_TYPE: 0x805303fd,
   NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_LOADING_OR_DONE_OVERRIDE_MIME_TYPE: 0x8053040d,
-  NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSEXML: 0x805303fe,
   NS_ERROR_DOM_JS_DECODING_ERROR: 0x80530402,
   NS_ERROR_DOM_IMAGE_INACTIVE_DOCUMENT: 0x80530403,
   NS_ERROR_DOM_IMAGE_INVALID_REQUEST: 0x80530404,
   NS_ERROR_DOM_IMAGE_BROKEN: 0x80530405,
   NS_ERROR_DOM_CORP_FAILED: 0x8053040c,
   NS_SUCCESS_DOM_NO_OPERATION: 0x530001,
   NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW: 0x530002,
   NS_SUCCESS_DOM_SCRIPT_EVALUATION_THREW_UNCATCHABLE: 0x530003,
--- a/dom/base/domerr.msg
+++ b/dom/base/domerr.msg
@@ -137,14 +137,13 @@ DOM4_MSG_DEF(SyntaxError, "The URI is ma
 DOM4_MSG_DEF(SyntaxError, "Invalid header name.", NS_ERROR_DOM_INVALID_HEADER_NAME)
 
 /* XMLHttpRequest errors. */
 DOM4_MSG_DEF(InvalidStateError, "XMLHttpRequest has an invalid context.", NS_ERROR_DOM_INVALID_STATE_XHR_HAS_INVALID_CONTEXT)
 DOM4_MSG_DEF(InvalidStateError, "XMLHttpRequest state must be OPENED.", NS_ERROR_DOM_INVALID_STATE_XHR_MUST_BE_OPENED)
 DOM4_MSG_DEF(InvalidStateError, "XMLHttpRequest must not be sending.", NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_SENDING)
 DOM4_MSG_DEF(InvalidStateError, "Cannot set 'responseType' property on XMLHttpRequest after 'send()' (when its state is LOADING or DONE).", NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_LOADING_OR_DONE_RESPONSE_TYPE)
 DOM4_MSG_DEF(InvalidStateError, "Cannot call 'overrideMimeType()' on XMLHttpRequest after 'send()' (when its state is LOADING or DONE).", NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_LOADING_OR_DONE_OVERRIDE_MIME_TYPE)
-DOM4_MSG_DEF(InvalidStateError, "responseXML is only available if responseType is '' or 'document'.", NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSEXML)
 
 /* Image decode errors. */
 DOM4_MSG_DEF(EncodingError, "Node bound to inactive document.", NS_ERROR_DOM_IMAGE_INACTIVE_DOCUMENT)
 DOM4_MSG_DEF(EncodingError, "Invalid image request.", NS_ERROR_DOM_IMAGE_INVALID_REQUEST)
 DOM4_MSG_DEF(EncodingError, "Invalid encoded image data.", NS_ERROR_DOM_IMAGE_BROKEN)
--- a/dom/xhr/XMLHttpRequestMainThread.cpp
+++ b/dom/xhr/XMLHttpRequestMainThread.cpp
@@ -440,18 +440,18 @@ static void LogMessage(
   nsContentUtils::ReportToConsole(nsIScriptError::warningFlag, "DOM"_ns, doc,
                                   nsContentUtils::eDOM_PROPERTIES, aWarning,
                                   aParams);
 }
 
 Document* XMLHttpRequestMainThread::GetResponseXML(ErrorResult& aRv) {
   if (mResponseType != XMLHttpRequestResponseType::_empty &&
       mResponseType != XMLHttpRequestResponseType::Document) {
-    aRv.Throw(
-        NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSEXML);
+    aRv.ThrowInvalidStateError(
+        "responseXML is only available if responseType is '' or 'document'.");
     return nullptr;
   }
   if (mWarnAboutSyncHtml) {
     mWarnAboutSyncHtml = false;
     LogMessage("HTMLSyncXHRWarning", GetOwner());
   }
   if (mState != XMLHttpRequest_Binding::DONE) {
     return nullptr;
--- a/xpcom/base/ErrorList.py
+++ b/xpcom/base/ErrorList.py
@@ -721,19 +721,16 @@ with modules["DOM"]:
     ] = FAILURE(
         1021
     )  # NOQA: E501
     errors[
         "NS_ERROR_DOM_INVALID_STATE_XHR_MUST_NOT_BE_LOADING_OR_DONE_OVERRIDE_MIME_TYPE"
     ] = FAILURE(
         1037
     )  # NOQA: E501
-    errors[
-        "NS_ERROR_DOM_INVALID_STATE_XHR_HAS_WRONG_RESPONSETYPE_FOR_RESPONSEXML"
-    ] = FAILURE(1022)
 
     # When manipulating the bytecode cache with the JS API, some transcoding
     # errors, such as a different bytecode format can cause failures of the
     # decoding process.
     errors["NS_ERROR_DOM_JS_DECODING_ERROR"] = FAILURE(1026)
 
     # Image decode errors.
     errors["NS_ERROR_DOM_IMAGE_INACTIVE_DOCUMENT"] = FAILURE(1027)