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

Side by Side Diff: Source/core/dom/NthIndexCache.h

Issue 1082293003: Componentization: make core/animation,clipboard,css,dom,editing,frame,html visible for blink_web. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 5 years, 8 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
« no previous file with comments | « Source/core/dom/NodeList.h ('k') | Source/core/dom/shadow/ElementShadow.h » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright 2015 The Chromium Authors. All rights reserved. 1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #ifndef NthIndexCache_h 5 #ifndef NthIndexCache_h
6 #define NthIndexCache_h 6 #define NthIndexCache_h
7 7
8 #include "core/CoreExport.h"
8 #include "core/dom/Element.h" 9 #include "core/dom/Element.h"
9 #include "core/dom/ElementTraversal.h" 10 #include "core/dom/ElementTraversal.h"
10 #include "platform/heap/Handle.h" 11 #include "platform/heap/Handle.h"
11 #include "wtf/HashMap.h" 12 #include "wtf/HashMap.h"
12 #include "wtf/OwnPtr.h" 13 #include "wtf/OwnPtr.h"
13 #include "wtf/RefPtr.h" 14 #include "wtf/RefPtr.h"
14 15
15 namespace blink { 16 namespace blink {
16 17
17 class Document; 18 class Document;
18 19
19 class NthIndexCache final { 20 class CORE_EXPORT NthIndexCache final {
20 STACK_ALLOCATED(); 21 STACK_ALLOCATED();
21 WTF_MAKE_NONCOPYABLE(NthIndexCache); 22 WTF_MAKE_NONCOPYABLE(NthIndexCache);
22 public: 23 public:
23 explicit NthIndexCache(Document&); 24 explicit NthIndexCache(Document&);
24 ~NthIndexCache(); 25 ~NthIndexCache();
25 26
26 inline unsigned nthChildIndex(Element&); 27 inline unsigned nthChildIndex(Element&);
27 inline unsigned nthLastChildIndex(Element&); 28 inline unsigned nthLastChildIndex(Element&);
28 29
29 private: 30 private:
(...skipping 52 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 83
83 inline unsigned NthIndexCache::nthLastChildIndex(Element& element) 84 inline unsigned NthIndexCache::nthLastChildIndex(Element& element)
84 { 85 {
85 ASSERT(element.parentNode()); 86 ASSERT(element.parentNode());
86 return ensureNthIndexDataFor(*element.parentNode()).nthLastIndex(element); 87 return ensureNthIndexDataFor(*element.parentNode()).nthLastIndex(element);
87 } 88 }
88 89
89 } // namespace blink 90 } // namespace blink
90 91
91 #endif // NthIndexCache_h 92 #endif // NthIndexCache_h
OLDNEW
« no previous file with comments | « Source/core/dom/NodeList.h ('k') | Source/core/dom/shadow/ElementShadow.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698