Changeset 109058 in webkit


Ignore:
Timestamp:
Feb 27, 2012 6:34:20 PM (12 years ago)
Author:
adamk@chromium.org
Message:

[MutationObservers] Clear pending mutation records on disconnect()
https://bugs.webkit.org/show_bug.cgi?id=78639

Reviewed by Ojan Vafai.

Source/WebCore:

Test: fast/mutation/disconnect-cancel-pending.html

  • dom/WebKitMutationObserver.cpp:

(WebCore::WebKitMutationObserver::disconnect): Clear pending records.
(WebCore::WebKitMutationObserver::deliver): Avoid calling the callback if no records are pending delivery.

LayoutTests:

  • fast/mutation/disconnect-cancel-pending-expected.txt: Added.
  • fast/mutation/disconnect-cancel-pending.html: Added.
Location:
trunk
Files:
2 added
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r109055 r109058  
     12012-02-27  Adam Klein  <adamk@chromium.org>
     2
     3        [MutationObservers] Clear pending mutation records on disconnect()
     4        https://bugs.webkit.org/show_bug.cgi?id=78639
     5
     6        Reviewed by Ojan Vafai.
     7
     8        * fast/mutation/disconnect-cancel-pending-expected.txt: Added.
     9        * fast/mutation/disconnect-cancel-pending.html: Added.
     10
    1112012-02-27  Brady Eidson  <beidson@apple.com>
    212
  • trunk/Source/WebCore/ChangeLog

    r109054 r109058  
     12012-02-27  Adam Klein  <adamk@chromium.org>
     2
     3        [MutationObservers] Clear pending mutation records on disconnect()
     4        https://bugs.webkit.org/show_bug.cgi?id=78639
     5
     6        Reviewed by Ojan Vafai.
     7
     8        Test: fast/mutation/disconnect-cancel-pending.html
     9
     10        * dom/WebKitMutationObserver.cpp:
     11        (WebCore::WebKitMutationObserver::disconnect): Clear pending records.
     12        (WebCore::WebKitMutationObserver::deliver): Avoid calling the callback if no records are pending delivery.
     13
    1142012-02-27  Adam Klein  <adamk@chromium.org>
    215
  • trunk/Source/WebCore/dom/WebKitMutationObserver.cpp

    r107170 r109058  
    9090void WebKitMutationObserver::disconnect()
    9191{
     92    m_records.clear();
    9293    HashSet<MutationObserverRegistration*> registrations(m_registrations);
    9394    for (HashSet<MutationObserverRegistration*>::iterator iter = registrations.begin(); iter != registrations.end(); ++iter)
     
    124125void WebKitMutationObserver::deliver()
    125126{
     127    if (m_records.isEmpty())
     128        return;
     129
    126130    MutationRecordArray records;
    127131    records.swap(m_records);
Note: See TracChangeset for help on using the changeset viewer.