Changeset 135337 in webkit


Ignore:
Timestamp:
Nov 20, 2012, 5:35:49 PM (13 years ago)
Author:
adamk@chromium.org
Message:

[JSC] MutationObserver wrapper should not be collected while still observing
https://bugs.webkit.org/show_bug.cgi?id=102744

Reviewed by Adam Barth.

Source/WebCore:

This is the JSC side of the change landed for V8 in r135228.
It ensures MutationObserver wrapper objects are kept alive as long as
any observed nodes.

  • bindings/js/JSMutationObserverCustom.cpp:

(WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): Keep MutationObserver wrappers alive
if any of their observed nodes' roots is an opaque root.

  • dom/MutationObserver.idl: Add JSCustomIsReachable

LayoutTests:

Remove suppressions for wrapper dropoff tests.

  • platform/efl/TestExpectations:
  • platform/gtk/TestExpectations:
  • platform/mac/TestExpectations:
  • platform/qt/TestExpectations:
  • platform/win/TestExpectations:
  • platform/wincairo/TestExpectations:
Location:
trunk
Files:
10 edited

Legend:

Unmodified
Added
Removed
  • trunk/LayoutTests/ChangeLog

    r135335 r135337  
     12012-11-20  Adam Klein  <adamk@chromium.org>
     2
     3        [JSC] MutationObserver wrapper should not be collected while still observing
     4        https://bugs.webkit.org/show_bug.cgi?id=102744
     5
     6        Reviewed by Adam Barth.
     7
     8        Remove suppressions for wrapper dropoff tests.
     9
     10        * platform/efl/TestExpectations:
     11        * platform/gtk/TestExpectations:
     12        * platform/mac/TestExpectations:
     13        * platform/qt/TestExpectations:
     14        * platform/win/TestExpectations:
     15        * platform/wincairo/TestExpectations:
     16
    1172012-11-20  Ryosuke Niwa  <rniwa@webkit.org>
    218
  • trunk/LayoutTests/platform/efl/TestExpectations

    r135307 r135337  
    17071707
    17081708webkit.org/b/102493 fast/events/mouse-cursor.html [ Failure ]
    1709 
    1710 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
    1711 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]
  • trunk/LayoutTests/platform/gtk/TestExpectations

    r135307 r135337  
    13861386webkit.org/b/102586 media/video-src-blob.html [ Failure ]
    13871387
    1388 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
    1389 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]
    1390 
    13911388# Fix for https://bugs.webkit.org/show_bug.cgi?id=97192 introduces these regressions
    13921389webkit.org/b/102776 media/media-document-audio-repaint.html [ Failure ]
  • trunk/LayoutTests/platform/mac/TestExpectations

    r135307 r135337  
    11911191# Hangs safari apparently due to an issue with weird multi-frame CUR image files
    11921192webkit.org/b/101811 fast/events/mouse-cursor-multiframecur.html [ Skip ]
    1193 
    1194 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
    1195 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]
  • trunk/LayoutTests/platform/qt/TestExpectations

    r135228 r135337  
    23872387# [Qt] fast/block/float/overhanging-tall-block.html asserts after r135025
    23882388webkit.org/b/102675 [ Debug ] fast/block/float/overhanging-tall-block.html
    2389 
    2390 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
    2391 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]
  • trunk/LayoutTests/platform/win/TestExpectations

    r135307 r135337  
    24282428fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last.html
    24292429fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line.html
    2430 
    2431 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
    2432 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]
  • trunk/LayoutTests/platform/wincairo/TestExpectations

    r135307 r135337  
    29592959fast/css3-text/css3-text-align-last/getComputedStyle/getComputedStyle-text-align-last.html
    29602960fast/css3-text/css3-text-decoration/getComputedStyle/getComputedStyle-text-decoration-line.html
    2961 
    2962 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff.html [ Skip ]
    2963 webkit.org/b/102744 fast/mutation/observer-wrapper-dropoff-transient.html [ Skip ]
  • trunk/Source/WebCore/ChangeLog

    r135332 r135337  
     12012-11-20  Adam Klein  <adamk@chromium.org>
     2
     3        [JSC] MutationObserver wrapper should not be collected while still observing
     4        https://bugs.webkit.org/show_bug.cgi?id=102744
     5
     6        Reviewed by Adam Barth.
     7
     8        This is the JSC side of the change landed for V8 in r135228.
     9        It ensures MutationObserver wrapper objects are kept alive as long as
     10        any observed nodes.
     11
     12        * bindings/js/JSMutationObserverCustom.cpp:
     13        (WebCore::JSMutationObserverOwner::isReachableFromOpaqueRoots): Keep MutationObserver wrappers alive
     14        if any of their observed nodes' roots is an opaque root.
     15        * dom/MutationObserver.idl: Add JSCustomIsReachable
     16
    1172012-11-20  Joshua Bell  <jsbell@chromium.org>
    218
  • trunk/Source/WebCore/bindings/js/JSMutationObserverCustom.cpp

    r135185 r135337  
    5959}
    6060
     61bool JSMutationObserverOwner::isReachableFromOpaqueRoots(JSC::Handle<JSC::Unknown> handle, void*, SlotVisitor& visitor)
     62{
     63    MutationObserver* observer = jsCast<JSMutationObserver*>(handle.get().asCell())->impl();
     64    HashSet<Node*> observedNodes = observer->getObservedNodes();
     65    for (HashSet<Node*>::iterator it = observedNodes.begin(); it != observedNodes.end(); ++it) {
     66        if (visitor.containsOpaqueRoot(root(*it)))
     67            return true;
     68    }
     69    return false;
     70}
     71
    6172} // namespace WebCore
    6273
  • trunk/Source/WebCore/dom/MutationObserver.idl

    r135185 r135337  
    3232    Conditional=MUTATION_OBSERVERS,
    3333    CustomConstructor,
    34     ConstructorParameters=1
     34    ConstructorParameters=1,
     35    JSCustomIsReachable
    3536] interface MutationObserver {
    3637    void observe(in Node target, in Dictionary options)
Note: See TracChangeset for help on using the changeset viewer.