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

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

Issue 298063010: Remove the Element.prefix setter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove Attribute::setPrefix Created 6 years, 7 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/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/dom/Element.cpp
diff --git a/Source/core/dom/Element.cpp b/Source/core/dom/Element.cpp
index 6fda57079b921222b9414a5b413edf4afd405399..ec0cf48e2e12921326de1ce279b53e3260d3863c 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1199,34 +1199,6 @@ String Element::nodeName() const
return m_tagName.toString();
}
-void Element::setPrefix(const AtomicString& prefix, ExceptionState& exceptionState)
-{
- UseCounter::count(document(), UseCounter::ElementSetPrefix);
-
- if (!prefix.isEmpty() && !Document::isValidName(prefix)) {
- exceptionState.throwDOMException(InvalidCharacterError, "The prefix '" + prefix + "' is not a valid name.");
- return;
- }
-
- // FIXME: Raise NamespaceError if prefix is malformed per the Namespaces in XML specification.
-
- const AtomicString& nodeNamespaceURI = namespaceURI();
- if (nodeNamespaceURI.isEmpty() && !prefix.isEmpty()) {
- exceptionState.throwDOMException(NamespaceError, "No namespace is set, so a namespace prefix may not be set.");
- return;
- }
-
- if (prefix == xmlAtom && nodeNamespaceURI != XMLNames::xmlNamespaceURI) {
- exceptionState.throwDOMException(NamespaceError, "The prefix '" + xmlAtom + "' may not be set on namespace '" + nodeNamespaceURI + "'.");
- return;
- }
-
- if (exceptionState.hadException())
- return;
-
- m_tagName.setPrefix(prefix.isEmpty() ? AtomicString() : prefix);
-}
-
const AtomicString& Element::locateNamespacePrefix(const AtomicString& namespaceToLocate) const
{
if (!prefix().isNull() && namespaceURI() == namespaceToLocate)
« no previous file with comments | « Source/core/dom/Element.h ('k') | Source/core/dom/Element.idl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698