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

Unified Diff: third_party/WebKit/Source/core/html/HTMLSlotElement.h

Issue 1489433002: Support the essential part of Shadow DOM v1 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Revert Internals.* Created 5 years 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 side-by-side diff with in-line comments
Download patch
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..66d3eba312322ce15ed7bcb3bf08c15e0040a76c 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 WillBeHeapVector<RefPtrWillBeMember<Node>>&);
+ 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
« no previous file with comments | « third_party/WebKit/Source/core/html/HTMLAttributeNames.in ('k') | third_party/WebKit/Source/core/html/HTMLSlotElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698