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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSlotElement.h

Issue 1590533006: Support Slot.getAssignedNodes({flatten: true}) in a document tree. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@v1-descendant-slots
Patch Set: rebased Created 4 years, 11 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 /* 1 /*
2 * Copyright (C) 2015 Google Inc. All rights reserved. 2 * Copyright (C) 2015 Google Inc. All rights reserved.
3 * 3 *
4 * Redistribution and use in source and binary forms, with or without 4 * Redistribution and use in source and binary forms, with or without
5 * modification, are permitted provided that the following conditions are 5 * modification, are permitted provided that the following conditions are
6 * met: 6 * met:
7 * 7 *
8 * * Redistributions of source code must retain the above copyright 8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer. 9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above 10 * * Redistributions in binary form must reproduce the above
(...skipping 26 matching lines...) Expand all
37 namespace blink { 37 namespace blink {
38 38
39 class AssignedNodesOptions; 39 class AssignedNodesOptions;
40 40
41 class CORE_EXPORT HTMLSlotElement final : public HTMLElement { 41 class CORE_EXPORT HTMLSlotElement final : public HTMLElement {
42 DEFINE_WRAPPERTYPEINFO(); 42 DEFINE_WRAPPERTYPEINFO();
43 public: 43 public:
44 DECLARE_NODE_FACTORY(HTMLSlotElement); 44 DECLARE_NODE_FACTORY(HTMLSlotElement);
45 45
46 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getAssignedNodes() const { ASSERT(!needsDistributionRecalc()); return m_assignedNodes; } 46 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getAssignedNodes() const { ASSERT(!needsDistributionRecalc()); return m_assignedNodes; }
47 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getDistributedNodes() cons t { ASSERT(!needsDistributionRecalc()); return m_distributedNodes; } 47 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getDistributedNodes();
48
49 const WillBeHeapVector<RefPtrWillBeMember<Node>> getAssignedNodesForBinding( const AssignedNodesOptions&); 48 const WillBeHeapVector<RefPtrWillBeMember<Node>> getAssignedNodesForBinding( const AssignedNodesOptions&);
50 49
51 Node* firstDistributedNode() const { return m_distributedNodes.isEmpty() ? n ullptr : m_distributedNodes.first().get(); } 50 Node* firstDistributedNode() const { return m_distributedNodes.isEmpty() ? n ullptr : m_distributedNodes.first().get(); }
52 Node* lastDistributedNode() const { return m_distributedNodes.isEmpty() ? nu llptr : m_distributedNodes.last().get(); } 51 Node* lastDistributedNode() const { return m_distributedNodes.isEmpty() ? nu llptr : m_distributedNodes.last().get(); }
53 52
54 // TODO(hayato): This takes O(N). Make it O(1) with node-to-index hash table . 53 // TODO(hayato): This takes O(N). Make it O(1) with node-to-index hash table .
55 Node* distributedNodeNextTo(const Node&) const; 54 Node* distributedNodeNextTo(const Node&) const;
56 Node* distributedNodePreviousTo(const Node&) const; 55 Node* distributedNodePreviousTo(const Node&) const;
57 56
58 void appendAssignedNode(Node&); 57 void appendAssignedNode(Node&);
(...skipping 19 matching lines...) Expand all
78 HTMLSlotElement(Document&); 77 HTMLSlotElement(Document&);
79 78
80 WillBeHeapVector<RefPtrWillBeMember<Node>> m_assignedNodes; 79 WillBeHeapVector<RefPtrWillBeMember<Node>> m_assignedNodes;
81 // TODO(hayato): Share code with DistributedNode class 80 // TODO(hayato): Share code with DistributedNode class
82 WillBeHeapVector<RefPtrWillBeMember<Node>> m_distributedNodes; 81 WillBeHeapVector<RefPtrWillBeMember<Node>> m_distributedNodes;
83 }; 82 };
84 83
85 } // namespace blink 84 } // namespace blink
86 85
87 #endif // HTMLSlotElement_h 86 #endif // HTMLSlotElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698