Changeset 207212 in webkit


Ignore:
Timestamp:
Oct 12, 2016 1:41:58 AM (8 years ago)
Author:
matthew_hanson@apple.com
Message:

Merge r206975. rdar://problem/28545012

Location:
branches/safari-602-branch
Files:
2 added
5 edited

Legend:

Unmodified
Added
Removed
  • branches/safari-602-branch/LayoutTests/ChangeLog

    r207209 r207212  
     12016-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
    1172016-10-12  Matthew Hanson  <matthew_hanson@apple.com>
    218
  • branches/safari-602-branch/Source/WebCore/ChangeLog

    r207209 r207212  
     12016-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
    1302016-10-12  Matthew Hanson  <matthew_hanson@apple.com>
    231
  • branches/safari-602-branch/Source/WebCore/dom/Document.cpp

    r207207 r207212  
    485485    , m_hasXMLDeclaration(false)
    486486    , m_designMode(inherit)
    487 #if !ASSERT_DISABLED
    488     , m_inInvalidateNodeListAndCollectionCaches(false)
    489 #endif
    490487#if ENABLE(DASHBOARD_SUPPORT)
    491488    , m_hasAnnotatedRegions(false)
     
    40023999
    40034000    list.setRegisteredForInvalidationAtDocument(false);
    4004     ASSERT(m_inInvalidateNodeListAndCollectionCaches
    4005         ? m_listsInvalidatedAtDocument.isEmpty()
    4006         : m_listsInvalidatedAtDocument.contains(&list));
     4001    ASSERT(m_listsInvalidatedAtDocument.contains(&list));
    40074002    m_listsInvalidatedAtDocument.remove(&list);
    40084003}
  • branches/safari-602-branch/Source/WebCore/dom/Document.h

    r207207 r207212  
    15861586    HashSet<LiveNodeList*> m_listsInvalidatedAtDocument;
    15871587    HashSet<HTMLCollection*> m_collectionsInvalidatedAtDocument;
    1588 #if !ASSERT_DISABLED
    1589     bool m_inInvalidateNodeListAndCollectionCaches;
    1590 #endif
    1591 
    15921588    unsigned m_nodeListAndCollectionCounts[numNodeListInvalidationTypes];
    15931589
  • branches/safari-602-branch/Source/WebCore/dom/Node.cpp

    r203303 r207212  
    815815void Document::invalidateNodeListAndCollectionCaches(const QualifiedName* attrName)
    816816{
    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);
    822819    for (auto* list : lists)
    823820        list->invalidateCacheForAttribute(attrName);
    824     HashSet<HTMLCollection*> collections = WTFMove(m_collectionsInvalidatedAtDocument);
     821
     822    Vector<HTMLCollection*, 8> collections;
     823    copyToVector(m_collectionsInvalidatedAtDocument, collections);
    825824    for (auto* collection : collections)
    826825        collection->invalidateCacheForAttribute(attrName);
    827 #if !ASSERT_DISABLED
    828     m_inInvalidateNodeListAndCollectionCaches = false;
    829 #endif
    830826}
    831827
Note: See TracChangeset for help on using the changeset viewer.