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

Side by Side Diff: Source/core/html/HTMLCollection.h

Issue 158563004: Make HTMLAllCollection named property getter behave more according to spec (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Fix linking error Created 6 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 | Annotate | Revision Log
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) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All r ights reserved. 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All r ights reserved.
5 * Copyright (C) 2014 Samsung Electronics. All rights reserved. 5 * Copyright (C) 2014 Samsung Electronics. All rights reserved.
6 * 6 *
7 * This library is free software; you can redistribute it and/or 7 * This library is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU Library General Public 8 * modify it under the terms of the GNU Library General Public
9 * License as published by the Free Software Foundation; either 9 * License as published by the Free Software Foundation; either
10 * version 2 of the License, or (at your option) any later version. 10 * version 2 of the License, or (at your option) any later version.
(...skipping 61 matching lines...) Expand 10 before | Expand all | Expand 10 after
72 virtual void updateNameCache() const; 72 virtual void updateNameCache() const;
73 bool hasNameCache() const { return m_isNameCacheValid; } 73 bool hasNameCache() const { return m_isNameCacheValid; }
74 void setHasNameCache() const { m_isNameCacheValid = true; } 74 void setHasNameCache() const { m_isNameCacheValid = true; }
75 75
76 typedef HashMap<StringImpl*, OwnPtr<Vector<Element*> > > NodeCacheMap; 76 typedef HashMap<StringImpl*, OwnPtr<Vector<Element*> > > NodeCacheMap;
77 Vector<Element*>* idCache(const AtomicString& name) const { return m_idCache .get(name.impl()); } 77 Vector<Element*>* idCache(const AtomicString& name) const { return m_idCache .get(name.impl()); }
78 Vector<Element*>* nameCache(const AtomicString& name) const { return m_nameC ache.get(name.impl()); } 78 Vector<Element*>* nameCache(const AtomicString& name) const { return m_nameC ache.get(name.impl()); }
79 void appendIdCache(const AtomicString& name, Element* element) const { appen d(m_idCache, name, element); } 79 void appendIdCache(const AtomicString& name, Element* element) const { appen d(m_idCache, name, element); }
80 void appendNameCache(const AtomicString& name, Element* element) const { app end(m_nameCache, name, element); } 80 void appendNameCache(const AtomicString& name, Element* element) const { app end(m_nameCache, name, element); }
81 81
82 private:
83 Element* traverseNextElement(Element& previous, const ContainerNode& root) c onst; 82 Element* traverseNextElement(Element& previous, const ContainerNode& root) c onst;
84 83
84 private:
85 static void append(NodeCacheMap&, const AtomicString&, Element*); 85 static void append(NodeCacheMap&, const AtomicString&, Element*);
86 void invalidateIdNameCacheMaps() const 86 void invalidateIdNameCacheMaps() const
87 { 87 {
88 m_idCache.clear(); 88 m_idCache.clear();
89 m_nameCache.clear(); 89 m_nameCache.clear();
90 m_isNameCacheValid = false; 90 m_isNameCacheValid = false;
91 } 91 }
92 92
93 const unsigned m_overridesItemAfter : 1; 93 const unsigned m_overridesItemAfter : 1;
94 const unsigned m_shouldOnlyIncludeDirectChildren : 1; 94 const unsigned m_shouldOnlyIncludeDirectChildren : 1;
95 mutable unsigned m_isNameCacheValid : 1; 95 mutable unsigned m_isNameCacheValid : 1;
96 mutable NodeCacheMap m_idCache; 96 mutable NodeCacheMap m_idCache;
97 mutable NodeCacheMap m_nameCache; 97 mutable NodeCacheMap m_nameCache;
98 mutable CollectionIndexCache<HTMLCollection, Element> m_collectionIndexCache ; 98 mutable CollectionIndexCache<HTMLCollection, Element> m_collectionIndexCache ;
99 99
100 friend class LiveNodeListBase; 100 friend class LiveNodeListBase;
101 }; 101 };
102 102
103 } // namespace 103 } // namespace
104 104
105 #endif 105 #endif
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698