| 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 26 matching lines...) Expand all Loading... |
| 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 Loading... |
| 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 |
| OLD | NEW |