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

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

Issue 2622193002: Dispatch slotchange events in "notify mutation observers" steps (Closed)
Patch Set: fixed Created 3 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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after
89 // shadow host. This method should be used only when m_assignedNodes is 89 // shadow host. This method should be used only when m_assignedNodes is
90 // dirty. e.g. To detect a slotchange event in DOM mutations. 90 // dirty. e.g. To detect a slotchange event in DOM mutations.
91 bool hasAssignedNodesSlow() const; 91 bool hasAssignedNodesSlow() const;
92 bool findHostChildWithSameSlotName() const; 92 bool findHostChildWithSameSlotName() const;
93 93
94 void clearDistribution(); 94 void clearDistribution();
95 void saveAndClearDistribution(); 95 void saveAndClearDistribution();
96 96
97 bool supportsDistribution() const { return isInV1ShadowTree(); } 97 bool supportsDistribution() const { return isInV1ShadowTree(); }
98 void didSlotChange(SlotChangeType); 98 void didSlotChange(SlotChangeType);
99 void dispatchSlotChangeEvent();
100 void clearSlotChangeEventEnqueued() { m_slotchangeEventEnqueued = false; }
99 101
100 static AtomicString normalizeSlotName(const AtomicString&); 102 static AtomicString normalizeSlotName(const AtomicString&);
101 103
102 DECLARE_VIRTUAL_TRACE(); 104 DECLARE_VIRTUAL_TRACE();
103 105
104 private: 106 private:
105 HTMLSlotElement(Document&); 107 HTMLSlotElement(Document&);
106 108
107 InsertionNotificationRequest insertedInto(ContainerNode*) final; 109 InsertionNotificationRequest insertedInto(ContainerNode*) final;
108 void removedFrom(ContainerNode*) final; 110 void removedFrom(ContainerNode*) final;
109 void willRecalcStyle(StyleRecalcChange) final; 111 void willRecalcStyle(StyleRecalcChange) final;
110 112
111 void enqueueSlotChangeEvent(); 113 void enqueueSlotChangeEvent();
112 void dispatchSlotChangeEvent();
113 114
114 HeapVector<Member<Node>> m_assignedNodes; 115 HeapVector<Member<Node>> m_assignedNodes;
115 HeapVector<Member<Node>> m_distributedNodes; 116 HeapVector<Member<Node>> m_distributedNodes;
116 HeapVector<Member<Node>> m_oldDistributedNodes; 117 HeapVector<Member<Node>> m_oldDistributedNodes;
117 HeapHashMap<Member<const Node>, size_t> m_distributedIndices; 118 HeapHashMap<Member<const Node>, size_t> m_distributedIndices;
118 bool m_slotchangeEventEnqueued = false; 119 bool m_slotchangeEventEnqueued = false;
119 }; 120 };
120 121
121 } // namespace blink 122 } // namespace blink
122 123
123 #endif // HTMLSlotElement_h 124 #endif // HTMLSlotElement_h
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698