 Chromium Code Reviews
 Chromium Code Reviews Issue 1604853004:
  Rename slot.getDistributedNodes() to slot.getAssingedNodes({flatten: true}).  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master
    
  
    Issue 1604853004:
  Rename slot.getDistributedNodes() to slot.getAssingedNodes({flatten: true}).  (Closed) 
  Base URL: https://chromium.googlesource.com/chromium/src.git@master| OLD | NEW | 
|---|---|
| 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 16 matching lines...) Expand all Loading... | |
| 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 27 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE | 
| 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 28 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | 
| 29 */ | 29 */ | 
| 30 | 30 | 
| 31 #ifndef HTMLSlotElement_h | 31 #ifndef HTMLSlotElement_h | 
| 32 #define HTMLSlotElement_h | 32 #define HTMLSlotElement_h | 
| 33 | 33 | 
| 34 #include "core/CoreExport.h" | 34 #include "core/CoreExport.h" | 
| 35 #include "core/html/HTMLElement.h" | 35 #include "core/html/HTMLElement.h" | 
| 36 | 36 | 
| 37 | |
| 38 | |
| 
kochi
2016/01/20 08:03:16
nit: unnecessary newline.
 
hayato
2016/01/20 08:29:07
Done.
 | |
| 37 namespace blink { | 39 namespace blink { | 
| 38 | 40 | 
| 41 class AssignedNodesOptions; | |
| 42 | |
| 39 class CORE_EXPORT HTMLSlotElement final : public HTMLElement { | 43 class CORE_EXPORT HTMLSlotElement final : public HTMLElement { | 
| 40 DEFINE_WRAPPERTYPEINFO(); | 44 DEFINE_WRAPPERTYPEINFO(); | 
| 41 public: | 45 public: | 
| 42 DECLARE_NODE_FACTORY(HTMLSlotElement); | 46 DECLARE_NODE_FACTORY(HTMLSlotElement); | 
| 43 | 47 | 
| 44 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getAssignedNodes() const { ASSERT(!needsDistributionRecalc()); return m_assignedNodes; } | 48 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getAssignedNodes() const { ASSERT(!needsDistributionRecalc()); return m_assignedNodes; } | 
| 45 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getDistributedNodes() cons t { ASSERT(!needsDistributionRecalc()); return m_distributedNodes; } | 49 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getDistributedNodes() cons t { ASSERT(!needsDistributionRecalc()); return m_distributedNodes; } | 
| 46 | 50 | 
| 47 const WillBeHeapVector<RefPtrWillBeMember<Node>> getAssignedNodesForBinding( ) { updateDistribution(); return m_assignedNodes; } | 51 const WillBeHeapVector<RefPtrWillBeMember<Node>> getAssignedNodesForBinding( const AssignedNodesOptions&); | 
| 48 const WillBeHeapVector<RefPtrWillBeMember<Node>> getDistributedNodesForBindi ng() { updateDistribution(); return m_distributedNodes; } | |
| 49 | 52 | 
| 50 Node* firstDistributedNode() const { return m_distributedNodes.isEmpty() ? n ullptr : m_distributedNodes.first().get(); } | 53 Node* firstDistributedNode() const { return m_distributedNodes.isEmpty() ? n ullptr : m_distributedNodes.first().get(); } | 
| 51 Node* lastDistributedNode() const { return m_distributedNodes.isEmpty() ? nu llptr : m_distributedNodes.last().get(); } | 54 Node* lastDistributedNode() const { return m_distributedNodes.isEmpty() ? nu llptr : m_distributedNodes.last().get(); } | 
| 52 | 55 | 
| 53 // TODO(hayato): This takes O(N). Make it O(1) with node-to-index hash table . | 56 // TODO(hayato): This takes O(N). Make it O(1) with node-to-index hash table . | 
| 54 Node* distributedNodeNextTo(const Node&) const; | 57 Node* distributedNodeNextTo(const Node&) const; | 
| 55 Node* distributedNodePreviousTo(const Node&) const; | 58 Node* distributedNodePreviousTo(const Node&) const; | 
| 56 | 59 | 
| 57 void appendAssignedNode(Node&); | 60 void appendAssignedNode(Node&); | 
| 58 void appendDistributedNode(Node&); | 61 void appendDistributedNode(Node&); | 
| (...skipping 18 matching lines...) Expand all Loading... | |
| 77 HTMLSlotElement(Document&); | 80 HTMLSlotElement(Document&); | 
| 78 | 81 | 
| 79 WillBeHeapVector<RefPtrWillBeMember<Node>> m_assignedNodes; | 82 WillBeHeapVector<RefPtrWillBeMember<Node>> m_assignedNodes; | 
| 80 // TODO(hayato): Share code with DistributedNode class | 83 // TODO(hayato): Share code with DistributedNode class | 
| 81 WillBeHeapVector<RefPtrWillBeMember<Node>> m_distributedNodes; | 84 WillBeHeapVector<RefPtrWillBeMember<Node>> m_distributedNodes; | 
| 82 }; | 85 }; | 
| 83 | 86 | 
| 84 } // namespace blink | 87 } // namespace blink | 
| 85 | 88 | 
| 86 #endif // HTMLSlotElement_h | 89 #endif // HTMLSlotElement_h | 
| OLD | NEW |