Changeset 236440 in webkit
- Timestamp:
- Sep 24, 2018 4:11:36 PM (6 years ago)
- Location:
- trunk
- Files:
-
- 2 added
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r236439 r236440 1 2018-09-24 Ryosuke Niwa <rniwa@webkit.org> 2 3 imported/w3c/web-platform-tests/shadow-dom/slotchange.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=167652 5 6 Reviewed by Saam Barati. 7 8 Added a regression test for signaling a lot of slot elements. 9 10 * fast/shadow-dom/signal-slot-list-retains-js-wrappers-expected.txt: Added. 11 * fast/shadow-dom/signal-slot-list-retains-js-wrappers.html: Added. 12 1 13 2018-09-24 Ryosuke Niwa <rniwa@webkit.org> 2 14 -
trunk/Source/WebCore/ChangeLog
r236439 r236440 1 2018-09-24 Ryosuke Niwa <rniwa@webkit.org> 2 3 imported/w3c/web-platform-tests/shadow-dom/slotchange.html is a flaky failure 4 https://bugs.webkit.org/show_bug.cgi?id=167652 5 6 Reviewed by Saam Barati. 7 8 The bug appears to be caused by the JS wrappers of slot elements getting prematurely collected. 9 Deployed GCReachableRef introduced in r236376 to fix the bug. 10 11 Test: fast/shadow-dom/signal-slot-list-retains-js-wrappers.html 12 13 * dom/MutationObserver.cpp: 14 (WebCore::signalSlotList): 15 (WebCore::MutationObserver::enqueueSlotChangeEvent): 16 (WebCore::MutationObserver::notifyMutationObservers): 17 1 18 2018-09-24 Ryosuke Niwa <rniwa@webkit.org> 2 19 -
trunk/Source/WebCore/dom/MutationObserver.cpp
r230695 r236440 35 35 36 36 #include "Document.h" 37 #include "GCReachableRef.h" 37 38 #include "HTMLSlotElement.h" 38 39 #include "Microtasks.h" … … 152 153 153 154 // https://dom.spec.whatwg.org/#signal-slot-list 154 static Vector< RefPtr<HTMLSlotElement>>& signalSlotList()155 { 156 static NeverDestroyed<Vector< RefPtr<HTMLSlotElement>>> list;155 static Vector<GCReachableRef<HTMLSlotElement>>& signalSlotList() 156 { 157 static NeverDestroyed<Vector<GCReachableRef<HTMLSlotElement>>> list; 157 158 return list; 158 159 } … … 190 191 { 191 192 ASSERT(isMainThread()); 192 ASSERT( !signalSlotList().contains(&slot));193 signalSlotList().append( &slot);193 ASSERT(signalSlotList().findMatching([&slot](auto& entry) { return entry.ptr() == &slot; }) == notFound); 194 signalSlotList().append(slot); 194 195 195 196 queueMutationObserverCompoundMicrotask(); … … 274 275 // 3. Let signalList be a copy of unit of related similar-origin browsing contexts' signal slot list. 275 276 // 4. Empty unit of related similar-origin browsing contexts' signal slot list. 276 Vector< RefPtr<HTMLSlotElement>> slotList;277 Vector<GCReachableRef<HTMLSlotElement>> slotList; 277 278 if (!signalSlotList().isEmpty()) { 278 279 slotList.swap(signalSlotList());
Note: See TracChangeset
for help on using the changeset viewer.