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

Unified Diff: third_party/WebKit/Source/core/dom/shadow/SlotAssignment.h

Issue 1925043002: Clean up ShadowRootRareData, ShadowRoot and SlotAssignment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixed Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/Source/core/dom/shadow/SlotAssignment.h
diff --git a/third_party/WebKit/Source/core/dom/shadow/SlotAssignment.h b/third_party/WebKit/Source/core/dom/shadow/SlotAssignment.h
index 4ed9646733cb399a60e4336bdb04ff347186cd30..50c5b48a22efd4a09e0ac9469521c5a90d07e80f 100644
--- a/third_party/WebKit/Source/core/dom/shadow/SlotAssignment.h
+++ b/third_party/WebKit/Source/core/dom/shadow/SlotAssignment.h
@@ -24,13 +24,25 @@ public:
void resolveAssignment(ShadowRoot&);
void resolveDistribution(ShadowRoot&);
+ void didAddSlot() { ++m_descendantSlotCount; }
+ void didRemoveSlot() { DCHECK_GT(m_descendantSlotCount, 0u); --m_descendantSlotCount; }
+ unsigned descendantSlotCount() const { return m_descendantSlotCount; }
+
+ const HeapVector<Member<HTMLSlotElement>>& descendantSlots() const { return m_descendantSlots; }
+
+ void setDescendantSlots(HeapVector<Member<HTMLSlotElement>>& slots) { m_descendantSlots.swap(slots); }
+ void clearDescendantSlots() { m_descendantSlots.clear(); }
+
DECLARE_TRACE();
private:
- SlotAssignment() { }
+ SlotAssignment() { };
void assign(Node&, HTMLSlotElement&);
void distribute(Node&, HTMLSlotElement&);
+
+ unsigned m_descendantSlotCount = 0;
+ HeapVector<Member<HTMLSlotElement>> m_descendantSlots;
HeapHashMap<Member<Node>, Member<HTMLSlotElement>> m_assignment;
};

Powered by Google App Engine
This is Rietveld 408576698