From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/dom/DocumentOrderedMap.h | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) (limited to 'Source/WebCore/dom/DocumentOrderedMap.h') diff --git a/Source/WebCore/dom/DocumentOrderedMap.h b/Source/WebCore/dom/DocumentOrderedMap.h index 221297bdd..46a5106ef 100644 --- a/Source/WebCore/dom/DocumentOrderedMap.h +++ b/Source/WebCore/dom/DocumentOrderedMap.h @@ -28,11 +28,10 @@ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ -#ifndef DocumentOrderedMap_h -#define DocumentOrderedMap_h +#pragma once -#include #include +#include #include #include @@ -45,6 +44,7 @@ class HTMLMapElement; class TreeScope; class DocumentOrderedMap { + WTF_MAKE_FAST_ALLOCATED; public: void add(const AtomicStringImpl&, Element&, const TreeScope&); void remove(const AtomicStringImpl&, Element&); @@ -58,8 +58,7 @@ public: Element* getElementById(const AtomicStringImpl&, const TreeScope&) const; Element* getElementByName(const AtomicStringImpl&, const TreeScope&) const; HTMLMapElement* getElementByMapName(const AtomicStringImpl&, const TreeScope&) const; - HTMLMapElement* getElementByLowercasedMapName(const AtomicStringImpl&, const TreeScope&) const; - HTMLImageElement* getElementByLowercasedUsemap(const AtomicStringImpl&, const TreeScope&) const; + HTMLImageElement* getElementByUsemap(const AtomicStringImpl&, const TreeScope&) const; HTMLLabelElement* getElementByLabelForAttribute(const AtomicStringImpl&, const TreeScope&) const; Element* getElementByWindowNamedItem(const AtomicStringImpl&, const TreeScope&) const; Element* getElementByDocumentNamedItem(const AtomicStringImpl&, const TreeScope&) const; @@ -67,21 +66,22 @@ public: const Vector* getAllElementsById(const AtomicStringImpl&, const TreeScope&) const; private: - template Element* get(const AtomicStringImpl&, const TreeScope&) const; + template + Element* get(const AtomicStringImpl&, const TreeScope&, const KeyMatchingFunction&) const; struct MapEntry { - MapEntry() - : element(0) - , count(0) - { } + MapEntry() { } explicit MapEntry(Element* firstElement) : element(firstElement) , count(1) { } - Element* element; - unsigned count; + Element* element { nullptr }; + unsigned count { 0 }; Vector orderedList; +#if !ASSERT_DISABLED || ENABLE(SECURITY_ASSERTIONS) + HashSet registeredElements; +#endif }; typedef HashMap Map; @@ -107,5 +107,3 @@ inline bool DocumentOrderedMap::containsMultiple(const AtomicStringImpl& id) con } } // namespace WebCore - -#endif // DocumentOrderedMap_h -- cgit v1.2.1