Chromium Code Reviews| Index: third_party/WebKit/Source/core/html/HTMLSlotElement.h |
| diff --git a/third_party/WebKit/Source/core/html/HTMLSlotElement.h b/third_party/WebKit/Source/core/html/HTMLSlotElement.h |
| index beb03d132fe4c8d2782f6b8b9ae1ec29a73647bc..b6f441a7febfb91455f7f84a0c4566e4aa1b9007 100644 |
| --- a/third_party/WebKit/Source/core/html/HTMLSlotElement.h |
| +++ b/third_party/WebKit/Source/core/html/HTMLSlotElement.h |
| @@ -39,15 +39,35 @@ namespace blink { |
| class CORE_EXPORT HTMLSlotElement final : public HTMLElement { |
| DEFINE_WRAPPERTYPEINFO(); |
| public: |
| - static PassRefPtrWillBeRawPtr<HTMLSlotElement> create(Document&); |
| - ~HTMLSlotElement() override; |
| + DECLARE_NODE_FACTORY(HTMLSlotElement); |
| + |
| + const WillBeHeapVector<RefPtrWillBeMember<Node>> getAssignedNodes() const { return m_assignedNodes; } |
| + // TODO(hayato): Support fallback contents of slot elements |
| + const WillBeHeapVector<RefPtrWillBeMember<Node>> getDistributedNodes() const { return m_distributedNodes; } |
| + |
| + Node* firstDistributedNode() const { return m_distributedNodes.isEmpty() ? nullptr : m_distributedNodes.first().get(); } |
| + Node* lastDistributedNode() const { return m_distributedNodes.isEmpty() ? nullptr : m_distributedNodes.last().get(); } |
| + |
| + // TODO(hayato): This takes O(N). Make it O(1) with node-to-index hash table. |
| + Node* distributedNodeNextTo(const Node&) const; |
| + Node* distributedNodePreviousTo(const Node&) const; |
| + |
| + void appendAssignedNode(Node&); |
| + void appendDistributedNode(Node&); |
| + void appendDistributedNodes(const Vector<RefPtr<Node>>&); |
|
tkent
2015/12/10 04:23:02
WillBeHeapVector<RefPtrWillBeMember<node>>
hayato
2015/12/10 08:11:21
Done.
|
| + void clearDistribution(); |
| + |
| + void attach(const AttachContext& = AttachContext()) override; |
| + void detach(const AttachContext& = AttachContext()) override; |
| DECLARE_VIRTUAL_TRACE(); |
| private: |
| HTMLSlotElement(Document&); |
| - AtomicString m_name; |
| + WillBeHeapVector<RefPtrWillBeMember<Node>> m_assignedNodes; |
| + // TODO(hayato): Share code with DistributedNode class |
| + WillBeHeapVector<RefPtrWillBeMember<Node>> m_distributedNodes; |
| }; |
| } // namespace blink |