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

Side by Side Diff: third_party/WebKit/Source/core/dom/custom/CustomElementUpgradeSorter.h

Issue 2242743002: Make custom elements work in HTML imports (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Addresses tkent's comments. Created 4 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
OLDNEW
1 // Copyright 2016 The Chromium Authors. All rights reserved. 1 // Copyright 2016 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 CustomElementUpgradeSorter_h 5 #ifndef CustomElementUpgradeSorter_h
6 #define CustomElementUpgradeSorter_h 6 #define CustomElementUpgradeSorter_h
7 7
8 #include "core/CoreExport.h" 8 #include "core/CoreExport.h"
9 #include "platform/heap/Handle.h" 9 #include "platform/heap/Handle.h"
10 10
(...skipping 16 matching lines...) Expand all
27 // Adds shadow-including descendents of parent to result in 27 // Adds shadow-including descendents of parent to result in
28 // shadow-including tree order. This operation is destroys the 28 // shadow-including tree order. This operation is destroys the
29 // state of this sorter; after calling sorted, you must not call 29 // state of this sorter; after calling sorted, you must not call
30 // add or sorted again with this object. 30 // add or sorted again with this object.
31 void sorted(HeapVector<Member<Element>>* result, Node* parent); 31 void sorted(HeapVector<Member<Element>>* result, Node* parent);
32 32
33 private: 33 private:
34 using ChildSet = HeapHashSet<Member<Node>>; 34 using ChildSet = HeapHashSet<Member<Node>>;
35 using ParentChildMap = HeapHashMap<Member<Node>, ChildSet>; 35 using ParentChildMap = HeapHashMap<Member<Node>, ChildSet>;
36 36
37 enum AddResult {
38 kParentAlreadyExistsInMap,
39 kParentAddedToMap
40 };
41
42 AddResult addToParentChildMap(Node* parent, Node* child);
37 void visit( 43 void visit(
38 HeapVector<Member<Element>>* result, 44 HeapVector<Member<Element>>* result,
39 ChildSet&, 45 ChildSet&,
40 const ChildSet::iterator&); 46 const ChildSet::iterator&);
41 47
42 Member<HeapHashSet<Member<Element>>> m_elements; 48 Member<HeapHashSet<Member<Element>>> m_elements;
43 49
44 // This is the subset of the tree, from root node (usually 50 // This is the subset of the tree, from root node (usually
45 // document) through elements and shadow roots, to candidates. 51 // document) through elements and shadow roots, to candidates.
46 Member<ParentChildMap> m_parentChildMap; 52 Member<ParentChildMap> m_parentChildMap;
47 }; 53 };
48 54
49 } // namespace blink 55 } // namespace blink
50 56
51 #endif // CustomElementUpgradeSorter_h 57 #endif // CustomElementUpgradeSorter_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698