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

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 75 matching lines...) Expand 10 before | Expand all | Expand 10 after
86 // shadow host. This method should be used only when m_assignedNodes is 86 // shadow host. This method should be used only when m_assignedNodes is
87 // dirty. e.g. To detect a slotchange event in DOM mutations. 87 // dirty. e.g. To detect a slotchange event in DOM mutations.
88 bool hasAssignedNodesSlow() const; 88 bool hasAssignedNodesSlow() const;
89 bool findHostChildWithSameSlotName() const; 89 bool findHostChildWithSameSlotName() const;
90 90
91 void clearDistribution(); 91 void clearDistribution();
92 void saveAndClearDistribution(); 92 void saveAndClearDistribution();
93 93
94 bool supportsDistribution() const { return isInV1ShadowTree(); } 94 bool supportsDistribution() const { return isInV1ShadowTree(); }
95 void didSlotChange(SlotChangeType); 95 void didSlotChange(SlotChangeType);
96 void dispatchSlotChangeEvent();
97 void clearSlotChangeEventEnqueued() { m_slotchangeEventEnqueued = false; }
96 98
97 static AtomicString normalizeSlotName(const AtomicString&); 99 static AtomicString normalizeSlotName(const AtomicString&);
98 100
99 DECLARE_VIRTUAL_TRACE(); 101 DECLARE_VIRTUAL_TRACE();
100 102
101 private: 103 private:
102 HTMLSlotElement(Document&); 104 HTMLSlotElement(Document&);
103 105
104 InsertionNotificationRequest insertedInto(ContainerNode*) final; 106 InsertionNotificationRequest insertedInto(ContainerNode*) final;
105 void removedFrom(ContainerNode*) final; 107 void removedFrom(ContainerNode*) final;
106 void willRecalcStyle(StyleRecalcChange) final; 108 void willRecalcStyle(StyleRecalcChange) final;
107 109
108 void enqueueSlotChangeEvent(); 110 void enqueueSlotChangeEvent();
109 void dispatchSlotChangeEvent();
110 111
111 HeapVector<Member<Node>> m_assignedNodes; 112 HeapVector<Member<Node>> m_assignedNodes;
112 HeapVector<Member<Node>> m_distributedNodes; 113 HeapVector<Member<Node>> m_distributedNodes;
113 HeapVector<Member<Node>> m_oldDistributedNodes; 114 HeapVector<Member<Node>> m_oldDistributedNodes;
114 HeapHashMap<Member<const Node>, size_t> m_distributedIndices; 115 HeapHashMap<Member<const Node>, size_t> m_distributedIndices;
115 bool m_slotchangeEventEnqueued = false; 116 bool m_slotchangeEventEnqueued = false;
116 }; 117 };
117 118
118 } // namespace blink 119 } // namespace blink
119 120
120 #endif // HTMLSlotElement_h 121 #endif // HTMLSlotElement_h
OLDNEW
« no previous file with comments | « third_party/WebKit/Source/core/dom/MutationObserver.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