summaryrefslogtreecommitdiff
path: root/Source/WebCore/dom/ElementAncestorIterator.h
diff options
context:
space:
mode:
Diffstat (limited to 'Source/WebCore/dom/ElementAncestorIterator.h')
-rw-r--r--Source/WebCore/dom/ElementAncestorIterator.h19
1 files changed, 8 insertions, 11 deletions
diff --git a/Source/WebCore/dom/ElementAncestorIterator.h b/Source/WebCore/dom/ElementAncestorIterator.h
index 6125cb8e0..4b62d38b3 100644
--- a/Source/WebCore/dom/ElementAncestorIterator.h
+++ b/Source/WebCore/dom/ElementAncestorIterator.h
@@ -23,8 +23,7 @@
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
-#ifndef ElementAncestorIterator_h
-#define ElementAncestorIterator_h
+#pragma once
#include "ElementIterator.h"
@@ -76,8 +75,8 @@ ElementAncestorIteratorAdapter<Element> elementAncestors(Element* descendant);
ElementAncestorConstIteratorAdapter<Element> elementAncestors(const Element* descendant);
template <typename ElementType> ElementAncestorIteratorAdapter<ElementType> lineageOfType(Element& first);
template <typename ElementType> ElementAncestorConstIteratorAdapter<ElementType> lineageOfType(const Element& first);
-template <typename ElementType> ElementAncestorIteratorAdapter<ElementType> ancestorsOfType(Element& descendant);
-template <typename ElementType> ElementAncestorConstIteratorAdapter<ElementType> ancestorsOfType(const Element& descendant);
+template <typename ElementType> ElementAncestorIteratorAdapter<ElementType> ancestorsOfType(Node& descendant);
+template <typename ElementType> ElementAncestorConstIteratorAdapter<ElementType> ancestorsOfType(const Node& descendant);
// ElementAncestorIterator
@@ -184,7 +183,7 @@ inline ElementAncestorConstIteratorAdapter<Element> elementAncestors(const Eleme
template <typename ElementType>
inline ElementAncestorIteratorAdapter<ElementType> lineageOfType(Element& first)
{
- if (isElementOfType<const ElementType>(first))
+ if (is<ElementType>(first))
return ElementAncestorIteratorAdapter<ElementType>(static_cast<ElementType*>(&first));
return ancestorsOfType<ElementType>(first);
}
@@ -192,25 +191,23 @@ inline ElementAncestorIteratorAdapter<ElementType> lineageOfType(Element& first)
template <typename ElementType>
inline ElementAncestorConstIteratorAdapter<ElementType> lineageOfType(const Element& first)
{
- if (isElementOfType<const ElementType>(first))
+ if (is<ElementType>(first))
return ElementAncestorConstIteratorAdapter<ElementType>(static_cast<const ElementType*>(&first));
return ancestorsOfType<ElementType>(first);
}
template <typename ElementType>
-inline ElementAncestorIteratorAdapter<ElementType> ancestorsOfType(Element& descendant)
+inline ElementAncestorIteratorAdapter<ElementType> ancestorsOfType(Node& descendant)
{
ElementType* first = findElementAncestorOfType<ElementType>(descendant);
return ElementAncestorIteratorAdapter<ElementType>(first);
}
template <typename ElementType>
-inline ElementAncestorConstIteratorAdapter<ElementType> ancestorsOfType(const Element& descendant)
+inline ElementAncestorConstIteratorAdapter<ElementType> ancestorsOfType(const Node& descendant)
{
const ElementType* first = findElementAncestorOfType<const ElementType>(descendant);
return ElementAncestorConstIteratorAdapter<ElementType>(first);
}
-}
-
-#endif
+} // namespace WebCore