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

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

Issue 16879016: Use toElement instead of static_cast<Element*> and static_cast<const Element*> (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
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
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 1945ff6869b8947f49c4e5f4aa783f8165ec5461..f1ee9570e52e282ab4235f944e91fe233c0dcb41 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -1538,7 +1538,7 @@ String Node::lookupPrefix(const AtomicString &namespaceURI) const
switch (nodeType()) {
case ELEMENT_NODE:
- return lookupNamespacePrefix(namespaceURI, static_cast<const Element *>(this));
+ return lookupNamespacePrefix(namespaceURI, toElement(this));
case DOCUMENT_NODE:
if (Element* de = toDocument(this)->documentElement())
return de->lookupPrefix(namespaceURI);
@@ -1571,7 +1571,7 @@ String Node::lookupNamespaceURI(const String &prefix) const
switch (nodeType()) {
case ELEMENT_NODE: {
- const Element *elem = static_cast<const Element *>(this);
+ const Element *elem = toElement(this);
if (!elem->namespaceURI().isNull() && elem->prefix() == prefix)
return elem->namespaceURI();

Powered by Google App Engine
This is Rietveld 408576698