| 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 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All | 4 * Copyright (C) 2003, 2004, 2005, 2006, 2007, 2008, 2011, 2012 Apple Inc. All |
| 5 * rights reserved. | 5 * rights reserved. |
| 6 * Copyright (C) 2014 Samsung Electronics. All rights reserved. | 6 * Copyright (C) 2014 Samsung Electronics. 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 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 173 virtual void SupportedPropertyNames(Vector<String>& names); | 173 virtual void SupportedPropertyNames(Vector<String>& names); |
| 174 | 174 |
| 175 virtual void UpdateIdNameCache() const; | 175 virtual void UpdateIdNameCache() const; |
| 176 bool HasValidIdNameCache() const { return named_item_cache_; } | 176 bool HasValidIdNameCache() const { return named_item_cache_; } |
| 177 | 177 |
| 178 void SetNamedItemCache(NamedItemCache* cache) const { | 178 void SetNamedItemCache(NamedItemCache* cache) const { |
| 179 DCHECK(!named_item_cache_); | 179 DCHECK(!named_item_cache_); |
| 180 // Do not repeat registration for the same invalidation type. | 180 // Do not repeat registration for the same invalidation type. |
| 181 if (InvalidationType() != kInvalidateOnIdNameAttrChange) | 181 if (InvalidationType() != kInvalidateOnIdNameAttrChange) |
| 182 GetDocument().RegisterNodeListWithIdNameCache(this); | 182 GetDocument().RegisterNodeListWithIdNameCache(this); |
| 183 named_item_cache_ = std::move(cache); | 183 named_item_cache_ = cache; |
| 184 } | 184 } |
| 185 | 185 |
| 186 NamedItemCache& GetNamedItemCache() const { | 186 NamedItemCache& GetNamedItemCache() const { |
| 187 DCHECK(named_item_cache_); | 187 DCHECK(named_item_cache_); |
| 188 return *named_item_cache_; | 188 return *named_item_cache_; |
| 189 } | 189 } |
| 190 | 190 |
| 191 private: | 191 private: |
| 192 void InvalidateIdNameCacheMaps(Document* old_document = 0) const { | 192 void InvalidateIdNameCacheMaps(Document* old_document = 0) const { |
| 193 if (!HasValidIdNameCache()) | 193 if (!HasValidIdNameCache()) |
| (...skipping 33 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 227 if (!attr_name || | 227 if (!attr_name || |
| 228 ShouldInvalidateTypeOnAttributeChange(InvalidationType(), *attr_name)) | 228 ShouldInvalidateTypeOnAttributeChange(InvalidationType(), *attr_name)) |
| 229 InvalidateCache(); | 229 InvalidateCache(); |
| 230 else if (*attr_name == HTMLNames::idAttr || *attr_name == HTMLNames::nameAttr) | 230 else if (*attr_name == HTMLNames::idAttr || *attr_name == HTMLNames::nameAttr) |
| 231 InvalidateIdNameCacheMaps(); | 231 InvalidateIdNameCacheMaps(); |
| 232 } | 232 } |
| 233 | 233 |
| 234 } // namespace blink | 234 } // namespace blink |
| 235 | 235 |
| 236 #endif // HTMLCollection_h | 236 #endif // HTMLCollection_h |
| OLD | NEW |