| 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 18 matching lines...) Expand all Loading... |
| 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 namespace blink { | 37 namespace blink { |
| 38 | 38 |
| 39 class AssignedNodesOptions; |
| 40 |
| 39 class CORE_EXPORT HTMLSlotElement final : public HTMLElement { | 41 class CORE_EXPORT HTMLSlotElement final : public HTMLElement { |
| 40 DEFINE_WRAPPERTYPEINFO(); | 42 DEFINE_WRAPPERTYPEINFO(); |
| 41 public: | 43 public: |
| 42 DECLARE_NODE_FACTORY(HTMLSlotElement); | 44 DECLARE_NODE_FACTORY(HTMLSlotElement); |
| 43 | 45 |
| 44 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getAssignedNodes() const {
ASSERT(!needsDistributionRecalc()); return m_assignedNodes; } | 46 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getAssignedNodes() const {
ASSERT(!needsDistributionRecalc()); return m_assignedNodes; } |
| 45 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getDistributedNodes() cons
t { ASSERT(!needsDistributionRecalc()); return m_distributedNodes; } | 47 const WillBeHeapVector<RefPtrWillBeMember<Node>>& getDistributedNodes() cons
t { ASSERT(!needsDistributionRecalc()); return m_distributedNodes; } |
| 46 | 48 |
| 47 const WillBeHeapVector<RefPtrWillBeMember<Node>> getAssignedNodesForBinding(
) { updateDistribution(); return m_assignedNodes; } | 49 const WillBeHeapVector<RefPtrWillBeMember<Node>> getAssignedNodesForBinding(
const AssignedNodesOptions&); |
| 48 const WillBeHeapVector<RefPtrWillBeMember<Node>> getDistributedNodesForBindi
ng() { updateDistribution(); return m_distributedNodes; } | |
| 49 | 50 |
| 50 Node* firstDistributedNode() const { return m_distributedNodes.isEmpty() ? n
ullptr : m_distributedNodes.first().get(); } | 51 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(); } | 52 Node* lastDistributedNode() const { return m_distributedNodes.isEmpty() ? nu
llptr : m_distributedNodes.last().get(); } |
| 52 | 53 |
| 53 // TODO(hayato): This takes O(N). Make it O(1) with node-to-index hash table
. | 54 // TODO(hayato): This takes O(N). Make it O(1) with node-to-index hash table
. |
| 54 Node* distributedNodeNextTo(const Node&) const; | 55 Node* distributedNodeNextTo(const Node&) const; |
| 55 Node* distributedNodePreviousTo(const Node&) const; | 56 Node* distributedNodePreviousTo(const Node&) const; |
| 56 | 57 |
| 57 void appendAssignedNode(Node&); | 58 void appendAssignedNode(Node&); |
| 58 void appendDistributedNode(Node&); | 59 void appendDistributedNode(Node&); |
| (...skipping 18 matching lines...) Expand all Loading... |
| 77 HTMLSlotElement(Document&); | 78 HTMLSlotElement(Document&); |
| 78 | 79 |
| 79 WillBeHeapVector<RefPtrWillBeMember<Node>> m_assignedNodes; | 80 WillBeHeapVector<RefPtrWillBeMember<Node>> m_assignedNodes; |
| 80 // TODO(hayato): Share code with DistributedNode class | 81 // TODO(hayato): Share code with DistributedNode class |
| 81 WillBeHeapVector<RefPtrWillBeMember<Node>> m_distributedNodes; | 82 WillBeHeapVector<RefPtrWillBeMember<Node>> m_distributedNodes; |
| 82 }; | 83 }; |
| 83 | 84 |
| 84 } // namespace blink | 85 } // namespace blink |
| 85 | 86 |
| 86 #endif // HTMLSlotElement_h | 87 #endif // HTMLSlotElement_h |
| OLD | NEW |