Clean up static_cast<Element*> usage

https://bugs.webkit.org/show_bug.cgi?id=124133

Reviewed by Andreas Kling.

We need to use toFoo cast function instead of static_cast<>. Though there is toElement(),
static_cast<Element*> is still being used.

No new tests, no behavior changes.

* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* dom/ElementTraversal.h:
(WebCore::::lastWithinTemplate):
(WebCore::::nextTemplate):
(WebCore::::previousTemplate):


git-svn-id: http://svn.webkit.org/repository/webkit/trunk@159092 268f45cc-cd09-0410-ab3c-d52691b4dbfc
parent 9a5ab80f
2013-11-11 Gyuyoung Kim <gyuyoung.kim@samsung.com>
Clean up static_cast<Element*> usage
https://bugs.webkit.org/show_bug.cgi?id=124133
Reviewed by Andreas Kling.
We need to use toFoo cast function instead of static_cast<>. Though there is toElement(),
static_cast<Element*> is still being used.
No new tests, no behavior changes.
* bindings/gobject/WebKitDOMPrivate.cpp:
(WebKit::wrap):
* dom/ElementTraversal.h:
(WebCore::::lastWithinTemplate):
(WebCore::::nextTemplate):
(WebCore::::previousTemplate):
2013-11-11 Anders Carlsson <andersca@apple.com>
FrameFilter can just be an std::function instead
......
......@@ -78,7 +78,7 @@ WebKitDOMNode* wrap(Node* node)
case Node::ELEMENT_NODE:
if (node->isHTMLElement())
return WEBKIT_DOM_NODE(wrap(toHTMLElement(node)));
return WEBKIT_DOM_NODE(wrapElement(static_cast<Element*>(node)));
return WEBKIT_DOM_NODE(wrapElement(toElement(node)));
case Node::ATTRIBUTE_NODE:
return WEBKIT_DOM_NODE(wrapAttr(static_cast<Attr*>(node)));
case Node::TEXT_NODE:
......
......@@ -109,7 +109,7 @@ inline Element* Traversal<Element>::lastWithinTemplate(CurrentType* current)
Node* node = NodeTraversal::last(current);
while (node && !node->isElementNode())
node = NodeTraversal::previous(node, current);
return static_cast<Element*>(node);
return toElement(node);
}
template <>
......@@ -119,7 +119,7 @@ inline Element* Traversal<Element>::nextTemplate(CurrentType* current)
Node* node = NodeTraversal::next(current);
while (node && !node->isElementNode())
node = NodeTraversal::nextSkippingChildren(node);
return static_cast<Element*>(node);
return toElement(node);
}
template <>
......@@ -129,7 +129,7 @@ inline Element* Traversal<Element>::nextTemplate(CurrentType* current, const Nod
Node* node = NodeTraversal::next(current, stayWithin);
while (node && !node->isElementNode())
node = NodeTraversal::nextSkippingChildren(node, stayWithin);
return static_cast<Element*>(node);
return toElement(node);
}
template <>
......@@ -139,7 +139,7 @@ inline Element* Traversal<Element>::previousTemplate(CurrentType* current)
Node* node = NodeTraversal::previous(current);
while (node && !node->isElementNode())
node = NodeTraversal::previous(node);
return static_cast<Element*>(node);
return toElement(node);
}
template <>
......@@ -149,7 +149,7 @@ inline Element* Traversal<Element>::previousTemplate(CurrentType* current, const
Node* node = NodeTraversal::previous(current, stayWithin);
while (node && !node->isElementNode())
node = NodeTraversal::previous(node, stayWithin);
return static_cast<Element*>(node);
return toElement(node);
}
// Generic versions.
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment