diff options
Diffstat (limited to 'chromium/third_party/blink/renderer/core/html/html_collection.h')
-rw-r--r-- | chromium/third_party/blink/renderer/core/html/html_collection.h | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/chromium/third_party/blink/renderer/core/html/html_collection.h b/chromium/third_party/blink/renderer/core/html/html_collection.h index 986ff159b81..0ba2dfaa56f 100644 --- a/chromium/third_party/blink/renderer/core/html/html_collection.h +++ b/chromium/third_party/blink/renderer/core/html/html_collection.h @@ -77,6 +77,7 @@ class CORE_EXPORT HTMLCollection : public ScriptWrappable, }; static HTMLCollection* Create(ContainerNode& base, CollectionType); + HTMLCollection(ContainerNode& base, CollectionType, ItemAfterOverrideType); ~HTMLCollection() override; void InvalidateCache(Document* old_document = nullptr) const override; void InvalidateCacheForAttribute(const QualifiedName*) const; @@ -114,11 +115,13 @@ class CORE_EXPORT HTMLCollection : public ScriptWrappable, void Trace(blink::Visitor*) override; protected: - HTMLCollection(ContainerNode& base, CollectionType, ItemAfterOverrideType); - class NamedItemCache final : public GarbageCollected<NamedItemCache> { public: - static NamedItemCache* Create() { return new NamedItemCache; } + static NamedItemCache* Create() { + return MakeGarbageCollected<NamedItemCache>(); + } + + NamedItemCache(); const HeapVector<Member<Element>>* GetElementsById( const AtomicString& id) const { @@ -147,7 +150,6 @@ class CORE_EXPORT HTMLCollection : public ScriptWrappable, } private: - NamedItemCache(); typedef HeapHashMap<StringImpl*, HeapVector<Member<Element>>> StringToElementsMap; static void AddElementToMap(StringToElementsMap& map, @@ -225,7 +227,8 @@ inline void HTMLCollection::InvalidateCacheForAttribute( if (!attr_name || ShouldInvalidateTypeOnAttributeChange(InvalidationType(), *attr_name)) InvalidateCache(); - else if (*attr_name == HTMLNames::idAttr || *attr_name == HTMLNames::nameAttr) + else if (*attr_name == html_names::kIdAttr || + *attr_name == html_names::kNameAttr) InvalidateIdNameCacheMaps(); } |