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

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

Issue 450273003: Uninline HTMLCollection / LiveNodeList's item() and length() member functions (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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
« no previous file with comments | « Source/core/dom/LiveNodeList.cpp ('k') | Source/core/html/HTMLCollection.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 27 matching lines...) Expand all
38 OverridesItemAfter, 38 OverridesItemAfter,
39 DoesNotOverrideItemAfter, 39 DoesNotOverrideItemAfter,
40 }; 40 };
41 41
42 static PassRefPtrWillBeRawPtr<HTMLCollection> create(ContainerNode& base, Co llectionType); 42 static PassRefPtrWillBeRawPtr<HTMLCollection> create(ContainerNode& base, Co llectionType);
43 virtual ~HTMLCollection(); 43 virtual ~HTMLCollection();
44 virtual void invalidateCache(Document* oldDocument = 0) const OVERRIDE; 44 virtual void invalidateCache(Document* oldDocument = 0) const OVERRIDE;
45 void invalidateCacheForAttribute(const QualifiedName*) const; 45 void invalidateCacheForAttribute(const QualifiedName*) const;
46 46
47 // DOM API 47 // DOM API
48 unsigned length() const { return m_collectionIndexCache.nodeCount(*this); } 48 unsigned length() const;
49 Element* item(unsigned offset) const { return m_collectionIndexCache.nodeAt( *this, offset); } 49 Element* item(unsigned offset) const;
50 virtual Element* namedItem(const AtomicString& name) const; 50 virtual Element* namedItem(const AtomicString& name) const;
51 bool namedPropertyQuery(const AtomicString&, ExceptionState&); 51 bool namedPropertyQuery(const AtomicString&, ExceptionState&);
52 void namedPropertyEnumerator(Vector<String>& names, ExceptionState&); 52 void namedPropertyEnumerator(Vector<String>& names, ExceptionState&);
53 53
54 // Non-DOM API 54 // Non-DOM API
55 void namedItems(const AtomicString& name, WillBeHeapVector<RefPtrWillBeMembe r<Element> >&) const; 55 void namedItems(const AtomicString& name, WillBeHeapVector<RefPtrWillBeMembe r<Element> >&) const;
56 bool isEmpty() const { return m_collectionIndexCache.isEmpty(*this); } 56 bool isEmpty() const { return m_collectionIndexCache.isEmpty(*this); }
57 bool hasExactlyOneItem() const { return m_collectionIndexCache.hasExactlyOne Node(*this); } 57 bool hasExactlyOneItem() const { return m_collectionIndexCache.hasExactlyOne Node(*this); }
58 58
59 // CollectionIndexCache API. 59 // CollectionIndexCache API.
(...skipping 96 matching lines...) Expand 10 before | Expand all | Expand 10 after
156 { 156 {
157 if (!attrName || shouldInvalidateTypeOnAttributeChange(invalidationType(), * attrName)) 157 if (!attrName || shouldInvalidateTypeOnAttributeChange(invalidationType(), * attrName))
158 invalidateCache(); 158 invalidateCache();
159 else if (*attrName == HTMLNames::idAttr || *attrName == HTMLNames::nameAttr) 159 else if (*attrName == HTMLNames::idAttr || *attrName == HTMLNames::nameAttr)
160 invalidateIdNameCacheMaps(); 160 invalidateIdNameCacheMaps();
161 } 161 }
162 162
163 } // namespace 163 } // namespace
164 164
165 #endif 165 #endif
OLDNEW
« no previous file with comments | « Source/core/dom/LiveNodeList.cpp ('k') | Source/core/html/HTMLCollection.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698