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

Side by Side Diff: third_party/WebKit/Source/core/html/HTMLSlotElement.h

Issue 1562743002: Revert of Support slot element's fallback content feature (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 11 months 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 unified diff | Download patch
OLDNEW
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 24 matching lines...) Expand all
35 #include "core/html/HTMLElement.h" 35 #include "core/html/HTMLElement.h"
36 36
37 namespace blink { 37 namespace blink {
38 38
39 class CORE_EXPORT HTMLSlotElement final : public HTMLElement { 39 class CORE_EXPORT HTMLSlotElement final : public HTMLElement {
40 DEFINE_WRAPPERTYPEINFO(); 40 DEFINE_WRAPPERTYPEINFO();
41 public: 41 public:
42 DECLARE_NODE_FACTORY(HTMLSlotElement); 42 DECLARE_NODE_FACTORY(HTMLSlotElement);
43 43
44 const WillBeHeapVector<RefPtrWillBeMember<Node>> getAssignedNodes() const { return m_assignedNodes; } 44 const WillBeHeapVector<RefPtrWillBeMember<Node>> getAssignedNodes() const { return m_assignedNodes; }
45 // TODO(hayato): Support fallback contents of slot elements
45 const WillBeHeapVector<RefPtrWillBeMember<Node>> getDistributedNodes() const { return m_distributedNodes; } 46 const WillBeHeapVector<RefPtrWillBeMember<Node>> getDistributedNodes() const { return m_distributedNodes; }
46 47
47 Node* firstDistributedNode() const { return m_distributedNodes.isEmpty() ? n ullptr : m_distributedNodes.first().get(); } 48 Node* firstDistributedNode() const { return m_distributedNodes.isEmpty() ? n ullptr : m_distributedNodes.first().get(); }
48 Node* lastDistributedNode() const { return m_distributedNodes.isEmpty() ? nu llptr : m_distributedNodes.last().get(); } 49 Node* lastDistributedNode() const { return m_distributedNodes.isEmpty() ? nu llptr : m_distributedNodes.last().get(); }
49 50
50 // TODO(hayato): This takes O(N). Make it O(1) with node-to-index hash table . 51 // TODO(hayato): This takes O(N). Make it O(1) with node-to-index hash table .
51 Node* distributedNodeNextTo(const Node&) const; 52 Node* distributedNodeNextTo(const Node&) const;
52 Node* distributedNodePreviousTo(const Node&) const; 53 Node* distributedNodePreviousTo(const Node&) const;
53 54
54 void appendAssignedNode(Node&); 55 void appendAssignedNode(Node&);
55 void appendDistributedNode(Node&); 56 void appendDistributedNode(Node&);
56 void appendDistributedNodes(const WillBeHeapVector<RefPtrWillBeMember<Node>> &); 57 void appendDistributedNodes(const WillBeHeapVector<RefPtrWillBeMember<Node>> &);
57 void clearDistribution(); 58 void clearDistribution();
58 59
59 void updateDistributedNodesWithFallback();
60
61 void attach(const AttachContext& = AttachContext()) override; 60 void attach(const AttachContext& = AttachContext()) override;
62 void detach(const AttachContext& = AttachContext()) override; 61 void detach(const AttachContext& = AttachContext()) override;
63 62
64 DECLARE_VIRTUAL_TRACE(); 63 DECLARE_VIRTUAL_TRACE();
65 64
66 private: 65 private:
67 HTMLSlotElement(Document&); 66 HTMLSlotElement(Document&);
68 67
69 WillBeHeapVector<RefPtrWillBeMember<Node>> m_assignedNodes; 68 WillBeHeapVector<RefPtrWillBeMember<Node>> m_assignedNodes;
70 // TODO(hayato): Share code with DistributedNode class 69 // TODO(hayato): Share code with DistributedNode class
71 WillBeHeapVector<RefPtrWillBeMember<Node>> m_distributedNodes; 70 WillBeHeapVector<RefPtrWillBeMember<Node>> m_distributedNodes;
72 }; 71 };
73 72
74 } // namespace blink 73 } // namespace blink
75 74
76 #endif // HTMLSlotElement_h 75 #endif // HTMLSlotElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/shadow/SlotAssignment.cpp ('k') | third_party/WebKit/Source/core/html/HTMLSlotElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698