Bug 1452010 part 2. Remove nsIDOMDOMException members. r=qdot

MozReview-Commit-ID: Bp5ablEtcHA
This commit is contained in:
Boris Zbarsky 2018-04-06 23:27:56 -04:00
parent 9b3d37b936
commit 23dc2febce
5 changed files with 26 additions and 73 deletions

View File

@ -21,33 +21,34 @@
#include "mozilla/ErrorResult.h"
using namespace mozilla;
using namespace mozilla::dom;
enum DOM4ErrorTypeCodeMap {
/* DOM4 errors from http://dvcs.w3.org/hg/domcore/raw-file/tip/Overview.html#domexception */
IndexSizeError = nsIDOMDOMException::INDEX_SIZE_ERR,
HierarchyRequestError = nsIDOMDOMException::HIERARCHY_REQUEST_ERR,
WrongDocumentError = nsIDOMDOMException::WRONG_DOCUMENT_ERR,
InvalidCharacterError = nsIDOMDOMException::INVALID_CHARACTER_ERR,
NoModificationAllowedError = nsIDOMDOMException::NO_MODIFICATION_ALLOWED_ERR,
NotFoundError = nsIDOMDOMException::NOT_FOUND_ERR,
NotSupportedError = nsIDOMDOMException::NOT_SUPPORTED_ERR,
IndexSizeError = DOMExceptionBinding::INDEX_SIZE_ERR,
HierarchyRequestError = DOMExceptionBinding::HIERARCHY_REQUEST_ERR,
WrongDocumentError = DOMExceptionBinding::WRONG_DOCUMENT_ERR,
InvalidCharacterError = DOMExceptionBinding::INVALID_CHARACTER_ERR,
NoModificationAllowedError = DOMExceptionBinding::NO_MODIFICATION_ALLOWED_ERR,
NotFoundError = DOMExceptionBinding::NOT_FOUND_ERR,
NotSupportedError = DOMExceptionBinding::NOT_SUPPORTED_ERR,
// Can't remove until setNamedItem is removed
InUseAttributeError = nsIDOMDOMException::INUSE_ATTRIBUTE_ERR,
InvalidStateError = nsIDOMDOMException::INVALID_STATE_ERR,
SyntaxError = nsIDOMDOMException::SYNTAX_ERR,
InvalidModificationError = nsIDOMDOMException::INVALID_MODIFICATION_ERR,
NamespaceError = nsIDOMDOMException::NAMESPACE_ERR,
InvalidAccessError = nsIDOMDOMException::INVALID_ACCESS_ERR,
TypeMismatchError = nsIDOMDOMException::TYPE_MISMATCH_ERR,
SecurityError = nsIDOMDOMException::SECURITY_ERR,
NetworkError = nsIDOMDOMException::NETWORK_ERR,
AbortError = nsIDOMDOMException::ABORT_ERR,
URLMismatchError = nsIDOMDOMException::URL_MISMATCH_ERR,
QuotaExceededError = nsIDOMDOMException::QUOTA_EXCEEDED_ERR,
TimeoutError = nsIDOMDOMException::TIMEOUT_ERR,
InvalidNodeTypeError = nsIDOMDOMException::INVALID_NODE_TYPE_ERR,
DataCloneError = nsIDOMDOMException::DATA_CLONE_ERR,
InvalidPointerId = nsIDOMDOMException::INVALID_POINTER_ERR,
InUseAttributeError = DOMExceptionBinding::INUSE_ATTRIBUTE_ERR,
InvalidStateError = DOMExceptionBinding::INVALID_STATE_ERR,
SyntaxError = DOMExceptionBinding::SYNTAX_ERR,
InvalidModificationError = DOMExceptionBinding::INVALID_MODIFICATION_ERR,
NamespaceError = DOMExceptionBinding::NAMESPACE_ERR,
InvalidAccessError = DOMExceptionBinding::INVALID_ACCESS_ERR,
TypeMismatchError = DOMExceptionBinding::TYPE_MISMATCH_ERR,
SecurityError = DOMExceptionBinding::SECURITY_ERR,
NetworkError = DOMExceptionBinding::NETWORK_ERR,
AbortError = DOMExceptionBinding::ABORT_ERR,
URLMismatchError = DOMExceptionBinding::URL_MISMATCH_ERR,
QuotaExceededError = DOMExceptionBinding::QUOTA_EXCEEDED_ERR,
TimeoutError = DOMExceptionBinding::TIMEOUT_ERR,
InvalidNodeTypeError = DOMExceptionBinding::INVALID_NODE_TYPE_ERR,
DataCloneError = DOMExceptionBinding::DATA_CLONE_ERR,
InvalidPointerId = 0,
EncodingError = 0,
/* XXX Should be JavaScript native errors */
@ -368,24 +369,6 @@ DOMException::DOMException(nsresult aRv, const nsACString& aMessage,
{
}
NS_IMETHODIMP
DOMException::GetCode(uint16_t* aCode)
{
NS_ENSURE_ARG_POINTER(aCode);
*aCode = mCode;
// Warn only when the code was changed (other than DOM Core)
// or the code is useless (zero)
if (NS_ERROR_GET_MODULE(mResult) != NS_ERROR_MODULE_DOM || !mCode) {
nsCOMPtr<nsIDocument> doc = nsContentUtils::GetDocumentFromCaller();
if (doc) {
doc->WarnOnceAbout(nsIDocument::eDOMExceptionCode);
}
}
return NS_OK;
}
void
DOMException::ToString(JSContext* aCx, nsACString& aReturn)
{

View File

@ -11,7 +11,6 @@
*/
DEPRECATED_OPERATION(EnablePrivilege)
DEPRECATED_OPERATION(DOMExceptionCode)
DEPRECATED_OPERATION(MutationEvent)
DEPRECATED_OPERATION(Components)
DEPRECATED_OPERATION(PrefixedVisibilityAPI)

View File

@ -13,6 +13,7 @@
#include "mozilla/Base64.h"
#include "mozilla/CheckedInt.h"
#include "mozilla/dom/DOMException.h"
#include "mozilla/dom/DOMExceptionBinding.h"
#include "mozilla/dom/File.h"
#include "mozilla/dom/FileReaderBinding.h"
#include "mozilla/dom/ProgressEvent.h"
@ -233,7 +234,7 @@ FileReader::OnLoadEndArrayBuffer()
// XXX Code selected arbitrarily
mError =
new DOMException(NS_ERROR_DOM_INVALID_STATE_ERR, errorMsg,
errorNameC, DOMException::INVALID_STATE_ERR);
errorNameC, DOMExceptionBinding::INVALID_STATE_ERR);
FreeDataAndDispatchError();
}

View File

@ -20,33 +20,5 @@
[uuid(5bd766d3-57a9-4833-995d-dbe21da29595)]
interface nsIDOMDOMException : nsISupports
{
const unsigned short INDEX_SIZE_ERR = 1;
const unsigned short DOMSTRING_SIZE_ERR = 2; // historical
const unsigned short HIERARCHY_REQUEST_ERR = 3;
const unsigned short WRONG_DOCUMENT_ERR = 4;
const unsigned short INVALID_CHARACTER_ERR = 5;
const unsigned short NO_DATA_ALLOWED_ERR = 6; // historical
const unsigned short NO_MODIFICATION_ALLOWED_ERR = 7;
const unsigned short NOT_FOUND_ERR = 8;
const unsigned short NOT_SUPPORTED_ERR = 9;
const unsigned short INUSE_ATTRIBUTE_ERR = 10; // historical
const unsigned short INVALID_STATE_ERR = 11;
const unsigned short SYNTAX_ERR = 12;
const unsigned short INVALID_MODIFICATION_ERR = 13;
const unsigned short NAMESPACE_ERR = 14;
const unsigned short INVALID_ACCESS_ERR = 15;
const unsigned short VALIDATION_ERR = 16; // historical
const unsigned short TYPE_MISMATCH_ERR = 17;
const unsigned short SECURITY_ERR = 18;
const unsigned short NETWORK_ERR = 19;
const unsigned short ABORT_ERR = 20;
const unsigned short URL_MISMATCH_ERR = 21;
const unsigned short QUOTA_EXCEEDED_ERR = 22;
const unsigned short TIMEOUT_ERR = 23;
const unsigned short INVALID_NODE_TYPE_ERR = 24;
const unsigned short DATA_CLONE_ERR = 25;
const unsigned short INVALID_POINTER_ERR = 26;
readonly attribute unsigned short code;
};

View File

@ -144,8 +144,6 @@ MediaEMEInsecureContextDeprecatedWarning=Using Encrypted Media Extensions at %S
MediaEMENoCapabilitiesDeprecatedWarning=Calling navigator.requestMediaKeySystemAccess() (at %S) without passing a candidate MediaKeySystemConfiguration containing audioCapabilities or videoCapabilities is deprecated and will soon become unsupported.
# LOCALIZATION NOTE: %S is the URL of the web page which is calling web APIs without passing data (a "codecs" string in the "contentType") that will soon be required. See https://bugzilla.mozilla.org/show_bug.cgi?id=1368583#c21 for explanation of this string.
MediaEMENoCodecsDeprecatedWarning=Calling navigator.requestMediaKeySystemAccess() (at %S) passing a candidate MediaKeySystemConfiguration containing audioCapabilities or videoCapabilities without a contentType with a “codecs” string is deprecated and will soon become unsupported.
# LOCALIZATION NOTE: Do not translate "DOMException", "code" and "name"
DOMExceptionCodeWarning=Use of DOMExceptions code attribute is deprecated. Use name instead.
# LOCALIZATION NOTE: Do not translate "Mutation Event" and "MutationObserver"
MutationEventWarning=Use of Mutation Events is deprecated. Use MutationObserver instead.
# LOCALIZATION NOTE: Do not translate "Components"