summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/webkit/WebCore/dom/ExceptionCode.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/webkit/WebCore/dom/ExceptionCode.cpp')
-rw-r--r--src/3rdparty/webkit/WebCore/dom/ExceptionCode.cpp60
1 files changed, 60 insertions, 0 deletions
diff --git a/src/3rdparty/webkit/WebCore/dom/ExceptionCode.cpp b/src/3rdparty/webkit/WebCore/dom/ExceptionCode.cpp
index 0291a211ff..7bb8a50a06 100644
--- a/src/3rdparty/webkit/WebCore/dom/ExceptionCode.cpp
+++ b/src/3rdparty/webkit/WebCore/dom/ExceptionCode.cpp
@@ -65,25 +65,70 @@ static const char* const exceptionNames[] = {
"QUOTA_EXCEEDED_ERR"
};
+static const char* const exceptionDescriptions[] = {
+ "Index or size was negative, or greater than the allowed value.",
+ "The specified range of text did not fit into a DOMString.",
+ "A Node was inserted somewhere it doesn't belong.",
+ "A Node was used in a different document than the one that created it (that doesn't support it).",
+ "An invalid or illegal character was specified, such as in an XML name.",
+ "Data was specified for a Node which does not support data.",
+ "An attempt was made to modify an object where modifications are not allowed.",
+ "An attempt was made to reference a Node in a context where it does not exist.",
+ "The implementation did not support the requested type of object or operation.",
+ "An attempt was made to add an attribute that is already in use elsewhere.",
+ "An attempt was made to use an object that is not, or is no longer, usable.",
+ "An invalid or illegal string was specified.",
+ "An attempt was made to modify the type of the underlying object.",
+ "An attempt was made to create or change an object in a way which is incorrect with regard to namespaces.",
+ "A parameter or an operation was not supported by the underlying object.",
+ "A call to a method such as insertBefore or removeChild would make the Node invalid with respect to \"partial validity\", this exception would be raised and the operation would not be done.",
+ "The type of an object was incompatible with the expected type of the parameter associated to the object.",
+ "An attempt was made to break through the security policy of the user agent.",
+ // FIXME: Couldn't find a description in the HTML/DOM specifications for NETWORK_ERR, ABORT_ERR, URL_MISMATCH_ERR, and QUOTA_EXCEEDED_ERR
+ "A network error occured.",
+ "The user aborted a request.",
+ "A worker global scope represented an absolute URL that is not equal to the resulting absolute URL.",
+ "An attempt was made to add something to storage that exceeded the quota."
+};
+
static const char* const rangeExceptionNames[] = {
"BAD_BOUNDARYPOINTS_ERR",
"INVALID_NODE_TYPE_ERR"
};
+static const char* const rangeExceptionDescriptions[] = {
+ "The boundary-points of a Range did not meet specific requirements.",
+ "The container of an boundary-point of a Range was being set to either a node of an invalid type or a node with an ancestor of an invalid type."
+};
+
static const char* const eventExceptionNames[] = {
"UNSPECIFIED_EVENT_TYPE_ERR"
};
+static const char* const eventExceptionDescriptions[] = {
+ "The Event's type was not specified by initializing the event before the method was called."
+};
+
static const char* const xmlHttpRequestExceptionNames[] = {
"NETWORK_ERR",
"ABORT_ERR"
};
+static const char* const xmlHttpRequestExceptionDescriptions[] = {
+ "A network error occured in synchronous requests.",
+ "The user aborted a request in synchronous requests."
+};
+
#if ENABLE(XPATH)
static const char* const xpathExceptionNames[] = {
"INVALID_EXPRESSION_ERR",
"TYPE_ERR"
};
+
+static const char* const xpathExceptionDescriptions[] = {
+ "The expression had a syntax error or otherwise is not a legal expression according to the rules of the specific XPathEvaluator.",
+ "The expression could not be converted to return the specified type."
+};
#endif
#if ENABLE(SVG)
@@ -92,6 +137,12 @@ static const char* const svgExceptionNames[] = {
"SVG_INVALID_VALUE_ERR",
"SVG_MATRIX_NOT_INVERTABLE"
};
+
+static const char* const svgExceptionDescriptions[] = {
+ "An object of the wrong type was passed to an operation.",
+ "An invalid value was passed to an operation or assigned to an attribute.",
+ "An attempt was made to invert a matrix that is not invertible."
+};
#endif
void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& description)
@@ -101,6 +152,7 @@ void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& des
const char* typeName;
int code = ec;
const char* const* nameTable;
+ const char* const* descriptionTable;
int nameTableSize;
int nameTableOffset;
ExceptionType type;
@@ -110,6 +162,7 @@ void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& des
typeName = "DOM Range";
code -= RangeException::RangeExceptionOffset;
nameTable = rangeExceptionNames;
+ descriptionTable = rangeExceptionDescriptions;
nameTableSize = sizeof(rangeExceptionNames) / sizeof(rangeExceptionNames[0]);
nameTableOffset = RangeException::BAD_BOUNDARYPOINTS_ERR;
} else if (code >= EventException::EventExceptionOffset && code <= EventException::EventExceptionMax) {
@@ -117,6 +170,7 @@ void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& des
typeName = "DOM Events";
code -= EventException::EventExceptionOffset;
nameTable = eventExceptionNames;
+ descriptionTable = eventExceptionDescriptions;
nameTableSize = sizeof(eventExceptionNames) / sizeof(eventExceptionNames[0]);
nameTableOffset = EventException::UNSPECIFIED_EVENT_TYPE_ERR;
} else if (code >= XMLHttpRequestException::XMLHttpRequestExceptionOffset && code <= XMLHttpRequestException::XMLHttpRequestExceptionMax) {
@@ -124,6 +178,7 @@ void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& des
typeName = "XMLHttpRequest";
code -= XMLHttpRequestException::XMLHttpRequestExceptionOffset;
nameTable = xmlHttpRequestExceptionNames;
+ descriptionTable = xmlHttpRequestExceptionDescriptions;
nameTableSize = sizeof(xmlHttpRequestExceptionNames) / sizeof(xmlHttpRequestExceptionNames[0]);
// XMLHttpRequest exception codes start with 101 and we don't want 100 empty elements in the name array
nameTableOffset = XMLHttpRequestException::NETWORK_ERR;
@@ -133,6 +188,7 @@ void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& des
typeName = "DOM XPath";
code -= XPathException::XPathExceptionOffset;
nameTable = xpathExceptionNames;
+ descriptionTable = xpathExceptionDescriptions;
nameTableSize = sizeof(xpathExceptionNames) / sizeof(xpathExceptionNames[0]);
// XPath exception codes start with 51 and we don't want 51 empty elements in the name array
nameTableOffset = XPathException::INVALID_EXPRESSION_ERR;
@@ -143,6 +199,7 @@ void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& des
typeName = "DOM SVG";
code -= SVGException::SVGExceptionOffset;
nameTable = svgExceptionNames;
+ descriptionTable = svgExceptionDescriptions;
nameTableSize = sizeof(svgExceptionNames) / sizeof(svgExceptionNames[0]);
nameTableOffset = SVGException::SVG_WRONG_TYPE_ERR;
#endif
@@ -150,17 +207,20 @@ void getExceptionCodeDescription(ExceptionCode ec, ExceptionCodeDescription& des
type = DOMExceptionType;
typeName = "DOM";
nameTable = exceptionNames;
+ descriptionTable = exceptionDescriptions;
nameTableSize = sizeof(exceptionNames) / sizeof(exceptionNames[0]);
nameTableOffset = INDEX_SIZE_ERR;
}
description.typeName = typeName;
description.name = (ec >= nameTableOffset && ec - nameTableOffset < nameTableSize) ? nameTable[ec - nameTableOffset] : 0;
+ description.description = (ec >= nameTableOffset && ec - nameTableOffset < nameTableSize) ? descriptionTable[ec - nameTableOffset] : 0;
description.code = code;
description.type = type;
// All exceptions used in the DOM code should have names.
ASSERT(description.name);
+ ASSERT(description.description);
}
} // namespace WebCore