Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(623)

Unified Diff: Source/core/dom/Document.cpp

Issue 18548003: Rename ExceptionCode constants to use the names in the spec (2/3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 7 years, 6 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/dom/DatasetDOMStringMap.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Document.cpp
diff --git a/Source/core/dom/Document.cpp b/Source/core/dom/Document.cpp
index 2e91820cc29f83f4ab6d8ff9d2d0defce76aff21..10f8c84d9ab574f2ddc6c0b10e1db98f5f69a7a1 100644
--- a/Source/core/dom/Document.cpp
+++ b/Source/core/dom/Document.cpp
@@ -783,7 +783,7 @@ PassRefPtr<Element> Document::createElementNS(const AtomicString& namespaceURI,
QualifiedName qName(prefix, localName, namespaceURI);
if (!hasValidNamespaceForElements(qName)) {
- ec = NAMESPACE_ERR;
+ ec = NamespaceError;
return 0;
}
@@ -913,7 +913,7 @@ PassRefPtr<Node> Document::importNode(Node* importedNode, bool deep, ExceptionCo
// FIXME: The following check might be unnecessary. Is it possible that
// oldElement has mismatched prefix/namespace?
if (!hasValidNamespaceForElements(oldElement->tagQName())) {
- ec = NAMESPACE_ERR;
+ ec = NamespaceError;
return 0;
}
RefPtr<Element> newElement = createElement(oldElement->tagQName(), false);
@@ -1112,7 +1112,7 @@ PassRefPtr<Element> Document::createElementNS(const String& namespaceURI, const
QualifiedName qName(prefix, localName, namespaceURI);
if (!hasValidNamespaceForElements(qName)) {
- ec = NAMESPACE_ERR;
+ ec = NamespaceError;
return 0;
}
@@ -3609,11 +3609,11 @@ String Document::cookie(ExceptionCode& ec) const
return String();
// FIXME: The HTML5 DOM spec states that this attribute can raise an
- // INVALID_STATE_ERR exception on getting if the Document has no
+ // InvalidStateError exception on getting if the Document has no
// browsing context.
if (!securityOrigin()->canAccessCookies()) {
- ec = SECURITY_ERR;
+ ec = SecurityError;
return String();
}
@@ -3630,11 +3630,11 @@ void Document::setCookie(const String& value, ExceptionCode& ec)
return;
// FIXME: The HTML5 DOM spec states that this attribute can raise an
- // INVALID_STATE_ERR exception on setting if the Document has no
+ // InvalidStateError exception on setting if the Document has no
// browsing context.
if (!securityOrigin()->canAccessCookies()) {
- ec = SECURITY_ERR;
+ ec = SecurityError;
return;
}
@@ -3660,7 +3660,7 @@ String Document::domain() const
void Document::setDomain(const String& newDomain, ExceptionCode& ec)
{
if (SchemeRegistry::isDomainRelaxationForbiddenForURLScheme(securityOrigin()->protocol())) {
- ec = SECURITY_ERR;
+ ec = SecurityError;
return;
}
@@ -3686,14 +3686,14 @@ void Document::setDomain(const String& newDomain, ExceptionCode& ec)
int newLength = newDomain.length();
// e.g. newDomain = webkit.org (10) and domain() = www.webkit.org (14)
if (newLength >= oldLength) {
- ec = SECURITY_ERR;
+ ec = SecurityError;
return;
}
String test = domain();
// Check that it's a subdomain, not e.g. "ebkit.org"
if (test[oldLength - newLength - 1] != '.') {
- ec = SECURITY_ERR;
+ ec = SecurityError;
return;
}
@@ -3701,7 +3701,7 @@ void Document::setDomain(const String& newDomain, ExceptionCode& ec)
// and we check that it's the same thing as newDomain
test.remove(0, oldLength - newLength);
if (test != newDomain) {
- ec = SECURITY_ERR;
+ ec = SecurityError;
return;
}
@@ -3821,7 +3821,7 @@ bool Document::parseQualifiedName(const String& qualifiedName, String& prefix, S
U16_NEXT(s, i, length, c)
if (c == ':') {
if (sawColon) {
- ec = NAMESPACE_ERR;
+ ec = NamespaceError;
return false; // multiple colons: not allowed
}
nameStart = true;
@@ -3847,14 +3847,14 @@ bool Document::parseQualifiedName(const String& qualifiedName, String& prefix, S
} else {
prefix = qualifiedName.substring(0, colonPos);
if (prefix.isEmpty()) {
- ec = NAMESPACE_ERR;
+ ec = NamespaceError;
return false;
}
localName = qualifiedName.substring(colonPos + 1);
}
if (localName.isEmpty()) {
- ec = NAMESPACE_ERR;
+ ec = NamespaceError;
return false;
}
@@ -4053,7 +4053,7 @@ PassRefPtr<Attr> Document::createAttributeNS(const String& namespaceURI, const S
QualifiedName qName(prefix, localName, namespaceURI);
if (!shouldIgnoreNamespaceChecks && !hasValidNamespaceForAttributes(qName)) {
- ec = NAMESPACE_ERR;
+ ec = NamespaceError;
return 0;
}
« no previous file with comments | « Source/core/dom/DatasetDOMStringMap.cpp ('k') | Source/core/dom/Element.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698