Changeset 207212 in webkit
- Timestamp:
- Oct 12, 2016 1:41:58 AM (8 years ago)
- Location:
- branches/safari-602-branch
- Files:
-
- 2 added
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/safari-602-branch/LayoutTests/ChangeLog
r207209 r207212 1 2016-10-12 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r206975. rdar://problem/28545012 4 5 2016-10-07 Ryosuke Niwa <rniwa@webkit.org> 6 7 REGRESSION(r165103): labels list doesn't get invalidated when other lists are invalidated at document level 8 https://bugs.webkit.org/show_bug.cgi?id=163145 9 10 Reviewed by Darin Adler. 11 12 Added a regression test. 13 14 * fast/dom/NodeList/form-labels-length-expected.txt: Added. 15 * fast/dom/NodeList/form-labels-length.html: Added. 16 1 17 2016-10-12 Matthew Hanson <matthew_hanson@apple.com> 2 18 -
branches/safari-602-branch/Source/WebCore/ChangeLog
r207209 r207212 1 2016-10-12 Matthew Hanson <matthew_hanson@apple.com> 2 3 Merge r206975. rdar://problem/28545012 4 5 2016-10-07 Ryosuke Niwa <rniwa@webkit.org> 6 7 REGRESSION(r165103): labels list doesn't get invalidated when other lists are invalidated at document level 8 https://bugs.webkit.org/show_bug.cgi?id=163145 9 10 Reviewed by Darin Adler. 11 12 The bug was caused by Document::invalidateNodeListAndCollectionCaches removing all node lists regardless 13 of whether they have been invalidated or not. 14 15 Fixed the bug by removing only those node lists that got invalidated via LiveNodeList::invalidateCache. 16 17 Test: fast/dom/NodeList/form-labels-length.html 18 19 * dom/Document.cpp: 20 (WebCore::Document::Document): 21 (WebCore::Document::unregisterNodeListForInvalidation): Removed the conditional which allowed removal to 22 happen while m_listsInvalidatedAtDocument is empty inside invalidateNodeListAndCollectionCaches. 23 * dom/Document.h: 24 * dom/Node.cpp: 25 (WebCore::Document::invalidateNodeListAndCollectionCaches): Just remove the node lists being invalidated via 26 LiveNodeList's invalidateCache, which calls unregisterNodeListForInvalidation, instead of removing them all. 27 We make a copy of the list of node lists into a local vector because mutating HashMap while iterating over it 28 is not a safe operation. 29 1 30 2016-10-12 Matthew Hanson <matthew_hanson@apple.com> 2 31 -
branches/safari-602-branch/Source/WebCore/dom/Document.cpp
r207207 r207212 485 485 , m_hasXMLDeclaration(false) 486 486 , m_designMode(inherit) 487 #if !ASSERT_DISABLED488 , m_inInvalidateNodeListAndCollectionCaches(false)489 #endif490 487 #if ENABLE(DASHBOARD_SUPPORT) 491 488 , m_hasAnnotatedRegions(false) … … 4002 3999 4003 4000 list.setRegisteredForInvalidationAtDocument(false); 4004 ASSERT(m_inInvalidateNodeListAndCollectionCaches 4005 ? m_listsInvalidatedAtDocument.isEmpty() 4006 : m_listsInvalidatedAtDocument.contains(&list)); 4001 ASSERT(m_listsInvalidatedAtDocument.contains(&list)); 4007 4002 m_listsInvalidatedAtDocument.remove(&list); 4008 4003 } -
branches/safari-602-branch/Source/WebCore/dom/Document.h
r207207 r207212 1586 1586 HashSet<LiveNodeList*> m_listsInvalidatedAtDocument; 1587 1587 HashSet<HTMLCollection*> m_collectionsInvalidatedAtDocument; 1588 #if !ASSERT_DISABLED1589 bool m_inInvalidateNodeListAndCollectionCaches;1590 #endif1591 1592 1588 unsigned m_nodeListAndCollectionCounts[numNodeListInvalidationTypes]; 1593 1589 -
branches/safari-602-branch/Source/WebCore/dom/Node.cpp
r203303 r207212 815 815 void Document::invalidateNodeListAndCollectionCaches(const QualifiedName* attrName) 816 816 { 817 #if !ASSERT_DISABLED 818 m_inInvalidateNodeListAndCollectionCaches = true; 819 #endif 820 HashSet<LiveNodeList*> lists = WTFMove(m_listsInvalidatedAtDocument); 821 m_listsInvalidatedAtDocument.clear(); 817 Vector<LiveNodeList*, 8> lists; 818 copyToVector(m_listsInvalidatedAtDocument, lists); 822 819 for (auto* list : lists) 823 820 list->invalidateCacheForAttribute(attrName); 824 HashSet<HTMLCollection*> collections = WTFMove(m_collectionsInvalidatedAtDocument); 821 822 Vector<HTMLCollection*, 8> collections; 823 copyToVector(m_collectionsInvalidatedAtDocument, collections); 825 824 for (auto* collection : collections) 826 825 collection->invalidateCacheForAttribute(attrName); 827 #if !ASSERT_DISABLED828 m_inInvalidateNodeListAndCollectionCaches = false;829 #endif830 826 } 831 827
Note: See TracChangeset
for help on using the changeset viewer.