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

Side by Side Diff: sky/engine/core/html/HTMLElement.h

Issue 942933003: Remove almost all clients of isHTMLElement (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 10 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 unified diff | Download patch
OLDNEW
1 /* 1 /*
2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org) 2 * Copyright (C) 1999 Lars Knoll (knoll@kde.org)
3 * (C) 1999 Antti Koivisto (koivisto@kde.org) 3 * (C) 1999 Antti Koivisto (koivisto@kde.org)
4 * Copyright (C) 2004-2007, 2009, 2014 Apple Inc. All rights reserved. 4 * Copyright (C) 2004-2007, 2009, 2014 Apple Inc. All rights reserved.
5 * 5 *
6 * This library is free software; you can redistribute it and/or 6 * This library is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU Library General Public 7 * modify it under the terms of the GNU Library General Public
8 * License as published by the Free Software Foundation; either 8 * License as published by the Free Software Foundation; either
9 * version 2 of the License, or (at your option) any later version. 9 * version 2 of the License, or (at your option) any later version.
10 * 10 *
(...skipping 38 matching lines...) Expand 10 before | Expand all | Expand 10 after
49 : Element(tagName, &document, type) 49 : Element(tagName, &document, type)
50 { 50 {
51 ASSERT(!tagName.localName().isNull()); 51 ASSERT(!tagName.localName().isNull());
52 } 52 }
53 53
54 // This requires isHTML*Element(const Element&) and isHTML*Element(const HTMLEle ment&). 54 // This requires isHTML*Element(const Element&) and isHTML*Element(const HTMLEle ment&).
55 // When the input element is an HTMLElement, we don't need to check the namespac e URI, just the local name. 55 // When the input element is an HTMLElement, we don't need to check the namespac e URI, just the local name.
56 #define DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \ 56 #define DEFINE_HTMLELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) \
57 inline bool is##thisType(const thisType* element); \ 57 inline bool is##thisType(const thisType* element); \
58 inline bool is##thisType(const thisType& element); \ 58 inline bool is##thisType(const thisType& element); \
59 inline bool is##thisType(const HTMLElement* element) { return element && is# #thisType(*element); } \ 59 inline bool is##thisType(const Node& node) { return node.isElementNode() ? i s##thisType(toElement(node)) : false; } \
60 inline bool is##thisType(const Node& node) { return node.isHTMLElement() ? i s##thisType(toHTMLElement(node)) : false; } \
61 inline bool is##thisType(const Node* node) { return node && is##thisType(*no de); } \ 60 inline bool is##thisType(const Node* node) { return node && is##thisType(*no de); } \
62 inline bool is##thisType(const Element* element) { return element && is##thi sType(*element); } \ 61 inline bool is##thisType(const Element* element) { return element && is##thi sType(*element); } \
63 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r eturn is##thisType(node.get()); } \ 62 template<typename T> inline bool is##thisType(const PassRefPtr<T>& node) { r eturn is##thisType(node.get()); } \
64 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur n is##thisType(node.get()); } \ 63 template<typename T> inline bool is##thisType(const RefPtr<T>& node) { retur n is##thisType(node.get()); } \
65 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e lement) { return is##thisType(element); } \ 64 template <> inline bool isElementOfType<const thisType>(const HTMLElement& e lement) { return is##thisType(element); } \
66 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType) 65 DEFINE_ELEMENT_TYPE_CASTS_WITH_FUNCTION(thisType)
67 66
68 } // namespace blink 67 } // namespace blink
69 68
70 #include "gen/sky/core/HTMLElementTypeHelpers.h" 69 #include "gen/sky/core/HTMLElementTypeHelpers.h"
71 70
72 #endif // SKY_ENGINE_CORE_HTML_HTMLELEMENT_H_ 71 #endif // SKY_ENGINE_CORE_HTML_HTMLELEMENT_H_
OLDNEW
« no previous file with comments | « sky/engine/core/editing/htmlediting.cpp ('k') | sky/engine/core/html/parser/HTMLConstructionSite.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698