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

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

Issue 688333002: Remove the Element.prefix setter (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebase Created 6 years, 1 month 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 1df94f8a62fa78e882246d91a7362162188f8a1a..023c8502de685fe77ee043a506c635694f3f268a 100644
--- a/Source/core/dom/Element.cpp
+++ b/Source/core/dom/Element.cpp
@@ -1164,34 +1164,6 @@ String Element::nodeName() const
return m_tagName.toString();
}
-void Element::setPrefix(const AtomicString& prefix, ExceptionState& exceptionState)
-{
- UseCounter::countDeprecation(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