OLD | NEW |
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 * (C) 2001 Peter Kelly (pmk@post.com) | 4 * (C) 2001 Peter Kelly (pmk@post.com) |
5 * (C) 2001 Dirk Mueller (mueller@kde.org) | 5 * (C) 2001 Dirk Mueller (mueller@kde.org) |
6 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved. | 6 * Copyright (C) 2003-2011, 2013, 2014 Apple Inc. All rights reserved. |
7 * | 7 * |
8 * This library is free software; you can redistribute it and/or | 8 * This library is free software; you can redistribute it and/or |
9 * modify it under the terms of the GNU Library General Public | 9 * modify it under the terms of the GNU Library General Public |
10 * License as published by the Free Software Foundation; either | 10 * License as published by the Free Software Foundation; either |
(...skipping 221 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
232 bool hasTagName(const HTMLQualifiedName& tagName) const { return ContainerNo
de::hasTagName(tagName); } | 232 bool hasTagName(const HTMLQualifiedName& tagName) const { return ContainerNo
de::hasTagName(tagName); } |
233 bool hasTagName(const SVGQualifiedName& tagName) const { return ContainerNod
e::hasTagName(tagName); } | 233 bool hasTagName(const SVGQualifiedName& tagName) const { return ContainerNod
e::hasTagName(tagName); } |
234 | 234 |
235 // Should be called only by Document::createElementNS to fix up m_tagName im
mediately after construction. | 235 // Should be called only by Document::createElementNS to fix up m_tagName im
mediately after construction. |
236 void setTagNameForCreateElementNS(const QualifiedName&); | 236 void setTagNameForCreateElementNS(const QualifiedName&); |
237 | 237 |
238 // A fast function for checking the local name against another atomic string
. | 238 // A fast function for checking the local name against another atomic string
. |
239 bool hasLocalName(const AtomicString& other) const { return m_tagName.localN
ame() == other; } | 239 bool hasLocalName(const AtomicString& other) const { return m_tagName.localN
ame() == other; } |
240 | 240 |
241 virtual const AtomicString& localName() const override final { return m_tagN
ame.localName(); } | 241 virtual const AtomicString& localName() const override final { return m_tagN
ame.localName(); } |
| 242 AtomicString localNameForSelectorMatching() const; |
242 const AtomicString& prefix() const { return m_tagName.prefix(); } | 243 const AtomicString& prefix() const { return m_tagName.prefix(); } |
243 virtual const AtomicString& namespaceURI() const override final { return m_t
agName.namespaceURI(); } | 244 virtual const AtomicString& namespaceURI() const override final { return m_t
agName.namespaceURI(); } |
244 | 245 |
245 const AtomicString& locateNamespacePrefix(const AtomicString& namespaceURI)
const; | 246 const AtomicString& locateNamespacePrefix(const AtomicString& namespaceURI)
const; |
246 | 247 |
247 virtual KURL baseURI() const override final; | 248 virtual KURL baseURI() const override final; |
248 | 249 |
249 virtual String nodeName() const override; | 250 virtual String nodeName() const override; |
250 | 251 |
251 PassRefPtrWillBeRawPtr<Element> cloneElementWithChildren(); | 252 PassRefPtrWillBeRawPtr<Element> cloneElementWithChildren(); |
(...skipping 587 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
839 } | 840 } |
840 | 841 |
841 inline void Element::setTagNameForCreateElementNS(const QualifiedName& tagName) | 842 inline void Element::setTagNameForCreateElementNS(const QualifiedName& tagName) |
842 { | 843 { |
843 // We expect this method to be called only to reset the prefix. | 844 // We expect this method to be called only to reset the prefix. |
844 ASSERT(tagName.localName() == m_tagName.localName()); | 845 ASSERT(tagName.localName() == m_tagName.localName()); |
845 ASSERT(tagName.namespaceURI() == m_tagName.namespaceURI()); | 846 ASSERT(tagName.namespaceURI() == m_tagName.namespaceURI()); |
846 m_tagName = tagName; | 847 m_tagName = tagName; |
847 } | 848 } |
848 | 849 |
| 850 inline AtomicString Element::localNameForSelectorMatching() const |
| 851 { |
| 852 if (isHTMLElement() || !document().isHTMLDocument()) |
| 853 return localName(); |
| 854 return localName().lower(); |
| 855 } |
| 856 |
849 inline bool isShadowHost(const Node* node) | 857 inline bool isShadowHost(const Node* node) |
850 { | 858 { |
851 return node && node->isElementNode() && toElement(node)->shadow(); | 859 return node && node->isElementNode() && toElement(node)->shadow(); |
852 } | 860 } |
853 | 861 |
854 inline bool isShadowHost(const Node& node) | 862 inline bool isShadowHost(const Node& node) |
855 { | 863 { |
856 return node.isElementNode() && toElement(node).shadow(); | 864 return node.isElementNode() && toElement(node).shadow(); |
857 } | 865 } |
858 | 866 |
(...skipping 40 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
899 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&) | 907 static PassRefPtrWillBeRawPtr<T> create(const QualifiedName&, Document&) |
900 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ | 908 #define DEFINE_ELEMENT_FACTORY_WITH_TAGNAME(T) \ |
901 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document&
document) \ | 909 PassRefPtrWillBeRawPtr<T> T::create(const QualifiedName& tagName, Document&
document) \ |
902 { \ | 910 { \ |
903 return adoptRefWillBeNoop(new T(tagName, document)); \ | 911 return adoptRefWillBeNoop(new T(tagName, document)); \ |
904 } | 912 } |
905 | 913 |
906 } // namespace | 914 } // namespace |
907 | 915 |
908 #endif // Element_h | 916 #endif // Element_h |
OLD | NEW |